Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Where do I add a non fuel git submodule to my project, what do I need to do to make it work?
  • Hey, I'm running into an issue adding a submodule to my project and getting fuel to recognize the autoloader.

    I'm trying to use the parse php library

    Using it as a composer dependency works fine but there are some issues in it so I forked the library, now I want to add that library to my fuel project but I'm confused as to where I put it and what I need to do to make the autoloader pick up on the classes.
    thanks in advanced
  • You can copy it into app/vendor, and do something like

    \Autoloader::add_namespace('Parse', APPPATH.'vendor'.DS.'parse-php-sdk'.DS.'src'.DS.'Parse'.DS, false);

    in your app bootstrap to map the "Parse" namespace to the src/Parse folder of the repo.

    If you are on the latest 1.8/develop, you can also use the get_composer() function to get the Composer Autoloader instance, and use the Composer API (https://getcomposer.org/apidoc/master/Composer/Autoload/ClassLoader.html) instead.
  • Thanks this worked perfectly!
  • Actually I think it was still running from the composer version.

    there are 2 vendor folders, which ones does it go in? fuel/vendor or fuel/app/vendor ?
  • So I tried adding the namespace 

    \Autoloader::add_namespace('Parse', APPPATH . 'vendor' . DS . 'parse-php-sdk' . DS . 'src' . DS . 'Parse' . DS, false);

    But the classes can't be found. For example I have an object that extends ParseObject

    class MyObject extends Parse\ParseObject -> class not found 

    what did end up working is adding the parse autoloader to the bootstrap.php file 

    require APPPATH . 'vendor' . DS . 'parse-php-sdk' . DS . 'autoload.php';



Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion