array( 'prefixes' => array( 'Zend' => __DIR__ . '/../../library/Zend', 'Application' => __DIR__ . '/../../library/Application', ), 'fallback_autoloader' => true ), )); try { $opts = new Zend_Console_Getopt( //Options array( 'help|?' => "Display usage information.", 'install=s' => "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 ( ! empty($opts->install) ) { echo date('Y-m-d H:i:s')." - Démarrage de la configuration.\n"; //Copy configuration $configDir = realpath(dirname(__FILE__)).'/profil'; $appconfigDir = APPLICATION_PATH.'/configs'; $profil = $opts->install; if ( !file_exists( $appconfigDir.'/application.ini') ) { $result = copy($configDir.'/'.$profil.'/application.ini', $appconfigDir.'/application.ini'); if ($result !== true) { echo date('Y-m-d H:i:s')." - Impossible de copier la configuration.\n"; exit(1); } } else { echo date('Y-m-d H:i:s')." - Le profil de configuration existe déja.\n"; exit(1); } echo date('Y-m-d H:i:s')." - Fin de la configuration.\n"; } else { echo date('Y-m-d H:i:s')." - Je n'ai rien fait !\n"; }