Commit f1653229 authored by jepso's avatar jepso

fixed new dql parser test script

parent 97b4eb3f
<?php <?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; $n = 1000;
$start = microtime(true); $start = microtime(true);
for ($i = 0; $i < $n; $i++) { for ($i = 0; $i < $n; $i++) {
/* $parser = new Doctrine_Query_Parser('SELECT u.name, u.age FROM User u WHERE u.id = ?'); $parser = new Doctrine_Query_Parser('SELECT u.name, u.age FROM User u WHERE u.id = ?');
$parser->parse();*/ $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);
} }
$end = microtime(true); $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