print Scorpio Configuration Files

MVC Site Configuration

The MVC system has additional configuration parameters over the system level settings. While most system settings could be placed within a site config, it is discouraged.

The MVC site config is in the exact same format as the main system config with sections and params and has full support of overridable components. There are a couple of differences though:

  1. MVC config files are inherited from the parent e.g. base -> baseAdminSite -> myAdminSite
  2. The site config must ALWAYS specify the parent site
  3. It must always specify the site status (active : 1 / 0)
  4. If a theme is NOT overridable (e.g. baseAdminSite) it must NOT appear in the config file.

The main MVC settings are listed in the table below.

SectionParamDescription
site   The main site configuration

parent
The parent site folder name

active
Is this site active

uriTextSeparator
The URI text character separator (- or _)

theme
The theme in use by this site, located in /base/themes

templateEngine
The template engine in use by the site if not the default Smarty engine. This must be a valid engine listed in mvcViewEngineFactory

controllerMapFilename
The name of the controllerMap file
default: controllerMap.xml

controllerMap
The full path to the controller map file (automatically generated)

defaultController
If no request is made, this is the default controller to route the request too e.g. home

path
The path to this site (automatically generated)
  alwaysPreloadSiteClasses* Enable or disable pre-loading of custom classes during the distributor start-up (default true)
  autoloadCacheEnabled* Enable the caching of controller class and library data, may improve performance (default true)
  autoloadCacheAutoSave* Enable or disable the registering of a shutdown handler that will automatically commit changes to the autoload cache back to the file system (default true)
  cacheStaticPages Should static pages be cached (default true)
  logLevel Site specific logLevel, should be on the valid logLevels from systemLogLevel. (default 8 - warning)
  useCaptchaOnLoginForms If true, will use a captcha on admin login forms or on sites that are configured to support this option. (default true)
     
plugins
  Plugins options
  libraryPath
The path to the plugins library files, used within the mvcAutoload system
     
classes
  Additional classes that should be loaded at engine start up, each parameter is a class name with the parameter being the name of the file containing that class. These classes should be located within the libraries folder of the site.
  className
Example entry. className.class.php

mvcController
The main site specific mvcController class

mvcSession
The site specific session class

mvcView
The site specific view class

mvcViewGeneric
A generic view class not inheriting from mvcViewBase
     


These options are used with the admin system to make it easier to build admin controllers for Data Access objects.

mvcDaoController
Data Access Object Controller class, used in the baseAdminSite for handling requests to DAO objects

mvcDaoModel
Data Access Object Model class; contains logic for the handling of DAO classes in a model context

mvcDaoView
Data Access Object View class; contains the logic for generating the various views for DAO objects
     
i18n   Internationalisation options
  active Is the internationalisation layer active on the site (default false, 0)
  identifier The markup identifier used for declaring text to be translated. For Smarty this is the tag (default t), for PHP templates, this is the function or method name.
  defaultLanguage The default language specified as a valid systemLocale e.g. en, eng_GB, en_US de_DE etc.
  adaptor The name of the translateAdaptor engine to use for reading translation files. This should be the trailing name e.g. array, ini, tmx, qt. (default array)
  adaptorOptions A string of pipe (|) separated options for the adaptor e.g. param=value|Param2=value2 (default disableNotices=true|scan=directory)
     
distributorPlugins   Enable or disable distributor plugins. Plugins are enabled as needed, but can be disabled on a per site basis
  mvcDistributorPluginLog Enable site specific logs, 0 (zero) to disable. 
  mvcDistributorPluginSession Enable session support for a site, 0 (zero) to disable
  mvcDistributorPluginDetectDevice Enables mobile device detection and output mapping
  mvcDistributorPluginLocale Enables locale support via session, get, request etc.
     
captcha   Settings for the captcha controller
  width Width of captcha image in pixels
  height Height of captcha image in pixels
  length The length of the captcha string (default 6 characters)
     
login   Settings for the admin system login restriction system
  maxDailyLoginAttempts The number of failed logins before an account is locked for the day

*Warning: it is possible to break a site by mis-using these options. If you set to NOT pre-load classes in and then use custom libraries during initialisation your site will fail - possibly silently. Only disable it if you either do not make use of custom libraries (e.g. mvcSession, mvcController etc) or if you have an MVC autoload cache already set with these entries.

mvcAutoload cache files can be generated via the scorpio.php CLI tool.