quidphp/lemur

LemurCMS, a content management system built on top of the QuidPHP framework

5.31.0 2022-07-02 23:30 UTC

This package is auto-updated.

Last update: 2024-11-04 18:54:23 UTC


README

Release License PHP Version Style CI Code Size

About

QuidPHP/Lemur contains the LemurCMS, a content management system built on top of the QuidPHP framework. It is part of the QuidPHP package.

License

QuidPHP/Lemur is available as an open-source software under the MIT license.

Documentation

QuidPHP/Lemur documentation is available at QuidPHP/Docs.

Installation

QuidPHP/Lemur can be easily installed with Composer. It is available on Packagist.

$ composer require quidphp/lemur

Once installed, the Quid\Lemur namespace will be available within your PHP application.

Requirement

QuidPHP/Lemur requires the following:

  • PHP 8.1
  • All requirements of quidphp/core
  • Any modern browser (not Internet Explorer)

Dependency

QuidPHP/Lemur has the following dependencies:

  • quidphp/core - Quid\Core - PHP library that provides an extendable platform to create dynamic applications
  • quidphp/navigation - Javascript module for navigating a website without reloading
  • quidphp/front - JavaScript and CSS assets for basic components
  • quidphp/include - Contains third-party front-end scripts
  • tinymce/tinymce - Tinymce - The world's best JavaScript library for rich text editing

All dependencies will be resolved by using the Composer installation process.

Comment

QuidPHP/Lemur code is commented and all methods are explained (in French).

PHP

Convention

QuidPHP/Lemur is built on the following conventions:

  • Core overloading: This namespace overloads many classes from Quid\Core.
  • Auto-alias: All class names that finishes by Alias will resolve to the existing class if no alias exists. Exemple: MyRole extents RoleAlias -> will resolve to Role if no alias is found.
  • Traits: Traits filenames start with an underscore (_).
  • Type: Files, function arguments and return types are strict typed.
  • Config: A special $config static property exists in all classes. This property gets recursively merged with the parents' property on initialization.
  • Coding: No curly braces are used in a IF statement if the condition can be resolved in only one statement.

Overview

