Commit 28f5767e5f7f2211d071c5568b0d51812c90ad12
1 parent
90ec05f6
webtools
Showing
2 changed files
with
101 additions
and
0 deletions
Show diff stats
| 1 | +<?php | |
| 2 | + | |
| 3 | +/* | |
| 4 | + +------------------------------------------------------------------------+ | |
| 5 | + | Phalcon Developer Tools | | |
| 6 | + +------------------------------------------------------------------------+ | |
| 7 | + | Copyright (c) 2011-2016 Phalcon Team (https://www.phalconphp.com) | | |
| 8 | + +------------------------------------------------------------------------+ | |
| 9 | + | This source file is subject to the New BSD License that is bundled | | |
| 10 | + | with this package in the file LICENSE.txt. | | |
| 11 | + | | | |
| 12 | + | If you did not receive a copy of the license and are unable to | | |
| 13 | + | obtain it through the world-wide-web, please send an email | | |
| 14 | + | to license@phalconphp.com so we can send you a copy immediately. | | |
| 15 | + +------------------------------------------------------------------------+ | |
| 16 | + | Authors: Andres Gutierrez <andres@phalconphp.com> | | |
| 17 | + | Eduar Carvajal <eduar@phalconphp.com> | | |
| 18 | + | Serghei Iakovlev <serghei@phalconphp.com> | | |
| 19 | + +------------------------------------------------------------------------+ | |
| 20 | +*/ | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * @const PTOOLS_IP Allowed IP for access. | |
| 24 | + * Phalcon Developers Tools can only be used in local machine, however | |
| 25 | + * you can set this to allow certain IP address. | |
| 26 | + * | |
| 27 | + * For example: | |
| 28 | + * 192.168.0.1 or SUBNET 192., 10.0.2., 86.84.124. | |
| 29 | + */ | |
| 30 | +defined('PTOOLS_IP') || define('PTOOLS_IP', '192.168.'); | |
| 31 | +defined('BASE_PATH') || define('BASE_PATH', dirname(dirname(__FILE__))); | |
| 32 | +defined('APP_PATH') || define('APP_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'app'); | |
| 33 | + | |
| 34 | +/** | |
| 35 | + * @const ENV_PRODUCTION Application production stage. | |
| 36 | + */ | |
| 37 | +defined('ENV_PRODUCTION') || define('ENV_PRODUCTION', 'production'); | |
| 38 | + | |
| 39 | +/** | |
| 40 | + * @const ENV_STAGING Application staging stage. | |
| 41 | + */ | |
| 42 | +defined('ENV_STAGING') || define('ENV_STAGING', 'staging'); | |
| 43 | + | |
| 44 | +/** | |
| 45 | + * @const ENV_DEVELOPMENT Application development stage. | |
| 46 | + */ | |
| 47 | +defined('ENV_DEVELOPMENT') || define('ENV_DEVELOPMENT', 'development'); | |
| 48 | + | |
| 49 | +/** | |
| 50 | + * @const ENV_TESTING Application test stage. | |
| 51 | + */ | |
| 52 | +defined('ENV_TESTING') || define('ENV_TESTING', 'testing'); | |
| 53 | + | |
| 54 | +/** | |
| 55 | + * @const APPLICATION_ENV Current application stage. | |
| 56 | + */ | |
| 57 | +defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ?: ENV_DEVELOPMENT); | |
| 58 | + | |
| 59 | +// ---------------------------- DO NOT EDIT BELOW ------------------------------ | |
| 60 | + | |
| 61 | +/** | |
| 62 | + * @const PTOOLSPATH The path to the Phalcon Developers Tools. | |
| 63 | + */ | |
| 64 | +defined('PTOOLSPATH') || define('PTOOLSPATH', '/var/www/phalcon-devtools'); | ... | ... |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/* | |
| 4 | + +------------------------------------------------------------------------+ | |
| 5 | + | Phalcon Developer Tools | | |
| 6 | + +------------------------------------------------------------------------+ | |
| 7 | + | Copyright (c) 2011-2016 Phalcon Team (https://www.phalconphp.com) | | |
| 8 | + +------------------------------------------------------------------------+ | |
| 9 | + | This source file is subject to the New BSD License that is bundled | | |
| 10 | + | with this package in the file LICENSE.txt. | | |
| 11 | + | | | |
| 12 | + | If you did not receive a copy of the license and are unable to | | |
| 13 | + | obtain it through the world-wide-web, please send an email | | |
| 14 | + | to license@phalconphp.com so we can send you a copy immediately. | | |
| 15 | + +------------------------------------------------------------------------+ | |
| 16 | + | Authors: Andres Gutierrez <andres@phalconphp.com> | | |
| 17 | + | Eduar Carvajal <eduar@phalconphp.com> | | |
| 18 | + | Serghei Iakovlev <serghei@phalconphp.com> | | |
| 19 | + +------------------------------------------------------------------------+ | |
| 20 | +*/ | |
| 21 | + | |
| 22 | +use Phalcon\Bootstrap; | |
| 23 | + | |
| 24 | +include 'webtools.config.php'; | |
| 25 | +include PTOOLSPATH . '/bootstrap/autoload.php'; | |
| 26 | + | |
| 27 | +$bootstrap = new Bootstrap([ | |
| 28 | + 'ptools_path' => PTOOLSPATH, | |
| 29 | + 'ptools_ip' => PTOOLS_IP, | |
| 30 | + 'base_path' => BASE_PATH, | |
| 31 | +]); | |
| 32 | + | |
| 33 | +if (APPLICATION_ENV === ENV_TESTING) { | |
| 34 | + return $bootstrap->run(); | |
| 35 | +} else { | |
| 36 | + echo $bootstrap->run(); | |
| 37 | +} | ... | ... |