dev-master
9999999-devCode once, host anywhere, run everywhere
MIT
The Requires
- php >=5.4
The Development Requires
by kipngetich kimutai
template composer switch environment package kimtooflex bunifu
Code once, host anywhere, run everywhere
Code once, host anywhere, run everywhere, (*1)
envswitch.php is a fast & flexible environment switching library for PHP 5.X+, (*2)
php composer.phar require kimtooflex/envswitch
use \envswitch\EnvSwitch;
Hello World - Obligatory hello world example (one server), (*3)
<?php use \envswitch\EnvSwitch; EnvSwitch::setEnv("127.0.0.2", function() { die("Hello world, this is development environment"); }, function() { die("Hello world, this is production environment"); } );
Example 1 - Respond to many servers, (*4)
<?php use \envswitch\EnvSwitch; EnvSwitch::setEnv("127.0.0.2,localhost", function() { die("Hello world, this is development environment"); }, function() { die("Hello world, this is production environment"); } );
Code once, host anywhere, run everywhere
MIT
template composer switch environment package kimtooflex bunifu