Better classmap
This commit is contained in:
parent
3030715fe0
commit
6121809f84
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
// Generated by ZF's ./bin/classmap_generator.php
|
||||
return array(
|
||||
'Bootstrap' => dirname(__FILE__) . '//Bootstrap.php',
|
||||
'AideController' => dirname(__FILE__) . '//controllers/AideController.php',
|
||||
'ArborescenceController' => dirname(__FILE__) . '//controllers/ArborescenceController.php',
|
||||
'ComptageController' => dirname(__FILE__) . '//controllers/ComptageController.php',
|
||||
'DashboardController' => dirname(__FILE__) . '//controllers/DashboardController.php',
|
||||
'EnrichissementController' => dirname(__FILE__) . '//controllers/EnrichissementController.php',
|
||||
'ErreurController' => dirname(__FILE__) . '//controllers/ErreurController.php',
|
||||
'ErrorController' => dirname(__FILE__) . '//controllers/ErrorController.php',
|
||||
'FieldsController' => dirname(__FILE__) . '//controllers/FieldsController.php',
|
||||
'GestionController' => dirname(__FILE__) . '//controllers/GestionController.php',
|
||||
'IndexController' => dirname(__FILE__) . '//controllers/IndexController.php',
|
||||
'UploadController' => dirname(__FILE__) . '//controllers/UploadController.php',
|
||||
'UserController' => dirname(__FILE__) . '//controllers/UserController.php',
|
||||
'Zend_View_Helper_DataDate' => dirname(__FILE__) . '//views/default/helpers/DataDate.php',
|
||||
'Zend_View_Helper_Field' => dirname(__FILE__) . '//views/default/helpers/Field.php',
|
||||
'Zend_View_Helper_ProfileLink' => dirname(__FILE__) . '//views/default/helpers/ProfileLink.php',
|
||||
);
|
@ -1,26 +0,0 @@
|
||||
<?php
|
||||
// Generated by ZF's ./bin/classmap_generator.php
|
||||
return array(
|
||||
'Application_Controller_Plugin_Auth' => dirname(__FILE__) . '//Controller/Plugin/Auth.php',
|
||||
'Application_Controller_Plugin_Comptage' => dirname(__FILE__) . '//Controller/Plugin/Comptage.php',
|
||||
'Application_Controller_Plugin_DataDate' => dirname(__FILE__) . '//Controller/Plugin/DataDate.php',
|
||||
'Application_Controller_Plugin_Lang' => dirname(__FILE__) . '//Controller/Plugin/Lang.php',
|
||||
'Application_Controller_Plugin_Menu' => dirname(__FILE__) . '//Controller/Plugin/Menu.php',
|
||||
'Application_Form_Login' => dirname(__FILE__) . '//Form/Login.php',
|
||||
'Application_Model_CiblageCodePostaux' => dirname(__FILE__) . '//Model/CiblageCodePostaux.php',
|
||||
'Application_Model_CiblageComptages' => dirname(__FILE__) . '//Model/CiblageComptages.php',
|
||||
'Application_Model_CiblageCriteres' => dirname(__FILE__) . '//Model/CiblageCriteres.php',
|
||||
'Application_Model_CiblageCustomerParams' => dirname(__FILE__) . '//Model/CiblageCustomerParams.php',
|
||||
'Application_Model_CiblageDepartements' => dirname(__FILE__) . '//Model/CiblageDepartements.php',
|
||||
'Application_Model_CiblageEnrichissementIdentifiants' => dirname(__FILE__) . '//Model/CiblageEnrichissementIdentifiants.php',
|
||||
'Application_Model_CiblageEnrichissementProfils' => dirname(__FILE__) . '//Model/CiblageEnrichissementProfils.php',
|
||||
'Application_Model_CiblageFormeJuridique' => dirname(__FILE__) . '//Model/CiblageFormeJuridique.php',
|
||||
'Application_Model_CiblageMinMax' => dirname(__FILE__) . '//Model/CiblageMinMax.php',
|
||||
'Application_Model_CiblageNaf' => dirname(__FILE__) . '//Model/CiblageNaf.php',
|
||||
'Application_Model_CiblagePrefs' => dirname(__FILE__) . '//Model/CiblagePrefs.php',
|
||||
'Application_Model_CiblageRegions' => dirname(__FILE__) . '//Model/CiblageRegions.php',
|
||||
'Application_Model_Sdv1Clients' => dirname(__FILE__) . '//Model/Sdv1Clients.php',
|
||||
'Application_Model_Sdv1SphinxIdx' => dirname(__FILE__) . '//Model/Sdv1SphinxIdx.php',
|
||||
'Application_Model_Sdv1Utilisateurs' => dirname(__FILE__) . '//Model/Sdv1Utilisateurs.php',
|
||||
'Application_Model_Sdv1UtilisateursService' => dirname(__FILE__) . '//Model/Sdv1UtilisateursService.php',
|
||||
);
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
// Generated by ZF's ./bin/classmap_generator.php
|
||||
return array(
|
||||
'Scores_Auth_Adapter_Db' => dirname(__FILE__) . '//Auth/Adapter/Db.php',
|
||||
'Scores_Auth_Adapter_Ws' => dirname(__FILE__) . '//Auth/Adapter/Ws.php',
|
||||
'Scores_Ciblage_Engine' => dirname(__FILE__) . '//Ciblage/Engine.php',
|
||||
'Scores_Ciblage_Extract' => dirname(__FILE__) . '//Ciblage/Extract.php',
|
||||
'Scores_Ciblage_Field_List' => dirname(__FILE__) . '//Ciblage/Field/List.php',
|
||||
'Scores_Ciblage_Field_Many' => dirname(__FILE__) . '//Ciblage/Field/Many.php',
|
||||
'Scores_Ciblage_Field_One' => dirname(__FILE__) . '//Ciblage/Field/One.php',
|
||||
'Scores_Ciblage_Field_Range' => dirname(__FILE__) . '//Ciblage/Field/Range.php',
|
||||
'Scores_Ciblage_Field_RangeDate' => dirname(__FILE__) . '//Ciblage/Field/RangeDate.php',
|
||||
'Scores_Ciblage_Field_RangeInput' => dirname(__FILE__) . '//Ciblage/Field/RangeInput.php',
|
||||
'Scores_Ciblage_Field_Search' => dirname(__FILE__) . '//Ciblage/Field/Search.php',
|
||||
'Scores_Ciblage_Field_Tag' => dirname(__FILE__) . '//Ciblage/Field/Tag.php',
|
||||
'Scores_Ciblage_Field_Tree' => dirname(__FILE__) . '//Ciblage/Field/Tree.php',
|
||||
'Scores_Ciblage_FieldList' => dirname(__FILE__) . '//Ciblage/FieldList.php',
|
||||
'Scores_Ciblage_Session' => dirname(__FILE__) . '//Ciblage/Session.php',
|
||||
'Mail' => dirname(__FILE__) . '//Mail.php',
|
||||
'Scores_Ws' => dirname(__FILE__) . '//Ws.php',
|
||||
);
|
File diff suppressed because it is too large
Load Diff
@ -18,10 +18,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
|
||||
require_once 'Zend/Loader/ClassMapAutoloader.php';
|
||||
Zend_Loader_AutoloaderFactory::factory(array(
|
||||
'Zend_Loader_ClassMapAutoloader' => array(
|
||||
__DIR__ . '/../library/Zend/autoload_classmap.php',
|
||||
__DIR__ . '/../library/Application/autoload_classmap.php',
|
||||
__DIR__ . '/../library/Scores/autoload_classmap.php',
|
||||
__DIR__ . '/../application/autoload_classmap.php',
|
||||
__DIR__ . '/../library/autoload_classmap.php',
|
||||
),
|
||||
'Zend_Loader_StandardAutoloader' => array(
|
||||
'prefixes' => array(
|
||||
|
34
scripts/build/classmap.php
Normal file
34
scripts/build/classmap.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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(),
|
||||
)));
|
||||
|
||||
$dir = array(
|
||||
APPLICATION_PATH,
|
||||
APPLICATION_PATH."/../library/Zend",
|
||||
APPLICATION_PATH."/../library/Application",
|
||||
APPLICATION_PATH."/../library/Scores",
|
||||
APPLICATION_PATH."/../library/Spreadsheet",
|
||||
);
|
||||
|
||||
$fileClassmap = APPLICATION_PATH."/../library/autoload_classmap.php";
|
||||
|
||||
$i = 0;
|
||||
foreach($dir as $d) {
|
||||
$options = " -a";
|
||||
if ($i==0) {
|
||||
$options = " -w";
|
||||
}
|
||||
passthru("php ".APPLICATION_PATH."/../bin/classmap_generator.php -l ".$d.$options." -o ".$fileClassmap);
|
||||
$i++;
|
||||
}
|
@ -20,10 +20,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
|
||||
require_once 'Zend/Loader/ClassMapAutoloader.php';
|
||||
Zend_Loader_AutoloaderFactory::factory(array(
|
||||
'Zend_Loader_ClassMapAutoloader' => array(
|
||||
__DIR__ . '/../../library/Zend/autoload_classmap.php',
|
||||
__DIR__ . '/../../library/Application/autoload_classmap.php',
|
||||
__DIR__ . '/../../application/autoload_classmap.php',
|
||||
__DIR__ . '/../../library/Scores/autoload_classmap.php',
|
||||
__DIR__ . '/../../library/autoload_classmap.php',
|
||||
),
|
||||
'Zend_Loader_StandardAutoloader' => array(
|
||||
'prefixes' => array(
|
||||
@ -44,6 +41,7 @@ try {
|
||||
array(
|
||||
'help|?' => "Affiche les informations d'utilisation",
|
||||
'install=s' => "Installe et configure",
|
||||
'etc' => "Mise en place crontab, logrotate",
|
||||
)
|
||||
);
|
||||
$opts->parse();
|
||||
@ -59,7 +57,6 @@ if (isset($opts->help))
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($opts->install)
|
||||
{
|
||||
echo date('Y-m-d H:i:s')." - Démarrage de la configuration.\n";
|
||||
@ -75,7 +72,7 @@ if ($opts->install)
|
||||
echo date('Y-m-d H:i:s')." - Impossible de copier la configuration.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
// --- Create application, bootstrap, and run
|
||||
$application = new Zend_Application(
|
||||
APPLICATION_ENV,
|
||||
@ -101,3 +98,23 @@ if ($opts->install)
|
||||
|
||||
echo date('Y-m-d H:i:s')." - Fin de la configuration.\n";
|
||||
}
|
||||
|
||||
|
||||
if ($opts->etc)
|
||||
{
|
||||
$vhostPath = realpath(APPLICATION_PATH.'/../');
|
||||
// --- Create application, bootstrap, and run
|
||||
$application = new Zend_Application(
|
||||
APPLICATION_ENV,
|
||||
APPLICATION_PATH . '/configs/application.ini'
|
||||
);
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
|
||||
// --- Configuration crontab
|
||||
$result = copy(APPLICATION_PATH.'/../scripts/build/etc/cron.d/odea', '/etc/cron.d/odea');
|
||||
if ($result) {
|
||||
passtrhu("sed -i -e 's/{VHOSTPATH}/".$vhostPath."/g' /etc/cron.d/odea");
|
||||
passtrhu("sed -i -e 's/{DATAPATH}/".$c->profil->path->data."/g' /etc/cron.d/odea");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,10 +19,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
|
||||
require_once 'Zend/Loader/ClassMapAutoloader.php';
|
||||
Zend_Loader_AutoloaderFactory::factory(array(
|
||||
'Zend_Loader_ClassMapAutoloader' => array(
|
||||
__DIR__ . '/../../library/Zend/autoload_classmap.php',
|
||||
__DIR__ . '/../../library/Application/autoload_classmap.php',
|
||||
__DIR__ . '/../../library/Scores/autoload_classmap.php',
|
||||
__DIR__ . '/../../application/autoload_classmap.php',
|
||||
__DIR__ . '/../../library/autoload_classmap.php',
|
||||
),
|
||||
'Zend_Loader_StandardAutoloader' => array(
|
||||
'prefixes' => array(
|
||||
|
@ -17,10 +17,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
|
||||
require_once 'Zend/Loader/ClassMapAutoloader.php';
|
||||
Zend_Loader_AutoloaderFactory::factory(array(
|
||||
'Zend_Loader_ClassMapAutoloader' => array(
|
||||
__DIR__ . '/../../library/Zend/autoload_classmap.php',
|
||||
__DIR__ . '/../../library/Application/autoload_classmap.php',
|
||||
__DIR__ . '/../../library/Scores/autoload_classmap.php',
|
||||
__DIR__ . '/../../application/autoload_classmap.php',
|
||||
__DIR__ . '/../../library/autoload_classmap.php',
|
||||
),
|
||||
'Zend_Loader_StandardAutoloader' => array(
|
||||
'prefixes' => array(
|
||||
@ -147,7 +144,7 @@ foreach ( $list as $key => $item ) {
|
||||
file_put_contents($file, ");", FILE_APPEND);
|
||||
echo " - OK\n";
|
||||
}
|
||||
|
||||
|
||||
// --- Gestion des minimums et maximum
|
||||
elseif ( $opts->minmax && array_key_exists('minmax', $item) ) {
|
||||
|
||||
@ -157,10 +154,10 @@ foreach ( $list as $key => $item ) {
|
||||
echo "Impossible de vider la table fields_minmax\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// --- Détermination des minimums et maximums
|
||||
$sql = 'SELECT MIN('.$key.') AS min, MAX('.$key.') AS max FROM jo.etablissements_act';
|
||||
|
||||
|
||||
$where = array();
|
||||
if ( array_key_exists($key, $minmaxSqlLimit) ) {
|
||||
$where = $minmaxSqlLimit[$key];
|
||||
@ -177,7 +174,7 @@ foreach ( $list as $key => $item ) {
|
||||
}
|
||||
}
|
||||
if ($opts->verbose) echo $sql."\n";
|
||||
|
||||
|
||||
try {
|
||||
$stmt = $db->query($sql);
|
||||
$result = $stmt->fetchObject();
|
||||
@ -194,15 +191,15 @@ foreach ( $list as $key => $item ) {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// --- Cache fichier
|
||||
$file = APPLICATION_PATH . '/../library/Scores/Table/'.$key.'.php';
|
||||
if ( $opts->overwrite && file_exists($file) ) {
|
||||
unlink($file);
|
||||
}
|
||||
|
||||
|
||||
if ( file_exists($file) ) continue;
|
||||
|
||||
|
||||
echo "Create cache for ".$key." => ".$file;
|
||||
$values = $fields->getItemValues($key);
|
||||
file_put_contents($file, "<?php\n");
|
||||
@ -212,6 +209,12 @@ foreach ( $list as $key => $item ) {
|
||||
file_put_contents($file, ");", FILE_APPEND);
|
||||
echo " - OK\n";
|
||||
}
|
||||
// --- Calcul des totaux
|
||||
elseif ($opts->total) {
|
||||
// fields_total
|
||||
// cle = total, val =
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
echo "Fin\n";
|
||||
|
Loading…
Reference in New Issue
Block a user