public function run() { if (!$this->run) { CommandHelper::runHelp(); return; } $debug = new DebugHelper(); if ($this->debug) { $debug->write(sprintf('Start %s', ucfirst($this->run))); } $command = sprintf('run%s', ucfirst($this->run)); $this->{$command}(); if ($this->debug) { $debug->write(sprintf('End %s', ucfirst($this->run))); } }
<?php if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get')) { date_default_timezone_set(@date_default_timezone_get()); } require_once 'bootstrap.php'; $shortopts = 'dluce:m:p:r:h:'; $options = getopt($shortopts); if (isset($options['e'])) { $command = new Command($options); $command->run(); } else { CommandHelper::runHelp(); }