本文整理汇总了PHP中CConsoleCommand类的典型用法代码示例。如果您正苦于以下问题:PHP CConsoleCommand类的具体用法?PHP CConsoleCommand怎么用?PHP CConsoleCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CConsoleCommand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* GenerateWorklistsCommand constructor.
*
* @param string $name
* @param CConsoleCommandRunner $runner
* @param WorklistManager $manager
*/
public function __construct($name, $runner, $manager = null)
{
if (is_null($manager)) {
$manager = new WorklistManager();
}
$this->manager = $manager;
parent::__construct($name, $runner);
}
开发者ID:openeyes,项目名称:openeyes,代码行数:15,代码来源:GenerateWorklistsCommand.php
示例2: renderPartial
/**
* Load and render the view
*
* @param $view view file path (yii path alias)
* @param null $data parameters to render in the view
* @return string the rendered view
* @throws CException if the view cannot be found
*/
public function renderPartial($view, $data = null)
{
if (($viewFile = $this->getViewFile($view)) !== false) {
$output = CConsoleCommand::renderFile($viewFile, $data, true);
return $output;
} else {
throw new CException(Yii::t('yii', '{controller} cannot find the requested view "{view}".', array('{controller}' => get_class($this), '{view}' => $view)));
}
}
开发者ID:narwold,项目名称:Small-Potatoes,代码行数:17,代码来源:SYiiMessage.php
示例3: afterAction
/**
* (non-PHPdoc)
* @see CConsoleCommand::afterAction()
*/
protected function afterAction($action, $params, $exitCode = 0)
{
$dirPath = Yii::app()->runtimePath . '/locks/';
$commandName = $this->getName();
$lockFileName = "{$commandName}_{$action}_.lock";
$lockFilePath = $dirPath . $lockFileName;
if (file_exists($lockFilePath)) {
unlink($lockFilePath);
}
return parent::afterAction($action, $params, $exitCode);
}
开发者ID:xiaoxiaochengxyuan,项目名称:kshenghuo,代码行数:15,代码来源:ConsoleCommand.php
示例4: run
/**
* Deciding if we are running the command locally or on Iron Workers
* @see CConsoleCommand::run()
* @param $args array
* @return If run locally the exit code. If run as IronWorker the ironWorker id.
*/
public function run($args)
{
//Store the parameters passed to the function, will be used to pass on to the iron workers
$this->yiicParams = $args;
//Add in the command name
array_unshift($this->yiicParams, $this->getName());
//Add in the entry script name
array_unshift($this->yiicParams, "./" . $this->getCommandRunner()->getScriptName());
CVarDumper::dump($this->yiicParams, 100, false);
if ($this->isIronWorker()) {
$this->ironWorker = true;
//Kick the command off to Iron Workers
$resId = $this->runAsIronWorker();
echo "Task " . $resId . " pushed to Iron Worker!\n";
//When run as an iron worker we return the IronWorker id
return $resId;
} else {
parent::run($args);
}
}
开发者ID:br0sk,项目名称:yiiron,代码行数:26,代码来源:EIronWorkersCommand.php
示例5: beforeAction
public function beforeAction($action, $params)
{
$path = Yii::getPathOfAlias($this->migrationPath);
if ($path === false || !is_dir($path)) {
echo 'Error: The migration directory does not exist: ' . $this->migrationPath . "\n";
exit(1);
}
$this->migrationPath = $path;
$yiiVersion = Yii::getVersion();
echo "\nYii Migration Tool for MongoYii v1.0 (based on Yii v{$yiiVersion})\n\n";
return CConsoleCommand::beforeAction($action, $params);
}
开发者ID:pvassiliou,项目名称:MongoYii,代码行数:12,代码来源:EMigrateMongoCommand.php
示例6: init
public function init()
{
parent::init();
Yii::getLogger()->autoFlush = 10;
Yii::getLogger()->detachEventHandler('onFlush', array(Yii::app()->log, 'collectLogs'));
Yii::getLogger()->attachEventHandler('onFlush', array($this, 'processLogs'));
}
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:7,代码来源:C2goCConsoleCommand.php
示例7: __construct
public function __construct($name, $runner)
{
parent::__construct($name, $runner);
if ($this->_log == null) {
$this->_log = new CronFileLogRoute('command_update');
}
}
开发者ID:hucongyang,项目名称:test,代码行数:7,代码来源:UpdateCommand.php
示例8: init
/**
* Ini system param
*/
public function init()
{
parent::init();
ini_set('memory_limit', '-1');
set_time_limit(0);
$this->_logger = LoggerFactory::getFileLogger('process_sync_db');
}
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:10,代码来源:SyncDBCommand.php
示例9: pluralize
/**
* Pluralize word depending on count
*
* @param string $name
* @param int $count
* @return string
*/
public function pluralize($name, $count = 1)
{
if ($count == 1) {
return $name;
}
return parent::pluralize($name);
}
开发者ID:septembermd,项目名称:n1,代码行数:14,代码来源:ConsoleCommand.php
示例10: run
public function run($args)
{
\Yii::getLogger()->autoFlush = 1;
\Yii::getLogger()->detachEventHandler('onFlush', [\Yii::app()->log, 'collectLogs']);
\Yii::getLogger()->attachEventHandler('onFlush', [$this, 'processLogs']);
parent::run($args);
}
开发者ID:herroffizier,项目名称:yiiq,代码行数:7,代码来源:Base.php
示例11: init
/**
* Initialize the command object.
*/
public function init()
{
// Tell yii to flush the logs every message (instead of buffering for the default 10,000)
// Without this, you cannot use the log to find out where the script has got to in it's current run.
Yii::getLogger()->autoFlush = 1;
Yii::getLogger()->autoDump = true;
parent::init();
}
开发者ID:peopleperhour,项目名称:yii-ses-feedback,代码行数:11,代码来源:ASesFeedbackCommand.php
示例12: afterAction
protected function afterAction($action, $params, $exitCode = 0)
{
if (isset($this->service['name'])) {
$this->log("SERVICE: Service {$this->service['name']} exited with code {$exitCode} [PID: {$this->pid}] ");
ServiceManager::markAsStopped($this->service['name'], $this->id);
}
return parent::afterAction($action, $params, $exitCode);
}
开发者ID:reggi49,项目名称:plansys,代码行数:8,代码来源:Service.php
示例13: init
public function init()
{
parent::init();
ini_set('memory_limit', '-1');
set_time_limit(0);
$this->_logger = LoggerFactory::getFileLogger('sms');
// $this->_logger = LoggerFactory::getConsoleLogger();
}
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:8,代码来源:SmsSendCommand.php
示例14: init
public function init()
{
parent::init();
ini_set('memory_limit', '-1');
set_time_limit(0);
// All reports are generated basing on data in UTC time.
TimezoneWork::set('UTC');
}
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:8,代码来源:ReportSendTestCommand.php
示例15: afterAction
public function afterAction($action, $params, $exitCode = 0)
{
if ($this->outputLog) {
echo implode("\n", $this->_log) . "\n";
}
array_unshift($this->_log, 'Launched at: ' . date("Y-m-d H:i:s"));
file_put_contents(Yii::app()->params['logDirPath'] . '/moveFollowUpAppointment.log', implode("\n", $this->_log), FILE_APPEND);
return parent::afterAction($action, $params, $exitCode);
}
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:9,代码来源:CronMoveFollowUpAppointmentsCommand.php
示例16: init
public function init()
{
parent::init();
ini_set('memory_limit', '-1');
set_time_limit(0);
self::$_logger = LoggerFactory::getFileLogger('reports');
// All reports are generated basing on data in UTC time.
TimezoneWork::set('UTC');
}
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:9,代码来源:ScheduleCommand_old.php
示例17: init
public function init()
{
parent::init();
Yii::import('application.modules.yupe.components.*');
Yii::import('application.modules.yupe.models.*');
Yii::import('application.modules.comment.models.*');
$this->migrator = is_object($this->migrator) ? $this->migrator : new Migrator();
$this->db = is_object($this->db) ? $this->db : Yii::app()->db;
}
开发者ID:alextravin,项目名称:yupe,代码行数:9,代码来源:MigrateToNestedSetsCommand.php
示例18: beforeAction
public function beforeAction($action, $params)
{
$path = Yii::getPathOfAlias($this->migrationPath);
if ($path === false || !is_dir($path)) {
echo 'Error: The migration directory does not exist: ' . $this->migrationPath . "\n";
exit(1);
}
$this->migrationPath = $path;
return parent::beforeAction($action, $params);
}
开发者ID:schmunk42,项目名称:database-command,代码行数:10,代码来源:EDatabaseCommand.php
示例19: init
public function init()
{
parent::init();
ini_set('memory_limit', '-1');
ini_set('display_errors', '1');
set_time_limit(0);
error_reporting(E_ALL);
$this->_logger = LoggerFactory::getFileLogger('poller');
// $this->_logger = LoggerFactory::getConsoleLogger(); // For testing
}
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:10,代码来源:PollingCommand.php
示例20: __construct
public function __construct($id, $module = null)
{
parent::__construct($id, $module);
$this->product_model = new Product();
$this->productType_model = new ProductType();
$this->productPublish_model = new ProductPublish();
$this->userProductBuy_model = new UserProductBuy();
$this->buyLogs_model = new BuyLogs();
$this->tradingRecord_model = new TradingRecord();
$this->userInfo_model = new Userinfo();
}
开发者ID:niujie123,项目名称:myself,代码行数:11,代码来源:BuyProCommand.php
注:本文中的CConsoleCommand类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论