3 * Table Definition for status_network
6 class Status_network extends DB_DataObject
9 /* the code below is auto generated do not remove the above tag */
11 public $__table = 'status_network'; // table name
12 public $nickname; // varchar(64) primary_key not_null
13 public $hostname; // varchar(255) unique_key
14 public $pathname; // varchar(255) unique_key
15 public $sitename; // varchar(255)
16 public $dbhost; // varchar(255)
17 public $dbuser; // varchar(255)
18 public $dbpass; // varchar(255)
19 public $dbname; // varchar(255)
20 public $created; // datetime() not_null
21 public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
24 function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Status_network',$k,$v); }
26 /* the code above is auto generated do not remove the tag below */
29 static function setupDB($dbhost, $dbuser, $dbpass, $dbname)
33 $config['db']['database_'.$dbname] = "mysqli://$dbuser:$dbpass@$dbhost/$dbname";
34 $config['db']['ini_'.$dbname] = INSTALLDIR.'/classes/statusnet.ini';
35 $config['db']['table_status_network'] = $dbname;
40 static function setupSite($servername, $pathname)
44 $parts = explode('.', $servername);
46 $sn = Status_network::staticGet('nickname', $parts[0]);
49 $dbhost = (empty($sn->dbhost)) ? 'localhost' : $sn->dbhost;
50 $dbuser = (empty($sn->dbuser)) ? $sn->nickname : $sn->dbuser;
51 $dbpass = $sn->dbpass;
52 $dbname = (empty($sn->dbname)) ? $sn->nickname : $sn->dbname;
54 $config['db']['database'] = "mysqli://$dbuser:$dbpass@$dbhost/$dbname";
55 $config['site']['name'] = $sn->sitename;