diff options
author | zotlabs <mike@macgirvin.com> | 2017-04-03 16:43:30 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-04-03 16:43:30 -0700 |
commit | d6c23486d563e29862d3db891e67649d13e6def0 (patch) | |
tree | aec0bc40905c4204eb13975e331978a4ce461007 /include/dir_fns.php | |
parent | 26125bcf0b8ce98fa4522f89792d7e77f25ff1ca (diff) | |
download | volse-hubzilla-d6c23486d563e29862d3db891e67649d13e6def0.tar.gz volse-hubzilla-d6c23486d563e29862d3db891e67649d13e6def0.tar.bz2 volse-hubzilla-d6c23486d563e29862d3db891e67649d13e6def0.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.php | 31 |
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 ", |