@@ -4,9 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use ETNA\Silex\Provider\ConversationProxy\DumbMethodsProxy; |
| 6 | 6 | use ETNA\Silex\Provider\ConversationProxy\ConversationManager; |
| 7 | - |
|
| 8 | 7 | use Guzzle\Http\Client; |
| 9 | - |
|
| 10 | 8 | use Silex\Application; |
| 11 | 9 | use Silex\ServiceProviderInterface; |
| 12 | 10 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | $rmq_config = $rmq_config ?: []; |
| 17 | 17 | $this->rmq_config['exchanges'] = isset($rmq_config['exchanges']) ? $rmq_config['exchanges'] : []; |
| 18 | - $this->rmq_config['queues'] = isset($rmq_config['queues']) ? $rmq_config['queues'] : []; |
|
| 18 | + $this->rmq_config['queues'] = isset($rmq_config['queues']) ? $rmq_config['queues'] : []; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | } catch (\Exception $exception) { |
| 97 | 97 | echo "Index {$app["elasticsearch.index"]} doesn't exist... \n"; |
| 98 | 98 | } |
| 99 | - $app["elasticsearch"]->put("/{$app["elasticsearch.index"]}-{$app["version"]}", [], file_get_contents($app["application_path"] . "/app/Utils/elasticsearch-settings.json"))->send(); |
|
| 99 | + $app["elasticsearch"]->put("/{$app["elasticsearch.index"]}-{$app["version"]}", [], file_get_contents($app["application_path"] . "/app/Utils/elasticsearch-settings.json"))->send(); |
|
| 100 | 100 | $app["elasticsearch"]->put("/{$app["elasticsearch.index"]}-{$app["version"]}/{$app["elasticsearch.type"]}/_mapping", [], file_get_contents($app["application_path"] . "/app/Utils/elasticsearch-mapping.json"))->send(); |
| 101 | 101 | |
| 102 | 102 | // Rajout de l'alias |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function __construct($auth_config = null) |
| 18 | 18 | { |
| 19 | - $auth_config = $auth_config ?: [ |
|
| 19 | + $auth_config = $auth_config ?: [ |
|
| 20 | 20 | "auth.api_path" => "^/?", |
| 21 | 21 | "auth.force_guest" => true, |
| 22 | 22 | "auth.cookie_expiration" => false, |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $app["orm.em"]->getConnection()->getConfiguration()->setSQLLogger($app["orm.profiler"]); |
| 27 | 27 | |
| 28 | 28 | $app->after( |
| 29 | - function (Request $request, Response $response) use ($app) { |
|
| 29 | + function(Request $request, Response $response) use ($app) { |
|
| 30 | 30 | $response->headers->set("X-ORM-Profiler-Route", $request->getPathInfo()); |
| 31 | 31 | $response->headers->set("X-ORM-Profiler-Count", count($app["orm.profiler"]->queries)); |
| 32 | 32 | $response->headers->set("X-ORM-Profiler-Queries", json_encode($app["orm.profiler"]->queries)); |
@@ -93,24 +93,24 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $configuration->addCustomStringFunction('REPLACE', 'DoctrineExtensions\Query\Mysql\Replace'); |
| 95 | 95 | |
| 96 | - $configuration->addCustomStringFunction('MD5', 'DoctrineExtensions\Query\Mysql\Md5'); |
|
| 96 | + $configuration->addCustomStringFunction('MD5', 'DoctrineExtensions\Query\Mysql\Md5'); |
|
| 97 | 97 | $configuration->addCustomStringFunction('SHA1', 'DoctrineExtensions\Query\Mysql\Sha1'); |
| 98 | 98 | $configuration->addCustomStringFunction('SHA2', 'DoctrineExtensions\Query\Mysql\Sha2'); |
| 99 | 99 | |
| 100 | - $configuration->addCustomNumericFunction('RAND', 'DoctrineExtensions\Query\Mysql\Rand'); |
|
| 100 | + $configuration->addCustomNumericFunction('RAND', 'DoctrineExtensions\Query\Mysql\Rand'); |
|
| 101 | 101 | $configuration->addCustomNumericFunction('ROUND', 'DoctrineExtensions\Query\Mysql\Round'); |
| 102 | 102 | |
| 103 | - $configuration->addCustomDatetimeFunction('DATE', 'DoctrineExtensions\Query\Mysql\Date'); |
|
| 104 | - $configuration->addCustomDatetimeFunction('DATEDIFF', 'DoctrineExtensions\Query\Mysql\DateDiff'); |
|
| 105 | - $configuration->addCustomDatetimeFunction('DATEADD', 'DoctrineExtensions\Query\Mysql\DateAdd'); |
|
| 103 | + $configuration->addCustomDatetimeFunction('DATE', 'DoctrineExtensions\Query\Mysql\Date'); |
|
| 104 | + $configuration->addCustomDatetimeFunction('DATEDIFF', 'DoctrineExtensions\Query\Mysql\DateDiff'); |
|
| 105 | + $configuration->addCustomDatetimeFunction('DATEADD', 'DoctrineExtensions\Query\Mysql\DateAdd'); |
|
| 106 | 106 | $configuration->addCustomDatetimeFunction('DATEFORMAT', 'DoctrineExtensions\Query\Mysql\DateFormat'); |
| 107 | - $configuration->addCustomDatetimeFunction('HOUR', 'DoctrineExtensions\Query\Mysql\Hour'); |
|
| 108 | - $configuration->addCustomDatetimeFunction('DAY', 'DoctrineExtensions\Query\Mysql\Day'); |
|
| 109 | - $configuration->addCustomDatetimeFunction('WEEK', 'DoctrineExtensions\Query\Mysql\Week'); |
|
| 110 | - $configuration->addCustomDatetimeFunction('MONTH', 'DoctrineExtensions\Query\Mysql\Month'); |
|
| 111 | - $configuration->addCustomDatetimeFunction('YEAR', 'DoctrineExtensions\Query\Mysql\Year'); |
|
| 107 | + $configuration->addCustomDatetimeFunction('HOUR', 'DoctrineExtensions\Query\Mysql\Hour'); |
|
| 108 | + $configuration->addCustomDatetimeFunction('DAY', 'DoctrineExtensions\Query\Mysql\Day'); |
|
| 109 | + $configuration->addCustomDatetimeFunction('WEEK', 'DoctrineExtensions\Query\Mysql\Week'); |
|
| 110 | + $configuration->addCustomDatetimeFunction('MONTH', 'DoctrineExtensions\Query\Mysql\Month'); |
|
| 111 | + $configuration->addCustomDatetimeFunction('YEAR', 'DoctrineExtensions\Query\Mysql\Year'); |
|
| 112 | 112 | |
| 113 | - $configuration->addCustomDatetimeFunction('FIELD', 'DoctrineExtensions\Query\Mysql\Field'); |
|
| 113 | + $configuration->addCustomDatetimeFunction('FIELD', 'DoctrineExtensions\Query\Mysql\Field'); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // Connect Repositories to the app |
| 133 | 133 | $app[$repositories_access] = $app->protect( |
| 134 | - function ($repository_name) use ($app, $db_config) { |
|
| 135 | - $class_name = "\\{$db_config['mappings'][0]['namespace']}\\". $repository_name; |
|
| 134 | + function($repository_name) use ($app, $db_config) { |
|
| 135 | + $class_name = "\\{$db_config['mappings'][0]['namespace']}\\" . $repository_name; |
|
| 136 | 136 | if (class_exists($class_name)) { |
| 137 | 137 | return $app['orm.em']->getRepository($class_name); |
| 138 | 138 | } |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | foreach ($app["orm.ems.options"] as $db_name => $db_config) { |
| 160 | 160 | $fct_name = $db_name === 'default' ? 'findOneOr404Factory' : "findOneOr404Factory_{$db_name}"; |
| 161 | 161 | $app[$fct_name] = $app->protect( |
| 162 | - function ($entity_name, $field_name = "") use ($app, $db_config) { |
|
| 163 | - return function ($field_value) use ($app, $db_config, $entity_name, $field_name) { |
|
| 164 | - $class_name = "\\{$db_config['mappings'][0]['namespace']}\\". $entity_name; |
|
| 162 | + function($entity_name, $field_name = "") use ($app, $db_config) { |
|
| 163 | + return function($field_value) use ($app, $db_config, $entity_name, $field_name) { |
|
| 164 | + $class_name = "\\{$db_config['mappings'][0]['namespace']}\\" . $entity_name; |
|
| 165 | 165 | |
| 166 | 166 | if (!class_exists($class_name)) { |
| 167 | 167 | throw new NotFoundHttpException(sprintf('%s does not exist', $class_name)); |