From 6ae19996a74d508483ea60a17f026af2b65d07ab Mon Sep 17 00:00:00 2001 From: amolkisan Date: Thu, 2 Jul 2015 18:46:18 +0530 Subject: [PATCH] Applied versioning code to set path in com_api (resource.php) library itself This is to set resource path if there is version provided in API url. --- code/site/libraries/resource.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/site/libraries/resource.php b/code/site/libraries/resource.php index d6659cc..68e662f 100755 --- a/code/site/libraries/resource.php +++ b/code/site/libraries/resource.php @@ -88,6 +88,10 @@ final public static function addIncludePath( $path=null ) { // no surrounding spaces allowed! $dir = trim($dir); + //Added to check if version exists and append version directory ++ $version = JFactory::getApplication()->input->get('version', 0); ++ if ($version > 0 && JFolder::exists($dir.'/'.$version)) ++ $dir=$dir.'/'.$version; // add to the top of the search dirs // so that custom paths are searched before core paths