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

Rename zephir_parser.so to contain PHP version? #1230

Closed
crocodile2u opened this issue Apr 7, 2016 · 6 comments
Closed

Rename zephir_parser.so to contain PHP version? #1230

crocodile2u opened this issue Apr 7, 2016 · 6 comments

Comments

@crocodile2u
Copy link
Contributor

crocodile2u commented Apr 7, 2016

Hey there.

There is a known issue with Zephir & switching between PHP versions 5.X and 7 (see related issue: #1175).

I found out that when Zephir compiles parser as a shared object, the filename is always zephir_parser.so. So, when I build my extension for the first time with php5, it will create the zephir_parser.so. Then I switch to PHP7 (I have both and I can switch with update-alternatives). Then zephir build results in an error. Yes, I can use --parser-compiled=force but this is something to figure out first. I mean, this is not obvious.

Moreover, its an overhead to always compile parser. What if zephir_parser.so is named zephir_parser-50620.so, zephir_parser-70005.so - depending on PHP_VERSION_ID ? This way it is still consistent with the --parser-compiled=force option (forces recompilation) and will result in less confusion from users that are unfamiliar with Zephir internals.

Cheers and thanks for a good job!

@steffengy
Copy link
Contributor

The issue is indeed known, but not quite that simple, since you also have to ensure that the parser is recompiled for changes. It surely is a part of a solution, but not a complete one.

Not sure if this will get implemented soon, any contributions here are welcome.

@Jurigag
Copy link
Contributor

Jurigag commented Apr 8, 2016

Why just not put zephir_parser.so into extensions folder in php ?

@hylent
Copy link
Contributor

hylent commented Apr 8, 2016

In my case, I install zephir_parser.so into PHP extension folder.
Everytime i update zephir, i recompile and reinstall zephir parser.

@Jurigag
Copy link
Contributor

Jurigag commented Apr 8, 2016

Just install -c should do it imho and create .ini file and that's it.

@steffengy
Copy link
Contributor

@Jurigag

Why just not put zephir_parser.so into extensions folder in php ?

Because it isn't smart to assume a standard setup of PHP.
There might simply not be an extensions folder (or one differently named),
which is annoying to handle. It also isn't nice in terms of permission,
because a user might not want, and doesn't give permission like when using zephir install
to tamper with his PHP installation(s). Therefore staying within the zephir buildtree and
buildroot is the cleaner option.

@sergeyklay
Copy link
Member

This issue was moved to zephir-lang/php-zephir-parser#12

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

No branches or pull requests

5 participants