Modern PHP Framework designed for high-performance web applications
, (*1)
Modern PHP Framework designed for high-performance web applications, (*2)
Luminance is a modern PHP framework, designed with love using PHP 7.1, ready for use immediately out of the box., (*3)
Documentation, (*4)
To install Luminance, ensure you have PHP 7.0 or above installed, and run either:, (*5)
git clone https://github.com/luminancephp/framework.git
Or, if you use Composer:, (*6)
composer require "luminance/framework:dev-master"
Now, change into the folder, and open your text editor. Change the application and database configuration paths in app/Configuration folder. Sample structure is available in the starter repository, (*7)
All applications have a small and simple folder structure:, (*8)
This is where all cache files written by Luminance\Cache\File.php, (*9)
This is where all application configuration will be, you can reference it by calling the Configuration Loader, (*10)
Example:, (*11)
$configuration = new \Luminance\Configuration\Loader("file_name"); echo $configuration->config["test_field_name"];
All controllers here are case sensitive, the controller name must match the file name., (*12)
Example controller:, (*13)
<?php /** * This is a hello world controller, as a sample controller * * @author Your Name <yourname@youremail.com> * @namespace Luminance\Controllers * @license LICENSE * @version 1.0.0 * @package MY APP NAME */ namespace Controllers; use Luminance\Controllers\BaseController; class ExampleWorld extends BaseController { public function index() { echo "Hello, world!"; } }
BaseController exposes the Request and Response object, by calling, respectively:, (*14)
$this->request->{methods}; $this->response->{methods};
These models are designed to be database objects, models must extend Table class., (*15)
Example:, (*16)
<?php /** * This is a test database */ namespace Luminance\Database; class Accounts extends Table { /** * This is a sample method, that queries a sample data set for it's ID, and returns the PDO object */ public function getUserById(int $user_id) { $this->setQueryString("SELECT * FROM accounts WHERE id = ?"); $this->replacements = array( $user_id ); return $this->execute(); } }
This is a standard views directory, you can use this as your base views directory, but do not have to use the built-in template parser. You can use any template parser, such as Twig, Smarty, etc., (*17)
We take security very seriously, if you find a security issue in our core, please report it by emailing michaeldoestech@gmail.com with the subject line "Luminance Security Issue Report", (*18)
We ask you give us time to respond, investigate, and fix the bug. Responsible disclosure policy of 90 days remains in effect from time of report to time of fix, if a fix is not completed within 90 days, we ask you allow up to an additional 30 days to complete the patch properly., (*19)