Przeglądaj źródła

Create restapi branch

tags/2.3.0
Steevan BARBOYON 8 lat temu
rodzic
commit
ac9bb132e9

+ 1
- 0
.gitignore Wyświetl plik

@@ -1 +1,2 @@
1 1
 .idea/
2
+vendor/

+ 0
- 15
Bundle/HelloWorldBundle/Controller/HelloWorldController.php Wyświetl plik

@@ -1,15 +0,0 @@
1
-<?php
2
-
3
-namespace PhpBenchmarksSymfony\Bundle\HelloWorldBundle\Controller;
4
-
5
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
-use Symfony\Component\HttpFoundation\Response;
7
-
8
-class HelloWorldController extends Controller
9
-{
10
-    /** @return Response */
11
-    public function helloworldAction()
12
-    {
13
-        return new Response('Hello World !');
14
-    }
15
-}

+ 0
- 10
Bundle/HelloWorldBundle/HelloWorldBundle.php Wyświetl plik

@@ -1,10 +0,0 @@
1
-<?php
2
-
3
-namespace PhpBenchmarksSymfony\Bundle\HelloWorldBundle;
4
-
5
-use Symfony\Component\HttpKernel\Bundle\Bundle;
6
-
7
-class HelloWorldBundle extends Bundle
8
-{
9
-
10
-}

+ 0
- 3
Bundle/HelloWorldBundle/Resources/config/routing.yml Wyświetl plik

@@ -1,3 +0,0 @@
1
-helloworld:
2
-    path: /benchmark/helloworld
3
-    defaults: { _controller: HelloWorldBundle:HelloWorld:helloworld }

+ 0
- 1500
Bundle/RestBundle/Resources/config/routing.yml
Plik diff jest za duży
Wyświetl plik


+ 0
- 17
Bundle/RestBundle/RestBundle.php Wyświetl plik

@@ -1,17 +0,0 @@
1
-<?php
2
-
3
-namespace PhpBenchmarksSymfony\Bundle\RestBundle;
4
-
5
-use PhpBenchmarksSymfony\DependencyInjection\CompilerPass\AddTranslationsPass;
6
-use Symfony\Component\DependencyInjection\ContainerBuilder;
7
-use Symfony\Component\HttpKernel\Bundle\Bundle;
8
-
9
-class RestBundle extends Bundle
10
-{
11
-    public function build(ContainerBuilder $container)
12
-    {
13
-        parent::build($container);
14
-
15
-        $container->addCompilerPass(new AddTranslationsPass());
16
-    }
17
-}

Bundle/RestBundle/Controller/RestController.php → Controller/RestApiController.php Wyświetl plik

@@ -1,14 +1,14 @@
1 1
 <?php
2 2
 
3
-namespace PhpBenchmarksSymfony\Bundle\RestBundle\Controller;
3
+namespace PhpBenchmarksSymfony\RestApiBundle\Controller;
4 4
 
5 5
 use PhpBenchmarksRestData\Service;
6
-use PhpBenchmarksSymfony\EventListener\DefineLocaleEventListener;
6
+use PhpBenchmarksSymfony\RestApiBundle\EventListener\DefineLocaleEventListener;
7 7
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8 8
 use Symfony\Component\HttpFoundation\JsonResponse;
9 9
 use Symfony\Component\HttpFoundation\Response;
10 10
 
