protected function runCommandPrompt() { $command = new Command(); $command->option('p')->aka('path')->file()->default($this->config->get('defaultFilePath'))->describedAs(sprintf('Result csv file path (%s is default)', $this->config->get('defaultFilePath'))); $command->option('n')->aka('name')->default($this->config->get('defaultFileName'))->describedAs(sprintf('Result csv file name (%s is default)', $this->config->get('defaultFileName'))); $command->option('y')->aka('year')->boolean()->default(false)->describedAs('Generate salary days for all current year (default for the reminder of current year)'); $command->option('s')->aka('startDate')->default(null)->describedAs('start year and month in format (Y-m)'); $command->option('e')->aka('endDate')->default(null)->describedAs('end year and month in format (Y-m)'); return $command; }
private function __construct() { $this->username = Config::get('mysql/username'); $this->password = Config::get('mysql/password'); $this->dsn = 'mysql:host=' . Config::get('mysql/host') . ';dbname=' . Config::get('mysql/database'); array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION); try { $this->database = new \PDO($this->dsn, $this->username, $this->password); } catch (\PDOException $ex) { $this->errors = $ex; } }