<?php set_time_limit(10000); defined('HOST_PROJECT') || define('HOST_PROJECT', "http://localhost/Project/DetProject"); // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application')); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'); $paths = array(realpath(APPLICATION_PATH . '/../library')); if (function_exists('zend_deployment_library_path') && zend_deployment_library_path('Zend Framework 1')) { $paths[] = zend_deployment_library_path('Zend Framework 1'); } $paths[] = get_include_path(); set_include_path(implode(PATH_SEPARATOR, $paths)); /** Zend_Application */ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini'); $application->bootstrap()->run();
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/../src'); define('APPLICATION_PATH', realpath(__DIR__ . '/../')); chdir(APPLICATION_PATH); if (is_dir(__DIR__ . '/vendor/ZF2/library')) { $zf2Path = __DIR__ . 'vendor/ZF2/library'; } elseif (getenv('ZF2_PATH')) { $zf2Path = getenv('ZF2_PATH'); } elseif (function_exists('zend_deployment_library_path') && zend_deployment_library_path('Zend Framework 2')) { $zf2Path = zend_deployment_library_path('Zend Framework 2'); } elseif (get_cfg_var('zf2_path')) { $zf2Path = get_cfg_var('zf2_path'); } if (is_dir(__DIR__ . '/vendor/ZendServerGateway')) { $zsModsPath = __DIR__ . '/vendor/'; } elseif (getenv('ZEND_SERVER_MODULES_PATH')) { $zsModsPath = getenv('ZEND_SERVER_MODULES_PATH'); } elseif (function_exists('zend_deployment_library_path') && zend_deployment_library_path('Zend Server Gateway')) { $zsModsPath = zend_deployment_library_path('Zend Server Gateway'); } elseif (get_cfg_var('zend_server_modules_path')) { $zsModsPath = get_cfg_var('zend_server_modules_path'); } if (!isset($zf2Path) || !isset($zsModsPath)) { header('HTTP/1.0 500 Internal Server Error'); echo 'The Zend Server environment was not set up correctly, please ensure ZF2_PATH and ZEND_SERVER_MODULES_PATH are correctly setup.'; exit(1); } include $zf2Path . '/Zend/Loader/AutoloaderFactory.php'; Zend\Loader\AutoloaderFactory::factory(array('Zend\\Loader\\StandardAutoloader' => array('autoregister_zf' => true, 'fallback_autoloader' => true))); $appConfig = (require 'config/application.config.php'); $appConfig['module_listener_options']['module_paths'][] = $zsModsPath; Zend\Mvc\Application::init($appConfig)->run();
* to be correctly configured, regardless of the installation method and keeps * the use of composer completely optional. This setup should work fine for * most users, however, feel free to configure autoloading however you'd like. */ // Composer autoloading if (file_exists('vendor/autoload.php')) { $loader = (include 'vendor/autoload.php'); } $zf2Path = false; if (is_dir('vendor/ZF2/library')) { $zf2Path = __DIR__ . '/vendor/ZF2/library'; } elseif (getenv('ZF2_PATH')) { // Support for ZF2_PATH environment variable or git submodule $zf2Path = getenv('ZF2_PATH'); } elseif (function_exists('zend_deployment_library_path') && zend_deployment_library_path('Zend Framework 2')) { $zf2Path = zend_deployment_library_path('Zend Framework 2'); } elseif (get_cfg_var('zf2_path')) { // Support for zf2_path directive value $zf2Path = get_cfg_var('zf2_path'); } if ($zf2Path) { if (isset($loader)) { $loader->add('Zend', $zf2Path); } else { include $zf2Path . '/Zend/Loader/AutoloaderFactory.php'; Zend\Loader\AutoloaderFactory::factory(array('Zend\\Loader\\StandardAutoloader' => array('autoregister_zf' => true))); } } if (!class_exists('Zend\\Loader\\AutoloaderFactory')) { throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.'); }
<?php require zend_deployment_library_path('ZendServerDeploymentHelper') . '/deph.php'; $deph = new DepH(); $sql = __DIR__ . '/templates/phundament.sql'; $params = $deph->getParams(); $mysqlClient = $params->get('MYSQL_CLIENT_PATH'); $user = $params->get('DB_USER'); $pass = $params->get('DB_PASS'); $host = $params->get('DB_HOST'); $port = $params->get('DB_PORT'); $shell = $deph->getShell(); $shell->exec("{$mysqlClient} -u {$user} -p{$pass} -h {$host} -P {$port} < {$sql}");