@ 2013-09-10T10:33:00Z <pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
//http://stackoverflow.com/questions/1777101/php-check-to-see-if-a-string-matches-a-pattern
require_once 'core.php';
if (!function_exists('rip') || !isset($_FILE))
die('can\'t rip');
/*start working...*/
init();
$a = getData();
if ($a === true)
startSelect();
print_r(getDebug());
function init(){
global $_URL, $_CACHER, $_FILE, $_DATA;
$_URL = file($_FILE);
parseLines($_URL);
$_CACHER['url'] = &$_URL;
$_CACHER['count'] = array();
//$_CACHER['data'] = &$_DATA;
return true;
}
function getData(){
global $_DATA, $_URL, $_CACHER, $_FPENDING, $_FALL, $_FSELECTED;
if (is_file($_FPENDING){
unset($_CACHER['url']);
unset($_CACHER['count']);
$_CACHER['status'] = 'from_cache_see_pending';
return false;
}
@mkdir('tmp/' . date("Y-m-d"), 0777);
@unlink($_FALL);
foreach ($_URL as $val){
$data = getFromUrl($val);
$_CACHER['count'][] = count($data);
//$_DATA[] = $data;
file_put_contents($_FALL, implode("\n", $data), FX_LOCK | FILE_APPEND);
}
$_CACHER['status'] = 'from_extern_cache_writed';
return true;
}
function startSelect(){
global $_PATT, $_FPENDING, $_FALL, $_FSELECTED;
$list = file($_FALL);
$good = array();
foreach ($list as $val){
foreach ($_PATT as $pat){
if (preg_match($pat, $val)){
$good[] = trim($val);
}
}
}
file_put_contents($_FSELECTED, implode("\n", $good));//only from patters
file_put_contents($_FPENDING, implode("\n", $good));//pattern + human.
}
function getFromUrl($url){
$data = file_get_contents($url);
$data = explode("\n", $data);
foreach ($data as &$val){
$val = getCleared($val);
}
return $data;
}
function getCleared($val){
return trim($val);
}
function parseLines(&$a){
if (!is_array($a))
return false;
foreach ($a as $k => $value){
$a[$k] = (getProp($value));
}
return $a;
}
function getProp($text){
$text = preg_replace_callback("/\[(.*?)\]/", "callback", $text);
return $text;
}
function callback($ok){
$ok = end($ok);
$rez = '';
eval('$rez = ' . $ok . ';');
return $rez;
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.19 0.030 0.073 18.86 5.4.18 0.027 0.053 19.05 5.4.17 0.030 0.053 19.19 5.4.16 0.030 0.060 18.96 5.4.15 0.047 0.037 18.99 5.4.14 0.030 0.043 16.56 5.4.13 0.030 0.057 16.51 5.4.12 0.033 0.047 16.56 5.4.11 0.023 0.053 16.50 5.4.10 0.033 0.037 16.50 5.4.9 0.033 0.040 16.41 5.4.8 0.027 0.057 16.22 5.4.7 0.020 0.047 16.60 5.4.6 0.030 0.063 16.43 5.4.5 0.030 0.053 16.16 5.4.4 0.023 0.037 16.48 5.4.3 0.030 0.070 16.34 5.4.2 0.037 0.060 16.17 5.4.1 0.043 0.050 16.55 5.4.0 0.040 0.057 15.78 5.3.27 0.033 0.070 14.66 5.3.26 0.030 0.043 14.62 5.3.25 0.033 0.067 14.77 5.3.24 0.017 0.080 14.54 5.3.23 0.023 0.050 14.77 5.3.22 0.040 0.050 14.60 5.3.21 0.037 0.047 14.59 5.3.20 0.017 0.043 14.54 5.3.19 0.033 0.070 14.74 5.3.18 0.033 0.040 14.56 5.3.17 0.027 0.047 14.58 5.3.16 0.027 0.037 14.59 5.3.15 0.043 0.063 14.66 5.3.14 0.030 0.040 14.55 5.3.13 0.030 0.070 14.71 5.3.12 0.030 0.050 14.46 5.3.11 0.027 0.050 14.46 5.3.10 0.037 0.030 14.27 5.3.9 0.030 0.043 14.04 5.3.8 0.020 0.067 14.04 5.3.7 0.020 0.050 14.03 5.3.6 0.023 0.063 14.01 5.3.5 0.020 0.040 13.88 5.3.4 0.033 0.060 13.98 5.3.3 0.030 0.073 13.94 5.3.2 0.027 0.043 13.68 5.3.1 0.027 0.043 13.66 5.3.0 0.027 0.060 13.66
preferences:dark mode live preview
142.66 ms | 1394 KiB | 7 Q