From ea5adb301b4b0765fda48667a4e493b121c8e5c9 Mon Sep 17 00:00:00 2001 From: Italo Date: Fri, 1 May 2020 00:07:43 -0400 Subject: [PATCH 1/4] Create FUNDING.yml --- .github/FUNDING.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..50062f2 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# Help me support this package + +ko_fi: DarkGhostHunter +custom: ['https://paypal.me/darkghosthunter'] From 423174aaa1128d8977f75b9534b432c0e6802c18 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 10 May 2020 20:17:34 +0200 Subject: [PATCH 2/4] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b40bd5..ef7e320 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Require this using Composer into your project composer require darkghosthunter/preloader -> This package doesn't requires `ext-opcache` to install. Just be sure to have it [enabled in your application server](https://www.php.net/manual/en/book.opcache.php). +> This package doesn't require `ext-opcache` to install. Just be sure to have it [enabled in your application server](https://www.php.net/manual/en/book.opcache.php). ## Usage From 209345954cf8d329b8227cf106d78708cf278aad Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 10 May 2020 20:20:39 +0200 Subject: [PATCH 3/4] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef7e320..70001be 100644 --- a/README.md +++ b/README.md @@ -209,7 +209,7 @@ Preloader::make()->selfExclude(); #### `memoryLimit()` -By default, Preloader defaults a memory limit of 32MB, which is enough for *most* applications. TThehe Preloader will generate a list of files until that memory limit is reached. +By default, Preloader defaults a memory limit of 32MB, which is enough for *most* applications. The Preloader will generate a list of files until that memory limit is reached. You can set your own memory limit in **MB**. From 679862c8b35f84c445e2d9676149928f120267cb Mon Sep 17 00:00:00 2001 From: Etienne Bruines Date: Wed, 27 May 2020 09:13:25 +0200 Subject: [PATCH 4/4] Updated require_once statement to valid php syntax Fixes #36 --- src/PreloaderCompiler.php | 2 +- tests/PreloaderTest.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/PreloaderCompiler.php b/src/PreloaderCompiler.php index d80443f..7d24a35 100644 --- a/src/PreloaderCompiler.php +++ b/src/PreloaderCompiler.php @@ -66,7 +66,7 @@ public function compile() : string '@output' => $this->scriptRealPath(), '@generated_at' => date('Y-m-d H:i:s e'), '@autoload' => isset($this->autoloader) - ? 'require_once ' . realpath($this->autoloader) : null, + ? 'require_once \'' . realpath($this->autoloader) . '\';': null, '@list' => $this->parseList(), '@mechanism' => $this->useRequire ? 'require_once $file' : 'opcache_compile_file($file)', diff --git a/tests/PreloaderTest.php b/tests/PreloaderTest.php index aa5c01f..ee35244 100644 --- a/tests/PreloaderTest.php +++ b/tests/PreloaderTest.php @@ -373,9 +373,11 @@ public function test_uses_require_instead_of_compile() $contents = file_get_contents($this->preloaderPath); - $this->assertStringContainsString('require_once ' . realpath(implode(DIRECTORY_SEPARATOR, [ + $path = realpath(implode(DIRECTORY_SEPARATOR, [ $this->workdir, 'autoload.php' - ])), $contents); + ])); + $expectedRequire = "require_once '$path';"; + $this->assertStringContainsString($expectedRequire, $contents); $this->assertStringContainsString('require_once $file', $contents); }