QuidPHP/Lemur contains 205 classes and traits. Here is an overview:

  • Boot - Extended abstract class for the object that bootstraps the cms
  • Cell - Extended class to represent an existing cell within a row
    • Crypt - Extended class for a cell with crypted data
    • Files - Abstract class extended by the media and medias cells
    • JsonArray - Class to manage a cell containing a json array
    • JsonExport - Class for a cell that contains json which should be exported (similar to var_export)
    • JsonRelation - Class to manage a cell containing a relation value to another cell containing a json array
    • Media - Class to work with a cell containing a value which is a link to a file
    • Medias - Class to manage a cell containing a value which is a link to many files
    • Money - Class to manage a cell managing money (money formatted string)
    • Phone - Class for a cell managing phone numbers
    • Primary - Class for dealing with a cell of a column which has an auto increment primary key
    • Relation - Abstract class extended by the enum and set cells
    • Uri - Class to manage a cell containing an URI
    • Video - Class to manage a cell containing a video from a third-party service
  • Cms
    • About - Class for the about popup route of the CMS
    • Account - Class for the account route of the CMS, by default redirects to the user's specific route
    • AccountChangePassword - Class for the change password route in the CMS
    • AccountChangePasswordSubmit - Class for the submit change password route in the CMS
    • ActivatePassword - Class for activating the password in the CMS
    • Calendar - Class for the calendar route of the CMS
    • CliClearAll - Class for a cli route to remove all cached and logged data
    • CliClearCache - Class for a cli route to remove all cached data
    • CliClearLog - Class for a cli route to remove all log data
    • CliCompile - Class for a cli route to compile assets (js and css)
    • CliPreload - Class for a cli route to generate the preload PHP script
    • CliSessionGc - Class for a cli route to remove expired sessions for the CMS
    • CliVersion - Class for the version route of the CMS, accessible via the cli
    • Contact - Class for the contact form route of the CMS
    • ContactSubmit - Class for a contact submit route for the CMS
    • Download - Class for the file download route of the CMS
    • Email - Class for the modal route to confirm the mailto link
    • Error - Class for the error route of the CMS
    • Export - Class for the export popup route of the CMS
    • ExportDownload - Class for the route to generate and download the CSV export for the CMS
    • General - Class for the general navigation route of the CMS
    • GeneralDelete - Class for the route which allows deleting rows from the general navigation page of the CMS
    • GeneralEdit - Class for the route that allows quick editing a cell from the general page
    • GeneralEditSubmit - Class for the route to manage the form to quick edit a cell from the general page
    • GeneralRelation - Class for the route which manages the filters for the general navigation page of the CMS
    • GeneralTruncate - Class for the route which allows truncating a table from the general page of the CMS
    • Home - Class for the home route of the CMS
    • HomeFeed - Class for the route feed of the home page for the CMS
    • HomeFeedRelation - Class for the route which manages table relation, used by some inputs in the CMS
    • Login - Class for the login route of the CMS
    • LoginSubmit - Class for the login submit route of the CMS
    • Logout - Class for the logout route of the CMS
    • PopupBoot - Class for the popup route with the boot information
    • PopupSession - Class for the popup route with the session information
    • Register - Class for the register route of the CMS
    • RegisterSubmit - Class for the register submit route of the CMS
    • ResetPassword - Class for the reset password route of the CMS
    • ResetPasswordSubmit - Class for the submit reset password route of the CMS
    • Robots - Class for the robots.txt route of the CMS
    • Search - Class for the global search route of the CMS
    • SessionRole - Class for the route with the popup to apply a fake role to the current session
    • SessionRoleSubmit - Class for the route to submit and apply a fake role to the current session
    • Sitemap - Class for the automated sitemap.xml route of the CMS
    • Specific - Class for the specific route of the CMS, generates the update form for a row
    • SpecificAdd - Class for the specific add route of the CMS, generates the insert form for a row
    • SpecificAddSubmit - Class for the submit specific add route, to process the insertion of a new row in the CMS
    • SpecificDelete - Class for the specific delete route, to process a row deletion in the CMS
    • SpecificDispatch - Class for the specific dispatch route, directs to the proper dispatch route of the CMS
    • SpecificDuplicate - Class for the specific duplicate route, to process a row duplication in the CMS
    • SpecificMulti - Class for the specific multi route of the CMS, generates the update form for multiple rows
    • SpecificMultiSubmit - Class for the submit multi specific route, to process the update of multiple rows in the CMS
    • SpecificPosition - Class for a route that redirects to the proper specific route according to a position
    • SpecificRelation - Class for the route which manages specific relation - enumSet inputs in the specific form
    • SpecificSubmit - Class for the submit specific route, to process the update of a row in the CMS
    • TableRelation - Class for the route which manages table relation, used by some inputs in the CMS
    • UserWelcome - Class for the user welcome route which can send a welcome email to the user
    • _cli - Trait that provides some initial configuration for a CMS cli route
    • _colRelation - Trait that provides methods related to a column relation
    • _common - Trait that provides commonly used methods for the CMS
    • _export - Trait that provides commonly used methods for exporting data from the CMS
    • _general - Trait that provides commonly used methods related to the general navigation route of the CMS
    • _generalInput - Trait that provides some methods for generating reusable general inputs
    • _generalRelation - Trait that provides methods to make a filter from a relation
    • _generalSegment - Trait that provides some methods for a general navigation page
    • _link - Trait that provides some initial configuration for a CMS link route
    • _module - Trait that provides some initial configuration for a CMS module route
    • _nobody - Trait which provides commonly used methods for routes where the user is not logged in the CMS
    • _page - Trait that provides some practical methods to work with page route within the CMS
    • _popup - Trait that provides some initial configuration for a CMS popup route
    • _relation - Trait that provides some initial configuration for a CMS relation route
    • _specific - Trait that provides commonly used methods for the specific routes of the CMS
    • _specificAddMulti - Trait that provides common methods between the specificAdd and specificMulti routes
    • _specificNav - Trait that provides a method for the specific navigation
    • _specificRelation - Trait that provides methods to make an enumSet input
    • _specificSubmit - Trait that provides commonly used methods for the specific submit routes of the CMS
    • _tableRelation - Trait that provides methods for a table relation selector
    • _template - Trait that grants the methods to generate the CMS HTML template
  • Col - Extended class to represent an existing column within a table, adds cms config
    • Auto - Class for the auto column, generate value automatically using the data from other cells
    • ContextType - Class for the contextType column, a checkbox set relation with all boot types
    • Crypt - Extended class for a column with crypted data
    • Date - Extended class for a date column, supports many date formats
    • Email - Extended class for a column managing email
    • Error - Extended class for a column that manages an error object
    • Excerpt - Class for a column which contains an excerpt of a longer value
    • Files - Extended abstract class extended by the media and medias cols
    • Fragment - Class for a column which contains URI fragments
    • IntegerRange - Class for an integer column that supports range
    • JsonArray - Class for a column which offers a simple input for json values
    • JsonExport - Class for a column that contains json which should be exported
    • JsonModel - Class for a column which offers a configurable complex input for json values
    • JsonRelation - Class to manage a column containing a relation value to another column which is a jsonArray
    • Media - Extended class to work with a column containing a value which is a link to a file
    • Medias - Class to work with a column containing a value which is a link to many files
    • Money - Class for a column managing money (money formatted string)
    • Percent - Class for a column percent value
    • Phone - Class for a column managing phone numbers, automatically formats the value
    • Primary - Extended class for dealing with a column which has an auto increment primary key
    • Range - Class for a column managing a range (minimum, maximum, increment)
    • Relation - Extended abstract class extended for a relation
    • Request - Extended class for a column that manages a request object
    • Serialize - Extended class for a column which should serialize its value
    • Set - Class for a column containing a set relation (many)
    • Slug - Class for a column dealing with an URI slug
    • SlugPath - Class for a column dealing with an URI slug within a URI path
    • Textarea - Class for a column which is editable through a textarea input
    • TinyMce - Class for a column which transforms the textarea in a simple tinymce WYSIWYG editor
    • TinyMceAdvanced - Class for a column which transforms the textarea in a complex tinymce WYSIWYG editor
    • UriAbsolute - Extended class for a column managing an absolute uri
    • UserActive - Class for the column which manages the active field for the user row
    • UserPassword - Class for the column which manages the active field for the user row
    • UserRole - Class for the column which manages the role field for the user row
    • Video - Extended abstract class for a column containing a video from a third-party service
    • _jsonRelation - Trait with common methods for jsonRelation columns
  • Db - Extended class used to query the database, adds cms logic
  • Lang
    • En - English language content used by this namespace
    • Fr - French language content used by this namespace
  • Route - Extended abstract class for a route, adds cms logic
    • Account - Abstract class for an account route
    • AccountChangePassword - Abstract class for an account change password route
    • AccountChangePasswordSubmit - Abstract class for an account change password submit route
    • AccountSubmit - Abstract class for an account submit route
    • ActivatePassword - Abstract class for a route to activate a password that was previously reset
    • Contact - Abstract class for a contact form route
    • ContactSubmit - Abstract class for a contact submit route
    • Login - Abstract class for a login route
    • LoginSubmit - Abstract class for a login submit route
    • Logout - Abstract class for a logout route
    • Register - Abstract class for a register route
    • RegisterSubmit - Abstract class for a register submit route
    • ResetPassword - Abstract class for a reset password route
    • ResetPasswordSubmit - Abstract class for a reset password submit route
    • _browscap - Trait with a method to generate text related to browser capabilities
    • _calendar - Trait that provides most methods to make a calendar route
    • _download - Trait that provides most methods necessary to make a download route
    • _formSubmit - Trait that provides methods and logic necessary to make a form submit route
    • _modal - Trait that provides some initial configuration for modal routes
    • _rowsFeed - Trait that grants methods related to a rows feed (with a load-more)
    • _searchGet - Trait that grants methods for search route via GET
    • _searchPost - Trait that grants methods for search route via POST
    • _specificPointer - Trait that grants methods to deal with a specific resource represent by a pointer (table/id)
    • _specificPrimary - Trait that provides most methods used for a specific route using a primary segment
    • _specificSlug - Trait with methods to work with a specific resource represented by an URI slug
  • Row - Extended class to represent a row within a table, adds cms config
    • CacheRoute - Class to store rendered route caches, with cms config
    • Contact - Class to work with a row of the contact table, stores contact messages
    • Email - Class to deal with a row of the email table, with cms config
    • Lang - Class to work with a row of the lang table, with cms config
    • Log - Class to represent a row of the log table, with cms config
    • LogCron - Class to represent a row of the logCron table, with cms config
    • LogEmail - Class to represent a row of the logEmail table, with cms config
    • LogError - Class to represent a row of the logError table, with cms config
    • LogHttp - Class to represent a row of the logHttp table, with cms config
    • LogSql - Class to represent a row of the logSql table, with cms config
    • QueueEmail - Class to deal with a row of the queueEmail table, with cms config
    • Redirection - Class to work with a row of the redirection table, with cms config
    • Session - Extended class for a row of the session table, with cms config
    • User - Extended class for a row of the user table, with cms logic
    • _log - Trait to set permissions for a log row
    • _media - Trait to work with a row of containing media, storage or video
    • _meta - Trait with methods to make a row a meta-source
  • Segment
    • _boolean - Trait that issues a method to deal with boolean route segment (1 or 0)
    • _col - Trait to manage a route segment which must contain a column name or object
    • _colRelation - Trait to work with a route segment which must contain a column with a relation
    • _cols - Trait to manage a route segment which must contain many columns
    • _direction - Trait to deal with a route segment which must contain a sorting direction
    • _filter - Trait to manage a complex route segment which contains filtering directive
    • _int - Trait that issues a method to deal with a simple integer route segment
    • _limit - Trait that issues a method to deal with a limit route segment (max per page)
    • _numeric - Trait that issues a method to deal with a simple numeric route segment
    • _order - Trait to manage a route segment which must contain an orderable column
    • _orderColRelation - Trait to work with a route segment which must contain an orderable column relation
    • _orderTableRelation - Trait to manage a route segment which must contain an orderable table relation
    • _page - Trait that issues a method to deal with a page route segment (page number)
    • _pointer - Trait to work with a pointer route segment (value which contains a table and row)
    • _primaries - Trait to deal with a route segment which must contain many rows
    • _primary - Trait to work with a route segment which must contain a row id or object
    • _selected - Trait that provides logic to deal with a route segment which represents a selected value
    • _slug - Trait that issues methods to work with a standard slug route segment
    • _str - Trait that issues a method to deal with a simple string route segment
    • _table - Trait to work with a route segment which must contain a table name or object
    • _timestamp - Trait to deal with a route segment which contains a timestamp
    • _timestampMonth - Trait to work with a route segment which contains the timestamp of a month
    • _yes - Trait that issues a method to deal with yes route segment
  • Service
    • Navigation - Class to integrate the quidphp-navigation javascript module
    • Polyfill - Class to integrate javascript polyfills
    • Sortable - Class to integrate the sortable javascript library
    • TinyMce - Class that provides a method to integrate the Tinymce WYSIWYG editor
  • Session - Extended class for the session with methods related to the CMS
  • Table - Extended class to represent an existing table within a database

