Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
31c51c1a5b | |||
171183c0ab |
@ -41,7 +41,7 @@ New classes must be prefaced with a doc-block following this style:
|
|||||||
*
|
*
|
||||||
* This is the admin controller.
|
* This is the admin controller.
|
||||||
*
|
*
|
||||||
* @version 3.0
|
* @version 1.1
|
||||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||||
* @link https://TheTempusProject.com/Hermes
|
* @link https://TheTempusProject.com/Hermes
|
||||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
# Hermes
|
# Hermes
|
||||||
Hermes is a small package to handle routing and autoloading designed in conjunction with [The Tempus Project](https://thetempusproject.com).
|
|
||||||
|
Hermes is a small package to handle routing and autoloading designed in conjunction with
|
||||||
|
[The Tempus Project](https://thetempusproject.com).
|
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* autoload.php
|
* bin/autoload.php
|
||||||
*
|
*
|
||||||
* Uses the Hermes autoloader if it has been defined.
|
* Uses the Hermes autoloader if it has been defined.
|
||||||
*
|
*
|
||||||
* @version 3.0
|
* @version 1.1
|
||||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||||
* @link https://TheTempusProject.com/TempusDebugger
|
* @link https://TheTempusProject.com/Hermes
|
||||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||||
*/
|
*/
|
||||||
namespace TheTempusProject\Hermes;
|
namespace TheTempusProject\Hermes;
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
*
|
*
|
||||||
* This should provide a simple way to add autoloading.
|
* This should provide a simple way to add autoloading.
|
||||||
*
|
*
|
||||||
* @version 3.0
|
* @version 1.1
|
||||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||||
* @link https://TheTempusProject.com/Core
|
* @link https://TheTempusProject.com/Hermes
|
||||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||||
*/
|
*/
|
||||||
namespace TheTempusProject\Hermes\Classes;
|
namespace TheTempusProject\Hermes\Classes;
|
||||||
@ -96,14 +96,27 @@ class Autoloader {
|
|||||||
foreach ( self::$namespaces[ $namespace ] as $key => $folder ) {
|
foreach ( self::$namespaces[ $namespace ] as $key => $folder ) {
|
||||||
if ( file_exists( $folder . $file ) ) {
|
if ( file_exists( $folder . $file ) ) {
|
||||||
$possible_locations[] = $folder . $file;
|
$possible_locations[] = $folder . $file;
|
||||||
|
break;
|
||||||
|
} elseif ( file_exists( $folder . ucfirst( $file ) ) ) {
|
||||||
|
$possible_locations[] = $folder . ucfirst( $file );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$newFile = '';
|
||||||
|
$exploded = explode( '_', $file );
|
||||||
|
foreach ( $exploded as &$value ) {
|
||||||
|
$newFile .= ucfirst( $value );
|
||||||
|
}
|
||||||
|
if ( file_exists( $folder . $newFile ) ) {
|
||||||
|
$possible_locations[] = $folder . $newFile;
|
||||||
|
break;
|
||||||
|
} elseif ( file_exists( $folder . ucfirst( $newFile ) ) ) {
|
||||||
|
$possible_locations[] = $folder . ucfirst( $newFile );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// foreach ( $possible_locations as $location ) {
|
|
||||||
// // report the locations
|
|
||||||
// }
|
|
||||||
if ( !empty( $possible_locations ) ) {
|
if ( !empty( $possible_locations ) ) {
|
||||||
require_once $possible_locations[0];
|
require_once $possible_locations[0];
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
*
|
*
|
||||||
* This class is used for header modification and page redirection.
|
* This class is used for header modification and page redirection.
|
||||||
*
|
*
|
||||||
* @version 3.0
|
* @version 1.1
|
||||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||||
* @link https://TheTempusProject.com/Core
|
* @link https://TheTempusProject.com/Hermes
|
||||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||||
*/
|
*/
|
||||||
namespace TheTempusProject\Hermes\Functions;
|
namespace TheTempusProject\Hermes\Functions;
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
*
|
*
|
||||||
* This class is used to return file and directory locations.
|
* This class is used to return file and directory locations.
|
||||||
*
|
*
|
||||||
* @version 3.0
|
* @version 1.1
|
||||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||||
* @link https://TheTempusProject.com/Core
|
* @link https://TheTempusProject.com/Hermes
|
||||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user