Classes in application/libraries are not being found

    • 75 posts
    March 19, 2018 7:00 PM EDT

    I've added a library to /application/libraries by following these steps:
    - Developer SDK -> Create a Package (choosing type = Library)
    - Added the library .tar skeleton via Package Manager -> Install New Package (all good and successful)
    - I added the files containing the PHP classes of the library inside /application/Libraries
    - tried to instantiate one of the classes from within a different module but I got this error:

    2018-03-19T22:40:58+00:00 ERR (3): Error Code: 4247ae Error: Class 'CamShowAPI' not found in /Applications/MAMP/htdocs/social-engine-4.10.1/application/modules/Livecams/controllers/CamshowController.php:9 Stack trace: #0 /Applications/MAMP/htdocs/social-engine-4.10.1/application/libraries/Zend/Controller/Action.php(516): Livecams_CamshowController->webserviceAction() #1 /Applications/MAMP/htdocs/social-engine-4.10.1/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('webserviceActio...') #2 /Applications/MAMP/htdocs/social-engine-4.10.1/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #3 /Applications/MAMP/htdocs/social-engine-4.10.1/application/modules/Core/Bootstrap.php(84): Zend_Controller_Front->dispatch() #4 /Applications/MAMP/htdocs/social-engine-4.10.1/application/libraries/Engine/Application.php(160): Core_Bootstrap->run() #5 /Applications/MAMP/htdocs/social-engine-4.10.1/application/index.php(223): Engine_Application->run() #6 /Applications/MAMP/htdocs/social-engine-4.10.1/index.php(25): include('/Applications/M...') #7 {main}

    Just in case, I then tried to:
    - Developer SDK -> Build Package
    - delete the library
    - add again the library using the newly built package so that all the files would be mentioned inside application/packages/library-camshow-4.0.0.json

    Got the same error.
    What am I doing wrong? How do I tell SE to load my LIbraries classes?


    This post was edited by socialenginestaff at March 21, 2018 4:26 AM EDT
    • Moderator
    • 6923 posts
    March 20, 2018 5:09 AM EDT

    I can't help much with stuff like this but you have written:

    - I added the files containing the PHP classes of the library inside /application/Libraries

    On my mac it's

    /application/libraries

    Do you think the folder name could be any issue?

    • 75 posts
    March 20, 2018 3:17 PM EDT

    no just a typo.

    The problem was a name space problem - solved that one, but thanks :-)