本文整理汇总了PHP中pake_desc函数的典型用法代码示例。如果您正苦于以下问题:PHP pake_desc函数的具体用法?PHP pake_desc怎么用?PHP pake_desc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pake_desc函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: import_default_tasks
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');
}
开发者ID:JasonWayne,项目名称:markdown-resume,代码行数:8,代码来源:pakeInteractiveTask.class.php
示例2: import_default_tasks
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]));
}
}
开发者ID:piotras,项目名称:pake,代码行数:9,代码来源:pakePhpExtensionTask.class.php
示例3: pake_desc
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <[email protected]>
*
* 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 .= '/';
}
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:31,代码来源:sfPakeEnvironment.php
示例4: pake_desc
* @author <[email protected]>
*
* 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');
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:31,代码来源:importVocabulary.php
示例5: pake_desc
<?php
/*
* This file is part of the anno0Tasks package.
*
* (c) 2011 Guglielmo Celata <[email protected]>
*
* 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 <[email protected]>
*/
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;
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:anno0Tasks.php
示例6: pake_desc
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <[email protected]>
*
* 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];
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:sfPakeTest.php
示例7: foreach
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)
开发者ID:otis22,项目名称:reserve-copy-system,代码行数:31,代码来源:Pakefile.php
示例8: pake_desc
<?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";
}
}
开发者ID:vcgato29,项目名称:poff,代码行数:23,代码来源:sfFacebookConnectRegisterUsersTask.php
示例9: pake_desc
<?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");
}
/**
开发者ID:mediasadc,项目名称:alba,代码行数:31,代码来源:alba.php
示例10: pake_import
<?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);
}
开发者ID:piotras,项目名称:appserver-in-php,代码行数:15,代码来源:Pakefile.php
示例11: pake_desc
* (c) 2011 Guglielmo Celata <[email protected]>
*
* 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 <[email protected]>
*/
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;
}
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:oppImportTasks.php
示例12: import_default_tasks
public static function import_default_tasks()
{
pake_desc('create a PEAR package');
pake_task('pakePearTask::pear_package');
}
开发者ID:piotras,项目名称:pake,代码行数:5,代码来源:pakePearTask.class.php
示例13: pake_desc
<?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 <[email protected]>
*
* 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";
}
?>
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:30,代码来源:sfPakeTask.php
示例14: pake_desc
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <[email protected]>
*
* 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");
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:fbCacheManagementTasks.php
示例15: pake_task
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
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:oppHistoryCachesTasks.php
示例16: pake_desc
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <[email protected]>
*
* 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');
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:sfPakePropelCrudGenerator.php
示例17: pake_desc
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <[email protected]>
*
* 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);
}
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:sfPakePlugins.php
示例18: pake_task
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);
开发者ID:sgrove,项目名称:cothinker,代码行数:31,代码来源:sfPakePropel.php
示例19: pake_desc
<?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);
开发者ID:sgrove,项目名称:cothinker,代码行数:31,代码来源:sfPakeSynchronizeTask.class.php
示例20: pake_desc
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <[email protected]>
*
* 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
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:31,代码来源:sfPakePropelAdminGenerator.php
注:本文中的pake_desc函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论