Example #1
0
 /**
  * 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);
 }
Example #2
0
 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);
 }
Example #5
0
 /**
  * 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);
     });
 }
Example #6
0
 public function comment($string)
 {
     if (!$this->option('silent')) {
         parent::comment($string);
     }
 }
Example #7
0
 /**
  * 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...');
 }
Example #8
0
 /**
  * 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);
 }
Example #9
0
 /**
  * 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);
     }
 }
Example #12
0
 public function comment($message)
 {
     parent::comment($this->log($message, 'Comment'));
 }
Example #13
0
 public function comment($string)
 {
     parent::comment($string);
     Log::info($string, [get_called_class()]);
 }
Example #14
0
 /**
  * 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);
     }
 }