Ticket Details

Cannot use Libraries::add in Bootstrap - class not found

RFC Ticket (pending)

###What happened:
- tried to register app specific libraries by following Zend integration tutorial:
in bootstrap.php


{{{
Libraries::add("MyLib", array(

    "prefix" => "MyLib_",

   "includePath" => '/htdocs/libraries/MyLib',

    "transform" => function($class) { return str_replace("_", "/", $class) . ".php"; }
));
}}}

result:

{{{Fatal error: Class 'Libraries' not found...}}}

which seems odd since it's not throwing an exception following class file inclusion

Added this line:

{{{use lithium\core\Libraries;}}}

another fatal error

{{{Fatal error: Class 'lithium\util\String' not found in C:\Users\SunWuKung\Documents\My Dropbox\Dev\lithium\libraries\lithium\core\Libraries.php on line 768}}}

###What was expected:
- autoloading of required library class

on 03.17.11 reported by: sunwukung

Updates

on 03.18.11 by harikt
  • type was changed to rfc
Every library may not be loading the way Zend has been done.

Please visit http://lithify.me/docs/lithium/core/Libraries

Some of the examples you can look over are 

http://dev.lithify.me/li3_oauth/source

http://dev.lithify.me/li3_doctrine/source/config/bootstrap.php

http://dev.lithify.me/li3_twig/source/config/bootstrap.php

http://dev.lithify.me/li3_activerecord/source/config/bootstrap.php

Also have a look into tcpdf integration .

Hope it will help to resolve the issue.

Thanks

Hari K T