本文整理汇总了PHP中Illuminate\Console\Command::comment方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::comment方法的具体用法?PHP Command::comment怎么用?PHP Command::comment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Console\Command
的用法示例。
在下文中一共展示了Command::comment方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createFolder
/**
* Create the specified folder.
*
* @param $folder
* @param $success
* @param $error
*/
protected function createFolder($folder, $success, $error)
{
if (!is_dir($folder)) {
$this->files->makeDirectory($folder);
return $this->console->info($success);
}
return $this->console->comment($error);
}
示例2: getMessage
private function getMessage($route, $target_id, \Illuminate\Database\Eloquent\Model $user, \Illuminate\Console\Command $command)
{
$url = $route . '/' . $user->id . '/' . $target_id;
$request = Request::create($url, 'GET');
Input::initialize([]);
if ($command->option('verbose')) {
$command->comment('route:' . $route);
}
$item = $this->router->dispatch($request)->getOriginalContent();
if ($item === null) {
return;
}
$view = 'sms.' . $route;
$message = view($view, ['item' => $item]);
if (Config::get('sms-manager.prefix')) {
$message = Config::get('sms-manager.prefix') . $message;
}
$adminPhone = Config::get('sms-manager.admin_phone');
$receiver_number = $adminPhone ? $adminPhone : $user->phone;
$to = $user->name;
// HACKHACK: Needs to update the database instead
if ($receiver_number[0] != '6') {
$receiver_number = '6' . $receiver_number;
}
return (object) ['to' => $to, 'receiver_number' => $receiver_number, 'message' => $message];
}
示例3: fire
/**
* Fire off the handler.
*
* @param \Aindong\Pluggables\Console\PluggableMakeCommand $console
* @param string $slug
*
* @return bool
*/
public function fire(Command $console, $slug)
{
$this->console = $console;
$this->slug = strtolower($slug);
$this->name = Str::studly($slug);
if ($this->pluggable->exists($this->slug)) {
$console->comment('Pluggable [{$this->name}] already exists.');
return false;
}
$this->generate($console);
}
示例4: fire
/**
* @param Command $console
* @param $name
* @return bool
*/
public function fire(Command $console, $name)
{
$this->console = $console;
$this->name = $name;
$this->Name = Str::studly($name);
if ($this->module->has($this->Name)) {
$console->comment("Module [{$this->Name}] already exists.");
return false;
}
$this->generate($console);
}
示例5: insertEntries
/**
* Insert entries in a table
*
* @param string $table
* @param array $entries
*/
protected function insertEntries($table, $entries)
{
$slices = array($entries);
// If the engine is SQLite and we have a lot of seeded entries
// We'll split the results to not overflow the variable limit
if (DB::getDriverName() === 'sqlite') {
$slicer = floor(999 / sizeof($entries[0]));
$slices = array_chunk($entries, $slicer);
}
if ($this->command) {
$this->command->comment('Insert entries');
}
$this->progressIterator($slices, function ($entries) use($table) {
DB::table($table)->insert($entries);
});
}
示例6: comment
public function comment($string)
{
if (!$this->option('silent')) {
parent::comment($string);
}
}
示例7: showModifiedNotification
/**
* Notify the user that the given view has been modified.
*
* @param \SplFileInfo $view
* @return void
*/
protected function showModifiedNotification($view)
{
$this->command->comment(' ⇒ View [' . $this->relativeViewPath($view) . '] has been modified. Skipping...');
}
示例8: comment
/**
* Allow the management of tabulation at the beginning of a message
*
* @param string $message
* @param null $verbosity
* @param int $tab
*/
public function comment($message, $verbosity = null, $tab = 0)
{
for ($i = 0; $i < $tab; $i++) {
$message = ' ' . $message;
}
parent::comment($message, $verbosity);
}
示例9: fire
/**
* Fire off the handler.
*
* @param \C5\AppKit\Console\ModuleMakeCommand $console
* @param string $slug
* @return bool
*/
public function fire(Command $console, $slug, $blank = false)
{
$this->console = $console;
$this->slug = $slug;
$this->name = strtolower($slug);
$this->blank = $blank;
if ($this->module->exists($this->slug)) {
$console->comment('Module [{$this->name}] already exists.');
return false;
}
$this->generate($console);
}
示例10: commandComment
public function commandComment($message)
{
$this->commandObj->comment($message);
}
示例11: writeComment
/**
* Display console message
*
* @param string $s the message to display
*
* @return void
*/
public function writeComment($s)
{
if ($this->display) {
parent::comment($s);
}
}
示例12: comment
public function comment($message)
{
parent::comment($this->log($message, 'Comment'));
}
示例13: comment
public function comment($string)
{
parent::comment($string);
Log::info($string, [get_called_class()]);
}
示例14: comment
/**
* Write a string as debug output.
*
* @param string $string
* @param null|int|string $verbosity
* @return void
*/
public function comment($string, $verbosity = null)
{
$string = $this->label('debug') . $string;
$this->log('debug', $string);
parent::comment($string, $verbosity);
}
示例15: comment
/**
* Display console message
*
* @param string $string
* @param null|int|string $verbosity
*
* @return void
*/
public function comment($string, $verbosity = null)
{
if ($this->display) {
parent::comment($string, $verbosity);
}
}