Wikimedia SlimApp
Common classes to help with creating an application using the Slim micro framework and Twig template engine.
|
Common classes to help with creating an application using the Slim micro framework and Twig template engine.
The library follows the Twelve-Factor App configuration principle of configuration via environment variables.
The following variables can be optionally provided:
app
)notice
)php://stderr
)data/cache
)localhost
)data/templates
)data/i18n
)en
)SetEnv LOG_LEVEL debug SetEnv CACHE_DIR /var/cache/twig SetEnv DEFAULT_LANG es
For environments where container based configuration isn't possible or desired, a .env
file can be placed in the root of the project. This file will be parsed using PHP's parse_ini_file()
function and the resulting settings will be injected into the application environment.
LOG_LEVEL=debug CACHE_DIR=/var/cache/twig DEFAULT_LANG=es
Code review process is done through Gerrit. To start hacking on the application refer to the Gerrit Tutorial.
Base Class for data access objects
This class contains common methods for performing SQL operations and handling nested transactions.
Page Controller
This class contains common methods for setting default data, getting flash messages and handling undefined methods.
Class for collecting and validating users' data
This class contains common methods for getting users' data, validating it and getting error messages in case of invalid data.
Based on code developed for the Wikimania Scholarships application and the Wikimedia Grants Review application.