From 5b41cf2b9135d8466b0e784102a212e484eb535b Mon Sep 17 00:00:00 2001 From: michalsn Date: Sun, 17 Dec 2023 12:29:00 +0100 Subject: [PATCH] fix publish command --- src/Commands/Publish.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Commands/Publish.php b/src/Commands/Publish.php index 33eb652..fa34a03 100644 --- a/src/Commands/Publish.php +++ b/src/Commands/Publish.php @@ -33,14 +33,11 @@ public function run(array $params) } foreach ($publisher->getPublished() as $file) { - $publisher->replace( - $file, - [ - 'namespace CodeIgniter\\Tasks\\Config' => 'namespace Config', - 'use CodeIgniter\\Config\\BaseConfig' => 'use CodeIgniter\\Tasks\\Config\\Tasks as BaseTasks', - 'class Tasks extends BaseConfig' => 'class Tasks extends BaseTasks', - ] - ); + $contents = file_get_contents($file); + $contents = str_replace('namespace CodeIgniter\\Tasks\\Config', 'namespace Config', $contents); + $contents = str_replace('use CodeIgniter\\Config\\BaseConfig', 'use CodeIgniter\\Tasks\\Config\\Tasks as BaseTasks', $contents); + $contents = str_replace('class Tasks extends BaseConfig', 'class Tasks extends BaseTasks', $contents); + file_put_contents($file, $contents); } CLI::write(CLI::color(' Published! ', 'green') . 'You can customize the configuration by editing the "app/Config/Tasks.php" file.');