laravel-packager
laravel-packager copied to clipboard
Close #167
Fixes package path in composer.json file.
I'll have to check this because it might not work on other OSes. Wasn't there a PHP constant that is system specific? 🤔
Do you mean PHP_OS
?
It could be a solution
if (PHP_OS === 'WINNT')
{
return $this->packagesPath() . '\\' . $this->vendor();
}
return $this->packagesPath() . '/' . $this->vendor();
I think this is the solution we are looking for.
public function vendorPath()
{
return $this->packagesPath().DIRECTORY_SEPARATOR.$this->vendor();
}
public function packagePath()
{
return $this->vendorPath().DIRECTORY_SEPARATOR.$this->package();
}
Hi, this is how it is done in Laravel, I think the PR can be accepted) Proof: laravel/framework/src/Illuminate/Foundation/Application.php
public function joinPaths($basePath, $path = '')
{
return $basePath.($path != '' ? DIRECTORY_SEPARATOR.ltrim($path, DIRECTORY_SEPARATOR) : '');
}
bump.