public static function import_default_tasks() { pake_desc('Display help on available commands'); pake_task('pakeInteractiveTask::help_pake'); pake_alias('?', 'pakeInteractiveTask::help_pake'); pake_desc('Quit interactive mode'); pake_task('pakeInteractiveTask::quit_pake'); }
public static function import_default_tasks() { foreach (self::$tasks as $taskname => $taskdata) { if ($taskdata[0] !== null) { pake_desc($taskdata[0]); } call_user_func_array('pake_task', array_merge(array(__CLASS__ . '::' . $taskname), $taskdata[1])); } }
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ pake_desc('synchronise project with another machine'); pake_task('sync', 'project_exists'); function run_sync($task, $args) { if (!count($args)) { throw new Exception('You must provide an environment to synchronize.'); } $env = $args[0]; $dryrun = isset($args[1]) ? $args[1] : false; if (!file_exists('config/rsync_exclude.txt')) { throw new Exception('You must create a rsync_exclude file for your project.'); } $host = $task->get_property('host', $env); $dir = $task->get_property('dir', $env); try { $user = $task->get_property('user', $env) . '@'; } catch (pakeException $e) { $user = ''; } if (substr($dir, -1) != '/') { $dir .= '/'; }
* @author <*****@*****.**> * * usage : * symfony import-vocabulary {type} {ID} {file path} -d ('delete existing' -- optional) * */ use ImportVocab\ImportVocab; pake_desc('Import a file into a vocabulary'); pake_task('import-vocabulary'); pake_desc('Import a list of vocabulary files'); pake_task('import-list'); pake_desc('Repair references in an import batch'); pake_task('import-repair'); echo "\n"; //xdebug_break(); //we could also prepend these as arguments, but not today //define('SF_APP', $app); //define('SF_ENVIRONMENT', $env); define('SF_APP', 'frontend'); define('SF_ENVIRONMENT', 'dev'); define('SF_ROOT_DIR', sfConfig::get('sf_root_dir')); define('SF_DEBUG', false); require_once(SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'vendor'. DIRECTORY_SEPARATOR .'autoload.php');
<?php /* * This file is part of the anno0Tasks package. * * (c) 2011 Guglielmo Celata <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * @package * @subpackage Task per estrarre dati per anno0 * @author Guglielmo Celata <*****@*****.**> */ pake_desc("estrae atti più rilevanti per determinati argomenti"); pake_task('a0-get-main-acts-for-tags', 'project_exists'); /** * estrae gli N atti più rilevanti per determinati argomenti (tag) */ function run_a0_get_main_acts_for_tags($task, $args, $options) { static $loaded; // load application context if (!$loaded) { task_loader(); $loaded = true; } echo "memory usage: " . memory_get_usage() . "\n"; $msg = sprintf("start time: %s\n", date('H:i:s')); echo $msg;
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ pake_desc('launch unit tests'); pake_task('test-unit', 'project_exists'); pake_desc('launch functional tests for an application'); pake_task('test-functional', 'project_exists'); pake_desc('launch all tests'); pake_task('test-all', 'project_exists'); function run_test_all($task, $args) { require_once sfConfig::get('sf_symfony_lib_dir') . '/vendor/lime/lime.php'; $h = new lime_harness(new lime_output_color()); $h->base_dir = sfConfig::get('sf_test_dir'); // register all tests $finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php'); $h->register($finder->in($h->base_dir)); $h->run(); } function run_test_functional($task, $args) { if (!count($args)) { throw new Exception('You must provide the app to test.'); } $app = $args[0];
foreach ($workers as $id) { if (isRunWorker($id)) { killWorker($id); } startWorker($id); } } pake_desc("Hard stop all gearman workers"); pake_task("stop_workers"); function run_stop_workers() { $out = ""; @pake_sh("pgrep -f worker.php | xargs kill"); pake_echo(print_r($out, true)); } pake_desc("Check is need run wokers and start it"); pake_task("worker_monitor"); function run_worker_monitor() { $workerStarter = Job_Monitor_Factory::createWorkerStarter(); if (!$workerStarter->isRun()) { Api_Core_Application::log("Не запущенны воркеры", null, Api_Component_Log_Logger::LEVEL_ERROR); run_restart_workers(); } } function isRunWorker($id) { $pidfile = RUNTIME_PATH . getWorkerPidFile($id); return file_exists($pidfile); } function startWorker($id)
<?php pake_desc('Register Facebook users for later linking'); pake_task('facebook-register-users'); function run_facebook_register_users($task, $args) { if (!count($args)) { throw new Exception('You must provide an application.'); } $app = $args[0]; define('SF_ROOT_DIR', sfConfig::get('sf_root_dir')); define('SF_APP', $app); require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php'; sfContext::getInstance(); $sfGuardUsers = sfFacebookConnect::getNonRegisteredUsers(); echo count($sfGuardUsers) . " non registered users in your database\n"; $chunks = array_chunk($sfGuardUsers, 50); $num_registered = 0; foreach ($chunks as $chunk) { $num_registered += sfFacebookConnect::registerUsers($chunk); echo $num_registered . " registered.\n"; } }
<?php pake_desc('Listado de Usuarios'); pake_task('alba-list-users', 'project_exists'); pake_desc('Limpiar archivos temporales'); pake_task('alba-clear-temp', 'project_exists'); pake_desc('[ALBA-fix] dump data to fixtures directory'); pake_task('alba-dump-data', 'project_exists'); pake_desc('[ALBA-fix] load data to fixtures directory'); pake_task('alba-load-data', 'project_exists'); function run_alba_list_users($task, $args) { // define constants define('SF_ROOT_DIR', sfConfig::get('sf_root_dir')); define('SF_APP', 'principal'); define('SF_ENVIRONMENT', 'prod'); define('SF_DEBUG', true); require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php'; $databaseManager = new sfDatabaseManager(); $databaseManager->initialize(); $users = UsuarioPeer::doSelect(new Criteria()); foreach ($users as $user) { pake_echo_action($user->getId(), $user->getUsuario() . " [" . $user->getEmail() . "]"); } } function run_alba_clear_temp($task, $args) { pake_echo_action('Limpiando archivos temporales...', 'Ok'); pake_echo_action("NO IMPLEMENTADO AUN"); } /**
<?php pake_import('pear'); pake_desc('package and install current snapshot'); pake_task('install', 'pear_package'); pake_desc('run Demo-application'); pake_task('demo'); function run_install() { pake_superuser_sh('pear install -f AppServer-0.2.2.tgz'); } function run_demo() { pake_sh('aip app ' . realpath(__DIR__ . '/examples/new/config.yaml'), true); }
* (c) 2011 Guglielmo Celata <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ /** * @package * @subpackage Task per importare atti in openparlamento * @author Guglielmo Celata <*****@*****.**> */ pake_desc("import ddl a partire da file yaml"); pake_task('opp-import-ddl-from-yaml', 'project_exists'); pake_desc("update ddl a partire da file yaml"); pake_task('opp-update-ddl-from-yaml', 'project_exists'); pake_desc("prepara uno o più ddl per l'upgrade test"); pake_task('opp-prepare-ddl-for-test', 'project_exists'); /** * Importa dei ddl a partire da un file yaml */ function run_opp_import_ddl_from_yaml($task, $args, $options) { static $loaded; // load application context if (!$loaded) { _loader(); } $dry_run = false; if (array_key_exists('dry-run', $options)) { $dry_run = true; }
public static function import_default_tasks() { pake_desc('create a PEAR package'); pake_task('pakePearTask::pear_package'); }
<?php /** * This task is used to make a tarball of the project ommiting subversion, eclipse, cache and log files * * It will look for the XSLT file data/transform/clay2propel.xsl * * @author <*****@*****.**> * * usage : * symfony tar * * installation : * Just drop it in SF_DATA_DIR/tasks/ */ pake_desc('Clear memcache'); pake_task('clear-memcache', 'app_exists'); function run_clear_memcache($task, $args) { define('SF_ROOT_DIR', realpath(dirname(__FILE__) . '/../../../../')); define('SF_APP', $args[0]); define('SF_ENVIRONMENT', 'dev'); define('SF_DEBUG', true); require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php'; // Clear all cache. $cache = new sfMemcacheCache(sfConfig::get('sf_cache_dir')); $cache->clean(); echo "Cleared\n"; } ?>
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ pake_desc('clear cached xmls'); pake_task('fb-clear-xml-cache', 'project_exists'); pake_alias('cx', 'fb-clear-xml-cache'); /** * clears xml files in the cache * * @example symfony fb-clear-xml-cache * @example symfony cx * * @param object $task * @param array $args */ function run_fb_clear_xml_cache($task, $args) { if (!file_exists('cache')) { throw new Exception('Cache directory does not exist.'); } $xml_cache_dir = sfConfig::get('sf_root_cache_dir') . "/atti"; // finder to remove all files in a cache directory $finder = pakeFinder::type('file')->ignore_version_control()->discard('.sf'); foreach ($args as $id) { $finder = $finder->name($id . ".xml");
pake_task('opp-build-pos-cache-politici', 'project_exists'); pake_desc("costruisce cache per gruppi"); pake_task('opp-build-cache-gruppi', 'project_exists'); pake_desc("costruisce cache per rami"); pake_task('opp-build-cache-rami', 'project_exists'); pake_desc("costruisce cache per gli atti"); pake_task('opp-build-cache-atti', 'project_exists'); pake_desc("costruisce cache per gli argomenti"); pake_task('opp-build-cache-tags', 'project_exists'); pake_desc("calcola i dati dei delta per la cache dei politici (percentuali di presenze, indici, ribellioni)"); pake_task('opp-compute-delta-politici', 'project_exists'); pake_desc("calcola i dati dei delta per la cache degli atti"); pake_task('opp-compute-delta-atti', 'project_exists'); pake_desc("calcola i dati dei delta per la cache dei tag"); pake_task('opp-compute-delta-tag', 'project_exists'); pake_desc("aggiorna i valori dell'indice in opp_carica, prelevandoli dalla cache"); pake_task('opp-upgrade-opp-carica-from-cache', 'project_exists'); /** * Aggiorna i valori di indice e posizione nella opp_carica * copiandoli dalla opp_politician_history_cache * Si deve specificare: * - il ramo (camera o senato) * Si può specificare: * - la data (da inizio legislatura a quella data) * Se la data non è specificata, viene copiato il valore dell'ultima data presente nei dati * Se sono passati degli ID (argomenti), sono interpretati come ID di politici e il calcolo è fatto solo per loro */ function run_opp_upgrade_opp_carica_from_cache($task, $args, $options) { static $loaded; // load application context
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ pake_desc('initialize a new propel CRUD module'); pake_task('propel-init-crud', 'app_exists'); pake_desc('generate a new propel CRUD module'); pake_task('propel-generate-crud', 'app_exists'); function run_propel_init_crud($task, $args) { if (count($args) < 2) { throw new Exception('You must provide your module name.'); } if (count($args) < 3) { throw new Exception('You must provide your model class name.'); } $app = $args[0]; $module = $args[1]; $model_class = $args[2]; try { $author_name = $task->get_property('author', 'symfony'); } catch (pakeException $e) { $author_name = 'Your name here'; } $constants = array('PROJECT_NAME' => $task->get_property('name', 'symfony'), 'APP_NAME' => $app, 'MODULE_NAME' => $module, 'MODEL_CLASS' => $model_class, 'AUTHOR_NAME' => $author_name); $sf_root_dir = sfConfig::get('sf_root_dir');
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ pake_desc('install a new plugin'); pake_task('plugin-install', 'project_exists'); pake_desc('upgrade a plugin'); pake_task('plugin-upgrade', 'project_exists'); pake_desc('uninstall a plugin'); pake_task('plugin-uninstall', 'project_exists'); pake_desc('list installed plugins'); pake_task('plugin-list', 'project_exists'); // symfony plugin-install pluginName function run_plugin_install($task, $args) { if (!isset($args[0])) { throw new Exception('You must provide the plugin name.'); } $config = _pear_init(); // install plugin $packages = array($args[0]); pake_echo_action('plugin', 'installing plugin "' . $args[0] . '"'); list($ret, $error) = _pear_run_command($config, 'install', array(), $packages); if ($error) { throw new Exception($error); }
pake_task('propel-build-schema', 'project_exists'); pake_desc('create schema.xml from schema.yml'); pake_task('propel-convert-yml-schema', 'project_exists'); pake_desc('create schema.yml from schema.xml'); pake_task('propel-convert-xml-schema', 'project_exists'); pake_desc('load data from fixtures directory'); pake_task('propel-load-data', 'project_exists'); pake_desc('dump data to fixtures directory'); pake_task('propel-dump-data', 'project_exists'); pake_desc('create database for current model'); pake_task('propel-build-db', 'project_exists'); pake_desc('insert sql for current model'); pake_task('propel-insert-sql', 'project_exists'); pake_desc('generate propel model and sql and initialize database'); pake_task('propel-build-all', 'propel-build-model', 'propel-build-sql', 'propel-insert-sql'); pake_desc('generate propel model and sql and initialize database, and load data'); pake_task('propel-build-all-load', 'propel-build-all', 'propel-load-data'); function run_propel_convert_yml_schema($task, $args) { _propel_convert_yml_schema(true); } function run_propel_convert_xml_schema($task, $args) { _propel_convert_xml_schema(true); } function _propel_convert_yml_schema($check_schema = true, $prefix = '') { $finder = pakeFinder::type('file')->name('*schema.yml'); $dirs = array('config'); if ($pluginDirs = glob(sfConfig::get('sf_root_dir') . '/plugins/*/config')) { $dirs = array_merge($dirs, $pluginDirs);
<?php // Task description pake_desc('synchronize a physical folder content with the asset library'); pake_task('sfassetlibrary-synchronize', 'project_exists'); pake_alias('sfals', 'sfassetlibrary-synchronize'); /** * * @param object $task * @param array $args */ function run_sfassetlibrary_synchronize($task, $args, $options) { if (!count($args)) { sfAssetsLibraryTools::log('Usage: php symfony sfassetlibrary-synchronize [app] [dirname] --notVerbose --removeOrphanAssets --removeOrphanFolders'); return; } $app = $args[0]; if (!is_dir(sfConfig::get('sf_app_dir') . DIRECTORY_SEPARATOR . $app)) { throw new Exception('The app "' . $app . '" does not exist.'); } if (!isset($args[1])) { throw new Exception('You must define a sychronization folder'); } $base_folder = $args[1]; $verbose = array_key_exists('notVerbose', $options) ? false : true; $removeOrphanAssets = array_key_exists('removeOrphanAssets', $options) ? true : false; $removeOrphanFolders = array_key_exists('removeOrphanFolders', $options) ? true : false; // define constants define('SF_ROOT_DIR', sfConfig::get('sf_root_dir')); define('SF_APP', $app);
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ pake_desc('initialize a new propel admin module'); pake_task('propel-init-admin', 'app_exists'); function run_propel_init_admin($task, $args) { if (count($args) < 2) { throw new Exception('You must provide your module name.'); } if (count($args) < 3) { throw new Exception('You must provide your model class name.'); } $app = $args[0]; $module = $args[1]; $model_class = $args[2]; $theme = isset($args[3]) ? $args[3] : 'default'; try { $author_name = $task->get_property('author', 'symfony'); } catch (pakeException $e) { $author_name = 'Your name here'; } $constants = array('PROJECT_NAME' => $task->get_property('name', 'symfony'), 'APP_NAME' => $app, 'MODULE_NAME' => $module, 'MODEL_CLASS' => $model_class, 'AUTHOR_NAME' => $author_name, 'THEME' => $theme); $moduleDir = sfConfig::get('sf_root_dir') . '/' . sfConfig::get('sf_apps_dir_name') . '/' . $app . '/' . sfConfig::get('sf_app_module_dir_name') . '/' . $module; // create module structure
public function load_pakefile() { pake_desc('Run server. usage: aip app [config.yaml]'); pake_task('MFS\\AppServer\\Runner\\RunnerApp::app'); }
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ pake_desc('freeze symfony libraries'); pake_task('freeze', 'project_exists'); pake_desc('unfreeze symfony libraries'); pake_task('unfreeze', 'project_exists'); function run_freeze($task, $args) { // check that the symfony librairies are not already freeze for this project if (is_readable(sfConfig::get('sf_lib_dir') . '/symfony')) { throw new Exception('You can only freeze when lib/symfony is empty.'); } if (is_readable(sfConfig::get('sf_data_dir') . '/symfony')) { throw new Exception('You can only freeze when data/symfony is empty.'); } if (is_readable(sfConfig::get('sf_web_dir') . '/sf')) { throw new Exception('You can only freeze when web/sf is empty.'); } if (is_link(sfConfig::get('sf_web_dir') . '/sf')) { pake_remove(sfConfig::get('sf_web_dir') . '/sf', ''); } $symfony_lib_dir = sfConfig::get('sf_symfony_lib_dir'); $symfony_data_dir = sfConfig::get('sf_symfony_data_dir'); pake_echo_action('freeze', 'freezing lib found in "' . $symfony_lib_dir . '"');
8. compile locales 9. compile rights 10. index documents '); pake_task('build-all', 'project_exists'); pake_alias('all', 'build-all'); pake_desc('compile locales'); pake_task('compile-locales', 'project_exists'); pake_alias('cl', 'compile-locales'); pake_desc('compile settings'); pake_task('compile-settings', 'project_exists'); pake_alias('cs', 'compile-settings'); pake_desc('compile right'); pake_task('compile-rights', 'project_exists'); pake_alias('cr', 'compile-rights'); pake_desc('create module: <module_name> <lib>'); pake_task('create-module', 'project_exists'); pake_alias('cm', 'create-module'); pake_task('compress-files', 'project_exists'); pake_alias('cf', 'compress-files'); pake_task('newsletter', 'project_exists'); pake_alias('nl', 'newsletter'); pake_task('tags-relations', 'project_exists'); pake_alias('tr', 'tags-relations'); pake_task('url-relations', 'project_exists'); pake_alias('ur', 'url-relations'); function run_compress_files($task, $args) { define('SF_ROOT_DIR', sfConfig::get('sf_root_dir')); define('SF_APP', 'frontend'); define('SF_ENVIRONMENT', 'prod');
public static function import_default_tasks() { pake_desc('launch project test suite'); pake_task('pakeSimpletestTask::test'); }
<?php pake_desc('promote a user super administrator'); pake_task('promote-super-admin', 'project_exists'); function run_promote_super_admin($task, $args) { if (!count($args)) { throw new Exception('You must provide a user name.'); } $username = $args[0]; throw new Exception('This task is not yet implemented.'); }
/** * This task is used to import either a vocabulary or an element set into an instance of the Registry * * It will look for the XSLT file data/transform/clay2propel.xsl * * @author <*****@*****.**> * * usage : * symfony import-vocabulary {type} {ID} {file path} -d ('delete existing' -- optional) * */ pake_desc('Import a file into a vocabulary'); pake_task('import-marc-vocabulary'); pake_desc('Import a list of vocabulary files'); pake_task('import-marc-list'); echo "\n"; //xdebug_break(); //we could also prepend these as arguments, but not today //define('SF_APP', $app); //define('SF_ENVIRONMENT', $env); if ( ! defined('SF_APP')) { define('SF_APP', 'frontend'); } if ( ! defined('SF_ENVIRONMENT')) { define('SF_ENVIRONMENT', 'prod'); }
*/ /** * @package * @subpackage Task that fetches politicians' images from op_openpolis and * stores resized versions in the op_openparlamento db * @author Guglielmo Celata <*****@*****.**> */ pake_desc("add tags to acts"); pake_task('opp-add-tags-to-acts', 'project_exists'); pake_desc("get all opp_carica_id(s) from the politician_id"); pake_task('opp-get-carica-id', 'project_exists'); pake_desc("sync politicians' images from op_openpolis, storing resized versions in the local db"); pake_task('opp-sync-polimages', 'project_exists'); pake_desc("create a list of URLs to pre-fetch, in order to populate the cache"); pake_task('opp-urls-to-cache', 'project_exists'); pake_desc('load data from fixtures directory (using myPropelData class)'); pake_task('opp-load-fixtures', 'project_exists'); /** * estrae e mostra le cariche id relative al politico id */ function run_opp_get_carica_id($task, $args, $options) { static $loaded; // load application context if (!$loaded) { _loader(); } $politici_id = $args; foreach ($politici_id as $politico_id) { $msg = sprintf("politico ID: {$politico_id} ... "); echo pakeColor::colorize($msg, array('fg' => 'green', 'bold' => false));
{ print pake_sh('vendor/bin/phpcs -s'); } pake_desc('Run PHPCBF to attempt to fix CS issues'); pake_task('phpcbf'); function run_phpcbf() { print pake_sh('vendor/bin/phpcbf'); } pake_desc('Run PHPMD'); pake_task('phpmd'); function run_phpmd() { print pake_sh('vendor/bin/phpmd ./ text cleancode,codesize,controversial,design,unusedcode --exclude vendor'); } pake_desc('Run PHPUnit tests'); pake_task('phpunit'); function run_phpunit() { $cc_token = getenv('CODECLIMATE_REPO_TOKEN'); $cc = !empty($cc_token); $clover = $cc ? ' --coverage-clover build/logs/clover.xml' : ''; $circle_test_reports = getenv('CIRCLE_TEST_REPORTS'); if (!empty($circle_test_reports)) { pake_mkdirs($circle_test_reports); $junit = " --log-junit {$circle_test_reports}/phpunit/junit.xml"; } else { $junit = ''; } print pake_sh('vendor/bin/phpunit' . $clover . $junit); if ($cc && file_exists('build/logs/clover.xml')) {
<?php pake_desc('generate database patch'); pake_task('propel-build-sql-diff'); pake_desc('insert database patch'); pake_task('propel-insert-sql-diff'); pake_desc('rebuild model and upgrade database'); pake_task('propel-update-all', 'app_exists', 'propel-build-model', 'propel-insert-sql-diff', 'clear-cache'); function run_propel_build_sql_diff($task, $args) { if (!count($args)) { throw new Exception('You must provide the application.'); } $app = $args[0]; if (!is_dir(sfConfig::get('sf_app_dir') . DIRECTORY_SEPARATOR . $app)) { throw new Exception(sprintf('The app "%s" does not exist.', $app)); } run_propel_build_sql($task, $args); pake_echo_action('propel-sql-diff', "building database patch"); define('SF_ROOT_DIR', realpath(dirname(__FILE__) . '/../../../..')); define('SF_APP', $app); define('SF_ENVIRONMENT', isset($args[1]) ? $args[1] : 'dev'); define('SF_DEBUG', 1); require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php'; $databaseManager = new sfDatabaseManager(); $databaseManager->initialize(); $i = new dbInfo(); $i->loadFromDb(); $i2 = new dbInfo(); $i2->loadAllFilesInDir(sfConfig::get('sf_data_dir') . '/sql'); $diff = $i->getDiffWith($i2);
* (c) 2010 Guglielmo Celata <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ /** * @package * @subpackage Task per estrarre testi e tagging degli atti * @author Guglielmo Celata <*****@*****.**> */ pake_desc("generazione csv tags degli atti"); pake_task('stlab-genera-atti-tags-csv', 'project_exists'); pake_desc("generazione csv elenco tag"); pake_task('stlab-genera-tags-csv', 'project_exists'); pake_desc("generazione dei files di testo degli atti"); pake_task('stlab-genera-testi-atti', 'project_exists'); /** * Genera un elenco csv di atti con i loro tag (id) * ATTO_ID, N_TAG, TAG_ID_1, TAG_ID_2, ... */ function run_stlab_genera_atti_tags_csv($task, $args, $options) { static $loaded; // load application context if (!$loaded) { _loader(); } $file_path = sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR . "stlab" . DIRECTORY_SEPARATOR . "atti_tags.csv"; $act_types = array(); if (array_key_exists('file_path', $options)) {