Commit f1653229 authored by jepso's avatar jepso

fixed new dql parser test script

parent 97b4eb3f
<?php
require_once 'Doctrine.php';
function autoload($className)
{
if (class_exists($className, false)) {
return false;
}
spl_autoload_register(array('Doctrine', 'autoload'));
$class = dirname(__FILE__) . DIRECTORY_SEPARATOR
. str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
if (file_exists($class)) {
require_once($class);
return true;
}
return false;
}
spl_autoload_register('autoload');
$n = 1000;
$start = microtime(true);
for ($i = 0; $i < $n; $i++) {
/* $parser = new Doctrine_Query_Parser('SELECT u.name, u.age FROM User u WHERE u.id = ?');
$parser->parse();*/
$scanner = new Doctrine_Query_Scanner('SELECT u.name, u.age FROM User u WHERE u.id = ?');
do {
$token = $scanner->scan();
} while ($token['type'] !== Doctrine_Query_Token::T_EOS);
$parser = new Doctrine_Query_Parser('SELECT u.name, u.age FROM User u WHERE u.id = ?');
$parser->parse();
}
$end = microtime(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment