Skip to content

Error in plugin:seed command #5859

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

Open
alisaracoglu opened this issue Apr 28, 2025 · 2 comments
Open

Error in plugin:seed command #5859

alisaracoglu opened this issue Apr 28, 2025 · 2 comments

Comments

@alisaracoglu
Copy link

alisaracoglu commented Apr 28, 2025

I have a plugin named Aso.Demo. Inside it there is a plugin seeder named Demo. When I run this seeder with the command php artisan plugin:seed Aso.Demo Demo I get the error Class ".\Updates\Seeders\Demo" does not exist

When I investigated the reason, I saw that the code return dirname(get_class($classObj)); in the getPluginNamespace method in the PluginManager class caused the problem. The dirname('Aso\\Demo\\Plugin') function returns .

For this reason I get the error .\Updates\Seeders\Demo not found".

Additional Information
PHP 8.3 (php-fpm)
OctoberCMS 3.7.11
MacOS 15.3.1 and Ubuntu 22.04

@daftspunk
Copy link
Member

Something doesn't add up here, the dirname function returns something different for me:

λ php artisan tinker
Psy Shell v0.12.7 (PHP 8.0.3 — cli) by Justin Hileman
>  dirname('Aso\\Demo\\Plugin')
= "Aso\Demo"

@alisaracoglu
Copy link
Author

Have you tried it on your Windows operating system? The difference in behavior between Windows and other operating systems is stated in the PHP document below.

On Windows, both slash (/) and backslash (\) are used as directory separator character. In other environments, it is the forward slash (/).

https://www.php.net/manual/en/function.dirname.php#:~:text=On%20Windows%2C%20both%20slash%20(/)%20and%20backslash%20(%5C)%20are%20used%20as%20directory%20separator%20character.%20In%20other%20environments%2C%20it%20is%20the%20forward%20slash%20(/).

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

No branches or pull requests

2 participants