This application is the code powering the Joomla! Framework website.
- PHP 7.2+
- PDO with MySQL support
- Composer
- Apache with mod_rewrite enabled
- If changing web assets, NPM is required
- Clone this repo on your web server
- Run the
composer installcommand to install all dependencies - Copy
etc/config.dist.jsontoetc/config.jsonand configure your environment (see below for full details on the configuration) - Run
vendor/bin/phinx migrateto set up the database
To seed the database with the Framework package data, the following steps should be taken:
- Run the
bin/framework package:synccommand, this will load the packages table based on the contents of thepackages.ymlfile at the repository root - Run the
bin/framework packagist:sync:releasescommand, this will load the releases table with all stable releases that have been tagged based on the Packagist API response - Run the
bin/framework packagist:sync:downloadscommand, this will load the download counts for all packages into the database
The web assets (CSS, JavaScript, and images) are compiled and processed with Vite. The primary source for all assets is the assets directory, the build is configured in vite.config.mjs and places the production assets into the www/media directory. It also writes www/media/manifest.json, which the application uses to add a cache busting version to the asset URLs.
The use of Vite requires NPM as hinted at in the Installation section. Node 20.19+ or 22.12+ is required. Three scripts are available:
npm run prodwill compile assets for production, which includes compression and minification; code must be committed to this repository with the production configurationnpm run devwill compile the assets without production optimizationsnpm run watchis the same as thedevscript but rebuilds the assets when a source file changes
This site makes use of Subresource Integrity (SRI), therefore the integrity hashes must be regenerated after compiling assets. This can be done by running the bin/framework template:generate-sri command.
The PHP code follows PSR-12 with a few additions, configured in .php-cs-fixer.dist.php. Check it with vendor/bin/php-cs-fixer fix --dry-run --diff, or fix all violations with vendor/bin/php-cs-fixer fix. The check runs on every push and pull request.
The database schema is managed through Phinx. The phinx.php file at the root of this repo configures the Phinx environment. Please see their documentation for more information.
The application's configuration is defined as follows:
- Database - The
joomla/databasepackage is used to provide a database connection as requireddatabase.host- The address of the database serverdatabase.user- The user to connect to the database asdatabase.password- The password for the database userdatabase.database- The name of the database to usedatabase.prefix- The prefix to use for the database's tables
- Template - The
twig/twigpackage is used for the application's templatestemplate.debug- Flag to enable Twig's debug functionality, when enabled the caching functionality is not availabletemplate.cache.enabled- Flag to enable Twig's caching functionalitytemplate.cache.path- The path relative to the repo root where cached Twig files should be stored
- Logging - The
monolog/monologpackage is used for logging functionalitylog.level- The default logging level to use for all application loggers, this defaults to theERRORlevellog.application- The logging level to use specifically for themonolog.handler.applicationlogger; defaults to thelog.levelvalue
- GitHub - The
joomla/githubpackage is used to interface with the GitHub API for some of the site's capabilitiesgh.token- Set a GitHub API token to use for authenticating to the API, this is the recommended settingapi.username- Set the GitHub account username to use for authenticating to the APIapi.password- Set the GitHub account password to use for authenticating to the API
- Error Reporting - The
errorReportingconfiguration key can be set to a valid bitmask to be passed into theerror_reporting()function - Debug - The
debugkey allows enabling the application's debug mode, this also makes the PHP Debug Bar available