\midcom_config

Core configuration defaults.

As always, you must not change this file. Instead, you have two levels of customization, merged in the order listed here:

Site-specific configuration:

MidCOM will include the file midcom::get()->config->get('midcom_config_basedir') . /midcom.conf which must be a regular PHP file. You may populate the global array $midcom_config_site in this file. It should list all options that apply to all installations (like the Cache backend selection or the indexer host).

Example:

$GLOBALS['midcom_config_site']['cache_module_content_backend'] = ['directory' => 'content/', 'driver' => 'sqlite'];

Instance-specific configuration:

After including the site itself, MidCOM also merges the contents of the global array $midcom_config_local, which may hold configuration data for the website itself.

These settings must be set for all sites:

  • midcom_root_topic_guid

You will usually include these lines somewhere before actually including MidCOM.

$GLOBALS['midcom_config_local']['midcom_root_topic_guid'] = '123456789...';

Configuration setting overview:

The following configuration options are available for the MidCOM core along with their defaults, shown in alphabetical order:

Authentication configuration

  • boolean allow_sudo: Set this to true (the default) to allow components to request super user privileges for certain operations. This is mainly used to allow anonymous access to the system without having to store a user account everywhere.
  • string auth_backend: The authentication backend to use, the "simple" backend is used as a default.
  • boolean auth_check_client_ip: Control whether to check the client IP address on each subsequent request when authentication a user. This is enabled by default as it will make session hijacking much harder. You should not turn it off unless you have very good reasons to do.
  • int auth_login_session_timeout: The login session timeout to use, this defaults to 3600 seconds (1 hour). Use 0 to have the session stay active until manual logout
  • string auth_frontend: The authentication frontend to use, the "form" frontend is used by default.
  • int auth_login_form_httpcode: HTTP return code used in MidCOM login screens, either 403 (403 Forbidden) or 200 (200 OK), defaulting to 403.
  • boolean auth_openid_enable: Whether to enable OpenID authentication handled with the net.nemein.openid library

Authentication Backend configuration: "simple"

  • auth_backend_simple_cookie_secure: Set the "secure" flag on cookie, defaults to true, applies only when actually using SSL/TLS
  • auth_backend_simple_cookie_id: The ID appended to the cookie prefix, separating auth cookies for different sites. Defaults to 1.
  • auth_backend_simple_cookie_path: Controls the valid path of the cookie, defaults to midcom_connection::get_url('self').
  • auth_backend_simple_cookie_domain: Controls the valid domain of the cookie. If it is set to null (the default), no domain is specified in the cookie, making it a traditional site-specific session cookie. If it is set, the domain parameter of the cookie will be set accordingly.

