Skip to content

Instantly share code, notes, and snippets.

@thewinterwind
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save thewinterwind/bf21c4e30d6a9d09cb47 to your computer and use it in GitHub Desktop.

Select an option

Save thewinterwind/bf21c4e30d6a9d09cb47 to your computer and use it in GitHub Desktop.

Revisions

  1. thewinterwind renamed this gist Jun 18, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. thewinterwind revised this gist Jun 18, 2014. No changes.
  3. thewinterwind created this gist Jun 18, 2014.
    86 changes: 86 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,86 @@
    // this is /app/start/artisan.php

    <?php

    /*
    |--------------------------------------------------------------------------
    | Register The Artisan Commands
    |--------------------------------------------------------------------------
    |
    | Each available Artisan command must be registered with the console so
    | that it is available to be called. We'll register every command so
    | the console gets access to each of the command object instances.
    |
    */

    Artisan::add(new UpdateStreaks);

    // this is /app/commands/UpdateStreaks.php

    <?php

    use Illuminate\Console\Command;
    use Symfony\Component\Console\Input\InputOption;
    use Symfony\Component\Console\Input\InputArgument;

    class UpdateStreaks extends Command {

    /**
    * The console command name.
    *
    * @var string
    */
    protected $name = 'ss:update-streaks';

    /**
    * The console command description.
    *
    * @var string
    */
    protected $description = 'Update the stock streaks';

    /**
    * Create a new command instance.
    *
    * @return void
    */
    public function __construct()
    {
    parent::__construct();
    }

    /**
    * Execute the console command.
    *
    * @return mixed
    */
    public function fire()
    {
    (new StoringController)->store_streaks();
    }

    /**
    * Get the console command arguments.
    *
    * @return array
    */
    protected function getArguments()
    {
    return array(
    array('example', InputArgument::OPTIONAL, 'An example argument.'),
    );
    }

    /**
    * Get the console command options.
    *
    * @return array
    */
    protected function getOptions()
    {
    return array(
    array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null),
    );
    }

    }