Composer : include path

This commit is contained in:
Michael RICOIS 2015-09-18 09:53:21 +00:00
parent 20bf7d9541
commit a68cf24509
16 changed files with 98 additions and 102 deletions

View File

@ -7,18 +7,13 @@ defined('APPLICATION_PATH')
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
if (APPLICATION_ENV == 'development'){
ini_set("soap.wsdl_cache_enabled", "0");
}
// --- Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
require_once realpath(__DIR__ . '/../vendor/autoload.php');
// --- Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$application->bootstrap()->run();

View File

@ -7,12 +7,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
try {

View File

@ -7,12 +7,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -7,6 +7,7 @@ defined('APPLICATION_PATH')
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -7,12 +7,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

67
scripts/build/genLog.php Normal file
View File

@ -0,0 +1,67 @@
<?php
// --- Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(__DIR__ . '/../../application'));
// --- Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.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|?' => "Aide.",
'log' => "",
)
);
$opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
echo $e->getUsageMessage();
exit;
}
//Usage
if( count($opts->getOptions())==0 || isset($opts->help))
{
echo $opts->getUsageMessage();
exit;
}
if ($opts->log) {
$c = new Zend_Config($application->getOptions());
$db = Zend_Db::factory($c->profil->db->metier);
Zend_Db_Table::setDefaultAdapter($db);
$sql = $db->select()->from('logs_item', '*', 'sdv1');
$stmt = $db->query($sql);
$outPath = APPLICATION_PATH . '/../library/Scores/Account/Log/List.php';
$outFile = $outPath . '/Config.php';
if ($stmt->rowCount() > 0) {
$result = $stmt->fetchAll(Zend_Db::FETCH_ASSOC);
file_put_contents($outFile, "<?php\n");
file_put_contents($outFile, "/* Auto generated ".date('Y-m-d H:i:s')." */\n");
file_put_contents($outFile, "return array(\n", FILE_APPEND);
foreach ($result as $c) {
file_put_contents($outFile, "\t'". $c->Code . "' => array(,\n", FILE_APPEND);
file_put_contents($outFile, "\t\t'Label' => ". $c->Label . ",\n", FILE_APPEND);
file_put_contents($outFile, "\t\'Description' => ". $c->Description . ",\n", FILE_APPEND);
file_put_contents($outFile, "\t\t'Category' => ". $c->Category . ",\n", FILE_APPEND);
file_put_contents($outFile, "\t),\n", FILE_APPEND);
}
file_put_contents($outFile, ");\n", FILE_APPEND);
}
}

View File

@ -7,12 +7,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -7,34 +7,27 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.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|?' => "Aide.",
'fichier=s' => "Nom du fichier complet : version ",
'affiche=s' => "Affiche resultat traitement "
));
$opts->parse();
}
catch (Zend_Console_Getopt_Exception $e)
{
echo $opts->getUsageMessage();
exit;
}
$opts = new Zend_Console_Getopt(
//Options
array(
'help|?' => "Aide.",
'fichier=s' => "Nom du fichier complet : version ",
'affiche=s' => "Affiche resultat traitement "
));
$opts->parse();
}
catch (Zend_Console_Getopt_Exception $e)
{
echo $opts->getUsageMessage();
exit;
}
//Usage
if( count($opts->getOptions())==0 || isset($opts->help))

View File

@ -7,12 +7,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -7,12 +7,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -7,12 +7,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -7,12 +7,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -8,12 +8,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -15,12 +15,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -9,12 +9,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run

View File

@ -7,12 +7,7 @@ defined('APPLICATION_PATH')
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(),
)));
// --- Composer autoload
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
// --- Create application, bootstrap, and run