Skip to content

Commit 9ddd9f2

Browse files
committed
Fixes the bug with autoloading format classes and thus fixes issue Luracast#59 allowing us to subclass format classes with out manually including them
1 parent 7d68db3 commit 9ddd9f2

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

restler/restler.php

+11-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @copyright 2010 Luracast
1111
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
1212
* @link http://luracast.com/products/restler/
13-
* @version 2.1.9
13+
* @version 2.2.0
1414
*/
1515
class Restler
1616
{
@@ -20,7 +20,7 @@ class Restler
2020
//
2121
// ------------------------------------------------------------------
2222

23-
const VERSION = '2.1.9';
23+
const VERSION = '2.2.0';
2424

2525
/**
2626
* URL of the currently mapped service
@@ -1422,10 +1422,15 @@ function autoload_formats($class_name)
14221422
{
14231423
$class_name = strtolower($class_name);
14241424
$file = RESTLER_PATH . "/$class_name/$class_name.php";
1425-
if (file_exists($file)) {
1426-
require_once($file);
1427-
} else if (file_exists("$class_name.php")) {
1428-
require_once ("$class_name.php");
1425+
if (file_exists ($file)) {
1426+
require_once ($file);
1427+
} else {
1428+
$file = RESTLER_PATH . "/$class_name.php";
1429+
if (file_exists ($file)) {
1430+
require_once ($file);
1431+
} elseif (file_exists ("$class_name.php")) {
1432+
require_once ("$class_name.php");
1433+
}
14291434
}
14301435
}
14311436

0 commit comments

Comments
 (0)