Jump to:

23456 Posts in 18905 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » The Manifest builder and including custom php libraries

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1507 Views
  • dalesaurus
    Avatar
    Community Member
    283 Posts

    The Manifest builder and including custom php libraries Link to this post

    I am attempting to add an existing PHP library into my SS install. I know the SS Manifest Builder traverses all folders hunting for php files that live in a directory that doesn't have a _manifest_exclude file in it and are not listed in _exclude.php.

    Logic would tell me that I can:

    • 1. Create a library dir: /mysite/lib/
    • 2. Copy my library files into that dir, MyCustomClass.php
    • 3. Rebuild
    • 4. Call MyClassPhp() from anywhere in the php code

    However in my controller when I try to instantiate new MyCustomClass() I get: Fatal error: Class 'MyCustomClass' not found in

    I perused the mainfest builder files and see that SS has indeed found it an produced a manifest file to include it. Is there a problem that I'm missing? Can I not have an arbitrary sub folder under /mysite/ with php? I don't see anywhere that the includes only work on /top-level/code/?

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: The Manifest builder and including custom php libraries Link to this post

    You should be able to use any folder name - not just code. I know for example the Mollom module stores the 3rd party library in /lib/

    Make sure your filename = classname eg if you call your class MyCustomClass then your file must be MyCustomClass.php.

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: The Manifest builder and including custom php libraries Link to this post

    Man, that is totally it. My first post on this forum ended up being the same thing.

    I'm going to go add some comments on the wiki. I know there is a blurb but it isn't stressed very much.

    http://doc.silverstripe.com/doku.php?id=manifestbuilder

    1507 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.