PHP Classes

(LMV)Luminova Framework: PHP Luminova framework: simple, powerful MVC/HMVC.

Recommend this page to a friend!
  Info   View files Example   Demos   Videos Videos   View files View files (120)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-07-24 (18 hours ago) RSS 2.0 feedNot yet rated by the usersTotal: 33 This week: 9All time: 11,027 This week: 8Up
Version License PHP version Categories
luminova 3.1.5MIT/X Consortium ...8.0Tools, Libraries, Templates, Console, C..., D..., P...
Description 

Author

PHP Luminova Framework is a robust MVC and HMVC framework, supporting Twig, Smarty, and PHP templating with layout inheritance and extensions using methods like `begin`, `end`, `import`, and `extend`.

It also offers:

- Unique database caching and ORM for query builders.

- Database migration and seeding with `NovaKit` commands for execution, rollback, and version control.

- Template view caching and built-in DOM minification, configurable via the env file.

- OpenAI models for creating AI-powered applications.

- Command-line tools for building CLI tools and managing the framework via `NovaKit CLI`.

- Sitemap generation with a single `NovaKit` command.

- CronJobs management for scheduling and execution using `NovaKit` command.

- Easy SCO schema object integration on web pages.

- Optimized HTTP and CLI routing.

- Cloud Storages, support different storages type like Locale, AWS S3, Azure Blob, Google Cloud Storage etc.

- Support symlink creation for local storage and cloud storage that supports temporal public URL.

- CDN module for local storage, to deliver files in browser without the need for `symlink`, it also support browser caching, large files and any file type.

- Easy file uploads with support for browser side chunking using libraries `Pluupload.js` etc.

- Utility classes and helper functions for various tasks.

- Comprehensive error handling and logging, along with support for maintenance mode.

Picture of Ujah Chigozie peter
  Performance   Level  
Name: Ujah Chigozie peter <contact>
Classes: 25 packages by
Country: Nigeria Nigeria
Age: 33
All time rank: 200910 in Nigeria Nigeria
Week rank: 8 Up2 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 11x

Instructions

Important Information

You can install the package from the PHP Classes Composer repository following the instructions in the Download tab.

Alternatively, you can download Luminova as a ZIP or .tar.gz archive. After extracting the archive to your preferred directory, run the following command to install the required modules:

composer update

Installing Luminova via Composer is recommended for easy updates:

composer create-project luminovang/luminova my-project

Manual Download

Download the latest version from Luminova's official website: Download Luminova.

Alternatively, you can manually download it from GitHub by following the instructions here: Installation Guide.

What is On Latest Update

