It is recommended you use either Symfony or Laminas as frameworks for projects.
Prometheus 3 is a basic web framework for use in creating websites for SunsetCoders. It is designed to operated with a standard LAMP stack. The framework is design to allow for:
- Website agnostic. Nothing in the framework should have any tight binding to any particular site or project.
- Secured database connection objects that abstract out hard-coded database methods from PHP.
- A page generation library to make the rendering of web pages cacheable and provide a single point of truth for the implementation of themes.
- To allow for the standardized handling of user logins and security.
- To allow for Composer as the main PHP package manager.
- To employ Bootstrap 4, jQuery and as the main UI tools jQueryUI.
- The entire framework should be drop-in. If we add features, or fix bugs, the entire framework should just drop straight into ANY existing site using it with no need for modifications.
- The framework should allow modules for common website sites. E-commerce, photo galleries etc.
- The framework should allow for multiple JS frameworks including Angular (which is my personal favorite).
- The framework should be completely site agnostic. NOTHING in the code should be aimed specifically at a particular site, except for the logic within modules (such as e-commerce).
- Maintenance of all sites should be done using PHP-CLI scripts - somewhat akin to Symfony 4.
- All sites will have common DB tables. Tables within the DB that are particular to modules such as e-commerce will be pre-pended with terms to help group tables within the schema.
- All code will be PHP 7.2 as a minimum.
- All code MUST follow the PSR standards.
- I plan to use DOCKER so that developers can work with local development on sites.
- I plan to use PHPDocumentor to keep technical documentation of the framework up to date at all times. To this end, ALL CODE MUST contain PHP Doc Blocks.
- Additional libraries will be brought into the framework using NPM, Bowser, and Composer.
- All version control is through GIT.
- Multilingual. I'm aiming to provide language translation files to allow for different locales - in a style very similar to Symfony.
- LAMP stack, using the XAMPP Library available online will cover all these requirements.
- PHP 7.2.11 as a minimum
- MariaDB 10.1.38.
- Apache 2.4.38
- Composer
- Bower
- NPM
- YARN
- Clone the git repository into the required web directory.
- Install the necessary PHP libraries via Composer
composer install
- Install the necessary client resource libraries via Bower
bower install
- Install the necessary client resource libraries via NPM
npm install
- Install the necessary files via YARN.
yarn install
- If you are using WINDOWS, be sure to uncomment the following line from the PHP.INI file:
extension=intl
- Be sure to create a SunsetCoders\SiteSpecific\Config\Config.yaml file. Use the sample_config.yaml as a guide.
- Setup your own site specific autoloader class in the root directory. Use the SampleSiteSpecificAutoload class as a guide. Be sure to rename this to "SiteSpecificAutoload" class once you are ready.
- All of your own classes should be contained in or within subfolders under the SunsetCoders\SiteSpecific folder, OR the \Public
folder.
- DO NOT put your own site specific classes in ANY OTHER FOLDER.
- Use a copy of the \SiteSpecificAutoloadExample.php class to build your own class autoloader. This class contains its OWN class map, so you do not need a second class map.
SiteSpecificAutoloadSample.php - A sample file showing how to build a site specific autoloader for your classes.
This should be SITE AGNOSTIC.
SunsetCodersClassAutoloader.php - Autoloader class to build autoloaders for SITE AGNOSTIC classes from the classmap.
You should NEVER NEED TO CHANGE THIS FILE.
SunsetCodersClassMap.php - Contains an array to map namespaces to specific folders and classes.
SITE AGNOSTIC - DO NOT CHANGE.
If you wish to map your OWN classes for a specific site,
use your own SpecificAutoloadSample.php instead.
\Public - All of your classes used to render pages for the end user go in this folder.
It is the ONLY folder accessible to the web.
\SunsetCoders - All code specific to Prom3 will mostly stored under here.
NONE of this is visible to the web.
\Config - The configuration class providing access to site specific settings is in here.
\Core - Core modules and controllers that are NOT site specific are in here.
\Controllers - Core controller classes.
\Models - Generic models classes.
\Repositories - Generic repository classes.
\DataAccess - DB access classes and utilities reside here.
\Exception - Common exceptions to ALL sites will sit in here.
\Maintenance - CLI based scripts for site management and construction appear here.
\PageRender - Classes to control page rendering are in here. These are SITE AGNOSTIC!!!!!!
\SiteSpecific - Any classes or resources specific to a particular site appear inside here.
\Config - Site specific config files (DB passwords etc etc) appear here.
\Controllers - Site specific controllers for models will appear here.
\Models - Site specific models will appear here.
\Repositories - Site specific repositories for all models will appear here.
The third party libraries used are subject to their license terms. To see a list of the libraries used, refer to the composer.json, bower.json and package.json files.