2 Commits
1.0 ... 1.0.2

Author SHA1 Message Date
31c51c1a5b bugfix for camelCase filenames 2024-08-20 06:26:47 -04:00
171183c0ab release prep 2024-08-12 22:56:27 -04:00
6 changed files with 30 additions and 15 deletions

View File

@ -41,7 +41,7 @@ New classes must be prefaced with a doc-block following this style:
*
* This is the admin controller.
*
* @version 3.0
* @version 1.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/Hermes
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -1,2 +1,4 @@
# 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).

View File

@ -1,12 +1,12 @@
<?php
/**
* autoload.php
* bin/autoload.php
*
* Uses the Hermes autoloader if it has been defined.
*
* @version 3.0
* @version 1.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/TempusDebugger
* @link https://TheTempusProject.com/Hermes
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Hermes;

View File

@ -4,9 +4,9 @@
*
* This should provide a simple way to add autoloading.
*
* @version 3.0
* @version 1.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/Core
* @link https://TheTempusProject.com/Hermes
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Hermes\Classes;
@ -96,14 +96,27 @@ class Autoloader {
foreach ( self::$namespaces[ $namespace ] as $key => $folder ) {
if ( file_exists( $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 ) ) {
require_once $possible_locations[0];
return;
}
}

View File

@ -4,9 +4,9 @@
*
* This class is used for header modification and page redirection.
*
* @version 3.0
* @version 1.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/Core
* @link https://TheTempusProject.com/Hermes
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Hermes\Functions;

View File

@ -4,9 +4,9 @@
*
* This class is used to return file and directory locations.
*
* @version 3.0
* @version 1.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/Core
* @link https://TheTempusProject.com/Hermes
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/