laravel-packager icon indicating copy to clipboard operation
laravel-packager copied to clipboard

Close #167

Open MimisK13 opened this issue 1 year ago • 5 comments

Fixes package path in composer.json file.

MimisK13 avatar Nov 01 '23 10:11 MimisK13

I'll have to check this because it might not work on other OSes. Wasn't there a PHP constant that is system specific? 🤔

Jeroen-G avatar Nov 01 '23 16:11 Jeroen-G

Do you mean PHP_OS?

It could be a solution

if (PHP_OS === 'WINNT')
{
    return $this->packagesPath() . '\\' . $this->vendor();
}

return $this->packagesPath() . '/' . $this->vendor();

MimisK13 avatar Nov 01 '23 17:11 MimisK13

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();
}

MimisK13 avatar Nov 01 '23 22:11 MimisK13

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) : '');
    }

Freezon avatar Nov 06 '23 15:11 Freezon

bump.

MimisK13 avatar Nov 28 '23 10:11 MimisK13