Directory Structure

The default O2Sytem Framework application structure is intended to provide a great starting point for both large and small applications. The framework implements almost no limit on the location of the php class files - as long as the composer or autoloader framework system can detect it. Therefore you should name it by standard php recommendation 4 or often called people PSR-4.

The App Directory

The app directory contains all the source code of your application that is neatly arranged in accordance with the designation of the source code files. By default, this directory is namespaced under App and is autoloaded by Composer and O2System Framework Autoloader using the PSR-4 autoloading standard.

Many of the classes in the app directory can be generated by O2System Console Commands. To review the avaliable commands, runs: php o2system make --help

The Cache Directory

The cache directory is to store all cache files from compiled parser templates, file-based sessions, file-based registry, image manipulation cache, logging files and other cache generated by your application and framework. Each cache file is stored in a folder named after its designation.

The Public Directory

The public directory is serves as your web server / root document, where all publicly accessible files will be placed in this directory such as javascript files, css files, images and other assets. Index.php which serves as the front-controller of your app's http request is located in this directory. The themes used by your application are also located within this directory.

The Storage Directory

Storage directory serves as a place of storage of raw-files or files uploaded from your application.

The Vendor Directory

The vendor directory contains framework and application Composer dependencies.

Last updated