aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-19 15:56:07 -0700
committerFriendika <info@friendika.com>2011-06-19 15:56:07 -0700
commit76ddbff0b5184c85be1e7ad2ffe6fb918ed65b65 (patch)
tree0e6d0aa962935aa4f522d9ac2eae2519ca7573ef /boot.php
parentd8e2dc23b9a62a2c5ab21eb13ab78340031ca051 (diff)
parent7c28e5893228320a2180a58aa68d913744d17e05 (diff)
downloadvolse-hubzilla-76ddbff0b5184c85be1e7ad2ffe6fb918ed65b65.tar.gz
volse-hubzilla-76ddbff0b5184c85be1e7ad2ffe6fb918ed65b65.tar.bz2
volse-hubzilla-76ddbff0b5184c85be1e7ad2ffe6fb918ed65b65.zip
Merge branch 'pull'
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php25
1 files changed, 17 insertions, 8 deletions
diff --git a/boot.php b/boot.php
index eeaf00f1a..1364385a1 100644
--- a/boot.php
+++ b/boot.php
@@ -6,7 +6,7 @@ ini_set('pcre.backtrack_limit', 250000);
define ( 'FRIENDIKA_VERSION', '2.2.1016' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
-define ( 'DB_UPDATE_VERSION', 1063 );
+define ( 'DB_UPDATE_VERSION', 1064 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -477,9 +477,13 @@ function install_plugin($plugin){
if(function_exists($plugin . '_install')) {
$func = $plugin . '_install';
$func();
- $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`) VALUES ( '%s', 1, %d ) ",
+
+ $plugin_admin = (function_exists($plugin."_plugin_admin")?1:0);
+
+ $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`, `plugin_admin`) VALUES ( '%s', 1, %d , %d ) ",
dbesc($plugin),
- intval($t)
+ intval($t),
+ $plugin_admin
);
}
}}
@@ -1243,8 +1247,10 @@ function get_config($family, $key, $instore = false) {
dbesc($key)
);
if(count($ret)) {
- $a->config[$family][$key] = $ret[0]['v'];
- return $ret[0]['v'];
+ // manage array value
+ $val = (preg_match("|^a:[0-9]+:{.*}$|", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']);
+ $a->config[$family][$key] = $val;
+ return $val;
}
else {
$a->config[$family][$key] = '!<unset>!';
@@ -1258,22 +1264,25 @@ function get_config($family, $key, $instore = false) {
if(! function_exists('set_config')) {
function set_config($family,$key,$value) {
-
global $a;
+
+ // manage array value
+ $dbvalue = (is_array($value)?serialize($value):$value);
if(get_config($family,$key,true) === false) {
$a->config[$family][$key] = $value;
$ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ",
dbesc($family),
dbesc($key),
- dbesc($value)
+ dbesc($dbvalue)
);
if($ret)
return $value;
return $ret;
}
+
$ret = q("UPDATE `config` SET `v` = '%s' WHERE `cat` = '%s' AND `k` = '%s' LIMIT 1",
- dbesc($value),
+ dbesc($dbvalue),
dbesc($family),
dbesc($key)
);