Testing

QuidPHP/Lemur contains 8 test classes:

  • Boot - Class for testing Quid\Lemur\Boot
  • Cell - Class for testing Quid\Lemur\Cell
  • Col - Class for testing Quid\Lemur\Col
  • Route - Class for testing Quid\Lemur\Route
  • Row - Class for testing Quid\Lemur\Row
  • Session - Class for testing Quid\Lemur\Session
  • Suite
    • BootLemur - Class for booting the Quid\Lemur testsuite
  • Table - Class for testing Quid\Lemur\Table

QuidPHP/Lemur testsuite can be run by creating a new QuidPHP/Assert project.

JavaScript

Convention

  • ES5: All code is compatible with ES5, there is no need for any JavaScript transpiler.
  • Strict: All generated files declare use strict on the first line.
  • Compiling: The concatenation of the JS files is done on the PHP side.

Overview

QuidPHP/Lemur contains 17 JavaScript files. Here is an overview:

  • cms
    • _lemur - Script of common behaviours for all pages of the CMS
    • colsSorter - Script for the col sorter component of the general page of the CMS
    • com - Script of behaviours for the communication component of the CMS
    • generalComponents - Component that manages the components on the general page
    • homeFeed - Script for feed component with a filter on the CMS home page
    • inputFiles - Script with logic for the file upload component of the CMS
    • quickEdit - Script for the quickEdit component in the general page of the CMS
    • rowsChecker - Script for the rows checker component in the general page of the CMS
    • specificComponents - Component that manages the panel on the specific form page of the CMS
    • specificMulti - Component that manages the multi modification form
    • specificNav - Component that manages the navigation box on the specific form page of the CMS
    • specificPanel - Component that manages the panel on the specific form page of the CMS
    • textareaExtra - Script for a component to search and insert content within a textarea, with support for tinymce
  • component
    • addRemove - Script of behaviours for an add-remove input component
    • enumSet - Script for an enumSet component (search in a relation)
    • sorter - Script with drag and drop related sorting functionnalities, uses Sortable
    • tinymce - Component to manage a Tinymce wysiwyg input

