Skip to content

Commit b0cc306

Browse files
committed
1.23 see README.md
1 parent 30e6023 commit b0cc306

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

AutoLoadOne.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545
*
4646
* @copyright Jorge Castro C. MIT License https://github.com/EFTEC/AutoLoadOne
4747
*
48-
* @version 1.22.2 2021-02-26
48+
* @version 1.23 2021-02-26
4949
* @noautoload
5050
*/
5151
class AutoLoadOne
5252
{
53-
const VERSION = '1.22.2';
53+
const VERSION = '1.23';
5454

5555

5656
public $rooturl = '';
@@ -548,10 +548,14 @@ public function genautoload($file, $namespaces, $namespacesAlt, $pathAbsolute, $
548548
function {{tempname}}__auto($class_name)
549549
{
550550
// its called only if the class is not loaded.
551-
$ns = dirname($class_name); // without trailing
552-
$ns = ($ns === '.') ? '' : $ns;
553-
$cls = explode('\\',$class_name);
554-
$cls = end($cls);
551+
$p=strrpos($class_name,'\\');
552+
if($p!==false) {
553+
$ns=substr($class_name,0,$p);
554+
$cls=substr($class_name,$p+1);
555+
} else {
556+
$ns='';
557+
$cls=$class_name;
558+
}
555559
// special cases
556560
if (isset($GLOBALS['{{tempname}}__arrautoloadCustom'][$class_name])) {
557561
{{tempname}}__loadIfExists($GLOBALS['{{tempname}}__arrautoloadCustom'][$class_name]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,8 @@ reads the composer.json files once.
556556

557557
## Version
558558

559+
* 1.23 2021-02-26
560+
* Updatted the file generated.
559561
* 1.22.2 2021-02-26
560562
* fixed composer.json
561563
* 1.22.1 2021-02-26

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "eftec/autoloadone",
33
"description": "AutoloadOne is a program that generates an autoload class for PHP.",
44
"type": "software",
5-
"version": "1.22.2",
5+
"version": "1.23",
66
"keywords": ["php","autoload"],
77
"homepage": "https://github.com/EFTEC/AutoLoadOne",
88
"minimum-stability": "beta",

0 commit comments

Comments
 (0)