69 lines
1.5 KiB
PHP
69 lines
1.5 KiB
PHP
<?php
|
|
// 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'));
|
|
|
|
// Ensure library/ is on include_path
|
|
set_include_path(implode(PATH_SEPARATOR, array(
|
|
realpath(APPLICATION_PATH . '/../library'),
|
|
get_include_path(),
|
|
)));
|
|
|
|
//Copy configuration
|
|
$configDir = realpath(dirname(__FILE__)).'/config';
|
|
$appconfigDir = APPLICATION_PATH.'/configs';
|
|
|
|
if (stristr(PHP_OS, 'WIN')) {
|
|
$hostname = 'development';
|
|
} else {
|
|
$hostname = exec('echo $(hostname)');
|
|
}
|
|
|
|
if ( !copy($configDir.'/'.$hostname.'/application.ini', $appconfigDir.'/application.ini') ) {
|
|
echo "application.ini could not be copied !\n";
|
|
exit;
|
|
}
|
|
|
|
/** Zend_Application */
|
|
require_once 'Zend/Application.php';
|
|
|
|
// Create application, bootstrap, and run
|
|
$application = new Zend_Application(
|
|
APPLICATION_ENV,
|
|
APPLICATION_PATH . '/configs/application.ini'
|
|
);
|
|
|
|
try {
|
|
$opts = new Zend_Console_Getopt(
|
|
//Options
|
|
array(
|
|
'help|?' => "Display usage information.",
|
|
'install' => "Make install operation.",
|
|
)
|
|
);
|
|
$opts->parse();
|
|
} catch (Zend_Console_Getopt_Exception $e) {
|
|
echo $e->getUsageMessage();
|
|
exit;
|
|
}
|
|
|
|
//Usage
|
|
if(isset($opts->help))
|
|
{
|
|
echo $opts->getUsageMessage();
|
|
exit;
|
|
}
|
|
|
|
if(isset($opts->install))
|
|
{
|
|
if (stristr(PHP_OS, 'WIN')) {
|
|
|
|
} else {
|
|
|
|
}
|
|
}
|