php - using Symfony class loader -


recently, i'm diving symfony's class loader component. however, need solve issue. have following folder structure;

-> project     -> public         -> index.php     -> package         -> request.php 

in index.php i'm using following statements load class loader of symfony;

define ('root', dirname(dirname(__file__)));  $paths = array(     'system' => root . '/package' );  $namespaces = array(     'mynamespace' => $paths['system'] );  require $paths['vendor'] .     '/symfony/class-loader/symfony/component/classloader/universalclassloader.php';  use symfony\component\classloader\universalclassloader;  $autoload = new universalclassloader(); $autoload->registernamespaces($namespaces); $autoload->register();  use mynamespace\request;  request::create(); 

in request.php, have following code;

namespace mynamespace;  class request {     static public function create()     {      } } 

however, in index.php file, says request class can't found

so, doing wrong here ? ideas ?


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -