简体   繁体   中英

Composer with Koseven (Kohana)

I'm developing an application where I started using Kohana and now Koseven, and I need to use an api that was available in the composer, I followed the steps to download the files I created a folder to sell inside the application, and put in the bootstrap.php code to call the autoload of the composer. But after doing this when trying to use a class of this api error of "class not found" occurs. I do not know what else to do, can you help me?

In order to use composer with Kohana or Koseven, you need to call composer 's autoloader from within bootstrap.php .

After Kohana::modules($modules); and before Route::set , insert the following code:

/**
 * Autoload composer libraries
 *
 */
require APPPATH . 'vendor/autoload.php';

This assumes your composer install command is run the from the root of your app, and it uses the default vendor directory.

Probably you must add this to your composer.json . (Check inc composer doc.) I don't know, because in modules directory I have second instance.

"extra": {
    "installer-paths": {
        "modules/{$name}/": ["type:kohana-module"]
    }
},

And enable module composer as first:

Kohana::modules(array(
    'composer'   => MODPATH.'composer',       // 
    'auth'       => MODPATH.'auth',       // Basic authentication
    'cache'      => MODPATH.'cache',      // Caching with multiple backends

It works for me ko3

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