aboutsummaryrefslogtreecommitdiffstats
path: root/include/directory.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-04-23 19:49:41 -0700
committerfriendica <info@friendica.com>2015-04-23 19:49:41 -0700
commit6679734135fb04f4a7beccb81663bf1e9574f062 (patch)
tree887488543d98b5dd297d917718bdd99844e83ba5 /include/directory.php
parent08b757a22cd2804bfec8ecf682b6987b8c06ca49 (diff)
parentc696860cc53bc25558d83de5eda65d9b583da382 (diff)
downloadvolse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.gz
volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.bz2
volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.zip
Merge branch 'master' into tres
Conflicts: include/Contact.php include/ItemObject.php include/api.php include/attach.php include/diaspora.php include/dir_fns.php include/enotify.php include/event.php include/expire.php include/items.php include/notifier.php include/notify.php include/photos.php include/taxonomy.php include/text.php include/widgets.php include/zot.php mod/admin.php mod/channel.php mod/dirsearch.php mod/display.php mod/editwebpage.php mod/events.php mod/home.php mod/item.php mod/manage.php mod/mood.php mod/network.php mod/page.php mod/photos.php mod/ping.php mod/post.php mod/thing.php mod/viewsrc.php view/css/mod_events.css
Diffstat (limited to 'include/directory.php')
-rw-r--r--include/directory.php34
1 files changed, 23 insertions, 11 deletions
diff --git a/include/directory.php b/include/directory.php
index a7324a99a..9ab1d805b 100644
--- a/include/directory.php
+++ b/include/directory.php
@@ -1,14 +1,23 @@
-<?php /** @file */
+<?php
+/**
+ * @file include/directory.php
+ * @brief executes directory_run()
+ */
require_once('boot.php');
require_once('include/zot.php');
require_once('include/cli_startup.php');
require_once('include/dir_fns.php');
-
+/**
+ * @brief
+ *
+ * @param array $argv
+ * @param array $argc
+ */
function directory_run($argv, $argc){
- cli_startup();
+ cli_startup();
if($argc < 2)
return;
@@ -37,8 +46,9 @@ function directory_run($argv, $argc){
$channel = $x[0];
+ if($dirmode != DIRECTORY_MODE_NORMAL) {
- if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
+ // this is an in-memory update and we don't need to send a network packet.
local_dir_update($argv[1],$force);
@@ -54,6 +64,8 @@ function directory_run($argv, $argc){
return;
}
+ // otherwise send the changes upstream
+
$directory = find_upstream_directory($dirmode);
$url = $directory['url'] . '/post';
@@ -66,8 +78,9 @@ function directory_run($argv, $argc){
if(! $z['success']) {
- // FIXME - we aren't updating channel_dirdate if we have to queue
- // the directory packet. That means we'll try again on the next poll run.
+ /** @FIXME we aren't updating channel_dirdate if we have to queue
+ * the directory packet. That means we'll try again on the next poll run.
+ */
$hash = random_string();
q("insert into outq ( outq_hash, outq_account, outq_channel, outq_driver, outq_posturl, outq_async, outq_created, outq_updated, outq_notify, outq_msg )
@@ -83,8 +96,7 @@ function directory_run($argv, $argc){
dbesc($packet),
dbesc('')
);
- }
- else {
+ } else {
q("update channel set channel_dirdate = '%s' where channel_id = %d",
dbesc(datetime_convert()),
intval($channel['channel_id'])
@@ -97,7 +109,7 @@ function directory_run($argv, $argc){
}
-if (array_search(__file__,get_included_files())===0){
- directory_run($argv,$argc);
- killme();
+if (array_search(__file__, get_included_files()) === 0) {
+ directory_run($argv, $argc);
+ killme();
}