samedi 17 septembre 2016

How to manually add ClassLoader in Laravel 5

I want add my class to classloader by this commands

$loader = new \Composer\Autoload\ClassLoader();
$loader->addPsr4('test\\', __DIR__ . '/../..' . '/modules/test');
$loader->register();

but dose not work and no error
dd($loader):

ClassLoader {#470 ▼
  -prefixLengthsPsr4: array:1 [▼
    "t" => array:1 [▶]
  ]
  -prefixDirsPsr4: array:1 [▼
    "test\" => array:1 [▼
      0 => "C:\wamp\www\app\Http\Controllers\admin/../../modules/test"
    ]
  ]
  -fallbackDirsPsr4: []
  -prefixesPsr0: []
  -fallbackDirsPsr0: []
  -useIncludePath: false
  -classMap: []
  -classMapAuthoritative: false
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire