61 lines
1.4 KiB
Markdown
61 lines
1.4 KiB
Markdown
|
|
# Hermes
|
|
|
|
Hermes is a small package to handle redirects, routing, and autoloading. This library id developed in conjunction with [The Tempus Project](https://thetempusproject.com).
|
|
|
|
## Installation
|
|
|
|
To install, simply use the composer command:
|
|
|
|
`php composer.phar require thetempusproject/hermes`
|
|
|
|
`composer require thetempusproject/hermes`
|
|
|
|
## Usage
|
|
|
|
Typical usage would be through including the package via composer.
|
|
|
|
```php
|
|
|
|
require_once VENDOR_DIRECTORY . 'autoload.php';
|
|
|
|
use TheTempusProject\Hermes\Functions\Redirect;
|
|
|
|
if ( ! App::$isAdmin ) {
|
|
return Redirect::home();
|
|
}
|
|
|
|
```
|
|
|
|
If you would like to use hermes own autoloading, simply inclode the constants file and the autoload file inside `/bin/`.
|
|
|
|
```php
|
|
|
|
use TheTempusProject\Hermes\Functions\Redirect;
|
|
|
|
// Hermes Constants
|
|
if ( ! defined( 'HERMES_CONSTANTS_LOADED' ) ) {
|
|
if ( defined( 'HERMES_CONFIG_DIRECTORY' ) ) {
|
|
require_once HERMES_CONFIG_DIRECTORY . 'constants.php';
|
|
}
|
|
}
|
|
|
|
// Hermes Autoloader (Autoloader)
|
|
if ( ! defined( 'HERMES_AUTOLOADED' ) ) {
|
|
if ( defined( 'HERMES_ROOT_DIRECTORY' ) ) {
|
|
require_once HERMES_ROOT_DIRECTORY . 'bin' . DIRECTORY_SEPARATOR . 'autoload.php';
|
|
}
|
|
}
|
|
|
|
Redirect::home();
|
|
|
|
```
|
|
|
|
## Issues / Bugs / Contact
|
|
|
|
If anyone actually uses this library and runs into any issues, feel free to contact me and I'll look into it.
|
|
|
|
[Joey Kimsey](mailto:Joey@thetempusproject.com) - _Lead Developer_
|
|
|
|
[JoeyKimsey.com](https://JoeyKimsey.com)
|