Browse Source

Merge branch 'master' of https://github.com/dracony/FrameworkBenchmarks into pr481_dracony_phpixie_fix_20131003-1
This relates to pull request 481.

[email protected] 12 years ago
parent
commit
bdd375f82d

+ 2 - 4
php-phpixie/classes/App/Controller/Benchmark.php

@@ -34,10 +34,8 @@ class Benchmark extends \PHPixie\Controller {
 		$fortunes[] = $fortune;
 		$fortunes[] = $fortune;
 		
 		
 		usort($fortunes, function($a, $b) { 
 		usort($fortunes, function($a, $b) { 
-			$am = $a->message;
-			$bm = $b->message;
-			if ($am==$bm) return 0;
-			return ($am<$bm)?-1:1;
+			if ($a->message===$b->message) return 0;
+			return ($a->message<$b->message)?-1:1;
 		} );
 		} );
 		
 		
 		$view = $this->pixie->view('fortunes');
 		$view = $this->pixie->view('fortunes');

+ 7 - 0
php-phpixie/classes/App/Model/Fortune.php

@@ -4,4 +4,11 @@ namespace App\Model;
 
 
 class Fortune extends \PHPixie\ORM\Model{
 class Fortune extends \PHPixie\ORM\Model{
 	public $table = 'Fortune';
 	public $table = 'Fortune';
+	public $message;
+		
+	public function values($row, $set_loaded = false){
+		parent::values($row, $set_loaded);
+		$this->message = $this->_row['message'];
+		return $this;
+	}
 }
 }

+ 1 - 1
php-phpixie/setup.py

@@ -12,7 +12,7 @@ def start(args):
   setup_util.replace_text("php-phpixie/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks")
   setup_util.replace_text("php-phpixie/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks")
 
 
   try:
   try:
-    subprocess.check_call("composer.phar install --optimize-autoloader", shell=True, cwd="php-silex")        
+    subprocess.check_call("composer.phar install --optimize-autoloader", shell=True, cwd="php-phpixie")        
     subprocess.check_call("sudo php-fpm --fpm-config config/php-fpm.conf -g " + home + "/FrameworkBenchmarks/php-phpixie/deploy/php-fpm.pid", shell=True)
     subprocess.check_call("sudo php-fpm --fpm-config config/php-fpm.conf -g " + home + "/FrameworkBenchmarks/php-phpixie/deploy/php-fpm.pid", shell=True)
     subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-phpixie/deploy/nginx.conf", shell=True)
     subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-phpixie/deploy/nginx.conf", shell=True)
     return 0
     return 0