Permalink
Browse files

final not using get_class

  • Loading branch information...
1 parent c5ffca5 commit ce204756cd8c8e30d1683dbf45ee10d2654b8d0c @cordoval committed Nov 11, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −2 src/PHPPeru/Examples.php
  2. +1 −1 src/PHPPeru/HeavyObject.php
  3. +2 −2 test.php
View
@@ -128,10 +128,10 @@ public function buildService($serviceId, $originalClosure, $proxied = false, $c)
$c[$serviceId] = $c->share(function ($c) use ($originalClosure, $serviceId) {
$this->c['cache_dir'] = __DIR__.'/../../cache';
$this->c['phpperu_namespace'] = 'PHPPeru';
- $fqcn = get_class(call_user_func($originalClosure, null));
+ //$fqcn = get_class(call_user_func($originalClosure, null));
$c[$serviceId . '_pimple_safe_object'] = $originalClosure;
$factory = new ServiceProxyFactory($c['cache_dir'], $c['phpperu_namespace']);
- return $factory->getProxy($fqcn, array($serviceId . '_pimple_safe_object'), $c);
+ return $factory->getProxy("PHPPeru\\HeavyObject", array($serviceId . '_pimple_safe_object'), $c);
});
} else {
$c[$serviceId] = $c->share($originalClosure);
@@ -10,7 +10,7 @@ public function __construct()
{
$this->items = array();
- foreach(range(1,1000000) as $value) {
+ foreach(range(1,10000000) as $value) {
$this->items[] = $value;
}
}
View
@@ -5,7 +5,7 @@
require __DIR__.'/vendor/autoload.php';
$examples = new Examples();
-/*
+
$start = microtime(true);
$examples->nastyExample();
echo 'nasty ........ ' . (microtime(true) - $start) . "\n";
@@ -21,7 +21,7 @@
$start = microtime(true);
$examples->goodAndFastAndAutomaticExample();
echo 'good and fast and automatic ' . (microtime(true) - $start) . "\n";
-*/
+
$start = microtime(true);
$examples->pimpleRefactorExample();
echo 'pimple refactor ' . (microtime(true) - $start) . "\n";

0 comments on commit ce20475

Please sign in to comment.