Download the PHP package codebjorn/mjolnir without Composer
On this page you can find all versions of the php package codebjorn/mjolnir. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codebjorn/mjolnir
More information about codebjorn/mjolnir
Files in codebjorn/mjolnir
Package mjolnir
Short Description WordPress Utility Framework
License MIT
Homepage https://github.com/quotesun/mjolnir
Informations about the package mjolnir
Mjölnir, WordPress Utility Framework
Mjölnir is small utility framework that gives utilities and possibilities to create WordPress plugins & themes using best of PHP. This package is compliant with PSR-1, PSR-2, PSR-4 and PSR-11.
If you think this approach is not working, please open an issue and let's discuss :)
Already made implementations
To see already made implementations please check official boilerplates:
Pre-Requirements
Before we proceed further:
-
I suggest you to read documentation of PHP League Container.
Mjölnir it uses as to provide Dependency Injection in your application. - Also, if you will use default template engine, check documentation of BladeOne
Requirements
Requirements for this framework are:
- PHP 7.1+
- Composer
Installation
You can install framework via composer:
Copy stubs from folder stubs
to your folder, rename app
folder if is need it and update {{namespace}}
with
application namespace
In a nutshell
Base of framework is dependency injection container, that stores some utility classes for: configuration, render, exception handling, hooks, blocks and all other services that you add and resolve, after all of that you add your service to hook.
As example, you have class that add some WP functionality PostTypes.php
, you resolve all dependencies
in ServiceProvider
and after apply it to a hook
Utilities
To explain how utilities works, let's take a look to each namespace that has utilities
Admin
Admin namespace contains utilities for add new features on admin side:
-
Option.php
is a wrapper of functions related to Option Api, examples: Page.php
is a wrapper for all functions related to creating a page in admin, examples:
Content
Content namespace contains utilities for creating different content solutions that WordPress has:
-
PostType.php
allows you easy to create different custom post types, example: -
Taxonomy.php
allows you easy to create different taxonomies, example: Shortcode.php
is a wrapper for functions related to Shortcode Api, example:
Database
Database namespace contains utilities for database interaction:
Query.php
is a wrapper for WP Query arguments
Routing
Routing namespace contains utilities related to routing system of WordPress such as Api:
Api.php
is a wrapper of all functions related to REST API, example:
Support
Support namespace contains utilities that will help you work with data:
-
Arr.php
is utility class that allows you to manipulate with array, examples: -
Collection.php
is class for working with arrays of data, examples: -
Is.php
is wrapper for functions to determine type of variable, examples: Str.php
is class to manipulate with string, examples:
Utils
Utils namespace contains utilities for working with plugins and themes:
-
Enqueue.php
is wrapper of functions related to enqueue, example: -
Post.php
is wrapper of WP_Post that gives better API to get post, example: Theme.php
is wrapper of functions related to theme, example:
Facades
Facades are API that allows you to create a class that will get resolved class from container, check stubs/app/Facades
to check default facades:
-
Action.php
give access to action hook, example: -
Filter.php
give access to filter hook, example: -
Block.php
give access to class related to block, example: -
Config.php
give access to config files, example: View.php
give access to view file for render, example:
Testing
//TODO
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Dorin Lazar
- All Contributors
License
The MIT License (MIT). Please see License File for more information.