Services

All Diem services can be extended and replaced

This is one of the greatest diem features.
Every part of Diem is called a service. And you can replace and extend each of them.
Want to change the way Diem detect browsers ? Replace the browser service by your own.

Learn about the Symfony Dependency Injection Container

Core

The core services can be used in both admin and front application.
To extend them, use the config/dm/services.yml file.
The original services.yml can be found in dmCorePlugin/config/dm/services.yml.

markdown

Responsible for parsing markdown text and generating HTML.

  • auto_header_id(bool) whether to generate automatic header ids, based on header text and previous headers structure.

file backup

Responsible for saving a copy of files edited. All files modified with a Diem code editor are backuped.

  • dir(string) where to save files, relative to project root directory. Defaults to data/dm/backup/filesystem

mail

Responsible for building an email from a DmMailTemplate and a data array, then pass it to Swift.
This service is not yet ready for usage

thread_launcher

Responsible for launching background tasks using an internal shell.

  • cli_file(string) where to write the task bootstrap, relative to the project root directory

page_synchronizer

Responsible for adding, updating and removing pages when the site content changes.

seo_synchronizer

Responsible for updating pages metas when the site content changes.

cache_cleaner

Responsible for clearing the cache automatically when the site content changes.

  • applications(array) applications whose cache should be cleared
  • environments(array) environments whose cache should be cleared
  • safe_models(array) when a instance of this models is created/updated/deleted, the cache is NOT cleared.

form_field

Represents a field in a form. Allows chainability in form template helpers.

script_name_resolver

Responsible for finding applications bootstrap urls. Allows to make a link to the site from the admin, and a link to admin from the site.

error_watcher

Responsible for listening the "application.throw_exception" events and make something with the errors.

  • error_description_class(string) class used to describe an error
  • mail_superadmin(bool) send mail to superadmin ( uses superadmin's email )
  • store_in_db(bool) store error in database

media_tag_image

Responsible for rendering tags with the £media helper. Configurable from the graphical configuration panel.

media_tag_flash

Responsible for rendering flash objects with the £media helper. Not ready yet, you should extend it if you need it.

media_tag_video

Responsible for rendering video with the £media helper. Not ready yet, you should extend it if you need it.

media_tag_audio

Responsible for rendering audio with the £media helper. Not ready yet, you should extend it if you need it.

media_resource

Ressource for a media_tag_*

table_tag

Responsible for rendering HTML tables with the £table helper

search_engine

Responsible for managing search indices and provide a handfull programming interface.

search_index

Responsible for maintaining and querying an index ( for example, the "en" index )

search_page

Responsible for indexing a page

theme

Responsible for managing a CSS theme

stylesheet_compressor

Responsible for minifying, merging and compressing stylesheets

  • minify(bool) whether to minify code
  • gz_compression(bool) whether to compress with gzip

javascript_compressor

Responsible for minifying, merging and compressing javascripts

  • minify(bool) whether to minify code
  • gz_compression(bool) whether to compress with gzip

auth_layout_helper

Responsible for rendering the authentication page layout

cache_manager

Responsible for managing cache

  • meta_cache_class(string) class for metacache ( use file cache or apc cache depending on server )

filesystem

Extension of sfFilesystem

event_log

Responsible for logging all notable events

  • name(string) the log visible name
  • file(string) where to save the log file, relative to project root directory
  • entry_service_name(string) service name for an entry of this log
  • rotation(bool) enable rotation on the log file ( strongly recommended )
  • max_size_megabytes(float) max size for the log file before rotating
  • ignore_models(array) models not to log
  • ignore_internal_actions(bool) whether to ignore Diem internal actions

event_log_entry

An entry of the event log

request_log

Responsible for logging all requests

  • name(string) the log visible name
  • file(string) where to save the log file, relative to project root directory
  • entry_service_name(string) service name for an entry of this log
  • rotation(bool) enable rotation on the log file ( strongly recommended )
  • max_size_megabytes(float) max size for the log file before rotating

request_log_entry

An entry of the request log

browser

Responsible for detecting user browser depending on its user agent

page_tree_watcher

Responsible for listening all events that may require a page synchronization, and launch the synchronization if any before redirections.

  • use_thread( auto, true, false ) whether to launch heavy synchronization tasks on another process

helper

Object oriented template helper.

  • use_beaf(bool) whether to use the "before-after" functionality on £ helper

widget_type_manager

Responsible for managing widget types.

Admin

The admin services can only be used in admin application.
To extend them, use the apps/admin/config/dm/services.yml file.
The original services.yml can be found in dmAdminPlugin/config/dm/services.yml.

bread_crumb

Responsible for building and rendering the admin automatic breadcrumbs.

log_chart

Responsible for rendering the log chart.

  • name(string) public name for this chart
  • lifetime(int) time in seconds to keep a cached version of the chart

week_chart

Responsible for rendering the week chart.

  • name(string) public name for this chart
  • lifetime(int) time in seconds to keep a cached version of the chart

visit_chart

Responsible for rendering the visit chart.

  • name(string) public name for this chart
  • lifetime(int) time in seconds to keep a cached version of the chart

content_chart

Responsible for rendering the content chart.

  • name(string) public name for this chart
  • lifetime(int) time in seconds to keep a cached version of the chart

browser_chart

Responsible for rendering the browser chart.

  • name(string) public name for this chart
  • lifetime(int) time in seconds to keep a cached version of the chart

gapi

Responsible for fetching data from google analytics.

Responsible for rendering admin link tags with the £link helper.

asset_config

Responsible for loading required assets.

admin_sort_table_form

Generic form to sort a table.

admin_sort_referers_form

Generic form to sort table's referers.

layout_helper

Responsible for rendering the admin layout.

admin_menu

Responsible for building and rendering the admin menu.

sitemap

Responsible for generating and saving an automatic sitemap.xml.

  • file(string) where to save the file, relative to web directory

Front

The front services can only be used in front application.
To extend them, use the apps/front/config/dm/services.yml file.
The original services.yml can be found in dmFrontPlugin/config/dm/services.yml.

html_sitemap

Responsible for building and rendering an HTML sitemap. Not to be confused with the xml sitemap, the HTML one is intended to be displayed on the site.

page_not_found_handler

Responsible to redirect or forward the user when the request page is not found.

form_manager

Responsible for creating and managing front forms.

doctrine_pager

Responsible for paginating the front doctrine collections, and rendering the pagination links.

Responsible for rendering a link tag to a record with the £link helper. Configurable from the graphical configuration panel.

Responsible for rendering a link tag to a DmPage instance with the £link helper. Configurable from the graphical configuration panel.

Responsible for rendering a link tag to a DmMedia instance with the £link helper. Configurable from the graphical configuration panel.

Responsible for rendering a link tag to a symfony action with the £link helper. Configurable from the graphical configuration panel.

Responsible for rendering a link tag to an external uri with the £link helper. Configurable from the graphical configuration panel.

Responsible for rendering a link tag to an exception with the £link helper. Configurable from the graphical configuration panel.

Ressource for a link_tag_*.

asset_config

Responsible for loading required assets.

theme_manager

Responsible for managing available themes.

widget_view

Responsible for rendering a widget.

layout_helper

Responsible for rendering the front layout.

page_helper

Responsible for rendering the front content.

widget_renderer

Responsible for rendering widgets.

  • config_file(string) path to the widget type configuration file, relative to the project directory

Questions and Feedback

If you need support or have a technical question, you can

  • Post to the google group
  • Come and chat on the #diem IRC channel on freenode