⬆️ ⬇️

CMS Diem Introductory Overview

Half a year ago I learned from a colleague about this CMS and she was very interested in me, recently got around in my hands to rummage, I hasten to share my impressions with habrazhitelemi and habragosti.



Briefly about the main thing







Detailed description and screenshots below

')

Server requirements







Additional requirements: APC, mbstring, graphviz, PHP! = 5.2.9



Actually, for a simple site, standard virtual hosting will go; for projects with a load, use VDS with APC installed



Charms diem



First, Diem as an application written in the symfony-framework preserves the entire development structure:

yml - configuration, built-in cache, unit-tests, three-level structure of templates (layout - module template, partial template)



Secondly, Diem has its own code management logic, naming notation , built-in search system , plug-ins for popular tasks, code generation for self-written modules.



Thirdly, in my opinion, the main advantage for the end user is a convenient content administration interface. I will try to tell about it in detail below.



Admin panel



The main admin page looks like this:







We see summary information generated by server logs and google-analytics statistics



In the top panel, there are buttons for creating a new page, updating the cache, a menu, an indicator for using APC, and symfony debugging information (about the duration of the query, the number of database accesses, memory usage, etc.



Impressive, isn't it? And all this is already in the installed version.



To write your own modules, you have your own approach: you describe the database structure and module behavior in a yml file, for example:



// config/doctrine/shema.yml<br/>

Category:<br/>

columns:<br/>

name: { type: string(20), notnull: true }<br/>

body: { type: clob, extra: markdown }<br/>

<br/>

Product:<br/>

columns:<br/>

category_id: { type: integer, notnull: true }<br/>

name: { type: string(15), notnull: true }<br/>

body: { type: clob, extra: markdown }<br/>

image: { type: integer, notnull: true }<br/>

cost: { type: integer(5), notnull: true }<br/>

relations:<br/>

Category:<br/>

foreignAlias: Products<br/>

Image:<br/>

class: DmMedia<br/>

local: image<br/>

onDelete: RESTRICT<br/>

<br/>

// config/dm/modules.yml<br/>

"":<br/>

category:<br/>

model: Category<br/>

page: true<br/>

name: "|"<br/>

admin: true<br/>

front: true<br/>

components:<br/>

list:<br/>

cache: true<br/>

show:<br/>

cache: true<br/>

<br/>

product:<br/>

parent: category<br/>

model: Product<br/>

page: true<br/>

name: "|"<br/>

admin: true<br/>

front: true<br/>

components:<br/>

listByCategory:<br/>

filters: [ category ]<br/>

cache: true<br/>

show:<br/>

cache: true<br/>

showLittle:<br/>

cache: true




Run from the console ./symfony dm: setup and ...



The script generates the necessary modules, actions and templates according to the specified scheme and you can already see in the admin section a section for managing goods







Based on the list and show keywords, templates are generated for viewing products as a list and a single display ...



Impressive even more?



Then wait for the continuation of articles ...



Lastly, a few screenshots, about which I do not have time to write in detail:





Editing the feedback form (again, the form is generated by the yml settings), it remains to impose a css design and the form is ready for use (validation, writing to the database, displaying in the admin area ensures diem)



It remains to drag the shape of the mouse in the right place of the site and all.





In the left tab «pages», as you can guess, the site structure is hidden: used when editing menus, for quick navigation, filling in directories, etc.



References:

Project site

Sites created on cms-diem

Website development on cms-diem



For interested people, I suggest to unite to create an adapted version for the RuNet with an expanded set of ready-made modules (for example, a photo gallery, an online store, integration with yandex-statistics ...)



Who wants to "play" - installation guide



UPD1: see how much Diem eats memory



with debug enabled and default settings

memory_usage = 15653864

memory_peak_usage = 15837840


total ~ 15Mb



in normal mode (without debugging) and standard settings

memory_usage = 14266416

memory_peak_usage = 14338544


total ~ 14Mb (1Mb eats debag)



with swift_mailer turned off (as advised by symfony developers to improve performance)

also around ~ 14Mb

(swift mailer was not called anywhere - autoload did not load anything, we eat the same amount of memory)



we include a cache of pages:

memory_usage = 6275864

memory_peak_usage = 6275864


total ~ 6Mb (save another 8Mb + minimizing queries to the database)



interesting to compare with Joomla and Drupal

Source: https://habr.com/ru/post/115362/



All Articles