summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/initializeinbox.php38
-rwxr-xr-xscripts/queuedaemon.php9
-rwxr-xr-xscripts/update_po_templates.php12
3 files changed, 44 insertions, 15 deletions
diff --git a/scripts/initializeinbox.php b/scripts/initializeinbox.php
index 43afc48eb..44508fe22 100644
--- a/scripts/initializeinbox.php
+++ b/scripts/initializeinbox.php
@@ -20,17 +20,18 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-$shortoptions = 'i:n:af';
-$longoptions = array('id=', 'nickname=', 'all', 'force');
+$shortoptions = 'i:n:af:';
+$longoptions = array('id=', 'nickname=', 'all', 'file=');
$helptext = <<<END_OF_INITIALIZEINBOX_HELP
initializeinbox.php [options]
initialize the inbox for a user
- -i --id ID of user to update
- -n --nickname nickname of the user to update
- -f --force force update even if user already has a location
- -a --all update all
+ -i --id ID of user to update
+ -n --nickname nickname of the user to update
+ -f FILENAME read list of IDs from FILENAME (1 per line)
+ --file=FILENAME ditto
+ -a --all update all
END_OF_INITIALIZEINBOX_HELP;
@@ -60,6 +61,21 @@ try {
initializeInbox($user);
}
}
+ } else if (have_option('f', 'file')) {
+ $filename = get_option_value('f', 'file');
+ if (!file_exists($filename)) {
+ throw new Exception("No such file '$filename'.");
+ } else if (!is_readable($filename)) {
+ throw new Exception("Can't read '$filename'.");
+ }
+ $ids = file($filename);
+ foreach ($ids as $id) {
+ $user = User::staticGet('id', $id);
+ if (empty($user)) {
+ print "Can't find user with id '$id'.\n";
+ }
+ initializeInbox($user);
+ }
} else {
show_help();
exit(1);
@@ -75,14 +91,20 @@ function initializeInbox($user)
print "Initializing inbox for $user->nickname...";
}
- $inbox = Inbox::staticGet('user_id', $user_id);
+ $inbox = Inbox::staticGet('user_id', $user->id);
+ if ($inbox && !empty($inbox->fake)) {
+ if (!have_option('q', 'quiet')) {
+ echo "(replacing faux cached inbox)";
+ }
+ $inbox = false;
+ }
if (!empty($inbox)) {
if (!have_option('q', 'quiet')) {
print "SKIP\n";
}
} else {
- $inbox = Inbox::initialize($user_id);
+ $inbox = Inbox::initialize($user->id);
if (!have_option('q', 'quiet')) {
if (empty($inbox)) {
print "ERR\n";
diff --git a/scripts/queuedaemon.php b/scripts/queuedaemon.php
index 8ef364fe7..162f617e0 100755
--- a/scripts/queuedaemon.php
+++ b/scripts/queuedaemon.php
@@ -21,7 +21,7 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
$shortoptions = 'fi:at:';
-$longoptions = array('id=', 'foreground', 'all', 'threads=');
+$longoptions = array('id=', 'foreground', 'all', 'threads=', 'skip-xmpp', 'xmpp-only');
/**
* Attempts to get a count of the processors available on the current system
@@ -260,6 +260,13 @@ if (!$threads) {
$daemonize = !(have_option('f') || have_option('--foreground'));
$all = have_option('a') || have_option('--all');
+if (have_option('--skip-xmpp')) {
+ define('XMPP_EMERGENCY_FLAG', true);
+}
+if (have_option('--xmpp-only')) {
+ define('XMPP_ONLY_FLAG', true);
+}
+
$daemon = new QueueDaemon($id, $daemonize, $threads, $all);
$daemon->runOnce();
diff --git a/scripts/update_po_templates.php b/scripts/update_po_templates.php
index 83bff6d80..f882f673a 100755
--- a/scripts/update_po_templates.php
+++ b/scripts/update_po_templates.php
@@ -80,20 +80,21 @@ function do_translatewiki_plugin($basedir, $plugin)
mkdir($yamldir);
}
$outfile = "$yamldir/StatusNet-{$plugin}.yml";
+ $pluginlc = strtolower( $plugin );
$data = <<<END
---
BASIC:
- id: out-statusnet-{$plugin}
+ id: out-statusnet-{$pluginlc}
label: StatusNet - {$plugin}
- description: "{{int:bw-desc-statusnet-plugin-{$plugin}}}"
+ description: "{{int:bw-desc-statusnet-plugin-{$pluginlc}}}"
namespace: NS_STATUSNET
- display: out/statusnet/{$plugin}
+ display: out/statusnet/{$pluginlc}
class: GettextMessageGroup
FILES:
class: GettextFFS
sourcePattern: %GROUPROOT%/plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po
- targetPattern: {$plugin}.po
+ targetPattern: plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po
codeMap:
en-gb: en_GB
no: nb
@@ -103,7 +104,7 @@ FILES:
MANGLER
class: StringMatcher
- prefix: {$plugin}-
+ prefix: {$pluginlc}-
patterns:
- "*"
@@ -208,4 +209,3 @@ if ($plugins) {
}
}
}
-