aboutsummaryrefslogtreecommitdiffstats
path: root/include/dir_fns.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-04-03 16:43:30 -0700
committerMario Vavti <mario@mariovavti.com>2017-04-04 10:02:33 +0200
commit50612565e97bcb20a822f94766fb5e1bd38f7cda (patch)
tree5c1510fb86fe712461db1696d0381d269f0f1d13 /include/dir_fns.php
parenta9bda2b12e3d393fa854e23207a081052e2e7bfd (diff)
downloadvolse-hubzilla-50612565e97bcb20a822f94766fb5e1bd38f7cda.tar.gz
volse-hubzilla-50612565e97bcb20a822f94766fb5e1bd38f7cda.tar.bz2
volse-hubzilla-50612565e97bcb20a822f94766fb5e1bd38f7cda.zip
create site_store_lowlevel() to initialise data structures for the site table
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r--include/dir_fns.php31
1 files changed, 11 insertions, 20 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php
index 3922730fc..2bd1228ec 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -185,26 +185,17 @@ function sync_directories($dirmode) {
/** @FIXME What to do if we're in a different realm? */
if ((! $r) && (z_root() != DIRECTORY_FALLBACK_MASTER)) {
- $r = array();
- $r[] = array(
- 'site_url' => DIRECTORY_FALLBACK_MASTER,
- 'site_flags' => DIRECTORY_MODE_PRIMARY,
- 'site_update' => NULL_DATE,
- 'site_directory' => DIRECTORY_FALLBACK_MASTER . '/dirsearch',
- 'site_realm' => DIRECTORY_REALM,
- 'site_valid' => 1,
- 'site_crypto' => 'aes256cbc'
-
- );
- $x = q("insert into site ( site_url, site_flags, site_update, site_directory, site_realm, site_valid, site_crypto )
- values ( '%s', %d, '%s', '%s', '%s', %d, '%s' ) ",
- dbesc($r[0]['site_url']),
- intval($r[0]['site_flags']),
- dbesc($r[0]['site_update']),
- dbesc($r[0]['site_directory']),
- dbesc($r[0]['site_realm']),
- intval($r[0]['site_valid']),
- dbesc($r[0]['site_crypto'])
+
+ $x = site_store_lowlevel(
+ [
+ 'site_url' => DIRECTORY_FALLBACK_MASTER,
+ 'site_flags' => DIRECTORY_MODE_PRIMARY,
+ 'site_update' => NULL_DATE,
+ 'site_directory' => DIRECTORY_FALLBACK_MASTER . '/dirsearch',
+ 'site_realm' => DIRECTORY_REALM,
+ 'site_valid' => 1,
+ 'site_crypto' => 'aes256cbc'
+ ]
);
$r = q("select * from site where site_flags in (%d, %d) and site_url != '%s' and site_type = %d ",