21309 Posts in 5738 Topics by 2603 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, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1217 Views |
-
The Manifest builder and including custom php libraries

14 August 2009 at 5:37am Last edited: 14 August 2009 5:39am
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/?
- 1. Create a library dir: /mysite/lib/
-
Re: The Manifest builder and including custom php libraries

14 August 2009 at 3:32pm
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.
-
Re: The Manifest builder and including custom php libraries

15 August 2009 at 2:24am
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.
| 1217 Views | ||
|
Page:
1
|
Go to Top |