CSS

Convention

  • SCSS: Nesting, variables and mixins are used within the stylesheets.
  • Compiling: The compiling and concatenation of the SCSS files is done on the PHP side.

Overview

QuidPHP/Lemur contains 37 SCSS stylesheets. Here is an overview:

  • cms
    • _form - Stylesheet with various form-related mixins
    • _include - Stylesheet with various global mixins
    • cms - Stylesheet containing the root styling rules as well as common classes for the CMS
    • general - Stylesheet for the general navigation page of the CMS
    • home - Stylesheet for the home route of the CMS
    • interface - Stylesheet for the main interface of the CMS
    • modal - Stylesheet for the modal and the modal routes
    • nobody - Stylesheet for the nobody routes of the CMS
    • specific - Stylesheet for the specific form page of the CMS
  • cms-component
    • _include - Stylesheet for various simple components of the CMS
    • addRemove - Stylesheet for the addRemove form component of the CMS
    • block - Stylesheet for the block component of the CMS
    • burger - Stylesheet for the burger component of the CMS
    • calendar - Stylesheet for the calendar component of the cms
    • clickOpen - Stylesheet related to clickOpen components for the CMS
    • colsSorter - Stylesheet for the colsSorter component of the CMS
    • com - Stylesheet for the communication component of the CMS
    • enumSet - Stylesheet for the enumSet component of the CMS
    • fakeSelect - Stylesheet for the fakeSelect component of the CMS
    • filter - Stylesheet for the filter component of the CMS
    • homeFeed - Stylesheet for the home feed component of the CMS
    • inputCalendar - Stylesheet for the input calendar of the CMS
    • inputFiles - Stylesheet for the files upload inputs component of the CMS
    • inputNumericRange - Styles for the integerRange component of the CMS
    • jsonArray - Mixin pour le champ jsonRelation dans le formulaire
    • mainNav - Stylesheet for the main navigation component of the CMS
    • modal - Stylesheet for the modal component of the CMS
    • quickEdit - Stylesheet for the quickEdit component of the CMS
    • rowsChecker - Stylesheet for the rowsChecker component of the CMS
    • searchAutoInfo - Stylesheet for the main search component of the CMS
    • searchSlide - Mixin for the searchSlide component of the CMS
    • specificNav - Stylesheet for the speciic nav component of the CMS
    • textareaExtra - Stylesheet for the textarea component of the CMS (with relation inserts)
    • tooltip - Stylesheet for the tooltip component of the CMS
  • cms-icon
    • base64 - Stylesheet containing all CMS icons in base64
    • icon - Stylesheet generating rules for the base64 icons
  • cms-tinymce
    • tinymce - Stylesheet providing default styling for the Tinymce wysiwyg editor