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

Overview

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.

Comments
  • Restrict Choices for Encrypter's Ciphers

    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.

    enhancement 
    opened by davidbyoung 18
  • Publish a coding standards document

    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

    enhancement 
    opened by connerbw 16
  • [FEATURE] QueryBuilder::whereIn

    [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.

    opened by MaartenStaa 15
  • phpDocumentor problem

    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

    wontfix 
    opened by adrix71 12
  • Migration errors

    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.

    opened by peteraba 11
  • Environment setup is extremely confusing.

    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.

    opened by Garbee 8
  • Initial efforts for PHP8 support

    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
    opened by peteraba 7
  • unambiguous migration ordering during running migrations:down

    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.

    bug 
    opened by peteraba 7
  • Update default path to localhost_router.php

    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.

    bug 
    opened by adamaltman 7
  • ensure ENV_NAME and Environment::name are never out of sync

    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.

    opened by itised 7
  • Suggestion: Add option to clear console cache for apex

    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.

    enhancement 
    opened by exts 6
Releases(v1.2.2)
  • v1.2.2(Feb 20, 2022)

    This release fixed a bug when the PHP binary path contains a space. It also converted all CI to use GitHub Actions instead of TravisCI and splitsh locally.

    Source code(tar.gz)
    Source code(zip)
Owner
Opulence
Opulence PHP framework
Opulence
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

Nazar Mokrynskyi 150 Apr 12, 2022
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.

Flare framework 3 Oct 24, 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

CodeIgniter 4 web framework 4.5k Jan 4, 2023
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

Yii Software 14k Dec 31, 2022
Simple, fast and secure PHP Framework with easy integration.

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

winact 2 Nov 23, 2021
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.

Sajidur Rahman 3 Jul 2, 2022
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

null 0 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

Digia 12 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

Pods Foundation, Inc 982 Jan 4, 2023
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.

Alvaro Graves 31 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

Anton 1 Dec 21, 2021
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

Hasmukh Dharajiya 2 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.

UnknownRori 5 Jul 28, 2022
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

Márrios 5 Jul 19, 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

Christian Lück 620 Jan 7, 2023
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

Hoang hieu 9 Oct 25, 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 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.

Leaf Framework 706 Jan 3, 2023
Kit is a lightweight, high-performance and event-driven web services framework that provides core components such as config, container, http, log and route.

Kit What is it Kit is a lightweight, high-performance and event-driven web services framework that provides core components such as config, container,

null 2 Sep 23, 2022