$m3u8 = preg_replace('^http://(.*)yacast.net/^', '/mnt/isilon/wwwroot/', $basename); if (time() - filectime($m3u8) > TS_AGE) { # file_put_contents('/tmp/'.str_replace(array(':', '/', ' '), '_', $basename).'.code', $filters['FILTER_TS_TOO_OLD']['code']); file_put_contents($coin, $filters['FILTER_TS_TOO_OLD']['code']); # if (DEBUG) echo "CODE: TS TOO OLD\n"; exit(0); } } // Exécution du test if (DEBUG) { echo "### ARG ###\n"; var_dump($argc, $argv); } //$proc = new Expect($url, $basename, CM_HOME); while ($retry < MAX_RETRY && !strstr($code, 'OK')) { $proc = new Expect($url, $basename, CM_HOME); /* if (DEBUG) { echo "@round #$retry\n"; var_dump($retry, $url, $basename, $code); } */ $code = $proc->execute($filters); $retry++; $proc->stop(); $proc = null; unset($proc); } if (DEBUG) { echo "CODE: {$code} ({$retry})\n"; } #file_put_contents('/tmp/'.str_replace(array(':', '/'), '_', $basename).'.code', $filters[$code]['code']);
function _fail($method, $args, $result, $expectedResult, $values) { if (empty($values)) { $format = 'expected %s to ' . str_replace('_', ' ', $method); $values = array($this->actual); if (!empty($args)) { $format .= ' %s'; $values[] = $args[0]; } } else { $format = array_shift($values); } if (!empty($values)) { array_walk($values, function (&$v) { $v = Expect::_export($v); }); $message = vsprintf($format, $values); } else { $message = $format; } $this->spec->fail(new \Exception($message)); }