diff --git a/public/webtools.config.php b/public/webtools.config.php new file mode 100644 index 0000000..21e8a35 --- /dev/null +++ b/public/webtools.config.php @@ -0,0 +1,64 @@ + | + | Eduar Carvajal | + | Serghei Iakovlev | + +------------------------------------------------------------------------+ +*/ + +/** + * @const PTOOLS_IP Allowed IP for access. + * Phalcon Developers Tools can only be used in local machine, however + * you can set this to allow certain IP address. + * + * For example: + * 192.168.0.1 or SUBNET 192., 10.0.2., 86.84.124. + */ +defined('PTOOLS_IP') || define('PTOOLS_IP', '192.168.'); +defined('BASE_PATH') || define('BASE_PATH', dirname(dirname(__FILE__))); +defined('APP_PATH') || define('APP_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'app'); + +/** + * @const ENV_PRODUCTION Application production stage. + */ +defined('ENV_PRODUCTION') || define('ENV_PRODUCTION', 'production'); + +/** + * @const ENV_STAGING Application staging stage. + */ +defined('ENV_STAGING') || define('ENV_STAGING', 'staging'); + +/** + * @const ENV_DEVELOPMENT Application development stage. + */ +defined('ENV_DEVELOPMENT') || define('ENV_DEVELOPMENT', 'development'); + +/** + * @const ENV_TESTING Application test stage. + */ +defined('ENV_TESTING') || define('ENV_TESTING', 'testing'); + +/** + * @const APPLICATION_ENV Current application stage. + */ +defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ?: ENV_DEVELOPMENT); + +// ---------------------------- DO NOT EDIT BELOW ------------------------------ + +/** + * @const PTOOLSPATH The path to the Phalcon Developers Tools. + */ +defined('PTOOLSPATH') || define('PTOOLSPATH', '/var/www/phalcon-devtools'); diff --git a/public/webtools.php b/public/webtools.php new file mode 100644 index 0000000..145a6d6 --- /dev/null +++ b/public/webtools.php @@ -0,0 +1,37 @@ + | + | Eduar Carvajal | + | Serghei Iakovlev | + +------------------------------------------------------------------------+ +*/ + +use Phalcon\Bootstrap; + +include 'webtools.config.php'; +include PTOOLSPATH . '/bootstrap/autoload.php'; + +$bootstrap = new Bootstrap([ + 'ptools_path' => PTOOLSPATH, + 'ptools_ip' => PTOOLS_IP, + 'base_path' => BASE_PATH, +]); + +if (APPLICATION_ENV === ENV_TESTING) { + return $bootstrap->run(); +} else { + echo $bootstrap->run(); +} -- libgit2 0.21.4