SOF3 / pharynx

A tool to recompile PHP sources into a phar in PSR-0
Apache License 2.0
16 stars 3 forks source link

Unable to Build Plugins with Virions Having One Folder Paths #19

Closed Aboshxm2 closed 9 months ago

Aboshxm2 commented 9 months ago

Code Sample

Command: %PHP_BINARY% -dphar.readonly=0 pharynx.phar -c -i %PLUGIN_PATH% -p=%PLUGIN_PATH%\out\%PLUGIN_NAME%.phar Output:

[13:25:08] Running `composer install` for plugin
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating autoload files
8 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
[13:25:09] Notice: skipping non-virion dependency C:\Users\Aboshxm2\Desktop\minecraft\pocketmine\pharynx-bug\testPlugin/vendor/pocketmine/pocketmine-mp
"test" is not a valid class name
Process finished with exit code 1
SOF3 commented 9 months ago

Is there any reason you must use a single-component namespace root? The namespace root must never be shared between two virions, so it is better to make it longer.

The virion 3.0 spec recommends against single-component namespace roots, and pharynx denies it directly.

Aboshxm2 commented 9 months ago

Is there any reason you must use a single-component namespace root? The namespace root must never be shared between two virions, so it is better to make it longer.

The virion 3.0 spec recommends against single-component namespace roots, and pharynx denies it directly.

I am trying to convert a public php library (Carbon) to a pccketmine virion. It has dozens of files. It's really hard to change their namespaces.

SOF3 commented 9 months ago

@Aboshxm2 you don't just "convert a public php library to a virion" by adding an extra.virion section in composer.json. By declaring that it is a virion, you confirm that you have checked that the library does not violate any of the rules required in the virion spec, including non-syntactic class references, use of global symbols and namespaces. This is why I recommend against converting public libraries to virions directly, because their maintainers will not guarantee any of these rules.