From: <txm...@us...> - 2015-06-03 10:42:47
|
Revision: 13078 http://sourceforge.net/p/xoops/svn/13078 Author: txmodxoops Date: 2015-06-03 10:42:45 +0000 (Wed, 03 Jun 2015) Log Message: ----------- Fixed conflict autoload.php Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/building.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/autoload.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php 2015-06-03 09:42:10 UTC (rev 13077) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php 2015-06-03 10:42:45 UTC (rev 13078) @@ -16,7 +16,7 @@ * @package tdmcreate * @since 2.5.0 * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $ + * @version $Id: autoload.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -26,31 +26,32 @@ ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); -function applicationAutoloader($class) { - $classFilename = $class.'.php'; - $cacheFile = __DIR__ . '/cache/classpaths.cache'; - $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array(); - if (!is_array($pathCache)) { $pathCache = array(); } - - if (array_key_exists($class, $pathCache)) { - /* Load class using path from cache file (if the file still exists) */ - if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; } +if(!function_exists('application_autoloader')) { + function application_autoloader($class) { + $classFilename = $class.'.php'; + $cacheFile = __DIR__ . '/cache/classpaths.cache'; + $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array(); + if (!is_array($pathCache)) { $pathCache = array(); } + + if (array_key_exists($class, $pathCache)) { + /* Load class using path from cache file (if the file still exists) */ + if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; } - } else { - /* Determine the location of the file within the $class_root and, if found, load and cache it */ - $directories = new RecursiveDirectoryIterator(__DIR__); - foreach(new RecursiveIteratorIterator($directories) as $file) { - if ($file->getFilename() == $classFilename) { - $fullPath = $file->getRealPath(); - $pathCache[$class] = $fullPath; - require_once $fullPath; - break; - } - } + } else { + /* Determine the location of the file within the $class_root and, if found, load and cache it */ + $directories = new RecursiveDirectoryIterator(__DIR__); + foreach(new RecursiveIteratorIterator($directories) as $file) { + if ($file->getFilename() == $classFilename) { + $fullPath = $file->getRealPath(); + $pathCache[$class] = $fullPath; + require_once $fullPath; + break; + } + } + } + + $serialized_paths = serialize($pathCache); + if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); } } - - $serialized_paths = serialize($pathCache); - if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); } -} - -spl_autoload_register('applicationAutoloader'); \ No newline at end of file + spl_autoload_register('application_autoloader'); +} \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/building.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/building.php 2015-06-03 09:42:10 UTC (rev 13077) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/building.php 2015-06-03 10:42:45 UTC (rev 13078) @@ -21,7 +21,7 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); - +include __DIR__ . '/autoload.php'; /** * Class TDMCreateBuilding */ Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-03 09:42:10 UTC (rev 13077) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-03 10:42:45 UTC (rev 13078) @@ -19,8 +19,6 @@ * @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -// Autoloader Classes -include __DIR__ . '/autoload.php'; /* * @Class TDMCreateFields * @extends XoopsObject Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/autoload.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/autoload.php 2015-06-03 09:42:10 UTC (rev 13077) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/autoload.php 2015-06-03 10:42:45 UTC (rev 13078) @@ -16,7 +16,7 @@ * @package tdmcreate * @since 2.5.0 * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $ + * @version $Id: autoload.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -26,31 +26,32 @@ ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); -function applicationAutoloader1($class) { - $classFilename = $class.'.php'; - $cacheFile = __DIR__ . '/cache/classpaths.cache'; - $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array(); - if (!is_array($pathCache)) { $pathCache = array(); } - - if (array_key_exists($class, $pathCache)) { - /* Load class using path from cache file (if the file still exists) */ - if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; } +if(!function_exists('application_autoloader')) { + function application_autoloader($class) { + $classFilename = $class.'.php'; + $cacheFile = __DIR__ . '/cache/classpaths.cache'; + $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array(); + if (!is_array($pathCache)) { $pathCache = array(); } + + if (array_key_exists($class, $pathCache)) { + /* Load class using path from cache file (if the file still exists) */ + if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; } - } else { - /* Determine the location of the file within the $class_root and, if found, load and cache it */ - $directories = new RecursiveDirectoryIterator(__DIR__); - foreach(new RecursiveIteratorIterator($directories) as $file) { - if ($file->getFilename() == $classFilename) { - $fullPath = $file->getRealPath(); - $pathCache[$class] = $fullPath; - require_once $fullPath; - break; - } - } + } else { + /* Determine the location of the file within the $class_root and, if found, load and cache it */ + $directories = new RecursiveDirectoryIterator(__DIR__); + foreach(new RecursiveIteratorIterator($directories) as $file) { + if ($file->getFilename() == $classFilename) { + $fullPath = $file->getRealPath(); + $pathCache[$class] = $fullPath; + require_once $fullPath; + break; + } + } + } + + $serialized_paths = serialize($pathCache); + if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); } } - - $serialized_paths = serialize($pathCache); - if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); } -} - -spl_autoload_register('applicationAutoloader1'); \ No newline at end of file + spl_autoload_register('application_autoloader'); +} \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-03 09:42:10 UTC (rev 13077) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-03 10:42:45 UTC (rev 13078) @@ -20,7 +20,7 @@ * @version $Id: 1.91 tables.php 11297 2013-03-24 10:58:10Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -include __DIR__ . '/autoload.php'; +include TDMC_CLASSES_PATH . '/autoload.php'; /* * @Class TDMCreateTables * @extends XoopsObject |