. * @author niel * @copyright 2016 nZEDb */ namespace app\extensions\command; use app\models\Settings; use lithium\console\command\Help; /** * Verifies various parts of your indexer. * * Actions: * * settings_table Checks that all settings in the 10~settings.tsv exist in your Db. */ class Verify extends \app\extensions\console\Command { /** * Constructor. * * @param array $config */ public function __construct(array $config = []) { $defaults = [ 'classes' => $this->_classes, 'request' => null, 'response' => [], ]; parent::__construct($config + $defaults); } public function run() { if (!$this->request->args()) { return $this->_help(); } return false; } public function settingstable() { $dummy = Settings::hasAllEntries($this); } /** * Invokes the `Help` command. * The invoked Help command will take over request and response objects of * the originally invoked command. Thus the response of the Help command * becomes the response of the original one. * * @return boolean */ protected function _help() { $help = new Help([ 'request' => $this->request, 'response' => $this->response, 'classes' => $this->_classes ]); return $help->run(get_class($this)); } /** * Class initializer. Parses template and sets up params that need to be filled. * * @return void */ protected function _init() { parent::_init(); } }