I have this code in an autoload function:
static function tbs($class) {
$path = TINY_MVC_DIR.'vendor'.DS.'tbs'.DS;
if($class == 'clsTinyButStrong') {
$file = $path . 'tbs_class.php';
if(file_exists($file)) {
$file = $path . 'plugins' .DS . 'tbs_plugin_ezsql.php';
if(file_exists($file)) include $file;
$file = $path . 'plugins' .DS . 'tbsdb_pdo.php';
if(file_exists($file)) include $file;
$file = $path . 'plugins' .DS . 'tbs_plugin_html.php';
if(file_exists($file)) include $file;
$file = $path . 'plugins' .DS . 'tbs_plugin_bypage.php';
if(file_exists($file)) include $file;
$file = $path . 'plugins' .DS . 'tbs_plugin_cache.php';
if(file_exists($file)) include $file;
$file = $path . 'plugins' .DS . 'tbs_plugin_mergeonfly.php';
if(file_exists($file)) include $file;
$file = $path . 'plugins' .DS . 'tbs_plugin_navbar.php';
if(file_exists($file)) include $file;
$file = $path . 'plugins' .DS . 'tbsdb_csv_php5.php';
if(file_exists($file)) include $file;
$file = $path . 'plugins' .DS . 'opentbs' . DS . 'tbs_plugin_opentbs.php';
if(file_exists($file)) include $file;
$file = $path . 'tbs_class.php';
include $file;
echo "autoLoad::tbs:return true<br />";
return true;
}
}
return false;
}
|
I have the following code to execute it:
$TBS = new clsTinyButStrong ;
echo "HomeController::execute:clsTinyButStrong created<br />";
$TBS->LoadTemplate($html) ;
$TBS->MergeBlock('click_blk',$click_to);
|
This code used to work with an earlier version of TBS. When I first upgraded to 3.7.0, the app stopped in autoload.php at this code:
$file = $path . 'plugins' .DS . 'tbs_plugin_html.php';
if(file_exists($file)) require_once $file;
|
I changed all of the "require_once" to "include" and the static function tbs($class) continued to the end, echoing the "return true") statement. (Deleting that statement didn't resolve the next problem.) I got back to my main code, where I executed "$TBS = new clsTinyButStrong ;". However, the "echo "HomeController::execute:clsTinyButStrong created<br />";" did not execute and the app stopped.
What must I do to make TBS work with the autoload function again? Thanks.