コード例 #1
0
ファイル: solrcli.php プロジェクト: Zoxive/Kohana-Solr
 public function action_index()
 {
     $model_name = $this->request->param('model');
     $method = $this->request->param('method', 'status');
     if (empty($model_name) || $method == 'help' || $model_name == 'help') {
         $this->_help();
     }
     // todo make this use the driver class somehow
     $this->model = Sprig::factory($model_name);
     $this->solr = Solr::factory($this->model);
     if (method_exists($this, '_' . $method)) {
         $this->{'_' . $method}();
     } else {
         throw new Kohana_Exception('Core method: :method not found.', array(':method' => $method === NULL ? 'NULL' : $method));
     }
 }