diff --git a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php index 1c843f549..641b33563 100755 --- a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php @@ -117,7 +117,13 @@ class MysqlGrammar extends Grammar ->from('information_schema.tables') ->where('table_schema', '=', $query->getConnection()->getDatabase()); - return \rtrim($builder->toSql(), ';'); + $sql = $builder->toSql(); + + foreach ($builder->binds as $bind) { + $query->bind($bind); + } + + return \rtrim($sql, ';'); } /** @@ -138,7 +144,13 @@ class MysqlGrammar extends Grammar ->where('table_schema', '=', $query->getConnection()->getDatabase()) ->andWhere('table_name', '=', $table); - return \rtrim($builder->toSql(), ';'); + $sql = $builder->toSql(); + + foreach ($builder->binds as $bind) { + $query->bind($bind); + } + + return \rtrim($sql, ';'); } /** diff --git a/DataStorage/Database/Schema/Grammar/PostgresGrammar.php b/DataStorage/Database/Schema/Grammar/PostgresGrammar.php index fbe037563..26211f101 100755 --- a/DataStorage/Database/Schema/Grammar/PostgresGrammar.php +++ b/DataStorage/Database/Schema/Grammar/PostgresGrammar.php @@ -44,7 +44,13 @@ class PostgresGrammar extends Grammar ->from('information_schema.tables') ->where('table_schema', '=', $query->getConnection()->getDatabase()); - return \rtrim($builder->toSql(), ';'); + $sql = $builder->toSql(); + + foreach ($builder->binds as $bind) { + $query->bind($bind); + } + + return \rtrim($sql, ';'); } /** @@ -65,7 +71,13 @@ class PostgresGrammar extends Grammar ->where('table_schema', '=', $query->getConnection()->getDatabase()) ->andWhere('table_name', '=', $table); - return \rtrim($builder->toSql(), ';'); + $sql = $builder->toSql(); + + foreach ($builder->binds as $bind) { + $query->bind($bind); + } + + return \rtrim($sql, ';'); } /** diff --git a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php index d4504665c..b679da5f6 100755 --- a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php +++ b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php @@ -54,7 +54,13 @@ class SQLiteGrammar extends Grammar ->from('sqlite_master') ->where('type', '=', 'table'); - return \rtrim($builder->toSql(), ';'); + $sql = $builder->toSql(); + + foreach ($builder->binds as $bind) { + $query->bind($bind); + } + + return \rtrim($sql, ';'); } /** @@ -67,7 +73,13 @@ class SQLiteGrammar extends Grammar ->from('pragma_table_info(\'' . $table . '\')') ->where('pragma_table_info(\'' . $table . '\')', '=', $table); - return \rtrim($builder->toSql(), ';'); + $sql = $builder->toSql(); + + foreach ($builder->binds as $bind) { + $query->bind($bind); + } + + return \rtrim($sql, ';'); } /** diff --git a/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php b/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php index 039f23ed8..74f078663 100755 --- a/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php +++ b/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php @@ -82,7 +82,13 @@ class SqlServerGrammar extends Grammar ->where('table_schema', '=', $query->getConnection()->getDatabase()) ->andWhere('table_name', '=', $table); - return \rtrim($builder->toSql(), ';'); + $sql = $builder->toSql(); + + foreach ($builder->binds as $bind) { + $query->bind($bind); + } + + return \rtrim($sql, ';'); } /** diff --git a/Module/StatusAbstract.php b/Module/StatusAbstract.php index c14a193df..e7e3f1764 100755 --- a/Module/StatusAbstract.php +++ b/Module/StatusAbstract.php @@ -53,7 +53,11 @@ abstract class StatusAbstract * @var array * @since 1.0.0 */ - private static array $routes = []; + public static array $routes = []; + + public static array $hooks = []; + + private static array $cache = []; /** * Deactivate module. @@ -117,17 +121,17 @@ abstract class StatusAbstract throw new PermissionException($destRoutePath); // @codeCoverageIgnore } - if (!isset(self::$routes[$destRoutePath])) { + if (!isset(self::$cache[$destRoutePath])) { /** @noinspection PhpIncludeInspection */ - self::$routes[$destRoutePath] = include $destRoutePath; + self::$cache[$destRoutePath] = include $destRoutePath; } /** @noinspection PhpIncludeInspection */ - $moduleRoutes = include $srcRoutePath; + $moduleCache = include $srcRoutePath; - self::$routes[$destRoutePath] = \array_merge_recursive(self::$routes[$destRoutePath], $moduleRoutes); + self::$cache[$destRoutePath] = \array_merge_recursive(self::$cache[$destRoutePath], $moduleCache); - \file_put_contents($destRoutePath, '