Directory Structure

The default installation of Concrete5 is setup in the following manner. (The root directory in these examples corresponds to the root of your Concrete5 website. These examples also assume you are running one website, and not sharing the Concrete5 core amongst several sites.)

application/

This is the application directory. It includes all items that are specific to this single website. In general, items in the application/ directory that also appear in the concrete directory override those in the concrete directory.

concrete/

This is the concrete source directory. When a new version of Concrete5 is downloaded this is the directory that contains most of the core files.

packages/

This directory contains sub-directories in the Package format. These are either custom-built packages or (more likely) packages that have been downloaded from the concrete5.org marketplace.

updates/

This directory contains additional Concrete5 core directories. These may be downloaded using the built-in Concrete5 updater (found in the Dashboard), or they may have been put in this directory manually. If a file named update.php appears in application/config, its contents will determine which core from the updates/ directory to use to currently power the website.

Concrete5 Source Directories

concrete/attributes/

This directory contains all the Attribute Types found in Concrete5 by default. These are activated in the database before they can be used. This happens during installation or upgrade.

concrete/authentication/

This directory contains all the Authentication Types found in Concrete5 by default. These are installed during installation.

concrete/blocks/

This directory contains all the Block Types found in Concrete5. These are activated in the database before they can be used. This happens during installation or upgrade.

concrete/bootstrap/

This directory contains PHP procedures that are run during startup of Concrete5. Examples include bootstrap/autoload.php (which, when included sets up all PHP autoloaders), bootstrap/helpers.php (which creates some useful global functions like array_to_object(), h() and t()) and bootstrap/start.php, which starts the actual bootstrapping process.

concrete/config/

This directory contains core configuration data. This data is read and saved by the Config library. Files in here contain the default configuration values for the various keys. The contents of each of these files is an associative array.

concrete/config/doctrine/

This directory contains PHP proxy classes generated by the built-in Doctrine ORM library. These are not something most developers need to worry about.

concrete/config/install/

This directory contains the Starting Point Packages used as sample content, available during installation.

concrete/controllers/

This directory contains controllers. In Concrete5, controllers can be run in three ways.

  1. As specified by routes to a specific URL.
  2. Automatically when a single page is rendered.
  3. Automatically when a page of a certain type is rendered.

concrete/controllers/single_page

All controllers in here are automatically loaded when a single page at the same path is loaded.

concrete/controllers/page_types/

All controllers in here correspond to the handle of a specific page type. Whenever a page of that type is loaded, a controller will also be loaded and run, if it exists.

Everything Else

All other controllers in the controllers/ directory are used by specific administrative routes. You can see how these routes and controllers interact by looking at the routes section of concrete/config/app.php

concrete/css

This directory contains minified, compiled CSS used by Concrete5.

concrete/css/build/

This directory contains unbuilt source LESS files, compiled by Concrete5 using Grunt during the build process. This happens prior to shipping a working Concrete5, and is not something end users have to understand or care about.

dispatcher.php

This is the main Concrete5 dispatcher file. It is included by the index.php file in the web root.

concrete/elements

The elements directory contains snippets of PHP code reused by Concrete5.

concrete/images

This directory contains images used by Concrete5.

concrete/jobs

This directory contains PHP classes that correspond to installed Concrete5 Jobs. Each Job is a self-contained PHP class with certain required methods.

concrete/js

This directory contains minified, compiled JavaScript used by Concrete5.

concrete/js/build/

This directory contains unminified source JavaScript files, compiled by Concrete5 using Grunt during the build process.

concrete/mail

This directory contains mail templates. These are used by the Mail Service.

concrete/single_pages

This directory contains single pages used by Concrete5. These are activated during installation.

concrete/src/

This directory contains all PHP classes used by Concrete5, separated into directories based on function. Important Note: every file and directory up to this point has been named using Concrete5's lowercase handle format. Once in the src/ directory things change, and directories and classes are camelcased (with the first letter being uppercased).

concrete/themes/

This directory contains all themes that ship with Concrete5. A theme must be activated on installation in order for it to appear in the installed themes list.

concrete/tools

This directory contains tools scripts that are used by certain user interface elements of Concrete5. These are officially deprecated in favor of views and controllers, but have not completely been phased out yet.

concrete/vendor

This directory contains third party libraries used by Concrete5. These libraries are installed during the build process of Concrete5 using Composer.

concrete/views

This directory contains views used by Concrete5's MVC layer. These views are specified by controllers in the controllers directory.

Application Directory

application/attributes

This directory contains attributes used just by this Concrete5 installation – or overrides of Concrete5 core attribute files.

application/authentication

This directory contains authentication types used just by this Concrete5 installation – or overrides of Concrete5 core authentication type files.

application/blocks

This directory contains block type code files used just by this Concrete5 installation – or overrides of Concrete5 core block type files.

application/bootstrap/app.php

This file is an optional file that developers can use to register events, rebind PHP classes, and more. This file is automatically loaded during the Concrete5 bootstrap routine.

application/bootstrap/autoload.php

This file is loaded during the Concrete5 bootstrap routine. It takes care of loading composer items (found in concrete/vendor/) and any custom autoloading necessary for the application.

application/bootstrap/start.php

This file is loaded during the Concrete5 bootstrap routine. This file enables environment detection and custom application environments.

application/controllers

This directory contains controllers used just by this Concrete5 installation – or overrides of Concrete5 core controller files.

application/elements

This directory contains elements used just by this Concrete5 installation – or overrides of Concrete5 core elements.

application/files

This directory contains files uploaded to this Concrete5 installation. Concrete5's file importer class manages this directory.

application/files/thumbnails

This directory contains image thumbnails generated automatically for files uploaded to Concrete5. The file manager uses some of these thumbnails but new image thumbnail types will automatically place their generated thumbnails in this directory.

application/files/incoming

Files uploaded to this directory are available for import into the file manager in the Dashboard. This can be useful when attempting to upload large files is failing through a browser.

application/files/cache

Internal Concrete5 cache files are written here. Generally, it is safe to delete this directory entirely if troubleshooting a problem in a Concrete5 installation.

application/jobs

This directory contains job classes used just by this Concrete5 installation – or overrides of Concrete5 core job classes.

application/languages

This directory contains language files used by Concrete5. These are populated during the build of Concrete5.

application/mail

This directory contains email templates used just by this Concrete5 installation – or overrides of Concrete5 email templates.

application/single_pages

This directory contains single page views used just by this Concrete5 installation – or overrides of Concrete5 single page views.

application/src

This directory contains custom PHP classes used by this application, or (in some limited cases) overrides of core Concrete5 PHP classes. Note: this directory obeys the same casing rules as the concrete/src directory.

application/themes

This directory contains custom themes used by this application, or overrides of core Concrete5 themes or components.

application/tools

This directory contains tools used by this application. These are deprecated in favor of routes, controllers and views.

application/views

This directory contains custom views used by this application, or views that override core Concrete5 views.

Loading Conversation