コード例 #1
0
ファイル: Avy.class.php プロジェクト: volrathxiii/Avy
 public function Avy($parameters, $display_process = true)
 {
     $this->GetFunctionFiles();
     if ($parameters != '__DASHBOARD__') {
         $parameters = strtolower($parameters);
         if (Prompt::Check()) {
             Prompt::Process($parameters);
             return;
         }
         if ($display_process) {
             echo "Avy-process:'" . $parameters . "'\n";
         }
         $Triggers = Triggers::getInstance();
         $findCommand = $Triggers->FindFunction($parameters);
         if (count($findCommand) > 0) {
             // Get top results
             if (count($findCommand) == 1) {
                 foreach ($findCommand as $key => $data) {
                     //var_dump($data);
                     $class = "";
                     eval('$class = new ' . $data['class'] . '();');
                     $function = $data['function'];
                     $class->setTriggered(array("keywords" => $parameters, "trigger" => $data));
                     $class->{$function}();
                     //$class = call_user_func($data[0]."::". $data[1], array("keywords"=>$parameters, "trigger"=>$data));
                 }
                 //$class = call_user_func();
             } else {
                 //Prompt which function to use
                 //Add to session
             }
         }
     }
 }