You can now define routes using the PHP8 attribute (e.g., #[Route('/', methods=['GET', 'POST'])]).

New Features

  • PHP Attributes: Added support for `Route` and `Error` attributes for easy route definition. This feature also includes attribute caching for improved performance in production environments.
  • Attribute Command: Introduced a `NovaKit` command to generate code-based routes from attribute definitions, helping to determine the most efficient routing method.
  • Temporary Tables: Added `temp` and `dropTemp` methods to the database `Builder` class, allowing for creating and deleting temporary database tables as needed.
  • CLI Exceptions: Introduced a new environment variable `throw.cli.exceptions` to enable the throwing and caching of exceptions in CLI scripts outside command controller classes. This can also be temporarily enabled with `setenv('throw.cli.exceptions', true)` for the current script execution.

Changes

  • Renamed: To avoid confusion, the environment variable `database.pdo.driver` has been renamed to `database.pdo.engine`.

Removed

  • Deprecated Methods: The deprecated method `andor` has been removed. The `orGroup` method is its replacement.

Optimizations

  • Method Descriptions & Comments: Enhanced to convey functionality and return types.
  • Improved Framework Documentation: Revised the Luminova official documentation for greater clarity.
  • Builder Class: Improved the `drop` method to support various database types and optional transactions.

Example

<?php
/**
 * Luminova Framework
 *
 * @package Luminova
 * @author Ujah Chigozie Peter
 * @copyright (c) Nanoblock Technology Ltd
 * @license See LICENSE file
 */
namespace App\Controllers;

use \
Luminova\Base\BaseCommand;

/**
 * This class demonstrates how command line tools can be implemented using PHP Luminova.
*/
class DemoCommand extends BaseCommand
{
   
/**
     * {@inheritdoc}
    */
   
protected string $group = 'demo';

   
/**
     * {@inheritdoc}
    */
   
protected string $name = 'demo-command';

   
/**
     * {@inheritdoc}
    */
   
protected array $usages = [
       
'php index.php demo <command> <arguments>',
       
'php index.php demo hello'
   
];

   
/**
     * {@inheritdoc}
    */
   
protected string $description = 'Luminova demo command line tool implementation example.';

   
/**
     * {@inheritdoc}
    */
   
protected array $options = [
       
'--help' => 'Show command help information.',
       
'-c, --color' => 'Show message with a specific color.',
       
'-s -select' => 'Indicate to prompt user enter select an option.',
       
'-p -password' => 'Indicate to prompt user to enter password.',
       
'-m -message' => 'Specify message to display.'
   
];

   
/**
     * {@inheritdoc}
    */
   
protected array $examples = [
       
'php index.php demo --help' => 'Show help message.',
       
'php index.php demo hello' => 'Show default message.',
       
'php index.php demo hello --password' => 'Show request for password.',
       
'php index.php demo hello --select' => 'Show request to choose and option.',
       
'php index.php demo hello --message="Hi"' => 'Show specified message.',
       
'php index.php demo hello --color="red"' => 'Show message with a specific color.',
    ];

   
/**
     * {@inheritdoc}
    */
   
public function help(array $helps): int
   
{
        return
STATUS_ERROR;
    }

   
/**
     * The command controller method hello.
     * This method will handle any demo command for hello.
     *
     * @see /routes/cli.php - The command line context.
     *
     * @return int Return status code STATUS_SUCCESS or STATUS_ERROR.
     * @example `php index.php demo hello arguments`
    */
   
public function hello(): int
   
{
       
$color = $this->getAnyOption('color', 'c', null);
       
$select = $this->getAnyOption('select', 's');
       
$password = $this->getAnyOption('password', 'p');
       
$message = $this->getAnyOption('message', 'm', 'Hello! this is a test default message.');

        if(
$color !== null && $color === ''){
           
$this->error('You need to provide a color for argument --color.');
            return
STATUS_SUCCESS;
        }

        if(
$select === true){
           
$message = $this->askForLanguages();
        }elseif(
$password === true){
           
$message = $this->askForPassword();
        }

        if(
$message === true){
           
$this->error('You need to provide a message for argument --message.');
            return
STATUS_SUCCESS;
        }

       
$this->writeln($message, $color);

        return
STATUS_SUCCESS;
    }

  
/**
     * Prompt user to select a programming language.
     *
     * @return string Return message and selected language.
    */
   
private function askForLanguages(): string
   
{
       
$options = [
           
"green" => 'PHP', // Use the array key to apply color.
           
'JAVA',
           
'JAVASCRIPT',
           
'SWIFT',
           
'PYTHON',
           
'C++',
           
"red" => 'HTML'
       
];

       
$input = $this->prompt(
           
'Enter your preferred programming language', // Message to display
           
$options, // Array of options to prompt.
           
'required|in_array(' . implode(',', $options) . ')' // Input validation rules.
       
);

        return
"Your preferred programming language is '{$input}'.";
    }

   
/**
     * Prompt user to enter a password.
     *
     * @return string Return password validation message.
    */
   
private function askForPassword(): string
   
{
       
// Password prompt.
       
$input = $this->password('Enter your password `12345`');

       
// Validate user password.
       
if ($input == '12345') {
            return
"You have entered the correct password '{$input}'.";
        }

        return
"Incorrect password {$input}.";
    }
}


Details

PHP Luminova Framework

Author PHP 8.0+ Source Code Latest Version Framework Source Code Framework Latest Version Software License Total Downloads Endpoint Badge

Local Image

About Luminova!

Luminova is a PHP framework built for speed and efficiency, designed to enhance your existing coding skills. At Luminova, we prioritize performance by offering feature customization through the env file. This ensures the framework includes only what's needed for your project, based on the features you enable. This approach allows you to enable or disable features as well as customizing your preferred template rendering mode and coding style.

Luminova, provide access to the Template object within the view files, allowing you to call template methods and properties using $this keyword within template files. This can be disabled if you prefer your views to be rendered in isolation, disabling it will allow you to access exported application classes using custom keyword $self.

Get started with Luminova by visiting our official documentation. For more information and sample code, check out our YouTube channel.

Composer Installation

Install luminova via Composer.

composer create-project luminovang/luminova my-project

Start Development Server

To start the PHP development server, run the following NovaKit command.

php novakit server

Sitemap Generator

To generate your website sitemap use the below NovaKit command.

php novakit generate:sitemap

To learn more about NovaKit commands read the novakit documentation.

Routing

Luminova support flexible routing implementation using Attributes or Router methods.

Define your route using PHP8 attributes:*

#[Route('/', methods: ['GET'])]
public function index(): int 
{
    return $this->view('index');
}

Or define your route using code-based routing:

<?php 
$router->get('/', 'YourController::index');

What's There For Me?

Here we can brief you on the basic features you can expect in Luminova. There's a lot more than what is written here. As Linus Torvalds said, "Talk is cheap. Show me the code."

  • Database Builder: A powerful Object Relational Mapping (ORM) tool that organizes CRUD operations and simplifies database interactions.
  • MVC & HMVC Architecture: Adheres to the Model-View-Controller and Hierarchical Model-View-Controller implementation.
  • Flexible HTTP Routing: Dynamic and fast routing implementation with a clear separation of concerns.
  • Templating: Optimized native PHP templating with additional inheritance and caching features. You can also use `Twig` or `Smarty` template engines.
  • Error Handling: Comprehensive error handling ensures that no errors go unnoticed, including non-fatal inline errors.
  • Session Management: Easily manage user login sessions without additional implementation.
  • CLI Routing: Dynamic routing for CLI implementations similar to HTTP routing methods.
  • Cloud Storage: Supports various cloud storage solutions like AWS, Azure, Google Cloud, and more.
  • File Management: Deliver files to the browser from any location with temporary or permanent URLs to access private files.
  • Sitemap Generator: Generate website sitemaps using the `NovaKit` command.
  • Schema Object: Support for generating schema objects for website pages.
  • Command Line Tool: Full support for implementing CLI tools, with everything you need available.
  • AI Models: Integrate or extend AI features into your application.
  • Database: A flexible database system that supports instant failover to a backup database without user interruption.
  • Security: Various security implementations to secure your application and user information.
  • Request Handling: Secure handling of incoming and outgoing HTTP requests.
  • Email: Send emails anywhere, with support for sending entire view content as the email body.
  • Translation: Create translations for your application using our translation class.
  • Encryption: Support for different encryption handlers and methods.
  • Services: Define classes that can be shared and discovered anywhere in your codebase, with support for serialization and class object caching.

Quick Tips

Q: My session works on the development server but not on the production server. - A: In production, change the $sessionDomain in /app/Controllers/Config/Session.php to your actual production domain. You can use '.' . APP_HOST for this. Also, update the Cookie.php configuration accordingly.

Q: My CSS and images are broken on the production server. - A: Ensure you set the app.environment.mood key to production in your environment file when in production.

Something Missing?

Your feedback is highly appreciated peter@luminova.ng. Let us know what more to add to enhance your experience with Luminova. You can also recommend tutorials for our YouTube channel to help you understand and use Luminova better.

Most important, don't forget to rate Luminova on GitHub. Your rating is like fuel to illuminate our motivation to add more features and make Luminova widely recognized and better.


  Luinova WebsiteExternal page  

Open in a separate window

Videos  
  • Luminova Installation Guide
  • PHP Luminova Framwork User Signup & Login Example
  • PHP Luminova Framwork With Symfony Twig Template
  Files folder image Files  
File Role Description
Files folder imageapp (1 directory)
Files folder imagebootstrap (3 files)
Files folder imagedocs (1 file)
Files folder imagepublic (4 files, 1 directory)
Files folder imageresources (1 directory)
Files folder imageroutes (3 files)
Files folder imagesamples (1 file)
Files folder imagesystem (1 file, 3 directories)
Accessible without login Plain text file .env Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file novakit Appl. Luminova CLI Tool
Accessible without login Plain text file phpstan.includes.php Aux. Auxiliary script
Accessible without login Plain text file phpstan.neon Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Plain text file rector.php Class Class source

  Files folder image Files  /  app  
File Role Description
Files folder imageControllers (4 files, 4 directories)

  Files folder image Files  /  app  /  Controllers  
File Role Description
Files folder imageConfig (18 files, 1 directory)
Files folder imageErrors (1 file)
Files folder imageLanguages (2 files)
Files folder imageUtils (2 files)
  Plain text file Application.php Class Class source
  Accessible without login Plain text file DemoCommand.php Example Class source
  Plain text file DemoRequest.php Class Class source
  Plain text file Welcome.php Class Class source

  Files folder image Files  /  app  /  Controllers  /  Config  
File Role Description
Files folder imageTemplates (2 directories)
  Plain text file AI.php Class Class source
  Plain text file Apis.php Class Class source
  Plain text file Browser.php Class Class source
  Plain text file Cookie.php Class Class source
  Plain text file Cron.php Class Class source
  Plain text file Database.php Class Class source
  Plain text file Encryption.php Class Class source
  Plain text file Files.php Class Class source
  Plain text file IPConfig.php Class Class source
  Accessible without login Plain text file Modules.php Aux. Auxiliary script
  Plain text file Preference.php Class Class source
  Accessible without login Plain text file Schema.php Aux. Auxiliary script
  Plain text file Security.php Class Class source
  Plain text file Services.php Class Class source
  Plain text file Session.php Class Class source
  Plain text file Sitemap.php Class Class source
  Accessible without login Plain text file Storage.php Aux. Auxiliary script
  Plain text file Template.php Class Class source

  Files folder image Files  /  app  /  Controllers  /  Config  /  Templates  
File Role Description
Files folder imageSmarty (2 files)
Files folder imageTwig (9 files)

  Files folder image Files  /  app  /  Controllers  /  Config  /  Templates  /  Smarty  
File Role Description
  Plain text file Classes.php Class Class source
  Plain text file Modifiers.php Class Class source

  Files folder image Files  /  app  /  Controllers  /  Config  /  Templates  /  Twig  
File Role Description
  Plain text file Extensions.php Class Class source
  Plain text file Filters.php Class Class source
  Plain text file Functions.php Class Class source
  Plain text file Globals.php Class Class source
  Plain text file NodeVisitors.php Class Class source
  Plain text file Operators.php Class Class source
  Plain text file Rot13Provider.php Class Class source
  Plain text file Tests.php Class Class source
  Plain text file TokenParsers.php Class Class source

  Files folder image Files  /  app  /  Controllers  /  Errors  
File Role Description
  Plain text file ViewErrors.php Class Class source

  Files folder image Files  /  app  /  Controllers  /  Languages  
File Role Description
  Accessible without login Plain text file App.en.php Aux. Auxiliary script
  Accessible without login Plain text file App.fr.php Aux. Auxiliary script

  Files folder image Files  /  app  /  Controllers  /  Utils  
File Role Description
  Plain text file Functions.php Class Class source
  Accessible without login Plain text file Global.php Aux. Auxiliary script

  Files folder image Files  /  bootstrap  
File Role Description
  Accessible without login Plain text file constants.php Example Example script
  Accessible without login Plain text file features.php Aux. Auxiliary script
  Plain text file functions.php Class Class source

  Files folder image Files  /  docs  
File Role Description
  Accessible without login Plain text file logo.svg Data Auxiliary data

  Files folder image Files  /  public  
File Role Description
Files folder imageassets (1 directory)
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Image file favicon.png Icon Icon image
  Plain text file index.php Class Class source
  Accessible without login Plain text file robots.txt Doc. Documentation

  Files folder image Files  /  public  /  assets  
File Role Description
Files folder imagecss (1 file)

  Files folder image Files  /  public  /  assets  /  css  
File Role Description
  Accessible without login Plain text file app.css Data Auxiliary data

  Files folder image Files  /  resources  
File Role Description
Files folder imageviews (4 files, 1 directory)

  Files folder image Files  /  resources  /  views  
File Role Description
Files folder imagesystem_errors (8 files)
  Accessible without login Plain text file 404.php Example Example script
  Accessible without login Plain text file index.php Aux. Auxiliary script
  Accessible without login Plain text file index.tpl Data Auxiliary data
  Accessible without login Plain text file index.twig Data Auxiliary data

  Files folder image Files  /  resources  /  views  /  system_errors  
File Role Description
  Accessible without login Plain text file 404.php Aux. Auxiliary script
  Accessible without login Plain text file api.php Example Example script
  Plain text file cli.php Class Class source
  Accessible without login Plain text file debug.css Data Auxiliary data
  Accessible without login Plain text file errors.php Example Example script
  Accessible without login Plain text file maintenance.css Data Auxiliary data
  Accessible without login Plain text file maintenance.php Aux. Auxiliary script
  Accessible without login Plain text file view.error.php Aux. Auxiliary script

  Files folder image Files  /  routes  
File Role Description
  Accessible without login Plain text file api.php Example Example script
  Accessible without login Plain text file cli.php Aux. Auxiliary script
  Accessible without login Plain text file web.php Example Example script

  Files folder image Files  /  samples  
File Role Description
  Accessible without login Plain text file index.php Example Sample index

  Files folder image Files  /  system  
File Role Description
Files folder imageComposer (3 files)
Files folder imageDebugger (3 files)
Files folder imageplugins (1 file, 2 directories)
  Plain text file Boot.php Class Class source

  Files folder image Files  /  system  /  Composer  
File Role Description
  Plain text file BaseComposer.php Class Class source
  Plain text file Builder.php Class Class source
  Plain text file Updater.php Class Class source

  Files folder image Files  /  system  /  Debugger  
File Role Description
  Plain text file Performance.php Class Class source
  Plain text file PHPStanRules.php Class Class source
  Plain text file Tracer.php Class Class source

  Files folder image Files  /  system  /  plugins  
File Role Description
Files folder imagecomposer (11 files)
Files folder imagepsr (3 directories)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script

  Files folder image Files  /  system  /  plugins  /  composer  
File Role Description
  Accessible without login Plain text file autoload_classmap.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_namespaces.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_psr4.php Aux. Auxiliary script
  Plain text file autoload_real.php Class Class source
  Plain text file autoload_static.php Class Class source
  Plain text file ClassLoader.php Class Class source
  Accessible without login Plain text file installed.json Data Auxiliary data
  Accessible without login Plain text file installed.php Aux. Auxiliary script
  Plain text file InstalledVersions.php Class Class source
  Accessible without login Plain text file LICENSE Lic. License text
  Accessible without login Plain text file platform_check.php Aux. Auxiliary script

  Files folder image Files  /  system  /  plugins  /  psr  
File Role Description
Files folder imagecache (4 files, 1 directory)
Files folder imagelog (3 files, 1 directory)
Files folder imagesimple-cache (4 files, 1 directory)

  Files folder image Files  /  system  /  plugins  /  psr  /  cache  
File Role Description
Files folder imagesrc (4 files)
  Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file LICENSE.txt Doc. Documentation
  Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  system  /  plugins  /  psr  /  cache  /  src  
File Role Description
  Plain text file CacheException.php Class Class source
  Plain text file CacheItemInterface.php Class Class source
  Plain text file CacheItemPoolInterface.php Class Class source
  Plain text file InvalidArgumentException.php Class Class source

  Files folder image Files  /  system  /  plugins  /  psr  /  log  
File Role Description
Files folder imagePsr (1 directory)
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file LICENSE Lic. License text
  Plain text file README.md Class Class source

  Files folder image Files  /  system  /  plugins  /  psr  /  log  /  Psr  
File Role Description
Files folder imageLog (8 files, 1 directory)

  Files folder image Files  /  system  /  plugins  /  psr  /  log  /  Psr  /  Log  
File Role Description
Files folder imageTest (3 files)
  Plain text file AbstractLogger.php Class Class source
  Plain text file InvalidArgumentException.php Class Class source
  Plain text file LoggerAwareInterface.php Class Class source
  Plain text file LoggerAwareTrait.php Class Class source
  Plain text file LoggerInterface.php Class Class source
  Plain text file LoggerTrait.php Class Class source
  Plain text file LogLevel.php Class Class source
  Plain text file NullLogger.php Class Class source

  Files folder image Files  /  system  /  plugins  /  psr  /  log  /  Psr  /  Log  /  Test  
File Role Description
  Plain text file DummyTest.php Class Class source
  Plain text file LoggerInterfaceTest.php Class Class source
  Plain text file TestLogger.php Class Class source

  Files folder image Files  /  system  /  plugins  /  psr  /  simple-cache  
File Role Description
Files folder imagesrc (3 files)
  Accessible without login Plain text file .editorconfig Data Auxiliary data
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file LICENSE.md Lic. License text
  Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  system  /  plugins  /  psr  /  simple-cache  /  src  
File Role Description
  Plain text file CacheException.php Class Class source
  Plain text file CacheInterface.php Class Class source
  Plain text file InvalidArgumentException.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:33
This week:9
All time:11,027
This week:8Up