Altax\Script\ScriptHandler::removeAutoloadFiles PHP Method

removeAutoloadFiles() public static method

autoload_files.php includes '/phpseclib/phpseclib/phpseclib/Crypt/Random.php'. and composer autoloader defines crypt_random_string function at initialize process. If you load phpseclib in a altax task configuration files (ex .altax/config.php) using composer autoloading. You will get a error PHP Fatal error: Cannot redeclare crypt_random_string(). In order to prevent the error. remove this settings.
public static removeAutoloadFiles ( ) : [type]
return [type]
    public static function removeAutoloadFiles()
    {
        $autoloadFile = realpath(__DIR__ . "/../../../vendor/composer/autoload_files.php");
        // Back up original file.
        copy($autoloadFile, dirname($autoloadFile) . "/autoload_files.original.php");
        file_put_contents($autoloadFile, self::CONTENT_OF_AUTOLOAD_FILES);
    }

Usage Example

 public function testRemoveAutoloadFiles()
 {
     ScriptHandler::removeAutoloadFiles();
 }
ScriptHandler