Esempio n. 1
0
 public static function handle(&$template)
 {
     if (isset($template[KEY_MOCK_DEFINE]) == false || is_array($template[KEY_MOCK_DEFINE]) == false) {
         return;
     }
     foreach ($template[KEY_MOCK_DEFINE] as $key => $value) {
         \Mock\Random\Define::set($key, Basic::handle($value));
     }
     unset($template[KEY_MOCK_DEFINE]);
 }
Esempio n. 2
0
 private static function _callback($values)
 {
     if (isset($values['url']) == false) {
         return false;
     }
     $url = Basic::handle($values['url']);
     if (isset($values['ms'])) {
         $ms = Basic::handle($values['ms']);
         return Http::callback($url, $ms);
     }
     return Http::callback($url);
 }
Esempio n. 3
0
 private static function _handle($template)
 {
     $values = array();
     foreach ($template as $key => $value) {
         if (strpos($key, '|')) {
             list($key, $count) = explode('|', $key);
             $values[$key] = Basic::handle($value, $count);
         } else {
             $values[$key] = Basic::handle($value);
         }
     }
     return $values;
 }