Opulence is a PHP web application framework that simplifies the difficult parts of creating and maintaining a secure, scalable website.

Last update: Jul 10, 2022

Opulence

Build Status Latest Stable Version Latest Unstable Version License

Introduction

Opulence is a PHP web application framework that simplifies the difficult parts of creating and maintaining a secure, scalable website. With Opulence, things like database management, caching, ORM, page templates, and routing are a cinch. It was written with customization, performance, and best-practices in mind. Thanks to test-driven development (TDD), the framework is reliable and thoroughly tested. Opulence is split into components, which can be installed separately or bundled together.

Installation

Opulence can be installed using Composer:

composer create-project opulence/project --prefer-dist

Documentation

For complete documentation, visit the official website.

Requirements

  • PHP 7.3
  • OpenSSL
  • mbstring

License

This software is licensed under the MIT license. Please read the LICENSE for more information.

Author

Opulence was written by David Young.

GitHub

https://github.com/opulencephp/opulence
Comments
  • 1. Restrict Choices for Encrypter's Ciphers

    Currently, the encrypter class lets you select broken ciphers. I propose restricting the ciphers you're allowed to select. If a broken cipher is selected, an \InvalidArgumentException should be thrown.

    Reviewed by davidbyoung at 2016-06-23 12:07
  • 2. Publish a coding standards document

    Hi, great project.

    Your code is very consistent but doesn't always match Symfony / PSR style. For example: Use of double quotes instead of single quotes even though there is no "$var" inside the string, single line PHPDoc comments for class properties, ...

    It would be nice if you could publish a document explaining what style you expect contributors to adhere to.

    Bonus points if I could import it into PHPStorm.

    Thanks.

    screenshot from 2017-01-10 11-06-58

    Reviewed by connerbw at 2017-01-10 16:14
  • 3. [FEATURE] QueryBuilder::whereIn

    It would be nice if the query builder supported a whereIn function, along with orWhereIn. This is something I miss quite often also in other frameworks.

    Example usage:

    use Opulence\QueryBuilders\PostgreSql\QueryBuilder;
    
    $query = (new QueryBuilder)->select("id", "name", "email")
        ->from("users")
        ->whereIn("id", [1, 2, 3])
        ->orWhereIn("email", ["[email protected]", "[email protected]"]);
    echo $query->getSql();
    

    This would output:

    SELECT id, name, email FROM users WHERE id IN (?, ?, ?) OR email IN (?, ?)
    

    I wouldn't mind giving implementing this a shot, the only question is whether this should default to using named or unnamed parameters. Perhaps it could default to unnamed, with an optional parameter to use named parameters? I'd like to hear what you think.

    Reviewed by MaartenStaa at 2016-06-22 14:52
  • 4. phpDocumentor problem

    Nice framework but unfortunately phpDocumentor does not read the IO\Stream folder probably because Opulence uses reserved names or because it does not support: void as return value.

    Unfortunately I do not know the reason.

    Could you resolve please?

    Thank you

    Reviewed by adrix71 at 2018-01-09 14:50
  • 5. Migration errors

    While developing AbterPHP, I ran the migrations hundreds of times and it kept bugging me to debug query errors, because currently the migration commands wouldn't even tell me that there was an error. With these changes I would be able to create a migration class like this:

    <?php
    
    declare(strict_types=1);
    
    namespace AbterPhp\Framework\Databases\Migrations;
    
    use Opulence\Databases\Migrations\Migration;
    
    class BaseMigration extends Migration
    {
        // ...
    
        /**
         * @inheritdoc
         */
        public function down(): bool
        {
            $sql       = 'SELECT 1';
            $statement = $this->connection->prepare($sql);
            if (!$statement->execute()) {
                $this->errors = $statement->errorInfo();
    
                return false;
            }
    
            return true;
        }
    
        /**
         * @inheritdoc
         */
        public function up(): bool
        {
            $sql       = 'SELECT 1';
            $statement = $this->connection->prepare($sql);
            if (!$statement->execute()) {
                $this->errors = $statement->errorInfo();
    
                return false;
            }
    
            return true;
        }
    }
    

    Obviously this change would warrant at least a minor version bump, if not a major one.

    Reviewed by peteraba at 2019-08-14 16:33
  • 6. Environment setup is extremely confusing.

    The entire environment setup is quite confusing to use. While it is possible to integrate it with other tools such as phinx, it isn't easy nor convenient.

    Dotenv is a fantastic package maintained by Vance that provides a seamless environment configuration experience. Simple to use and share between tooling.

    Could a move to using Dotenv be considered? Taking advantage of it will provide the best experience to developers.

    Reviewed by Garbee at 2016-06-21 23:42
  • 7. Initial efforts for PHP8 support

    There are two main topics to be solved:

    1. Some PDO adapters are not compatible with \PDO classes they extend (Connection, Statement)
    2. Reflection usage. Especially relying on the now deprecated ReflectionParameter::getClass. Additionally it seems like something has changed in regards to tokenization / autoloader, because the ReflectionClass constructor fails for the parsed migrations in FileMigrationFinder
    Reviewed by peteraba at 2021-03-07 11:47
  • 8. unambiguous migration ordering during running migrations:down

    Issue description

    The executedmigrations table will contain the datetime of the execution in the daterun column and this would be then used for finding the latest executed migration if you ran ./apex migrations:down. The problem is, if you ran previous migrations at once before, this will not provide a sufficient way to select the latest migration run. Instead it will pick a random one executed in the exact second of the truly last executed one.

    Example

    Code

    namespace AbterPhp\Users\Databases\Migrations;
    // ...
    class Init extends Migration
    {
        // ...
        public static function getCreationDate(): DateTime
        {
            return DateTime::createFromFormat(DateTime::ATOM, '2019-02-28T21:00:00+00:00');
        }
        // ...
    }
    
    namespace AbterPhp\Pages\Databases\Migrations;
    // ...
    class Init extends Migration
    {
        // ...
        public static function getCreationDate(): DateTime
        {
            return DateTime::createFromFormat(DateTime::ATOM, '2019-02-28T21:01:00+00:00');
        }
        // ...
    }
    
    namespace AbterPhp\Files\Databases\Migrations;
    // ...
    class Init extends Migration
    {
        // ...
        public static function getCreationDate(): DateTime
        {
            return DateTime::createFromFormat(DateTime::ATOM, '2019-02-28T22:00:00+00:00');
        }
        // ...
    }
    
    namespace AbterPhp\Contact\Databases\Migrations;
    // ...
    class Init extends Migration
    {
        // ...
        public static function getCreationDate(): DateTime
        {
            return DateTime::createFromFormat(DateTime::ATOM, '2019-02-28T23:00:00+00:00');
        }
        // ...
    }
    

    Database

    | migration | daterun | --------------| -----------| AbterPhp\Users\Databases\Migrations\Init | 2019-03-04 12:03:43 | AbterPhp\Contact\Databases\Migrations\Init | 2019-03-04 12:03:44 | AbterPhp\Files\Databases\Migrations\Init | 2019-03-04 12:03:44 | AbterPhp\Pages\Databases\Migrations\Init | 2019-03-04 12:03:44 |

    It may any of the last 3 for migrate:down.

    Incomplete list of potential fixes

    1. Replace daterun column with a time format which will contain some high resolution time. (Backwards compatible, but requires a schema upgrade)
    2. Store the getCreationDate in a column and use that as a second sorting parameter when selecting the "last run" migration.
    3. Retrieve all migrations run at the same time as the "last" one and select the migration with the latest getCreationDate returned. (Backwards compatible and no schema upgrade necessary, but he query will be somewhat harder to understand, and could lead to problems if someone changes the getCreatedAt value of a migration.)
    4. ~~Sleep 1 second before executing consecutive schema upgrades.~~ :smile:

    Note: Using microseconds as high resolution time is probably enough in most cases although it might just make it harder to reproduce the issue. Giving an option to use hrtime instead could have benefits, but only doable in PHP at the moment afaik. (https://pecl.php.net/package/hrtime, http://php.net/manual/en/function.hrtime.php) Without hrtime precision it might make sense to combine more solutions too.

    Reviewed by peteraba at 2019-03-06 14:37
  • 9. Update default path to localhost_router.php

    I just installed the skeleton, but was receiving this error:

    /project$ php apex app:runlocally
    Running at http://localhost:80
    [Fri Dec 22 11:05:39 2017] PHP Warning:  Unknown: failed to open stream: No such file or directory in Unknown on line 0
    [Fri Dec 22 11:05:39 2017] PHP Fatal error:  Unknown: Failed opening required '/project/public/localhost_router.php' (include_path='.:/usr/share/php') in Unknown on line 0
    

    This patch I am submitting fixed the issue for me.

    Reviewed by adamaltman at 2017-12-22 17:33
  • 10. ensure ENV_NAME and Environment::name are never out of sync

    The Opulence starter project sets ENV_NAME as an environment variable, and that environment variable is then used to set the Environmnet::name. If the ENV_NAME variable is changed, or the Environment::name member is changed, the two values would no longer have been equal.

    Reviewed by itised at 2016-09-09 15:44
  • 11. Suggestion: Add option to clear console cache for apex

    One thing I learned is that there's a cache file for console that almost instantly gets cached in tmp/framework/console called cachedBootstrapperRegistry.json and say if you remove a bootstrap class it'll throw a fatal error making apex compeltely unusable because it's looking for a class that doesn't exist anymore.

    My suggestion is to be able to call: php apex --hard-cache-clear which does one thing and that's to clear the cache directly and nothing else that way you won't have to manually do it to get apex working again.

    I'm still learning Opulence, so maybe I'll try creating a PR if I figure it out tonight.

    Reviewed by exts at 2016-11-17 18:39
CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework

CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework. It is free, Open Source and is distributed under Free Public Lice

Apr 12, 2022
Flare is a PHP full-stack web framework that is light, fast, flexible, and secure.
Flare is a PHP full-stack web framework that is light, fast, flexible, and secure.

Flare framework is a PHP full-stack web framework that is simple ,powerful , fast , flexible, and secure with long-term support.

Jul 27, 2022
CodeIgniter - a PHP full-stack web framework that is light, fast, flexible and secure

CodeIgniter 4 Development What is CodeIgniter? CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure. More informatio

Aug 16, 2022
Implementing programming best practices and patterns, and creating a custom PHP framework from scratch.

Implementing programming best practices and patterns, and creating a custom PHP framework from scratch.

Jul 2, 2022
Yii 2: The Fast, Secure and Professional PHP Framework
Yii 2: The Fast, Secure and Professional PHP Framework

Yii 2 is a modern framework designed to be a solid foundation for your PHP application. It is fast, secure and efficient and works right out of the bo

Aug 14, 2022
Simple, fast and secure PHP Framework with easy integration.

simple-php-framework Simple, fast and secure PHP Framework with easy integration.

Nov 23, 2021
Mind is the PHP code framework designed for developers. It offers a variety of solutions for creating design patterns, applications and code frameworks.
Mind is the PHP code framework designed for developers. It offers a variety of solutions for creating design patterns, applications and code frameworks.

Mind Mind is the PHP code framework designed for developers. It offers a variety of solutions for creating design patterns, applications and code fram

Dec 13, 2021
Extension for creating and sending emails for the Yii PHP framework.

yii-emailer Extension for creating and sending emails for the Yii PHP framework. Usage Migrate the email_message database table by this command: yiic

Mar 30, 2022
Pods is a development framework for creating, extending, managing, and deploying customized content types in WordPress.

Pods Framework Pods is a development framework for creating, extending, managing, and deploying customized content types in WordPress. Description Che

Aug 4, 2022
LODSPeaKr is a framework for creating Linked Data applications in a simple and easy way

LODSPeaKr is a framework for creating Linked Data applications in a simple and easy way. You can see several applications created using LODSPeaKr.

Jun 23, 2020
FlyCubePHP is an MVC Web Framework developed in PHP and repeating the ideology and principles of building WEB applications, embedded in Ruby on Rails.

FlyCubePHP FlyCubePHP is an MVC Web Framework developed in PHP and repeating the ideology and principles of building WEB applications, embedded in Rub

Dec 21, 2021
Basis for creating a CLI with php

Firulin-core v1 From Firulin-core you can create a CLI any way you want, adding new commands easily. Requeriments PHP 7.4^ Composer Get started co

Jul 19, 2022
Laravel 8 Project Restrict User Access From IP Addresses. prevent other ip address that want to access over secure api or urls.

block-ip-address-laravel Laravel 8 Project Restrict User Access From IP Addresses. prevent other ip address that want to access over secure api or url

Mar 24, 2022
Rori-PHP is custom non production web application framework inspired by Laravel syntax

Rori-PHP is custom non production web application framework inspired by Laravel syntax. A web framework provides a structure and starting point for your application allowing you to focus on creating something amazing.

Jul 28, 2022
Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

Framework X Framework X – the simple and fast micro framework for building reactive web applications that run anywhere. Quickstart Documentation Tests

Aug 9, 2022
Improve Core Web Vital score for Magento 2 website

Magento 2 Optimization for Google Insights This modules allows you modify the HTML, Javascript, CSS, update the position, optimize CWV (Core Web Vital

Jul 9, 2022
Leaf is a PHP framework that helps you create clean, simple but powerful web apps and APIs quickly and easily.
Leaf is a PHP framework that helps you create clean, simple but powerful web apps and APIs quickly and easily.

Leaf is a PHP framework that helps you create clean, simple but powerful web apps and APIs quickly and easily. Leaf introduces a cleaner and much simpler structure to the PHP language while maintaining it's flexibility. With a simple structure and a shallow learning curve, it's an excellent way to rapidly build powerful and high performant web apps and APIs.

Aug 6, 2022
Newsprint is a simple web application that will fetch the front page of a newspaper and display it on an eink display
Newsprint is a simple web application that will fetch the front page of a newspaper and display it on an eink display

Newsprint is a simple web application that will fetch the front page of a newspaper and display it on an eink display. The specific resolutions and sizes have been setup to work with a 32" eInk place & play display from Visionect but can be modified for other screen resolutions.

Aug 6, 2022