Browse Source

update vendors

Espinoza Guillermo 6 năm trước cách đây
mục cha
commit
4b7127fa98

+ 1 - 0
app/AppKernel.php

@@ -45,6 +45,7 @@ class AppKernel extends Kernel
             new KeaBundle\KeaBundle(),
             new HostBundle\HostBundle(),
             new IPv6Bundle\IPv6Bundle(),
+            new CheckSintaxBundle\CheckSintaxBundle()
         ];
 
         if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

+ 8 - 0
composer.json

@@ -120,6 +120,13 @@
             "options": {
                 "local_pk": "./keys/bitbucket.id_rsa"
             }
+        },
+        {
+            "type": "vcs",
+            "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/CheckSintaxBundle.git",
+            "options": {
+                "local_pk": "./keys/bitbucket.id_rsa"
+            }
         }
     ],
     "config": {
@@ -148,6 +155,7 @@
         "ik/template-bundle": "dev-master",
         "ik/webservice-bundle": "dev-master",
         "ik/workflow-bundle": "dev-master",
+        "ik/check-sintax-bundle": "dev-master",
         "incenteev/composer-parameter-handler": "^2.0",
         "jdorn/sql-formatter": "^1.2.17",
         "jms/serializer": "^1.9.0",

+ 28 - 4
composer.lock

@@ -1,10 +1,10 @@
 {
     "_readme": [
         "This file locks the dependencies of your project to a known state",
-        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "c13b7907c7f63cd619c536178ee342ba",
+    "content-hash": "775237eb10e4346b5a04f069cd38bdb0",
     "packages": [
         {
             "name": "behat/transliterator",
@@ -1475,6 +1475,29 @@
             ],
             "time": "2019-02-11T17:28:26+00:00"
         },
+        {
+            "name": "ik/check-sintax-bundle",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/CheckSintaxBundle.git",
+                "reference": "df53b6339c7ae09fbdc350540f15e334be42b000"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "CheckSintaxBundle\\": ""
+                }
+            },
+            "description": "Flowdat 3 Device Bundle",
+            "keywords": [
+                "Admin Generator",
+                "admin",
+                "bundle",
+                "validators"
+            ],
+            "time": "2019-01-31T13:23:39+00:00"
+        },
         {
             "name": "ik/device-bundle",
             "version": "dev-master",
@@ -1527,7 +1550,7 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/migrations.git",
-                "reference": "f786c642a32803b11cda2514940d69bce81116ac"
+                "reference": "f28fb9789575889674e392a84e85a98d4b7dc0bb"
             },
             "type": "library",
             "autoload": {
@@ -1542,7 +1565,7 @@
                 "bundle",
                 "migrations"
             ],
-            "time": "2019-01-31T11:55:56+00:00"
+            "time": "2019-02-01T12:35:40+00:00"
         },
         {
             "name": "ik/oauthclient-bundle",
@@ -6279,6 +6302,7 @@
         "ik/template-bundle": 20,
         "ik/webservice-bundle": 20,
         "ik/workflow-bundle": 20,
+        "ik/check-sintax-bundle": 20,
         "sonata-project/admin-bundle": 20,
         "voryx/restgeneratorbundle": 20
     },

+ 13 - 1
src/HostBundle/EventListener/KEAHostReservationSubscriber.php

@@ -78,12 +78,24 @@ class KEAHostReservationSubscriber implements EventSubscriber
                         $set = 'fixed_ip=:fixed_ip';
                         break;
                 }
+
+                $query = "SELECT COUNT(*) AS `exists`
+                FROM information_schema.tables 
+                WHERE table_schema = 'fd3_cablemodem' 
+                AND table_name = 'cablemodem';";
+                
+                $this->connection = $this->serviceContainer->get('database_connection');    
+                $stmt = $this->connection->prepare($query);
+                $stmt->execute();
+                $tableExists = $stmt->fetchAll();
+                if (!isset($tableExists[0]['exists']) || $tableExists[0]['exists'] == '0') {
+                    return;
+                }
                 
                 $query = sprintf("UPDATE fd3_cablemodem.cablemodem 
                     SET %s
                     WHERE mac=:mac;
                     ", $set);
-                $this->connection = $this->serviceContainer->get('database_connection');    
                 $stmt = $this->connection->prepare($query);
                 $stmt->bindValue('mac', $entity->getMac());
                 $stmt->bindValue('fixed_ip', null);