From 77e41fec2cf6d99abda9a4ba27436f87e3468d62 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 16 Oct 2015 13:18:33 +0200 Subject: Fix for not-namespaced interface loading --- framework/PradoBase.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3