简体   繁体   中英

How can I install modules in zf3 without using composer?

How can we install modules in zend framework 3 manually?. I mean without using composer how can we do that?

You will need a PSR-4 compatible autoloader (such as Aura Router or so on), which you'd need to include in public/index.php .

Then download any modules you want, configure your autoloader, and good luck with your dependencies' dependencies...


May I ask why you would rather not use Composer?

Actually I am gonna use my application with shared hosting which doesn't support shell.

So basically I am not aware of your deployment process, but I'd definitively use composer on my local system, then upload the vendor folder when deploying, however you do that.

If you're using a CI, then do your composer processing there.

I got a better solution. By editing 3 files we can add a module without using composer. 1.modules.config.php in config folder Just add the module name in the return array. 2. autoload_psr4.php in vendor/composer directory Add your module information to return array in following format 'Modulename\\' => array($modulepath), 3. autoload_static.php in vendor/composer directory Here we have to add the module information in two places 1. In $prefixLengthsPsr4 array as 'M' => array( 'Modulename\\' => 11, ), The key value indicates the first letter of module name and the numerical value is the length of modulename +1(for /). 2. In $prefixDirsPsr4 array as 'modulename\\' => array ( 0 => DIR . '/../..' . '/module/modulename/src', ), Its done.Thank you :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM