View Single Post
Old 01-06-2009, 02:50 PM   #11 (permalink)
Scottymeuk
The Contributor
 
Join Date: Jan 2009
Posts: 40
Thanks: 10
Scottymeuk is on a distinguished road
Default

My index.php (This needs to carry to:

All Other classes
All Other files that are included by functions
Everything that is included really without having to do
PHP Code:
$core  = new app_1
at the top of each page.

PHP Code:
$core = new app_1;
$core->app = new app($core);

echo 
$core->app->xss_clean('f'); 
The class:

PHP Code:
class app_1
{
    public 
$app;
    public 
$database;
    public 
$form;
    public 
$input;
    public 
$language;
    public 
$session;
    public 
$user;
    public 
$plugin;
    
    function 
__construct()
    {
        
$this->app = new app();
        
$this->database = new database();
        
$this->form = new form();
        
$this->input = new input();
        
$this->language = new language();
        
$this->session = new session();
        
$this->user = new user();
        
//$this->plugin = new plugin();
    
}

If i am honest with you I dont need any registry etc if its possible. I just really need to make that global. I have tried what you said above but i have to do
PHP Code:
$pApp TalkPHP_Factory::getInstance(); 
again in all the included files etc which i cannot do as it needs to be all automatic as it needs to be fast to develop. I know its only 1 bit of code but it will get really annoying and it seems a bit pointless.

Last edited by Scottymeuk : 01-06-2009 at 03:27 PM.
Scottymeuk is offline  
Reply With Quote