瀏覽代碼

updated Zend Framework (#4277)

Vytautas Stankus 6 年之前
父節點
當前提交
96ce569d73

+ 2 - 2
frameworks/PHP/zend/benchmark_config.json

@@ -5,8 +5,8 @@
       "plaintext_url": "/plaintext",
       "json_url": "/json",
       "db_url": "/db",
-      "update_url": "/update?queries=",
-      "query_url": "/db-multi?queries=",
+      "update_url": "/updates?queries=",
+      "query_url": "/queries?queries=",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",

+ 4 - 3
frameworks/PHP/zend/composer.json

@@ -1,6 +1,6 @@
 {
     "name": "zendframework/skeleton-application",
-    "description": "Skeleton Application for ZF2",
+    "description": "Skeleton Application for ZF",
     "license": "BSD-3-Clause",
     "keywords": [
         "framework",
@@ -8,8 +8,9 @@
     ],
     "homepage": "http://framework.zend.com/",
     "require": {
-        "php": ">=5.3.3",
-        "zendframework/zendframework": "~2.2"
+        "php": "^7.2",
+        "zendframework/zend-mvc": "^3.0.1",
+        "zendframework/zend-db": "^2.9.3"
     },
     "autoload": {
         "psr-0": {

文件差異過大導致無法顯示
+ 354 - 3763
frameworks/PHP/zend/composer.lock


+ 2 - 0
frameworks/PHP/zend/config/application.config.php

@@ -1,6 +1,8 @@
 <?php
 return array(
     'modules' => array(
+        'Zend\Router',
+        'Zend\Db',
         'FrameworkBenchmarks',
     ),
     'module_listener_options' => array(

+ 3 - 2
frameworks/PHP/zend/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Controller/BenchController.php

@@ -5,6 +5,7 @@ namespace FrameworkBenchmarks\Controller;
 use Zend\Mvc\Controller\AbstractActionController;
 use Zend\Stdlib\ArrayUtils;
 use Zend\View\Model\JsonModel;
+use Zend\View\Model\ViewModel;
 use Zend\Http\Headers;
 use Zend\Db\TableGateway\TableGateway;
 
@@ -51,7 +52,7 @@ class BenchController extends AbstractActionController
     /**
      * @return \Zend\View\Model\JsonModel
      */
-    public function dbMultiAction()
+    public function queriesAction()
     {
         /* @var $request \Zend\Http\Request */
         $request = $this->getRequest();
@@ -70,7 +71,7 @@ class BenchController extends AbstractActionController
         return new JsonModel($worlds);
     }
 
-    public function updateAction()
+    public function updatesAction()
     {
       $request = $this->getRequest();
       $queries = (int) $request->getQuery('queries', 1);

+ 11 - 11
frameworks/PHP/zend/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Module.php

@@ -19,7 +19,7 @@ class Module
             'router' => array(
                 'routes' => array(
                     'plaintext' => array(
-                      'type' => 'Zend\Mvc\Router\Http\Literal',
+                      'type' => 'Zend\Router\Http\Literal',
                       'options' => array(
                           'route' => '/plaintext',
                           'defaults' => array(
@@ -29,7 +29,7 @@ class Module
                       ),
                     ),
                     'json' => array(
-                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                        'type' => 'Zend\Router\Http\Literal',
                         'options' => array(
                             'route' => '/json',
                             'defaults' => array(
@@ -39,7 +39,7 @@ class Module
                         ),
                     ),
                     'db' => array(
-                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                        'type' => 'Zend\Router\Http\Literal',
                         'options' => array(
                             'route' => '/db',
                             'defaults' => array(
@@ -48,23 +48,23 @@ class Module
                             ),
                         ),
                     ),
-                    'db-multi' => array(
-                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                    'queries' => array(
+                        'type' => 'Zend\Router\Http\Literal',
                         'options' => array(
-                            'route' => '/db-multi',
+                            'route' => '/queries',
                             'defaults' => array(
                                 'controller' => 'FrameworkBenchmarks\Controller\BenchController',
-                                'action' => 'db-multi',
+                                'action' => 'queries',
                             ),
                         ),
                     ),
-                    'update' => array(
-                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                    'updates' => array(
+                        'type' => 'Zend\Router\Http\Literal',
                         'options' => array(
-                            'route' => '/update',
+                            'route' => '/updates',
                             'defaults' => array(
                                 'controller' => 'FrameworkBenchmarks\Controller\BenchController',
-                                'action' => 'update',
+                                'action' => 'updates',
                             ),
                         ),
                     ),

+ 3 - 6
frameworks/PHP/zend/module/FrameworkBenchmarks/src/FrameworkBenchmarks/ServiceFactory/BenchControllerServiceFactory.php

@@ -13,8 +13,6 @@ use FrameworkBenchmarks\Controller\BenchController;
 use FrameworkBenchmarks\Entity\World;
 use Zend\Db\ResultSet\ResultSet;
 use Zend\Db\TableGateway\TableGateway;
-use Zend\ServiceManager\FactoryInterface;
-use Zend\ServiceManager\ServiceLocatorInterface;
 
 /**
  * Factory responsible for instantiating {@see \FrameworkBenchmarks\Controller\DbController}
@@ -22,18 +20,17 @@ use Zend\ServiceManager\ServiceLocatorInterface;
  * @author Marco Pivetta <[email protected]>
  * @link   http://www.techempower.com/benchmarks
  */
-class BenchControllerServiceFactory implements FactoryInterface
+class BenchControllerServiceFactory
 {
     /**
      * {@inheritDoc}
      *
      * @return \FrameworkBenchmarks\Controller\DbController
      */
-    public function createService(ServiceLocatorInterface $serviceLocator)
+    public function __invoke(\Psr\Container\ContainerInterface $container)
     {
-        /* @var $serviceLocator \Zend\ServiceManager\AbstractPluginManager */
         /* @var $dbAdapter \Zend\Db\Adapter\AdapterInterface */
-        $dbAdapter          = $serviceLocator->getServiceLocator()->get('Zend\Db\Adapter\Adapter');
+        $dbAdapter          = $container->get('Zend\Db\Adapter\Adapter');
         $resultSetPrototype = new ResultSet();
 
         $resultSetPrototype->setArrayObjectPrototype(new World());

+ 1 - 1
frameworks/PHP/zend/zend.dockerfile

@@ -20,7 +20,7 @@ RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children =
 RUN mkdir -p data/cache
 RUN chmod 777 data/cache
 
-RUN composer install --no-dev --quiet
+RUN composer install --quiet --no-dev -o
 
 CMD service php7.3-fpm start && \
     nginx -c /zend/deploy/nginx.conf -g "daemon off;"

部分文件因文件數量過多而無法顯示