https://github.com/frc/wp-env-heroku-custom-php-constant
https://github.com/frc/wp-env-heroku-custom-php-constant
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/frc/wp-env-heroku-custom-php-constant
- Owner: frc
- Created: 2017-01-12T11:33:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-14T09:25:19.000Z (over 7 years ago)
- Last Synced: 2025-08-09T08:57:14.301Z (11 months ago)
- Language: PHP
- Size: 2.93 KB
- Stars: 1
- Watchers: 18
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wp-env-heroku-custom-php-constant
Allow PHP constants to be defined through Heroku environment, as long as the environment key starts with FRC_PHP_CONST_ prefix.
The prefix gets removed when the constant is set in the PHP side. For example, an environment variable FRC_PHP_CONST_PLL_COOKIE will define the PHP constant PLL_COOKIE within WordPress by using the getenv function (with the value coming from the env key).
## Getting it to work with PHP standalone server
This works out of the box with Heroku or Heroku local environments, but for the PHP standalone webserver it requires some tweaking in `php.ini` (for "brewed" PHP, the configuration is in `/usr/local/etc/php//php.ini`).
Make sure the `variables_order` directive is set to `EGPCS` (most likely the default is `GPCS`).