Download the PHP package obsidian-moon/engine without Composer
On this page you can find all versions of the php package obsidian-moon/engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download obsidian-moon/engine
More information about obsidian-moon/engine
Files in obsidian-moon/engine
Package engine
Short Description An Open Source, Lightweight and 100% Modular Framework in PHP
License MIT
Homepage https://github.com/obsidian-moon/engine
Informations about the package engine
Obsidian Moon Engine
This is a project that I have worked on for several years after wanting a completely modular framework. I am aiming for lightweight and able to include any modules from other applications, etc.
Installing Obsidian Moon Engine
Since Obsidian Moon Engine uses Composer you will need to install it before you can run the code with it. Once you have installed Composer you will then be able to install it by running the following command:
Alternatively, you can install the Obsidian Moon Framework with a prebuilt structure, by using the following command. Click the link for additional information.
Implelementation
To see a complete implementation of these features review the common.php file from the Obsidian Moon Framework. However, below are expanded examples which you can read to see all the optional features in use.
Controllers
Controllers are simple classes that hold methods that can be called from the ControllerHandler
class. You can extend
the builtin abstract class AbstractController
and pass it your views folder configuration, as follows:
Controller Handler
In your application, you can pass information regarding your controller from symfony/routing
or by passing an array
with _controller
declared. It will return a Symfony Response once the ControllerHandler::render()
method is called,
and it has found the class and method declared:
Exception Handler
You can utilize the use of a custom Exception Handler to handle whether the error message is shown or a custom error is. You can do so as follows:
View Handler
The view handler will look for the location it is passed and find a file with the name that is declared and can return its value, or store it in the output property for later use. There are various ways it can be used, but the most common is as follows:
Complete List of Changes
Credits
Obsidian Moon Engine uses the following libraries and projects in its development:
- PHP 8 with Composer package manager.
- Symfony 6 Components for HTTP Requests and Routing.
Summary of Obsidian Moon Engine
Most of the code for this is meant to keep it as modular as possible. With version 1.x
I found that I ended up having
to repeat a lot of the code because of how routing was unable to be handled automatically. Using symfony routes
components ended up solving that issue. However, I was forced to rewrite the code to where it was simpler. I hope
that you find this code as useful as I have. And, I will continue to add to it as I expand it with my projects.
Regards,
Alfonso Martinez
Obsidian Moon Development
All versions of engine with dependencies
vlucas/phpdotenv Version ^5.5
symfony/routing Version ^6.2
symfony/http-foundation Version ^6.2