/** * 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); }
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]; }
/** * 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); }
/** * @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); }
/** * 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); }); }
public function comment($string) { if (!$this->option('silent')) { parent::comment($string); } }
/** * 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...'); }
/** * 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); }
/** * 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); }
public function commandComment($message) { $this->commandObj->comment($message); }
/** * Display console message * * @param string $s the message to display * * @return void */ public function writeComment($s) { if ($this->display) { parent::comment($s); } }
public function comment($message) { parent::comment($this->log($message, 'Comment')); }
public function comment($string) { parent::comment($string); Log::info($string, [get_called_class()]); }
/** * 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); }
/** * 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); } }