Libraries allow you to compile a set of PHP functions and/or classes which are intended to be accessed from other projects through a specified Application Programming Interface (API).
Build a Library project when you want to:
Library projects may contain any number of source files, including files from multiple directories under the project root. All source files will compile to two main library files: a static and a dynamic library.
On Windows, the files will have the extensions .a (static) and .dll (dynamic).
On Unix, the files will have the extensions .a (static) and .so (dynamic).
There are other files created during a library build. See see Working With Libraries for more information on compiling, using and deploying libraries.
The source files in a library project should contain functions and classes that implement the functionality that should be available to the end developer (or that is to be shared between projects). Normally a list of classes and functions (along with their arguments) are made available in the documentation that accompanies the library.
Using a compiled library is transparent in Roadsend PHP code. To “load” a compiled library, simply include the source code file from the compiled library as if it were a normal include file on disk.
Roadsend PHP will search the compiled libraries that are loaded in the current environment for the requested source file, and use it in its compiled form if found.
Loading a compiled library to the current environment can be done in a number of ways:
pcc -u my-library application.php