<?php
/**
* This script contains the database information needed by a db object.
* It will return as Array :
* DBRef, the reference to the DB options set to use to connect to the database,
* @see db.opt.php
* table, Table used by object to store his data.
* struct, An associative array with internal / dbfield associations.
* func, An associative array with object method / dbmethod, dbqueries associations.
* These informations are available to the object using the CORE::getcnf('object') method
*
* @author Benjamin Gillissen <hide@address.com>
*
* **************************************************************
Copyright (C) 2007 Benjamin Gillissen
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details at:
http://www.gnu.org/copyleft/gpl.html
* **************************************************************
*/
$o['table'] = configs::get('db', 'table_prefix').'cache_rpcbrw';
//intkeys //tablefield
$o['struct'] = Array( 'rpc' => 'rpc',
'catid' => 'catid',
'title' => 'title',
'data' => 'data',
'engine' => 'engine',
'id' => 'id'
);
//DB vendor //object method //db method //db query
$o['mysql']= Array( 'cleanbyrpc' => Array ('delete', "DELETE FROM `%table%` WHERE `%struct_rpc%`='%arg_rpc%'"),
'add' => Array ('insert', "INSERT INTO `%table%` (`%struct_rpc%`, `%struct_catid%`, `%struct_title%`, `%struct_data%`, `%struct_engine%`, `%struct_id%`)
VALUES ('%arg_rpc%', '%arg_catid%', '%arg_title%', '%arg_data%', '%arg_engine%', '%arg_id%')"),
'idisonrpc' => Array ('ispresent', "SELECT COUNT(*) FROM `%table%` WHERE `%struct_rpc%`='%arg_rpc%' AND `%struct_id%`='%arg_id%' AND `%struct_engine%`='%arg_engine%'"),
'listbycat' => Array ('fetchrow', "SELECT * FROM `%table%` WHERE `%struct_rpc%`='%arg_rpc%' AND `%struct_catid%`='%arg_catid%' ORDER BY `%struct_title%`")
);
$o['create']['mysql'] = "CREATE TABLE `%table%` ( `%struct_rpc%` int(3) NOT NULL,
`%struct_catid%` int(3) NOT NULL,
`%struct_title%` varchar(255) NOT NULL,
`%struct_data%` longblob NOT NULL,
`%struct_engine%` enum('nbrid','nzbid') NOT NULL,
`%struct_id%` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$o['sqlite']= Array();
$o['create']['sqlite'] = "";
return $o;