11
-class RestController extends Controller
11
+class RestApiController extends Controller
12 12
 {
13 13
     /** @return Response */
14 14
     public function restAction()

+ 0
- 26
DependencyInjection/CompilerPass/AddTranslationsPass.php Wyświetl plik

@@ -1,26 +0,0 @@
1
-<?php
2
-
3
-namespace PhpBenchmarksSymfony\DependencyInjection\CompilerPass;
4
-
5
-use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
-use Symfony\Component\DependencyInjection\ContainerBuilder;
7
-
8
-class AddTranslationsPass implements CompilerPassInterface
9
-{
10
-    public function process(ContainerBuilder $container)
11
-    {
12
-        $definition = $container->findDefinition('translator');
13
-        $definition->addMethodCall(
14
-            'addResource',
15
-            ['yml', __DIR__ . '/../../Translation/phpbenchmarks.en.yml', 'en', 'phpbenchmarks']
16
-        );
17
-        $definition->addMethodCall(
18
-            'addResource',
19
-            ['yml', __DIR__ . '/../../Translation/phpbenchmarks.en_GB.yml', 'en_GB', 'phpbenchmarks']
20
-        );
21
-        $definition->addMethodCall(
22
-            'addResource',
23
-            ['yml', __DIR__ . '/../../Translation/phpbenchmarks.fr_FR.yml', 'fr_FR', 'phpbenchmarks']
24
-        );
25
-    }
26
-}

Bundle/RestBundle/DependencyInjection/RestExtension.php → DependencyInjection/RestApiExtension.php Wyświetl plik

@@ -1,13 +1,13 @@
1 1
 <?php
2 2
 
3
-namespace PhpBenchmarksSymfony\Bundle\RestBundle\DependencyInjection;
3
+namespace PhpBenchmarksSymfony\RestApiBundle\DependencyInjection;
4 4
 
5 5
 use Symfony\Component\Config\FileLocator;
6 6
 use Symfony\Component\DependencyInjection\ContainerBuilder;
7 7
 use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
8 8
 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9 9
 
10
-class RestExtension extends Extension
10
+class RestApiExtension extends Extension
11 11
 {
12 12
     /**
13 13
      * @param array $configs

+ 1
- 1
EventListener/DefineLocaleEventListener.php Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-namespace PhpBenchmarksSymfony\EventListener;
3
+namespace PhpBenchmarksSymfony\RestApiBundle\EventListener;
4 4
 
5 5
 use Symfony\Component\HttpFoundation\RequestStack;
6 6
 use Symfony\Component\Translation\TranslatorInterface;

Bundle/RestBundle/Normalizer/CommentNormalizer.php → Normalizer/CommentNormalizer.php Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-namespace PhpBenchmarksSymfony\Bundle\RestBundle\Normalizer;
3
+namespace PhpBenchmarksSymfony\RestApiBundle\Normalizer;
4 4
 
5 5
 use PhpBenchmarksRestData\Comment;
6 6
 use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

Bundle/RestBundle/Normalizer/CommentTypeNormalizer.php → Normalizer/CommentTypeNormalizer.php Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-namespace PhpBenchmarksSymfony\Bundle\RestBundle\Normalizer;
3
+namespace PhpBenchmarksSymfony\RestApiBundle\Normalizer;
4 4
 
5 5
 use PhpBenchmarksRestData\CommentType;
6 6
 use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

Bundle/RestBundle/Normalizer/UserNormalizer.php → Normalizer/UserNormalizer.php Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-namespace PhpBenchmarksSymfony\Bundle\RestBundle\Normalizer;
3
+namespace PhpBenchmarksSymfony\RestApiBundle\Normalizer;
4 4
 
5 5
 use PhpBenchmarksRestData\User;
6 6
 use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

+ 28
- 4
README.md Wyświetl plik

@@ -14,12 +14,36 @@ You can compare results between Apache Bench and Siege, PHP 5.6 to 7.2 and versi
14 14
 
15 15
 It's benchmark bundles for almost all Symfony versions.
16 16
 
17
-Symfony 2.0 to 2.3 : use [2.0 version](https://github.com/phpbenchmarks/symfony/tree/2.0).
17
+As Symfony change `request` service to `request_stack` in Symfony 2.4, branches has been created for Symfony <= 2.3.
18 18
 
19
-Symfony 2.4 to latest : use [1.0 version](https://github.com/phpbenchmarks/symfony).
19
+Hello World: [helloworld](https://github.com/phpbenchmarks/symfony/tree/helloworld)
20
+
21
+REST Api (Symfony 2.0 to 2.3): [restapi-symfony-2-3](https://github.com/phpbenchmarks/symfony/tree/restapi-symfony-2-3)
22
+
23
+REST Api (Symfony 2.4 to 4.x): [restapi](https://github.com/phpbenchmarks/symfony/tree/restapi)
24
+
25
+Blog: [blog](https://github.com/phpbenchmarks/symfony/tree/blog)
26
+
27
+Small overload (Symfony 2.0 to 2.3): [smalloverload-symfony-2-3](https://github.com/phpbenchmarks/symfony/tree/smalloverload-symfony-2-3)
28
+
29
+Small overload (Symfony 2.4 to 4.x): [smalloverload](https://github.com/phpbenchmarks/symfony/tree/smalloverload)
30
+
31
+Big overload (Symfony 2.0 to 2.3): [bigoverload-symfony-2-3](https://github.com/phpbenchmarks/symfony/tree/bigoverload-symfony-2-3)
32
+
33
+Big overload (Symfony 2.4 to 4.x): [bigoverload](https://github.com/phpbenchmarks/symfony/tree/bigoverload)
20 34
 
21 35
 You can find how we benchmark it [here](http://www.phpbenchmarks.com/en/benchmark-protocol).
22 36
 
23
-## Symfony
37
+## How version works ?
38
+
39
+We do not follow semantic version for this repository. Here is an explanation about our versioning system:
40
+
41
+`X` benchmark type (`1` Hello World, `2` Blog, `3` REST Api, `4` Small overload, `5` Big overload)
42
+
43
+`Y` related to Symfony version (`0` Symfony 2.0 to 2.3, `1` Symfony 3.4 to 4.x for `REST Api` benchmak for example)
44
+
45
+`Z` new version, not just bugfix and could contains BC
46
+
47
+## Symfony benchmarks
24 48
 
25
-You can find all Symfony benchmarks [here](http://www.phpbenchmarks.com/fr/benchmark/apache-bench/php-7.1/select-version/symfony.html).
49
+You can find all Symfony benchmarks [here](http://www.phpbenchmarks.com/en/benchmark/apache-bench/php-7.2/select-version/symfony.html).

+ 1500
- 0
Resources/config/routing.yml
Plik diff jest za duży
Wyświetl plik


Bundle/RestBundle/Resources/config/services.yml → Resources/config/services.yml Wyświetl plik

@@ -1,27 +1,27 @@
1 1
 services:
2 2
     benchmark.normalizer.user:
3
-        class: PhpBenchmarksSymfony\Bundle\RestBundle\Normalizer\UserNormalizer
3
+        class: PhpBenchmarksSymfony\RestApiBundle\Normalizer\UserNormalizer
4 4
         public: false
5 5
         arguments: ['@translator']
6 6
         tags:
7 7
             - { name: serializer.normalizer }
8 8
 
9 9
     benchmark.normalizer.comment:
10
-        class: PhpBenchmarksSymfony\Bundle\RestBundle\Normalizer\CommentNormalizer
10
+        class: PhpBenchmarksSymfony\RestApiBundle\Normalizer\CommentNormalizer
11 11
         public: false
12 12
         arguments: ['@translator']
13 13
         tags:
14 14
             - { name: serializer.normalizer }
15 15
 
16 16
     benchmark.normalizer.comment_type:
17
-        class: PhpBenchmarksSymfony\Bundle\RestBundle\Normalizer\CommentTypeNormalizer
17
+        class: PhpBenchmarksSymfony\RestApiBundle\Normalizer\CommentTypeNormalizer
18 18
         public: false
19 19
         arguments: ['@translator']
20 20
         tags:
21 21
             - { name: serializer.normalizer }
22 22
 
23 23
     benchmark.event_listener.define_locale:
24
-        class: PhpBenchmarksSymfony\EventListener\DefineLocaleEventListener
24
+        class: PhpBenchmarksSymfony\RestApiBundle\EventListener\DefineLocaleEventListener
25 25
         arguments: ['@request_stack', '@translator']
26 26
         tags:
27 27
             - { name: kernel.event_listener, event: defineLocale }

Translation/phpbenchmarks.en.yml → Resources/translations/phpbenchmarks.en.yml Wyświetl plik


Translation/phpbenchmarks.en_GB.yml → Resources/translations/phpbenchmarks.en_GB.yml Wyświetl plik


Translation/phpbenchmarks.fr_FR.yml → Resources/translations/phpbenchmarks.fr_FR.yml Wyświetl plik


+ 10
- 0
RestApiBundle.php Wyświetl plik

@@ -0,0 +1,10 @@
1
+<?php
2
+
3
+namespace PhpBenchmarksSymfony\RestApiBundle;
4
+
5
+use Symfony\Component\DependencyInjection\ContainerBuilder;
6
+use Symfony\Component\HttpKernel\Bundle\Bundle;
7
+
8
+class RestApiBundle extends Bundle
9
+{
10
+}

+ 1
- 1
composer.json Wyświetl plik

@@ -4,7 +4,7 @@
4 4
     "type": "project",
5 5
     "autoload": {
6 6
         "psr-4": {
7
-            "PhpBenchmarksSymfony\\": ""
7
+            "PhpBenchmarksSymfony\\RestApiBundle\\": ""
8 8
         }
9 9
     },
10 10
     "require": {

Ładowanie…
Anuluj
Zapisz