1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-19 21:02:09 +02:00

Code optimization for speed and reduced memory usage.

This commit is contained in:
Cameron
2020-12-20 11:50:10 -08:00
parent 6b5cc07929
commit 601df26d51
91 changed files with 522 additions and 482 deletions

160
e107_tests/composer.lock generated
View File

@@ -72,16 +72,16 @@
},
{
"name": "codeception/codeception",
"version": "4.1.12",
"version": "4.1.13",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Codeception.git",
"reference": "fc550bf6e90d69fbfc8ab7e9e0a330ac98ffafdd"
"reference": "e817f83fe019ed3f9c280254b88f90cc70c3d7cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/fc550bf6e90d69fbfc8ab7e9e0a330ac98ffafdd",
"reference": "fc550bf6e90d69fbfc8ab7e9e0a330ac98ffafdd",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/e817f83fe019ed3f9c280254b88f90cc70c3d7cf",
"reference": "e817f83fe019ed3f9c280254b88f90cc70c3d7cf",
"shasum": ""
},
"require": {
@@ -155,7 +155,7 @@
],
"support": {
"issues": "https://github.com/Codeception/Codeception/issues",
"source": "https://github.com/Codeception/Codeception/tree/4.1.12"
"source": "https://github.com/Codeception/Codeception/tree/4.1.13"
},
"funding": [
{
@@ -163,7 +163,7 @@
"type": "open_collective"
}
],
"time": "2020-11-16T06:36:57+00:00"
"time": "2020-12-20T13:35:09+00:00"
},
{
"name": "codeception/lib-asserts",
@@ -338,20 +338,20 @@
},
{
"name": "codeception/module-db",
"version": "1.0.2",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/Codeception/module-db.git",
"reference": "d5f1def43c1f0ebdd57d506224c4a4632e3a6059"
"reference": "8c8076cd05d4db95798acd7dba2a56578210982c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/module-db/zipball/d5f1def43c1f0ebdd57d506224c4a4632e3a6059",
"reference": "d5f1def43c1f0ebdd57d506224c4a4632e3a6059",
"url": "https://api.github.com/repos/Codeception/module-db/zipball/8c8076cd05d4db95798acd7dba2a56578210982c",
"reference": "8c8076cd05d4db95798acd7dba2a56578210982c",
"shasum": ""
},
"require": {
"codeception/codeception": "^4.0",
"codeception/codeception": "*@dev",
"php": ">=5.6.0 <9.0"
},
"conflict": {
@@ -384,9 +384,9 @@
],
"support": {
"issues": "https://github.com/Codeception/module-db/issues",
"source": "https://github.com/Codeception/module-db/tree/1.0.2"
"source": "https://github.com/Codeception/module-db/tree/1.1.0"
},
"time": "2020-10-23T18:21:20+00:00"
"time": "2020-12-20T13:37:07+00:00"
},
{
"name": "codeception/module-phpbrowser",
@@ -891,16 +891,16 @@
},
{
"name": "nikic/php-parser",
"version": "v4.10.3",
"version": "v4.10.4",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984"
"reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984",
"reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e",
"reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e",
"shasum": ""
},
"require": {
@@ -941,9 +941,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.10.3"
"source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4"
},
"time": "2020-12-03T17:45:45+00:00"
"time": "2020-12-20T10:01:03+00:00"
},
{
"name": "phar-io/manifest",
@@ -1007,16 +1007,16 @@
},
{
"name": "phar-io/version",
"version": "3.0.3",
"version": "3.0.4",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
"reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae"
"reference": "e4782611070e50613683d2b9a57730e9a3ba5451"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/version/zipball/726c026815142e4f8677b7cb7f2249c9ffb7ecae",
"reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae",
"url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451",
"reference": "e4782611070e50613683d2b9a57730e9a3ba5451",
"shasum": ""
},
"require": {
@@ -1052,9 +1052,9 @@
"description": "Library for handling version information and constraints",
"support": {
"issues": "https://github.com/phar-io/version/issues",
"source": "https://github.com/phar-io/version/tree/3.0.3"
"source": "https://github.com/phar-io/version/tree/3.0.4"
},
"time": "2020-11-30T09:21:21+00:00"
"time": "2020-12-13T23:18:30+00:00"
},
{
"name": "phpdocumentor/reflection-common",
@@ -1216,16 +1216,16 @@
},
{
"name": "phpspec/prophecy",
"version": "1.12.1",
"version": "1.12.2",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d"
"reference": "245710e971a030f42e08f4912863805570f23d39"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d",
"reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39",
"reference": "245710e971a030f42e08f4912863805570f23d39",
"shasum": ""
},
"require": {
@@ -1237,7 +1237,7 @@
},
"require-dev": {
"phpspec/phpspec": "^6.0",
"phpunit/phpunit": "^8.0 || ^9.0 <9.3"
"phpunit/phpunit": "^8.0 || ^9.0"
},
"type": "library",
"extra": {
@@ -1277,9 +1277,9 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/1.12.1"
"source": "https://github.com/phpspec/prophecy/tree/1.12.2"
},
"time": "2020-09-29T09:10:42+00:00"
"time": "2020-12-19T10:15:11+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -2920,16 +2920,16 @@
},
{
"name": "symfony/browser-kit",
"version": "v5.2.0",
"version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
"reference": "4fc769a12282a12bc47f883f04f01ff3777e369b"
"reference": "87d6f0a7436b03a57d4cf9a6a9cd0c83a355c49a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/4fc769a12282a12bc47f883f04f01ff3777e369b",
"reference": "4fc769a12282a12bc47f883f04f01ff3777e369b",
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/87d6f0a7436b03a57d4cf9a6a9cd0c83a355c49a",
"reference": "87d6f0a7436b03a57d4cf9a6a9cd0c83a355c49a",
"shasum": ""
},
"require": {
@@ -2971,7 +2971,7 @@
"description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/browser-kit/tree/v5.2.0"
"source": "https://github.com/symfony/browser-kit/tree/v5.2.1"
},
"funding": [
{
@@ -2987,20 +2987,20 @@
"type": "tidelift"
}
],
"time": "2020-11-14T11:04:29+00:00"
"time": "2020-12-18T08:03:05+00:00"
},
{
"name": "symfony/console",
"version": "v5.2.0",
"version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b"
"reference": "47c02526c532fb381374dab26df05e7313978976"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/3e0564fb08d44a98bd5f1960204c958e57bd586b",
"reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b",
"url": "https://api.github.com/repos/symfony/console/zipball/47c02526c532fb381374dab26df05e7313978976",
"reference": "47c02526c532fb381374dab26df05e7313978976",
"shasum": ""
},
"require": {
@@ -3068,7 +3068,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v5.2.0"
"source": "https://github.com/symfony/console/tree/v5.2.1"
},
"funding": [
{
@@ -3084,20 +3084,20 @@
"type": "tidelift"
}
],
"time": "2020-11-28T11:24:18+00:00"
"time": "2020-12-18T08:03:05+00:00"
},
{
"name": "symfony/css-selector",
"version": "v5.2.0",
"version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256"
"reference": "f789e7ead4c79e04ca9a6d6162fc629c89bd8054"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256",
"reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/f789e7ead4c79e04ca9a6d6162fc629c89bd8054",
"reference": "f789e7ead4c79e04ca9a6d6162fc629c89bd8054",
"shasum": ""
},
"require": {
@@ -3133,7 +3133,7 @@
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/css-selector/tree/v5.2.0"
"source": "https://github.com/symfony/css-selector/tree/v5.2.1"
},
"funding": [
{
@@ -3149,7 +3149,7 @@
"type": "tidelift"
}
],
"time": "2020-10-28T21:31:18+00:00"
"time": "2020-12-08T17:02:38+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -3220,16 +3220,16 @@
},
{
"name": "symfony/dom-crawler",
"version": "v5.2.0",
"version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
"reference": "0969122fe144dd8ab2e8c98c7e03eedc621b368c"
"reference": "ee7cf316fb0de786cfe5ae32ee79502b290c81ea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/0969122fe144dd8ab2e8c98c7e03eedc621b368c",
"reference": "0969122fe144dd8ab2e8c98c7e03eedc621b368c",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/ee7cf316fb0de786cfe5ae32ee79502b290c81ea",
"reference": "ee7cf316fb0de786cfe5ae32ee79502b290c81ea",
"shasum": ""
},
"require": {
@@ -3274,7 +3274,7 @@
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/dom-crawler/tree/v5.2.0"
"source": "https://github.com/symfony/dom-crawler/tree/v5.2.1"
},
"funding": [
{
@@ -3290,20 +3290,20 @@
"type": "tidelift"
}
],
"time": "2020-10-24T12:01:57+00:00"
"time": "2020-12-18T08:02:46+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v5.2.0",
"version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c"
"reference": "1c93f7a1dff592c252574c79a8635a8a80856042"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/aa13a09811e6d2ad43f8fb336bebdb7691d85d3c",
"reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1c93f7a1dff592c252574c79a8635a8a80856042",
"reference": "1c93f7a1dff592c252574c79a8635a8a80856042",
"shasum": ""
},
"require": {
@@ -3359,7 +3359,7 @@
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/event-dispatcher/tree/v5.2.0"
"source": "https://github.com/symfony/event-dispatcher/tree/v5.2.1"
},
"funding": [
{
@@ -3375,7 +3375,7 @@
"type": "tidelift"
}
],
"time": "2020-11-01T16:14:45+00:00"
"time": "2020-12-18T08:03:05+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
@@ -3458,16 +3458,16 @@
},
{
"name": "symfony/finder",
"version": "v5.2.0",
"version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "fd8305521692f27eae3263895d1ef1571c71a78d"
"reference": "0b9231a5922fd7287ba5b411893c0ecd2733e5ba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/fd8305521692f27eae3263895d1ef1571c71a78d",
"reference": "fd8305521692f27eae3263895d1ef1571c71a78d",
"url": "https://api.github.com/repos/symfony/finder/zipball/0b9231a5922fd7287ba5b411893c0ecd2733e5ba",
"reference": "0b9231a5922fd7287ba5b411893c0ecd2733e5ba",
"shasum": ""
},
"require": {
@@ -3499,7 +3499,7 @@
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v5.2.0"
"source": "https://github.com/symfony/finder/tree/v5.2.1"
},
"funding": [
{
@@ -3515,7 +3515,7 @@
"type": "tidelift"
}
],
"time": "2020-11-18T09:42:36+00:00"
"time": "2020-12-08T17:02:38+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -4084,16 +4084,16 @@
},
{
"name": "symfony/string",
"version": "v5.2.0",
"version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242"
"reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/40e975edadd4e32cd16f3753b3bad65d9ac48242",
"reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242",
"url": "https://api.github.com/repos/symfony/string/zipball/5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed",
"reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed",
"shasum": ""
},
"require": {
@@ -4147,7 +4147,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v5.2.0"
"source": "https://github.com/symfony/string/tree/v5.2.1"
},
"funding": [
{
@@ -4163,20 +4163,20 @@
"type": "tidelift"
}
],
"time": "2020-10-24T12:08:07+00:00"
"time": "2020-12-05T07:33:16+00:00"
},
{
"name": "symfony/yaml",
"version": "v5.2.0",
"version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598"
"reference": "290ea5e03b8cf9b42c783163123f54441fb06939"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/bb73619b2ae5121bbbcd9f191dfd53ded17ae598",
"reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598",
"url": "https://api.github.com/repos/symfony/yaml/zipball/290ea5e03b8cf9b42c783163123f54441fb06939",
"reference": "290ea5e03b8cf9b42c783163123f54441fb06939",
"shasum": ""
},
"require": {
@@ -4222,7 +4222,7 @@
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v5.2.0"
"source": "https://github.com/symfony/yaml/tree/v5.2.1"
},
"funding": [
{
@@ -4238,7 +4238,7 @@
"type": "tidelift"
}
],
"time": "2020-11-28T10:57:20+00:00"
"time": "2020-12-08T17:02:38+00:00"
},
{
"name": "theseer/tokenizer",

View File

@@ -163,12 +163,14 @@ class e_fileTest extends \Codeception\Test\Unit
{
}
*/
public function testGet_dirs()
{
$actual = $this->fl->get_dirs(e_LANGUAGEDIR);
$expected = array ( 0 => 'English' );
$this->assertSame($expected, $actual);
}
/*
public function testGetErrorMessage()
{
@@ -387,12 +389,26 @@ class e_fileTest extends \Codeception\Test\Unit
{
}
*/
public function testGet_files()
{
$reject = array('style.*');
$result = $this->fl->get_files(e_THEME."voux/", "\.php|\.css|\.xml|preview\.jpg|preview\.png", $reject, 1);
$files = array();
foreach($result as $f)
{
$files[] = $f['fname'];
}
$this->assertContains('install.xml', $files); // 1 level deep.
$this->assertContains('theme.php', $files);
$this->assertContains('theme.xml', $files);
$this->assertNotContains('style.css', $files);
}
/*
public function testGetUserDir()
{

View File

@@ -744,12 +744,22 @@ class e_formTest extends \Codeception\Test\Unit
{
}
*/
public function testGet_attributes()
{
$options = array(
'class' => 'myclass',
'id' => 'custom-id',
'readonly' => true,
'data-something' => 'custom-att'
);
$actual = $this->_frm->get_attributes($options);
$expected = " class='myclass' id='custom-id' readonly='readonly' data-something='custom-att'";
$this->assertSame($expected, $actual);
}
/*
public function test_format_id()
{