1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Issue #5120 Fix customization of folder paths for handlers and plugins. Updated dependencies.

'defaultdb' is now deprecated in new e107_config.php. Use 'db' instead.
This commit is contained in:
camer0n
2025-03-31 16:02:46 -07:00
parent 7267cbd635
commit d4fcbfe1ea
6 changed files with 78 additions and 71 deletions

View File

@@ -157,12 +157,12 @@ if(!empty($CLASS2_INCLUDE))
if(empty($HANDLERS_DIRECTORY)) if(empty($HANDLERS_DIRECTORY))
{ {
$HANDLERS_DIRECTORY = 'e107_handlers/'; $HANDLERS_DIRECTORY = !empty($config['paths']['handlers']) ? $config['paths']['handlers'] : 'e107_handlers/';
} }
if(empty($PLUGINS_DIRECTORY)) if(empty($PLUGINS_DIRECTORY))
{ {
$PLUGINS_DIRECTORY = 'e107_plugins/'; $PLUGINS_DIRECTORY = !empty($config['paths']['plugins']) ? $config['paths']['plugins'] : 'e107_plugins/';
} }
//define("MPREFIX", $mySQLprefix); moved to $e107->set_constants() //define("MPREFIX", $mySQLprefix); moved to $e107->set_constants()
@@ -222,6 +222,13 @@ else // New e107_config.php format. v2.4+
$e107_paths = $config['paths']; $e107_paths = $config['paths'];
$sql_info = $config['database']; $sql_info = $config['database'];
$E107_CONFIG = $config['other'] ?? []; $E107_CONFIG = $config['other'] ?? [];
if(isset($sql_info['defaultdb']))
{
echo "WARNING: 'defaultdb' is deprecated. Please use 'db' instead.\n";
exit;
}
unset($config); unset($config);
} }
@@ -291,11 +298,12 @@ e107::getSingleton('e107_traffic'); // We start traffic counting ASAP
//DEPRECATED, BC, $e107->sql caught by __get() //DEPRECATED, BC, $e107->sql caught by __get()
/** @var e_db $sql */ /** @var e_db $sql */
$sql = e107::getDb(); //TODO - find & replace $sql, $e107->sql $sql = e107::getDb();
$sql->db_SetErrorReporting(false); $sql->db_SetErrorReporting(false);
$dbg->logTime('SQL Connect'); $dbg->logTime('SQL Connect');
$merror=$sql->db_Connect($sql_info['server'], $sql_info['user'], $sql_info['password'], $sql_info['defaultdb']);
$merror=$sql->db_Connect($sql_info['server'], $sql_info['user'], $sql_info['password'], varset($sql_info['db'], $sql_info['db']));
unset($sql_info); unset($sql_info);
// create after the initial connection. // create after the initial connection.
//DEPRECATED, BC, call the method only when needed //DEPRECATED, BC, call the method only when needed

View File

@@ -549,6 +549,11 @@ class e107
} }
} }
if(!empty($e107_config_mysql_info['db']))
{
$e107_config_mysql_info['defaultdb'] = $e107_config_mysql_info['db'];
}
return $this->_init($e107_paths, $e107_root_path, $e107_config_mysql_info, $e107_config_override); return $this->_init($e107_paths, $e107_root_path, $e107_config_mysql_info, $e107_config_override);
} }

View File

@@ -3,7 +3,7 @@
"description": "Test harness for e107", "description": "Test harness for e107",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"require-dev": { "require-dev": {
"twig/twig": "^3.0", "twig/twig": ">=3.14.1",
"codeception/codeception": ">=5.0.11", "codeception/codeception": ">=5.0.11",
"codeception/module-asserts": ">=3.0.0", "codeception/module-asserts": ">=3.0.0",
"codeception/module-db": ">=3.1.2", "codeception/module-db": ">=3.1.2",
@@ -15,11 +15,5 @@
"optimize-autoloader": true, "optimize-autoloader": true,
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true "sort-packages": true
},
"autoload-dev": {
"psr-4": {
"Helper\\": "tests/_support/Helper/",
"Tests\\Unit\\": "tests/unit/"
}
} }
} }

116
e107_tests/composer.lock generated
View File

@@ -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": "ae4819661a6eba7be2e2e4c2b9365531", "content-hash": "8f3cf57778f5679abfeb6f0b37d3a6c0",
"packages": [], "packages": [],
"packages-dev": [ "packages-dev": [
{ {
@@ -700,16 +700,16 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "7.9.2", "version": "7.9.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "d281ed313b989f213357e3be1a179f02196ac99b" "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
"reference": "d281ed313b989f213357e3be1a179f02196ac99b", "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -806,7 +806,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/guzzle/issues", "issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.9.2" "source": "https://github.com/guzzle/guzzle/tree/7.9.3"
}, },
"funding": [ "funding": [
{ {
@@ -822,20 +822,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-24T11:22:20+00:00" "time": "2025-03-27T13:37:11+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
"version": "2.0.4", "version": "2.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/promises.git", "url": "https://github.com/guzzle/promises.git",
"reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c",
"reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -889,7 +889,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/promises/issues", "issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/2.0.4" "source": "https://github.com/guzzle/promises/tree/2.2.0"
}, },
"funding": [ "funding": [
{ {
@@ -905,20 +905,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-10-17T10:06:22+00:00" "time": "2025-03-27T13:27:01+00:00"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "2.7.0", "version": "2.7.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1005,7 +1005,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.7.0" "source": "https://github.com/guzzle/psr7/tree/2.7.1"
}, },
"funding": [ "funding": [
{ {
@@ -1021,7 +1021,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-18T11:15:46+00:00" "time": "2025-03-27T12:30:47+00:00"
}, },
{ {
"name": "masterminds/html5", "name": "masterminds/html5",
@@ -1394,16 +1394,16 @@
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "12.0.5", "version": "12.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "da732486790670c622aa367eb3dbb7e1619e68be" "reference": "d331a5ced3d9a2b917baa9841b2211e72f9e780d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/da732486790670c622aa367eb3dbb7e1619e68be", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d331a5ced3d9a2b917baa9841b2211e72f9e780d",
"reference": "da732486790670c622aa367eb3dbb7e1619e68be", "reference": "d331a5ced3d9a2b917baa9841b2211e72f9e780d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1430,7 +1430,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-main": "12.0.x-dev" "dev-main": "12.1.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -1459,7 +1459,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.0.5" "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.1.0"
}, },
"funding": [ "funding": [
{ {
@@ -1467,7 +1467,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2025-03-15T07:24:51+00:00" "time": "2025-03-17T13:56:07+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@@ -1716,16 +1716,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "12.0.7", "version": "12.0.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "2845e49082ef7acc4a71a2ef71bbf32f31da22c9" "reference": "6075843014de23bcd6992842d69ca99d25d6a433"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2845e49082ef7acc4a71a2ef71bbf32f31da22c9", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6075843014de23bcd6992842d69ca99d25d6a433",
"reference": "2845e49082ef7acc4a71a2ef71bbf32f31da22c9", "reference": "6075843014de23bcd6992842d69ca99d25d6a433",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1739,7 +1739,7 @@
"phar-io/manifest": "^2.0.4", "phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1", "phar-io/version": "^3.2.1",
"php": ">=8.3", "php": ">=8.3",
"phpunit/php-code-coverage": "^12.0.4", "phpunit/php-code-coverage": "^12.1.0",
"phpunit/php-file-iterator": "^6.0.0", "phpunit/php-file-iterator": "^6.0.0",
"phpunit/php-invoker": "^6.0.0", "phpunit/php-invoker": "^6.0.0",
"phpunit/php-text-template": "^5.0.0", "phpunit/php-text-template": "^5.0.0",
@@ -1751,7 +1751,7 @@
"sebastian/exporter": "^7.0.0", "sebastian/exporter": "^7.0.0",
"sebastian/global-state": "^8.0.0", "sebastian/global-state": "^8.0.0",
"sebastian/object-enumerator": "^7.0.0", "sebastian/object-enumerator": "^7.0.0",
"sebastian/type": "^6.0.0", "sebastian/type": "^6.0.2",
"sebastian/version": "^6.0.0", "sebastian/version": "^6.0.0",
"staabm/side-effects-detector": "^1.0.5" "staabm/side-effects-detector": "^1.0.5"
}, },
@@ -1793,7 +1793,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.0.7" "source": "https://github.com/sebastianbergmann/phpunit/tree/12.0.10"
}, },
"funding": [ "funding": [
{ {
@@ -1809,7 +1809,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-03-07T07:32:22+00:00" "time": "2025-03-23T16:03:59+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",
@@ -2901,16 +2901,16 @@
}, },
{ {
"name": "sebastian/type", "name": "sebastian/type",
"version": "6.0.0", "version": "6.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/type.git", "url": "https://github.com/sebastianbergmann/type.git",
"reference": "533fe082889a616f330bcba6f50965135f4f2fab" "reference": "1d7cd6e514384c36d7a390347f57c385d4be6069"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/533fe082889a616f330bcba6f50965135f4f2fab", "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/1d7cd6e514384c36d7a390347f57c385d4be6069",
"reference": "533fe082889a616f330bcba6f50965135f4f2fab", "reference": "1d7cd6e514384c36d7a390347f57c385d4be6069",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2946,7 +2946,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/type/issues", "issues": "https://github.com/sebastianbergmann/type/issues",
"security": "https://github.com/sebastianbergmann/type/security/policy", "security": "https://github.com/sebastianbergmann/type/security/policy",
"source": "https://github.com/sebastianbergmann/type/tree/6.0.0" "source": "https://github.com/sebastianbergmann/type/tree/6.0.2"
}, },
"funding": [ "funding": [
{ {
@@ -2954,7 +2954,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2025-02-07T05:00:19+00:00" "time": "2025-03-18T13:37:31+00:00"
}, },
{ {
"name": "sebastian/version", "name": "sebastian/version",
@@ -3132,16 +3132,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v7.2.1", "version": "v7.2.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" "reference": "e51498ea18570c062e7df29d05a7003585b19b88"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88",
"reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "reference": "e51498ea18570c062e7df29d05a7003585b19b88",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3205,7 +3205,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v7.2.1" "source": "https://github.com/symfony/console/tree/v7.2.5"
}, },
"funding": [ "funding": [
{ {
@@ -3221,7 +3221,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-11T03:49:26+00:00" "time": "2025-03-12T08:11:12+00:00"
}, },
{ {
"name": "symfony/css-selector", "name": "symfony/css-selector",
@@ -3962,16 +3962,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v7.2.4", "version": "v7.2.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf" "reference": "87b7c93e57df9d8e39a093d32587702380ff045d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf", "url": "https://api.github.com/repos/symfony/process/zipball/87b7c93e57df9d8e39a093d32587702380ff045d",
"reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf", "reference": "87b7c93e57df9d8e39a093d32587702380ff045d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -4003,7 +4003,7 @@
"description": "Executes commands in sub-processes", "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/process/tree/v7.2.4" "source": "https://github.com/symfony/process/tree/v7.2.5"
}, },
"funding": [ "funding": [
{ {
@@ -4019,7 +4019,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-02-05T08:33:46+00:00" "time": "2025-03-13T12:21:46+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
@@ -4276,16 +4276,16 @@
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v7.2.3", "version": "v7.2.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "ac238f173df0c9c1120f862d0f599e17535a87ec" "reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/ac238f173df0c9c1120f862d0f599e17535a87ec", "url": "https://api.github.com/repos/symfony/yaml/zipball/4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
"reference": "ac238f173df0c9c1120f862d0f599e17535a87ec", "reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -4328,7 +4328,7 @@
"description": "Loads and dumps YAML files", "description": "Loads and dumps YAML files",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/yaml/tree/v7.2.3" "source": "https://github.com/symfony/yaml/tree/v7.2.5"
}, },
"funding": [ "funding": [
{ {
@@ -4344,7 +4344,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-01-07T12:55:42+00:00" "time": "2025-03-03T07:12:39+00:00"
}, },
{ {
"name": "theseer/tokenizer", "name": "theseer/tokenizer",

View File

@@ -43,7 +43,7 @@ return [
'server' => '{{ mySQLserver }}', 'server' => '{{ mySQLserver }}',
'user' => '{{ mySQLuser }}', 'user' => '{{ mySQLuser }}',
'password' => '{{ mySQLpassword }}', 'password' => '{{ mySQLpassword }}',
'defaultdb'=> '{{ mySQLdefaultdb }}', 'db' => '{{ mySQLdefaultdb }}',
'prefix' => '{{ mySQLprefix }}', 'prefix' => '{{ mySQLprefix }}',
'charset' => 'utf8', 'charset' => 'utf8',
], ],

View File

@@ -1561,7 +1561,7 @@ return [
'server' => '{$this->previous_steps['mysql']['server']}', 'server' => '{$this->previous_steps['mysql']['server']}',
'user' => '{$this->previous_steps['mysql']['user']}', 'user' => '{$this->previous_steps['mysql']['user']}',
'password' => '{$this->previous_steps['mysql']['password']}', 'password' => '{$this->previous_steps['mysql']['password']}',
'defaultdb'=> '{$this->previous_steps['mysql']['db']}', 'db' => '{$this->previous_steps['mysql']['db']}',
'prefix' => '{$this->previous_steps['mysql']['prefix']}', 'prefix' => '{$this->previous_steps['mysql']['prefix']}',
'charset' => 'utf8mb4', 'charset' => 'utf8mb4',
], ],