quidphp/site

Extended platform to build a website using the QuidPHP framework and LemurCMS

5.31.0 2022-07-02 23:30 UTC

This package is auto-updated.

Last update: 2024-12-16 21:48:03 UTC


README

Release License PHP Version Style CI Code Size

About

QuidPHP/Site is an extended platform to build a website using the QuidPHP framework and LemurCMS. It is part of the QuidPHP package.

License

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

Documentation

QuidPHP/Site documentation is available at QuidPHP/Docs.

Installation

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

$ composer require quidphp/site

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

Requirement

QuidPHP/Site requires the following:

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

Dependency

QuidPHP/Site has the following dependency:

  • quidphp/lemur - Quid\Lemur - LemurCMS, a content management system built on top of the QuidPHP framework

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

Comment

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

PHP

Convention

QuidPHP/Site is built on the following conventions:

  • Core overloading: This namespace overloads many classes from Quid\Core and Quid\Lemur.
  • 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/Site contains 49 classes, traits and interfaces. Here is an overview:

  • App
    • 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 app
    • CliVersion - Class for a version route of the app, accessible via the cli
    • Error - Abstract class for the error route of the app
    • Home - Abstract class for the home route of the app
    • Robots - Class for the robots.txt route of the app
    • Sitemap - Class for the automated sitemap.xml route of the app
  • Boot - Extended abstract class for the object that bootstraps the app and cms
  • Cell
    • EmailNewsletter - Class for an email newsletter cell (subscribes to a third-party newsletter)
    • GoogleMaps - Class to work with a cell containing Google maps geo-localization data
    • JsonForm - Class to work with a cell containing a json form
    • JsonFormRelation - Class to manage a cell containing a relation value to another cell containing a json form
  • Cms
    • CliPreload - Class for a cli route to generate the preload PHP script for the CMS
  • Col
    • EmailNewsletter - Class for an email newsletter column (subscribes to a third-party newsletter)
    • Embed - Class for a column containing an embed video (from youtube or vimeo)
    • GoogleMaps - Class for a GoogleMaps column, with geo-localization data
    • Hierarchy - Class for an hierarchy column, like a website page sitemap
    • JsonForm - Class for a column containing a json form
    • JsonFormRelation - Class to manage a column containing a relation value to another column which is a jsonForm
    • Route - Class for a column that creates an enum relation with route classes
    • Vimeo - Class for a column containing a Vimeo video
    • YouTube - Class for a column containing a YouTube video
  • Contract
    • Newsletter - Interface to describe methods for a newsletter third-party service
  • Db - Extended class used to query the database, adds app config
  • 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 app logic
    • NewsletterSubmit - Abstract class for a newsletter submit route
    • _breadcrumbs - Trait that provides methods related to generating breadcrumbs
    • _general - Trait that provides basic methods used for a general route
    • _page - Trait that provides basic logic for a page route
    • _pageBreadcrumbs - Trait that provides a method related to generating breadcrumbs for a page
    • _specific - Trait that provides basic methods used for a specific route
  • Row - Extended class to represent a row within a table, adds app config
    • Page - Class for a row which represents a page
    • User - Extended class for a row of the user table, with app logic
    • _pageConfig - Trait related to the configuration of a row representing a page
  • Service
    • GoogleAnalytics - Class that provides some methods to integrate GoogleAnalytics tracking
    • GoogleGeocoding - Class used to make GoogleGeocoding localization requests
    • GoogleMaps - Class used to generate javascript GoogleMaps
    • GoogleTagManager - Class used to generate the googleTagManager trackers
    • Mailchimp - Class that provides some methods to communicate with Mailchimp using api 3
    • PdfCrowd - Class that provides some methods to communicate with Pdfcrowd (and generate a pdf from html)
    • Vimeo - Class used to make requests to the Vimeo API
    • YouTube - Class that can be used to make requests to the YouTube API

Testing

QuidPHP/Site contains 3 test classes:

  • Boot - Class for testing Quid\Site\Boot
  • Db - Class for testing Quid\Site\Db
  • Suite
    • BootSite - Class for booting the Quid\Site testsuite

QuidPHP/Site 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/Site contains 14 JavaScript files. Here is an overview:

  • cms
    • jsonForm - Script containing logic for the jsonForm component which is based on the addRemove input
    • site - Script of additional behaviours for the specific form page of the CMS
  • component
    • carouselScroll - Script for a carousel component which scrolls
    • clickRemove - Component that removes itself on click
    • googleAnalytics - Script containing logic for googleAnalytics
    • googleMaps - Script containing logic for a simple googleMaps component
    • hoverSlide - Component to change height of target with mouseenter/mouseleave
    • preload - Component to preload assets, currently only images
    • scrollSections - Script containing logic for scrolling multiple sections linked to a hash
    • tabsScroll - Component that adds scrolling support to tabsSlider
    • tabsSlider - Component that adds timeout and iframe support to the tabsNav component
    • toggler - Component to toggle attributes on many elements using a trigger
    • windowSmall - Component to open a small window from an anchor link
    • wrapConsecutive - Component to wrap consecutive nodes of the same type in another node

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/Site contains 8 SCSS stylesheets. Here is an overview: