prom-cms/core

Core for PromCMS


README

This project contains essential parts of PromCMS.

TODOs

  1. Improve tests
  2. Add documentation (Partially done)
  3. Migrate to Doctrine
  4. Migrate to illuminate/database models and still use SleekDB Create SleekDB Adapter into Doctrine
  5. Improve twig rendering
  6. Improve events
  7. Provide better international experience
    1. Add twig function/tags/filters
    2. Rethink intl on models (should that info be on models itself?)
  8. Support MySQL in custom models
    • Perhaps support Illuminate/Database again by creating package that adds SleekDB as a db driver

FAQ and HOW TOs

What functions/filters/helpers/etc are accessible in Twig?

How can I access services or other objects provided by PromCMS?

Services are stored in PSR Container by PromCMS. In fact, PromCMS sets those objects and subscribes to them internally from the container.

Let's look at this example code that can be placed inside <your app root>/src/bootstrap.php:

use PromCMS\Core\Config;

return function (App $app) {
  // Access PSR container
  $container = $app->getContainer();
  
  // Now you can access whatever - for example Config! It`s fully "type-safe" ;)
  $config = $container->get(Config::Class);

  // Now you can use it normally (this is boolean which has true if current .env does not have environment specified or has development value)
  echo $config->env->development;
}

What services does PromCMS expose?

PromCMS exposes a variety of services and objects that help you with creating your project. Each item has its own documentation page (or even PHPDoc) that you can access by clicking on each item

What possible .env options can I set, how can I access them and what they control?

Every PromCMS should have secrets stored in .env. PromCMS stores known configuration in PromCMS\Core\Config which is accessible through PSR Container (see this section for more)

Known keys

APP_ENV

SECURITY_SESSION_LIFETIME

SECURITY_TOKEN_LIFETIME

APP_DEBUG

MAIL_HOST

MAIL_PORT

MAIL_USER

MAIL_PASS

MAIL_ADDRESS

SYSTEM_LOGGING_PATHNAME

Describes the relative path to where should Logger log.

  • type: string|null
  • default: null
  • example: SYSTEM_LOGGING_PATHNAME="./.temp/app.log"