1

I am creating a post-update-cmd script in which I call some functions.

The file is

lib\Vendor\Module\CustomClass.php

This is the command:

"post-update-cmd": [
Vendor \\ Module \\ CustomClass :: customfunc
]

and the file:

namespace Vendor\Module;

class CustomClass  {

// .. some stuff for get rootfolder (in this case is /../../../../../../

public static function customfunc() {
  if(file_exists(self::$MagentoRootFolder.'/app/Mage.php') == true){
      $bootstrapFileName = self::$MagentoRootFolder.'/app/Mage.php';
  }
 else{
      die("Mage.php file not found in ./app or parent folder");
  }

try{
      require self::$MagentoRootFolder . '/app/bootstrap.php';
      require_once $bootstrapFileName;
      umask(0);

    }
    catch (\Exception $e){
      die($e->getMessage());
    }


    Mage::app('admin');

}

But when i run composer update the result is this:

[ErrorException] include (Vendor \ Module \ Mage.php): failed to open stream: No such file or directory

How can I include Mage: app to work also within this path?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.