Esempio n. 1
0
/**
 * @usage
 *
 * db_schema()->getSchema()
 */
function db_schema($target = 'default')
{
    $options = Database::getConfig($target);
    if (empty($options)) {
        $options['target'] = 'default';
    } else {
        $options['target'] = $target;
    }
    return Database::getConnection($options['target'])->schema($options);
}
Esempio n. 2
0
 public function write(array $data)
 {
     Database::getConnection($this->target)->query("INSERT INTO {watchdog} (\n                version,\n                servername,\n                remoteip,\n                bundle,\n                ssid,\n                uid,\n                datetime,\n                exectime,\n                method,\n                referer,\n                agent,\n                scheme,\n                query,\n                path,\n                host,\n                port\n            )\n            VALUES (\n                :version, \n                :servername, \n                :remoteip, \n                :bundle, \n                :ssid, \n                :uid, \n                :datetime, \n                :exectime, \n                :method, \n                :referer, \n                :agent, \n                :scheme, \n                :query, \n                :path, \n                :host, \n                :port\n            )", $data);
 }