- Basic Concepts
- Files and Directory Layout
- Request Processing Overview
- The Application Object
- Generating a Response
- URL Handlers
- Filters and Layout
- Dependency Injection
- Static Resources
- Common Patterns
- Handling Logins
- Deploying Resources
- Asset Storage
- Handling Exceptions
- Dates and Times
- Record Streams
- Modules and Scaffolds
- Http Clients
- Toolkit Classes
- Introduction & Setup
- Creating a custard command
Files and Directory Layout of a Rhubarb Project
All Rhubarb projects look very similar at the root directory level. As Rhubarb favours configuration over convention very few files and directories are actually required by Rhubarb itself and most are just good patterns to follow.
Essential Files and Directories
- The Composer configuration file detailing which modules to download and what autoload class paths to recognise.
- Composer will download Rhubarb, its modules and any other required third-party dependencies here.
- The Composer folder containing any official Rhubarb modules and scaffolds including the main Rhubarb project itself.
Recommended Files and Directories
- You can put your source code in any directory; your projects composer.json simply needs the autoload settings configured correctly. However 'src' is a commonly recognised convention for where a projects source code will be - especially amongst other Composer projects.
- Again unit tests can be in any folder but by convention we usually create a tests folder at the same level as the src folder.
- For a normal project serving a single application often this file will create and configure the root Application object.
- It's good practice to move any settings unique to the deployment of your application into a separate file which is ignored or excluded from version control. Settings like database connections and logging will differ greatly from your development environment to your production environment and keeping these settings out of your project's source control will reduce the chance of deploying development settings into the production environment.
- Static resources used by the layout of your application like images and CSS files can be stored here.
However most files required by PHP classes should be
deployedusing a deployment provider instead.
- Deployed files using the simple
RelocationResourceDeploymentProviderwill end up here.