diff --git a/src/modules/mo/mo_dhl/Install.php b/src/modules/mo/mo_dhl/Install.php index 37c1fe0..6aaa976 100644 --- a/src/modules/mo/mo_dhl/Install.php +++ b/src/modules/mo/mo_dhl/Install.php @@ -23,7 +23,6 @@ class Install */ public static function onActivate() { - static::addBootstrapLoader(); static::ensureConfigVariableNameLength(); static::addTables(); static::addColumns(); @@ -43,44 +42,6 @@ protected static function ensureDocumentsFolderExists() } } - /** - * Adds a line to the functions.php in the modules directory to ensure that the bootstrap is included. - */ - protected static function addBootstrapLoader() - { - $lines = file_exists(static::getFunctionsFile()) ? file(static::getFunctionsFile(), FILE_IGNORE_NEW_LINES) : ['', $lines, true); - if ($lineOfClosingTag !== false) { - $lines = array_slice($lines, 0, $lineOfClosingTag); - } - $lines[] = $bootstrapLoader; - - file_put_contents(static::getFunctionsFile(), implode(PHP_EOL, $lines) . PHP_EOL); - } - - /** - * @return string - */ - protected static function getFunctionsFile() - { - return OX_BASE_PATH . 'modules/functions.php'; - } - - /** - * @return string - */ - protected static function getBootstrapLoaderStatement() - { - $comment = 'This line was automatically generated.'; - return "require_once __DIR__ . '/mo/mo_dhl/bootstrap.php'; // {$comment}"; - } - /** * Add a new column with specified type to a table. * @@ -134,27 +95,9 @@ protected static function cleanUp() */ public static function onDeactivate() { - static::removeBootstrapLoader(); static::cleanUp(); } - /** - * Removes the line in the functions.php in the modules directory that loads the bootstrap, in case this line - * exists. - */ - protected static function removeBootstrapLoader() - { - if (!file_exists(static::getFunctionsFile())) { - return; - } - - $lines = file(static::getFunctionsFile(), FILE_IGNORE_NEW_LINES); - $lineOfBootstrapLoader = array_search(static::getBootstrapLoaderStatement(), $lines, true); - if ($lineOfBootstrapLoader !== false) { - unset($lines[$lineOfBootstrapLoader]); - } - file_put_contents(static::getFunctionsFile(), implode(PHP_EOL, $lines) . PHP_EOL); - } /** * @throws \Exception diff --git a/src/modules/mo/mo_dhl/bootstrap.php b/src/modules/mo/mo_dhl/bootstrap.php deleted file mode 100644 index bbcb182..0000000 --- a/src/modules/mo/mo_dhl/bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ -