Categories > TinyButStrong general >

Version 3.7.0 of TBS doesn't work with autoload

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Alan Lake
Date: 2011-04-01
Time: 19:57

Version 3.7.0 of TBS doesn't work with autoload

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.
By: Skrol29
Date: 2011-04-03
Time: 00:15

Re: Version 3.7.0 of TBS doesn't work with autoload

Hi,

I cannot reproduce your problem. I have TBS 3.7.0 with PHP 5.3.3.
I've tested with only the 5 plug-ins given in the package (bypage, cache, html, mergeonfly, navbar)
Can you give more debuging information, or can you send to me a code that reproduce the bug?
By: Alan Lake
Date: 2011-04-03
Time: 15:31

Re: Version 3.7.0 of TBS doesn't work with autoload -- solved

Thanks for your reply, Scrol.
My PHP is 5.3.5.
The problem was in the SELinux Context setting of Fedora 14.  The SELinux Context in the properties for each file and directory must be "httpd_user_content_t".  When I downloaded the new version of TBS, the SELinux Contexts were registered as "data_t".

You can have your settings looking just fine (to an old timer) and it still won't work.  The SELinux Contexts have to be checked.  Gr-r-r.   SELinux is really a pain in the probiscus as far as I'm concerned.