function services_install in Services 5
Same name and namespace in other branches
- 6.3 services.install \services_install()
- 6 services.install \services_install()
- 6.2 services.install \services_install()
- 7.3 services.install \services_install()
- 7 services.install \services_install()
Implementation of hook_install().
File
- ./
services.install, line 9 - This install creates the tables which are required by the services module
Code
function services_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {services_keys} (\n kid varchar(32) NOT NULL default '',\n title varchar(255) NOT NULL default '',\n domain varchar(255) NOT NULL default '',\n PRIMARY KEY (kid)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
db_query("CREATE TABLE {services_timestamp_nonce} (\n timestamp varchar(32) NOT NULL default '',\n domain varchar(255) NOT NULL default '',\n nonce varchar(32) NOT NULL default ''\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
break;
case 'pgsql':
db_query("CREATE TABLE {services_keys} (\n kid varchar(32) NOT NULL default '',\n title varchar(255) NOT NULL default '',\n domain varchar(255) NOT NULL default '',\n PRIMARY KEY (kid)\n )");
db_query("CREATE TABLE {services_timestamp_nonce} (\n timestamp varchar(32) NOT NULL default '',\n domain varchar(255) NOT NULL default '',\n nonce varchar(32) NOT NULL default ''\n )");
break;
}
}