mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16668] Use topological sort as a Trait
PHPBB3-16668
This commit is contained in:
parent
ea12db9bb4
commit
32a19c3306
3 changed files with 17 additions and 11 deletions
|
@ -29,7 +29,7 @@
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"bantu/ini-get-wrapper": "~1.0",
|
"bantu/ini-get-wrapper": "~1.0",
|
||||||
"chita/topological_sort": "^2.0",
|
"chita/topological_sort": "^3.0",
|
||||||
"composer/composer": "^2.0",
|
"composer/composer": "^2.0",
|
||||||
"composer/installers": "^1.9",
|
"composer/installers": "^1.9",
|
||||||
"composer/package-versions-deprecated": "^1.11",
|
"composer/package-versions-deprecated": "^1.11",
|
||||||
|
|
19
phpBB/composer.lock
generated
19
phpBB/composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"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#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "28a6c105dc6e78c65f88c1926eb8b1b7",
|
"content-hash": "5039b83cb8ee1def8a7f60edcf6b6890",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "bantu/ini-get-wrapper",
|
"name": "bantu/ini-get-wrapper",
|
||||||
|
@ -42,16 +42,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "chita/topological_sort",
|
"name": "chita/topological_sort",
|
||||||
"version": "v2.0.1",
|
"version": "v3.0.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/CHItA/TopologicalSort.git",
|
"url": "https://github.com/CHItA/TopologicalSort.git",
|
||||||
"reference": "34ed1f8459b597ec49bf6dd04a6f837691bb2d5d"
|
"reference": "9e0401c712d0c7cf012f264cc105669844d2479e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/CHItA/TopologicalSort/zipball/34ed1f8459b597ec49bf6dd04a6f837691bb2d5d",
|
"url": "https://api.github.com/repos/CHItA/TopologicalSort/zipball/9e0401c712d0c7cf012f264cc105669844d2479e",
|
||||||
"reference": "34ed1f8459b597ec49bf6dd04a6f837691bb2d5d",
|
"reference": "9e0401c712d0c7cf012f264cc105669844d2479e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -61,6 +61,11 @@
|
||||||
"phpunit/phpunit": "^7.0"
|
"phpunit/phpunit": "^7.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"CHItA\\TopologicalSort\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"MIT"
|
"MIT"
|
||||||
|
@ -74,9 +79,9 @@
|
||||||
"description": "Topological sort function",
|
"description": "Topological sort function",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/CHItA/TopologicalSort/issues",
|
"issues": "https://github.com/CHItA/TopologicalSort/issues",
|
||||||
"source": "https://github.com/CHItA/TopologicalSort/tree/v2.0.1"
|
"source": "https://github.com/CHItA/TopologicalSort/tree/v3.0.1"
|
||||||
},
|
},
|
||||||
"time": "2021-01-03T12:12:53+00:00"
|
"time": "2021-01-04T21:31:59+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/ca-bundle",
|
"name": "composer/ca-bundle",
|
||||||
|
|
|
@ -20,13 +20,15 @@ use phpbb\db\driver\driver_interface;
|
||||||
use phpbb\db\migrator;
|
use phpbb\db\migrator;
|
||||||
use phpbb\db\tools\tools_interface;
|
use phpbb\db\tools\tools_interface;
|
||||||
use UnexpectedValueException;
|
use UnexpectedValueException;
|
||||||
use function CHItA\TopologicalSort\topologicalSort;
|
use CHItA\TopologicalSort\TopologicalSort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The schema generator generates the schema based on the existing migrations
|
* The schema generator generates the schema based on the existing migrations
|
||||||
*/
|
*/
|
||||||
class schema_generator
|
class schema_generator
|
||||||
{
|
{
|
||||||
|
use TopologicalSort;
|
||||||
|
|
||||||
/** @var config */
|
/** @var config */
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
|
@ -116,8 +118,7 @@ class schema_generator
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
require_once __DIR__ . '/../../../vendor/chita/topological_sort/src/TopologicalSort.php';
|
$this->topologicalSort($migrations, $edges, true, $apply_for_each, $filter);
|
||||||
topologicalSort($migrations, $edges, true, $apply_for_each, $filter);
|
|
||||||
}
|
}
|
||||||
catch (LogicException $e)
|
catch (LogicException $e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue