Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close #167 #168

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Close #167 #168

wants to merge 3 commits into from

Conversation

MimisK13
Copy link
Contributor

@MimisK13 MimisK13 commented Nov 1, 2023

Fixes package path in composer.json file.

@Jeroen-G
Copy link
Owner

Jeroen-G commented Nov 1, 2023

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

@MimisK13
Copy link
Contributor Author

MimisK13 commented Nov 1, 2023

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
Copy link
Contributor Author

MimisK13 commented Nov 1, 2023

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

@Freezon
Copy link

Freezon commented Nov 6, 2023

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

@MimisK13
Copy link
Contributor Author

bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants