Skip to content
Github mirror of "wikimedia/slimapp" - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitattributes
.gitignore
.gitreview
.travis.yml
COPYING
Doxyfile
README.md
composer.json
composer.lock
phpcs.xml
phpunit.xml.dist

README.md

Wikimedia SlimApp

Common classes to help with creating an application using the Slim micro framework and Twig template engine.

System Requirements

  • PHP >= 5.5.9

Configuration

The library follows the Twelve-Factor App configuration principle of configuration via environment variables.

The following variables can be optionally provided:

  • LOG_CHANNEL = Logger name (default: app)
  • LOG_LEVEL = PSR-3 logging level (default: notice)
  • LOG_FILE = fopen()-compatible filename or stream URI (default: php://stderr)
  • CACHE_DIR = Directory to cache twig templates (default: data/cache)
  • SMTP_HOST = SMTP mail server (default: localhost)
  • TEMPLATE_DIR = Twig template directory (default: data/templates)
  • I18N_DIR = i18n data file directory (default: data/i18n)
  • DEFAULT_LANG = Default i18n lanaguage (default: en)

Apache

SetEnv LOG_LEVEL debug
SetEnv CACHE_DIR /var/cache/twig
SetEnv DEFAULT_LANG es

.env file

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

Authors

  • Bryan Davis, Wikimedia Foundation
  • Niharika Kohli, Wikimedia Foundation

Based on code developed for the Wikimania Scholarships application and the Wikimedia Grants Review application.

License

GNU GPL 3.0+

You can’t perform that action at this time.