2017 © Pedro Peláez
 

package framework

Modern PHP Framework designed for high-performance web applications

image

luminance/framework

Modern PHP Framework designed for high-performance web applications

  • Wednesday, February 7, 2018
  • by michaelgv
  • Repository
  • 1 Watchers
  • 7 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Logo, (*1)

Luminance

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)

Features

  • PSR4 Autoloader
  • Modern Router (magic, pre-defined routes)
  • Clean, documented code base
  • ORM Database Table Structure
  • Powerful HTTP Request and Response Library
  • Compatible with PHP 7 and above
  • Configuration System
  • Caching System
  • Built-in CSRF and Sanitizing of input fields
  • Micro-template parser

Installation

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)

App Folder Structure

All applications have a small and simple folder structure:, (*8)

  • Cache
  • Configuration
  • Controllers
  • Models
  • Views

Cache

This is where all cache files written by Luminance\Cache\File.php, (*9)

Configuration

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"];

Controllers

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};

Models

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();
    }
}

Views

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)

Security

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)

The Versions

07/02 2018

dev-master

9999999-dev

Modern PHP Framework designed for high-performance web applications

  Sources   Download

MIT

framework luminance luminance-framework