Cache configuration

  • array cache_autoload_queue: The cache module loading queue during startup, you should normally have no need to change this (unless you want to add your own caching modules, in which case you have to ensure that the loading queue of MidCOM itself (as seen in this file) is not changed.

  • string cache_base_directory: The directory where to place cache files for MidCOM. This defaults to /tmp/ (note the trailing slash) as this is writable everywhere.

  • Array cache_module_content_backend: The configuration of the content cache backend. Check the documentation of midcom_services_cache_backend of what options are available here. In general, you should use this only to change the backend driver. In all other cases you should leave this option untouched. The defaults are to store all cache databases into the 'content/' subdirectory of the cache base directory.

  • string cache_module_content_name: The identifier, the content cache should use for naming the files/directories it creates. This defaults to a string constructed out of the host's name, port and prefix. You should only change this if you run multiple MidCOM sites on the same host.

  • boolean cache_module_content_uncached: Set this to true if you want the site to run in an uncached mode. This is different from cache_disable in that the regular header preprocessing is done anyway, allowing for browser side caching. Essentially, the computing order is the same (no_cache for example is considered like usual), but the cache file is not stored. This defaults to false.

  • string cache_module_content_headers_strategy: Valid values are
    'no-cache' activates no-cache mode that actively tries to circumvent all caching
    'revalidate' is the default which sets 'must-revalidate' and presses the issue by setting Expires to current time
    'public' and 'private' enable caching with the cache-control header of the same name, default expiry timestamps are generated using the cache_module_content_default_lifetime

  • int cache_module_content_default_lifetime: How many seconds from now to set the default Expires header to, defaults to 15 minutes. Also used as default expiry time for content-cache entries that have no expiry set.

  • string cache_module_content_headers_strategy_authenticated: Defaults to 'private', this is equivalent to cache_module_content_headers_strategy but applies when we have authenticated user.

  • int cache_module_content_default_lifetime_authenticated: defaults to 0, equivalent to cache_module_content_default_lifetime but applies to authenticated users (except this does not set content-cache expiry). These two options are added to combat braindead proxies.

  • string cache_module_content_caching_strategy: Valid values are
    'user' the "classic" mode, per user content-cache, default
    'memberships' cache per group memberships (users that have same memberships share same cache), for many cases this should offer more performance and smaller cache but if you use per-user privileges or other user specific processing this will cause hard-to-debug issues
    'public' everything goes to single public cache, disabling logins altogether will likely be safer.

  • Array cache_module_nap_backend: The configuration of the nap/metadata cache backend. Check the documentation of midcom_services_cache_backend of what options are available here. In general, you should use this only to change the backend driver. In all other cases you should leave this option untouched. The defaults are to store all cache databases into the 'nap/' subdirectory of the cache base directory. The databases are named after the root topic guid, which should be sufficient in all cases. If you really want to separate things here, use different directories for the backends.

  • string cache_module_memcache_backend: The cache backend to use for the memcache caching module. The default is null, which disables the module entirely. This is the default. If you have both memcached and the memcached PHP extension installed, set this to 'memcached', to enable the cache.

  • Array cache_module_memcache_backend_config: The backend configuration to use if a backend was specified. See the individual backend documentations for more information about the allowed option set. This defaults to an empty array.

  • Array cache_module_memcache_data_groups: The data groups available for the memcache module. You should normally not have to touch this, see the memcache module documentation for details. This defaults to ['ACL', 'PARENT'].

See also midcom_services_cache, the midcom_services_cache_backend class hierarchy and the midcom_services_cache_module class hierarchy.

Indexer configuration

  • string indexer_index_name: The default Index to use when indexing the website. This defaults to a string constructed out of the host's name, port and prefix. You should only change this if you run the same MidCOM site across multiple hosts.
  • string indexer_backend: The default indexer backend to use. This defaults to the false, indicating that no indexing should be done. Right now, the SOLR backend is recommended.
  • indexer_reindex_allowed_ips: Array of IPs that don't need to basic authenticate themselves to run MidCOM reindexing or cron.

Indexer backend configuration: SOLR module

  • string indexer_xmltcp_host: The host name or IP address where the indexer daemon is running. This defaults to "tcp://127.0.0.1", which is the default bind address of the daemon.
  • int indexer_xmltcp_port: The port to which to connect. This defaults to 8983, which is the default port of the daemon.

Logging configuration

  • string log_filename: The filename to dump logging messages to, this defaults to /tmp/debug.log.
  • int log_level: The logging level to use when starting up the logger, set to MIDCOM_LOG_ERROR by default. You cannot use the MIDCOM* constants when setting micdom_config_local, as they are not defined at that point. Use 0 for CRITICAL, 1 for ERROR, 2 for WARNING, 3 for INFO and 4 for DEBUG level logging.
  • array error_actions: Actions to run when a specific error code is produced. This can be used for saving logs about 404 errors from broken links, or sending an error 500 to webmaster for analysis.

    Configuration example:

$GLOBALS['midcom_config_local']['error_actions'] = array ( 500 => array ( 'action' => 'email', 'email' => 'webmaster@example.net', ), 404 => array ( 'action' => 'log', 'filename' => '/var/log/broken_links.log', ), );

MidCOM Core configuration

  • GUID midcom_root_topic_guid: This is the GUID of the topic we should handle. This must be set on a per-site basis, otherwise MidCOM won't start up.
  • string midcom_sgconfig_basedir: The base snippetdir where the current sites' configuration is stored. This defaults to "/sitegroup-config" which will result in the original default shared sitegroup-wide configuration.
  • string midcom_site_url: The fully qualified URL to the Website. A trailing slash is required. It defaults to '/'. If an absolute local URL is given to this value, the full URL of the current host is prefixed to its value, so that this configuration key can be used for Location headers. You must not use a relative URL. This key will be completed by the MidCOM Application constructor, before that, it might contain a URL which is not suitable for relocations.
  • string midcom_tempdir: A temporary directory that can be used when components need to write out files. Defaults to '/tmp'.
  • mixed midcom_max_memory: The maximum memory limit to use doing resource-intensive tasks like when reindexing the entire site, which can require quite some amount of memory, as the complete NAP cache has to be loaded and binary indexing can take some memory, too. Defaults to -1.
    • mixed midcom_max_execution_time: The maximum execution time for resource-intensive tasks
    • array midcom_components: Additional out-of-tree components as name => path pairs

RCS system

string midcom_services_rcs_bin_dir: the prefix for the rcs utilities (default: /usr/bin) string midcom_services_rcs_root : the directory where the rcs files get placed. (default: must be set!) boolean midcom_services_rcs_enable: if set, midcom will fail hard if the rcs service is not operational. (default: false)

Style Engine

  • Array styleengine_default_styles: Use this array to set site-wide default styles to be used for the components. This is an array indexing component name to style path. Components not present in this array use the default style delivered with the component. Any style set directly on a topic or inherited to it will override these settings. This defaults to an empty Array.

Toolbars System

The CSS classes and IDs used by the toolbars service can be configured using these options:

  • string toolbars_host_style_class: defaults to "midcom_toolbar host_toolbar"
  • string toolbars_host_style_id: defaults to ""
  • string toolbars_node_style_class: defaults to "midcom_toolbar node_toolbar"
  • string toolbars_node_style_id: defaults to ""
  • string toolbars_view_style_class: defaults to midcom_toolbar view_toolbar
  • string toolbars_view_style_id: defaults to ""
  • string toolbars_object_style_class: defaults to midcom_toolbar object_toolbar
  • string toolbars_simple_css_path: this defaults to MIDCOM_STATIC_URL/midcom.services.toolbars/simple.css and is used to set the css for the toolbars used with onsite editing.
  • boolean toolbars_enable_centralized: defaults to true, whether to enable the centralized, javascript-floating MidCOM toolbar that users can display with midcom::get()->toolbars->show();

Utility Programs

The various paths set here lead to the utility programs required by MidCOM, both mandatory and optional applications are listed here. To indicate that a certain application is unavailable, set it to null. The defaults assume that the files are within the $PATH of the Apache user and should be sufficient in most cases. Package maintainers are encouraged to make the paths explicit.

  • string utility_imagemagick_base: The base path of the ImageMagick executables, the tools mogrify, identify and convert are needed for almost all kinds of image operations in MidCOM and have to be present therefore. The path entered here requires a trailing slash.
  • string utility_jpegtran: JPEGTran is used to do lossless rotation of JPEG images for automatic EXIF rotation in n.s.photos for example. If unavailable, there is an automatic fallback to imagemagick.
  • string utility_catdoc: Transforms Word Documents into text for indexing.
  • string utility_pdftotext: Transforms PDF Documents into text for indexing.
  • string utility_unrtf: Transforms RTF Documents into text files for indexing.

Visibility settings (NAP and DBA)

  • boolean show_hidden_objects: This flag indicates whether objects that are invisible either by explicit hiding or by their scheduling should be shown anyway. This defaults to true at this time
  • boolean show_unapproved_objects: This flag indicates whether objects should be shown even if they are not approved. This defaults to true.

Summary

Methods
Properties
Constants
__construct()
get()
set()
offsetSet()
offsetExists()
offsetUnset()
offsetGet()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_complete_defaults()
$_default_config
$_merged_config
N/A

Properties

$_default_config

$_default_config : 

Type

$_merged_config

$_merged_config : 

Type

Methods

__construct()

__construct() 

get()

get(  $key,   $default = null) 

Parameters

$key
$default

set()

set(  $key,   $value) 

Parameters

$key
$value

offsetSet()

offsetSet(  $offset,   $value) 

Parameters

$offset
$value

offsetExists()

offsetExists(  $offset) 

Parameters

$offset

offsetUnset()

offsetUnset(  $offset) 

Parameters

$offset

offsetGet()

offsetGet(  $offset) 

Parameters

$offset

_complete_defaults()

_complete_defaults()