obsidian-moon / framework
An Open Source, Lightweight and 100% Modular Framework in PHP
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.1
- obsidian-moon/engine: ^2.1
Requires (Dev)
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2025-03-01 00:29:43 UTC
README
Installing Obsidian Moon Framework
Because 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:
composer create-project obsidian-moon/framework
Once installed you can change the namespace of your application's files by entering the following into the
composer.json
file:
{ "autoload": { "class-map": ["app/"], "files": ["app/mix.php"], "psr-4": { "ObsidianMoon\\Framework\\": "app/" } } }
File Structure
Once installed, you will find that the application will consist of the following structure.
.
|-- app/ // Application namespace root
| |-- Controllers/ // Controllers for handling routes
| |-- Entity/ // For storing entities, to be explained later
| |-- Modules/ // Modular classes for handling various functionality
|-- config/ // For the presession modifications used by OME
| |-- environment.php // Modifies system values if needed, before the session is started
| |-- routes.php // Routes for the application
|-- node_modules/ // If you use something like webpack, you would .gitignore this folder.
|-- public/ // Contains all the files that are available to user, eg. js, css, images, etc.
| |-- .htaccess // Look in examples for how to best set this
| |-- index.php // The primary entry point to your application.
| |-- ...
|-- src/ // Required library directory used by OME
| |-- js/ // Store your JS source files for webpack
| |-- scss/ // SCSS that will be processed by webpack
| |-- views/ // All view files will go in here
| |-- ...
|-- vendor/ // Composer files needed for application, you can gitignore this
|-- common.php
|-- composer.json
|-- ...
Apache Support
If you use apache you will be able to start setting up the routing by using the following in an .htaccess
file in the
app's public
folder:
<IfModule mod_rewrite.c> # Enabling the mod_rewrite module in this folder RewriteEngine On Options -Indexes # Redirects invalid locations to index RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule>
A more complete .htaccess
file with caching has been included in the public
folder.
Overview of the Base Methods
The framework uses Obsidian Moon Engine, and you can find more details regarding the methods in its README.md
Credits
Obsidian Moon Framework builds on top of Obsidian Moon Engine and uses the following libraries and projects in its development:
- PHP 8 with Composer package manager.
- Symfony 6 Components for HTTP Requests and Routing.
- Node.js with NPM.
- Laravel Mix, a wrapper for webpack to compile assets.
- HTML5 Boilerplate, selected features to create HTML5 foundation for templates and views.
- ESLint and StyleLint for ensuring proper coding in source JS and SCSS.