当前位置: 首页>>代码示例>>PHP>>正文


PHP Shell::out方法代码示例

本文整理汇总了PHP中Shell::out方法的典型用法代码示例。如果您正苦于以下问题:PHP Shell::out方法的具体用法?PHP Shell::out怎么用?PHP Shell::out使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shell的用法示例。


在下文中一共展示了Shell::out方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: truncateModels

 /**
  * Truncate the given models
  *
  * @param array $modelsToTruncate An array of models (names) to truncate
  * @return void
  * @todo Improve testability by extracting the model object retrieval part.
  */
 public function truncateModels($modelsToTruncate)
 {
     foreach ($modelsToTruncate as $modelName) {
         $this->_shell->out(__('Truncate model %s...', $modelName), 1, Shell::VERBOSE);
         $model = ClassRegistry::init($modelName);
         $datasource = $model->getDataSource();
         $datasource->truncate($model->table);
     }
 }
开发者ID:ravage84,项目名称:cakephp-fake-seeder,代码行数:16,代码来源:ShellModelTruncator.php

示例2: _run

 /**
  * Runs task
  */
 protected function _run()
 {
     $this->_Process = new TaskProcess($this->_task['command'] . $this->_argsToString($this->_task['arguments']), $this->_task['path']);
     $this->_Process->setTimeout($this->_task['timeout']);
     try {
         $this->_Process->start(function ($type, $buffer) {
             if ('err' === $type) {
                 $this->_Shell->err($buffer);
                 $this->_task['stderr'] .= $buffer;
             } else {
                 $this->_Shell->out($buffer);
                 $this->_task['stdout'] .= $buffer;
             }
             $this->_TaskServer->updated($this->_task);
         });
         while ($this->_Process->isRunning()) {
             $this->_task['process_id'] = (int) $this->_Process->getPid();
             $this->_TaskServer->updateStatistics($this->_task);
             $this->_Process->checkTimeout();
             sleep(Configure::read('Task.checkInterval'));
             if ($this->_TaskServer->mustStop($this->_task['id'])) {
                 $this->_Process->stop(Configure::read('Task.stopTimeout'));
                 $this->_task['code'] = 143;
                 $this->_task['code_string'] = TaskProcess::$exitCodes[143];
                 return $this->_stopped(true);
             }
         }
         $this->_task['code'] = $this->_Process->getExitCode();
         $this->_task['code_string'] = $this->_Process->getExitCodeText();
     } catch (Exception $Exception) {
         $this->_task['code'] = 134;
         $this->_task['code_string'] = $Exception->getMessage();
     }
     $this->_stopped(false);
 }
开发者ID:imsamurai,项目名称:cakephp-task-plugin,代码行数:38,代码来源:TaskRunner.php

示例3: out

 function out($data)
 {
     if (is_scalar($data)) {
         parent::out($data);
     } else {
         parent::out(print_r($data, true));
     }
 }
开发者ID:surjit,项目名称:Multitask,代码行数:8,代码来源:threaded_task.php

示例4: out

 /**
  * Modifies the out method for prettier formatting
  *
  * @param string $sString String to output.
  * @param boolean $bNewline If true, the outputs gets an added newline.
  */
 function out($sString, $bNewline = true)
 {
     return parent::out("  " . $sString, $bNewline);
 }
开发者ID:jmhobbs,项目名称:cakephp-yaml-migrations-and-fixtures,代码行数:10,代码来源:migrate.php

示例5: out

 /**
  * Overwrites parent method to introduce the "quiet" variant
  * 
  * @access public
  */
 function out($msg = '')
 {
     if (!$this->quiet) {
         parent::out($msg);
     }
 }
开发者ID:rcaravita,项目名称:jodeljodel,代码行数:11,代码来源:upload_gc.php

示例6: out

 /**
  * Overrides standard shell output to allow /r without /n
  *
  * Outputs a single or multiple messages to stdout. If no parameters
  * are passed outputs just a newline.
  *
  * @param mixed $message A string or a an array of strings to output
  * @param integer $newlines Number of newlines to append
  * @return integer Returns the number of bytes returned from writing to stdout.
  * @access public
  */
 public function out($message = NULL, $newLines = 0, $level = 1)
 {
     return parent::out($message, $newLines);
 }
开发者ID:klarkc,项目名称:Searchable-Behaviour-for-CakePHP,代码行数:15,代码来源:ProgressBarTask.php

示例7: out

 /**
  * Modifies the out method for prettier formatting
  *
  * @param string $string String to output.
  * @param boolean $newline If true, the outputs gets an added newline.
  */
 function out($string = '', $newline = true)
 {
     return parent::out(' ' . $string, $newline);
 }
开发者ID:joelmoss,项目名称:cakephp-db-migrations,代码行数:10,代码来源:migrate.php

示例8: out

 /**
  * Overrides standard shell output to allow /r without /n
  *
  * Outputs a single or multiple messages to stdout. If no parameters
  * are passed outputs just a newline.
  *
  * @param mixed $message A string or a an array of strings to output
  * @param integer $newlines Number of newlines to append
  * @return integer Returns the number of bytes returned from writing to stdout.
  * @access public
  */
 public function out($message = null, $newLines = 0)
 {
     return parent::out($message, $newLines);
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:15,代码来源:ProgressBarTask.php

示例9: out

 function out($str = '')
 {
     $str = date('Y-m-d H:i:s') . ' ' . $str;
     return parent::out($str);
 }
开发者ID:edukondaluetg,项目名称:cakephp_queue,代码行数:5,代码来源:queue.php

示例10: out

 /**
  * Prints a message
  *
  * @return void
  */
 public function out($message = '')
 {
     parent::out($message);
 }
开发者ID:sime,项目名称:cakephp-braintree-plugin,代码行数:9,代码来源:braintree.php

示例11: out

 function out($str = null, $newlines = 1, $level = Shell::NORMAL)
 {
     if ($newlines > 0) {
         $str = date('Y-m-d H:i:s') . ' ' . $str;
     }
     return parent::out($str, $newlines, $level);
 }
开发者ID:ElThac0,项目名称:cakephp_queue,代码行数:7,代码来源:QueueShell.php


注:本文中的Shell::out方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。