Beispiel #1
0
 /**
  * @param $urls
  */
 public function add($urls)
 {
     $urls = explode("\n", $urls);
     foreach ($urls as $url) {
         $url = trim($url);
         if (empty($url)) {
             continue;
         }
         if (!extasyTestModel::exists($url)) {
             $model = new extasyTestModel();
             if (preg_match('#^\\/\\/#', $url)) {
                 $url = 'http:' . $url;
             }
             $model->url = $url;
             $model->method = 'GET';
             $model->insert();
         }
     }
     $msg = sprintf('Added %d urls', sizeof($urls));
     $this->addAlert($msg);
     $this->jumpBack();
 }
Beispiel #2
0
 public function test($testId)
 {
     Trace::setDisabled();
     $test = new extasyTestModel();
     $found = $test->get($testId);
     if ($found) {
         $test->execute();
         $result = array('lastTestDate' => $test->lastTestDate->getValue(), 'testResult' => $test->obj_lastResult->getAdminViewValue());
         die(json_encode($result));
     } else {
         throw new Exception('test model not found ');
     }
 }