function __construct($sel)
 {
     if (jelix_scan_module_sel($sel, $this)) {
         if ($this->module == '') {
             $this->module = jApp::getCurrentModule();
         }
         $this->_createPath();
         $this->_createCachePath();
     } else {
         throw new jExceptionSelector('jelix~errors.selector.invalid.syntax', array($sel, $this->type));
     }
 }
예제 #2
0
파일: testperf.php 프로젝트: hadrienl/jelix
}
class obj
{
    public $module;
    public $resource;
    public $request;
}
$t1 = microtime(true);
for ($i = 0; $i < 1000; $i++) {
    $o = new obj();
    module_selector("aaa~bbb", $o);
}
$t2 = microtime(true);
for ($i = 0; $i < 1000; $i++) {
    $o = new obj();
    jelix_scan_module_sel("aaa~bbb", $o);
}
$t3 = microtime(true);
echo "module_selector = " . ($t2 - $t1) . "\n";
echo "jelix_scan_selector = " . ($t3 - $t2) . "\n";
$t1 = microtime(true);
for ($i = 0; $i < 1000; $i++) {
    $o = new obj();
    action_selector("aaa~bbb@classic", $o);
}
$t2 = microtime(true);
for ($i = 0; $i < 1000; $i++) {
    $o = new obj();
    jelix_scan_action_sel("aaa~bbb@classic", $o, "machin_bidule");
}
$t3 = microtime(true);