Dotclear


Ignore:
Timestamp:
04/03/15 08:33:36 (10 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Use dcCore pass as argument to constructor instead of global one.
$core property must be at least protected to not be considered as a settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.settings.php

    r2990 r2991  
    2222class dcSettings 
    2323{ 
     24     protected $core;         ///< <b>connection</b> Database connection object 
    2425     protected $con;          ///< <b>connection</b> Database connection object 
    2526     protected $table;        ///< <b>string</b> Settings table name 
     
    3940     public function __construct($core,$blog_id) 
    4041     { 
    41           $this->con =& $core->con; 
     42        $this->core = &$core; 
     43          $this->con = &$core->con; 
    4244          $this->table = $core->prefix.'setting'; 
    43           $this->blog_id =& $blog_id; 
     45          $this->blog_id = &$blog_id; 
    4446          $this->loadSettings(); 
    4547     } 
     
    7476                    $rs->movePrev(); 
    7577               } 
    76                $this->namespaces[$ns] = new dcNamespace($GLOBALS['core'], $this->blog_id, $ns,$rs); 
     78               $this->namespaces[$ns] = new dcNamespace($this->core, $this->blog_id, $ns,$rs); 
    7779          } while(!$rs->isStart()); 
    7880     } 
     
    8890     { 
    8991          if (!array_key_exists($ns, $this->namespaces)) { 
    90                $this->namespaces[$ns] = new dcNamespace($GLOBALS['core'], $this->blog_id, $ns); 
     92               $this->namespaces[$ns] = new dcNamespace($this->core, $this->blog_id, $ns); 
    9193          } 
    9294          return $this->namespaces[$ns]; 
     
    280282          if (!isset($this->namespaces[$this->ns])) { 
    281283               // Create namespace if needed 
    282                $this->namespaces[$this->ns] = new dcNamespace($GLOBALS['core'], $this->blog_id, $this->ns); 
     284               $this->namespaces[$this->ns] = new dcNamespace($this->core, $this->blog_id, $this->ns); 
    283285          } 
    284286          $this->namespaces[$this->ns]->put($id, $value, $type, $label, $value_change, $global); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map