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

Allow users to configure their phpize and php-config location from their projects #1175

Closed
wants to merge 2 commits into from

Conversation

Izopi4a
Copy link
Contributor

@Izopi4a Izopi4a commented Jan 27, 2016

allow users to add those options into their project/config.json file

"environment": {
        "phpize": "_PATH_TO_PHPIZE_", #ex /opt/php-5615/bin/phpize
        "php-config": "_PATH_TO_PHP-CONFIG", #ex /opt/php-5615/bin/php-config
        "alwaysCompileParser" : true 
}

the reason i added alwaysCompileParser is because i saw couple of issues about people trying php 7, then they go back to php5 and in this case compiling the parser throws errors. Enabling this should prevent any kind of errors of this kind.

also removed the @unlink stuff since i hate it :D

@mruz
Copy link
Contributor

mruz commented Jan 27, 2016

I think alwaysCompileParser is unnecessary due to parser-compiled

zephir generate --parser-compiled=force

* @param FunctionDefinition $func
* @param array $statement
* @param null $statement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am used to see what's the default parameter, but if you agree i will change it back to array

@Izopi4a
Copy link
Contributor Author

Izopi4a commented Jan 27, 2016

i saw the force compile option, however i think project specific stuff can make the developer live easier.

Easy to remove if you want.

@steffengy
Copy link
Contributor

I do not quite see a point for adding a configuration for phpize/php-config.

The alwaysCompileParser stuff is unnecessary: A proper parser detection
implementation, which currently unfortunately nobody seems to have time to implement,
would just make it unnecessary.

@Izopi4a
Copy link
Contributor Author

Izopi4a commented Jan 27, 2016

the point is that my ubuntu comes with php 5.3 and no updates.
I am always running latest php version, since in php 7 you have to use zephir build i am not able to specify my php version. In this way i can specify where the extension should be installed.

phalcon/cphalcon#11203 (comment)

@steffengy
Copy link
Contributor

It doesn't make sense to configure the path to PHP in a configuration which is specific to zephir,
as this introduces a dependency to your local system or to a specific directory layout, which isn't what project-specific configuration files are for. That is like trying to use a makefile configured on another system...

If you want to use a custom path to php-config/phpize that's something to be configured by modifying your path (as zephir doesn't support environmental variables for this kind of stuff).
Alternatively you should'be fine to use zephir generate --backend=ZendEngine3
and do the compilation step manually, which is probably the worse solution, except
if you need more flexibility anyways.

@Izopi4a
Copy link
Contributor Author

Izopi4a commented Jan 27, 2016

i am not gonna argue, but i am pretty sure people will start crying over this. Many people are compiling their php's. I am pretty sure i am not the only one, now i am force to edit my /etc/alternatives directory every single time i want to compile a php7 extension.

Thank you for the feedback.

@Izopi4a Izopi4a closed this Jan 27, 2016
@steffengy
Copy link
Contributor

Many people are compiling their php's

Again this isn't a problem at all.
It's more than trivial to setup a short wrapper script, which makes sure everything is setup
for the correct PHP version and then calls zephir build (or passes your arguments to zephir).

It could make sense though to allow users to specify something like --php_dir=/tmp/php7 like the
PHP build system uses, which wouldn't misuse project settings for system-specific settings.

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

4 participants