Last active
December 28, 2015 23:59
-
-
Save sasezaki/7582951 to your computer and use it in GitHub Desktop.
to run under phpdbg & react, react-zf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This makes our life easier when dealing with paths. Everything is relative | |
* to the application root now. | |
*/ | |
chdir(dirname(__DIR__)); | |
// Decline static file requests back to the PHP built-in webserver | |
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) { | |
return false; | |
} | |
// Setup autoloading | |
require 'init_autoloader.php'; | |
if (PHP_SAPI === 'phpdbg') { | |
Zend\Console\Console::overrideIsConsole(true); | |
$app = Zend\Mvc\Application::init(require 'config/application.config.php'); | |
$app->getServiceManager()->get('Request')->getParams()->fromArray(['react', 'start']); | |
$app->run(); | |
return; | |
} | |
// Run the application! | |
Zend\Mvc\Application::init(require 'config/application.config.php')->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment