diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2015-10-16 13:18:33 +0200 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2015-10-16 13:18:33 +0200 |
commit | 77e41fec2cf6d99abda9a4ba27436f87e3468d62 (patch) | |
tree | aefad49f1a1bd64eafdac9369e8f8477f236fadb | |
parent | df99958863a061065c95a9c7910374325529d542 (diff) |
Fix for not-namespaced interface loadingnamespace
-rw-r--r-- | framework/PradoBase.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/framework/PradoBase.php b/framework/PradoBase.php index e60daafb..4b3003ca 100644 --- a/framework/PradoBase.php +++ b/framework/PradoBase.php @@ -271,6 +271,12 @@ class PradoBase self::$classExists[$type] = class_exists($type, false); } + /* + * Old apps compatibility support: if the component name has been specified using the + * old namespace syntax (eg. Application.Common.MyDataModule), assume that the calling + * code expects the class not to be php5.3-namespaced (eg: MyDataModule instead of + * \Application\Common\MyDataModule) + */ if( ($pos = strrpos($type, '\\')) !== false & ($requestedType != $type)) $type = substr($type,$pos+1); @@ -336,7 +342,7 @@ class PradoBase } } - if($checkClassExistence && !class_exists($namespace,false)) + if($checkClassExistence && !class_exists($namespace,false) && !interface_exists($namespace,false)) throw new TInvalidOperationException('prado_component_unknown',$namespace,''); } else if(($path=self::getPathOfNamespace($namespace,self::CLASS_FILE_EXT))!==null) |