Tutorials: Project Structure
Once installed, framework uses following default file/folder structure:
- composer.json: framework or your project composer dependencies definitions
- configure.php: step-by-step console configurer adapting framework to your project needs
- index.php: bootstrap PHP file that makes framework sole handler of HTTP requests and errors/uncaught exceptions
- stderr.xml: configures STDERR MVC API to manage exception-response flow
- stdout.xml: configures STDOUT MVC API to manage request-response flow
- application: contains your non-static project files (php, html), with following files/folders inside:
- cacheables: contains classes using HTTP Headers API and STDOUT MVC API in order to generate ETag/Last-Modified values
- controllers: contains STDOUT MVC API or STDERR MVC API controllers
- handlers: contains classes that perform as session handlers, useful to maintain state in distributed projects
- NoSQLSessionHandler: binds NoSQL Data Access API in order to handle sessions into a key-value store database.
- listeners: contains STDOUT MVC API event listeners, able to bind logic to application lifecycle events.
- LoggingListener: binds Logging API in order to be able to log messages later on
- SQLDataSourceInjector: binds SQL Data Access API in order to be able to query sql databases later on
- NoSQLDataSourceInjector: binds NoSQL Data Access API in order to be able to query key-value stores later on
- ErrorListener: sets up STDERR MVC API to use same response format as route requested
- SecurityListener: binds Web Security API & OAuth2 Client API in order to be able to authenticate and authorize requests
- LocalizationListener: binds Internationalization API in order to be able to auto translate response into client locale
- HttpHeadersListener: binds HTTP Headers API in order to be able to read, write and validate HTTP headers
- HttpCorsListener: performs CORS validation of current resource in case an OPTIONS request is received and immediately sends response back to client browser.
- HttpCachingListener: performs HTTP caching validation of response based on client request headers, sets headers and updates response accordingly.
- loggers: contains classes using Logging API to log messages on a particular storage medium
- FileLogger: logs messages into files
- SyslogLogger: logs messages using syslog
- models: contains classes and functions that together form your project's PHP business logic, some already provided by framework
- Attributes: a Lucinda\STDOUT\Attributes implementation encapsulating information detected by event listeners above. Developers building new event listeners are expected to add their own here!
- EmergencyHandler: a Lucinda\STDERR\ErrorHandler used for errors encountered while STDERR MVC API is handling
- getRemoteResource: a procedural function that makes it extremely easy to retrieve a resource from an OAuth2 provider.
Loaded by: SecurityListener
- SQL: a procedural function that makes it extremely easy to query an SQL server process results.
Loaded by: SQLDataSourceInjector
- translate: a procedural function that makes it extremely easy to automatically translate sections in views by keyword.
Loaded by: LocalizationListener
- dao: contains data access objects, encapsulating operations with SQL/NoSQL databases
- NoSQLLoginThrottler: binds NoSQL Data Access API in order to use a NoSQL server to store failed login attempts.
Used by: SecurityListener
- SQLLoginThrottler: binds SQL Data Access API in order to use a SQL table to store failed login attempts.
Used by: SecurityListener
- renderers: contains classes using STDERR MVC API to resolve view into response body based on response format
- HtmlRenderer: resolves response for handled exception in html format, using View Language API templating
- JsonRenderer: resolves response for handled exception in json format, using Lucinda\Framework\Json class
- reporters: contains classes binding STDERR MVC API to Logging API in order to report error to a storage medium
- FileReporter: reports errors to files
- SyslogReporter: reports errors to syslog
- resolvers: contains classes using STDOUT MVC API to resolve view into response body based on response format
- HtmlResolver: resolves response for handled request in html format, using View Language API templating
- JsonResolver: resolves response for handled request in json format, using Lucinda\Framework\Json class
- tags: contains View Language API tag libraries, useful in breaking up HTML templates into reusable parts that extend HTML standard
- views: contains View Language API templates (themselves to be broken into sub-templates or tags)
- compilations: contains View Language API compilations of templated views into PHP
- public: contains your static project files (images, js, css)
- vendor: contains APIs pulled based on composer.json above via composer update