The directory layout of Stubbles
After installing stubbles, you will see the following directories:
cache => Directory used for caching
config
config/php => PHP based configuration files
config/xml => XML based configuration files
docroot => should contain any files that need to be accessed by the webserver
examples => contains examples that show how features of Stubbles could be used
lib => contains the stubbles archive and other third party libraries
log => this is where the logfiles should go into
src
src/main
src/main/php => place application classes, organized in packages
src/main/resources => other source files that contain no php (xml files for example)
src/test
src/test/php => application test cases and test suites
src/test/resources => other non-php files needed by the test cases
Below the src/main/php and src/test/php all classes are organized in packages. The package net.stubbles is reserved for stubbles classes and should not be used by user application classes.
If an application class MyExample is placed in src/main/php/org/example/MyExample.php it can be loaded via the stubbles class loader: stubClassLoader::load('org.example.MyExample');. See Using the Stubbles class loader for more information about this.
All classes will be loaded with the stubbles class loader, independent from whether they reside in the lib or in the src/main/php directory.
Contents of the lib directory
The lib directory contains the Stubbles archive and other third party libraries. However, starting with release 0.8.0, there will be more then one stubbles archive:
- stubbles.php: the full framework containing all packages and classes and is a self-running star file
- stubbles-core: contains net::stubbles::lang, net::stubbles::php::string and net::stubbles::reflection and is a self-running star file
- stubbles-auth: contains net::stubbles::auth
- stubbles-events: contains net::stubbles::events
- stubbles-ioc: contains net::stubbles::ioc
- stubbles-peer: contains net::stubbles:peer
- stubbles-rdbms: contains net::stubbles::rdbms (including persistence API)
- stubbles-util-cache contains net::stubbles::util::cache
- stubbles-util-log contains net::stubbles::util::log
- stubbles-util-xjconf contains net::stubbles::util::xjconf
- stubbles-website contains net::stubbles::ipo, net::stubbles::service and net::stubbles::websites
- stubbles-xml: contains net::stubbles::xml
Please bear in mind that you only can use either stubbles.php or the single star archives. Therefore you should either delete stubbles.php or the other stubbles-* files. You should also keep in mind that still not all classes and packages that are in stubbles.php can be found inside the other files as we did not finally decide about their correct location yet.
If you only need parts of the framework you may delete all files that are not necessary for your application. Though you should keep in mind that all stubbles-* files require stubbles-core and can not be used without it.
