From 1ef42babb510fda318cf48ff5290a51ea189049a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 8 Jan 2009 16:19:22 -0500 Subject: Make some scripts executable --- scripts/sitemap.php | 0 scripts/update_pot.sh | 0 scripts/update_translations.php | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/sitemap.php mode change 100644 => 100755 scripts/update_pot.sh mode change 100644 => 100755 scripts/update_translations.php (limited to 'scripts') diff --git a/scripts/sitemap.php b/scripts/sitemap.php old mode 100644 new mode 100755 diff --git a/scripts/update_pot.sh b/scripts/update_pot.sh old mode 100644 new mode 100755 diff --git a/scripts/update_translations.php b/scripts/update_translations.php old mode 100644 new mode 100755 -- cgit v1.2.3-54-g00ecf From ee8dab3f404dab40861fc21317131300f0147d02 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Sat, 10 Jan 2009 00:11:10 +0200 Subject: Updated file id's of language files --- scripts/update_translations.php | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'scripts') diff --git a/scripts/update_translations.php b/scripts/update_translations.php index 3eb7b3401..4d7adafea 100755 --- a/scripts/update_translations.php +++ b/scripts/update_translations.php @@ -5,28 +5,28 @@ chdir(dirname(__FILE__) . '/..'); /* Languages to pull */ $languages = array( - 'da_DK' => 'http://laconi.ca/translate/download.php?file_id=23', - 'nl_NL' => 'http://laconi.ca/translate/download.php?file_id=39', - 'en_NZ' => 'http://laconi.ca/translate/download.php?file_id=15', - 'eo' => 'http://laconi.ca/translate/download.php?file_id=10', - 'fr_FR' => 'http://laconi.ca/translate/download.php?file_id=19', - 'de_DE' => 'http://laconi.ca/translate/download.php?file_id=18', - 'it_IT' => 'http://laconi.ca/translate/download.php?file_id=21', - 'ko' => 'http://laconi.ca/translate/download.php?file_id=33', - 'no_NB' => 'http://laconi.ca/translate/download.php?file_id=31', - 'pt' => 'http://laconi.ca/translate/download.php?file_id=8', - 'pt_BR' => 'http://laconi.ca/translate/download.php?file_id=72', - 'ru_RU' => 'http://laconi.ca/translate/download.php?file_id=26', - 'es' => 'http://laconi.ca/translate/download.php?file_id=9', - 'tr_TR' => 'http://laconi.ca/translate/download.php?file_id=37', - 'uk_UA' => 'http://laconi.ca/translate/download.php?file_id=44', - 'he_IL' => 'http://laconi.ca/translate/download.php?file_id=71', - 'mk_MK' => 'http://laconi.ca/translate/download.php?file_id=67', - 'ja_JP' => 'http://laconi.ca/translate/download.php?file_id=43', - 'cs_CZ' => 'http://laconi.ca/translate/download.php?file_id=63', - 'ca_ES' => 'http://laconi.ca/translate/download.php?file_id=49', - 'pl_PL' => 'http://laconi.ca/translate/download.php?file_id=51', - 'sv_SE' => 'http://laconi.ca/translate/download.php?file_id=55' + 'da_DK' => 'http://laconi.ca/translate/download.php?file_id=93', + 'nl_NL' => 'http://laconi.ca/translate/download.php?file_id=97', + 'en_NZ' => 'http://laconi.ca/translate/download.php?file_id=87', + 'eo' => 'http://laconi.ca/translate/download.php?file_id=88', + 'fr_FR' => 'http://laconi.ca/translate/download.php?file_id=99', + 'de_DE' => 'http://laconi.ca/translate/download.php?file_id=100', + 'it_IT' => 'http://laconi.ca/translate/download.php?file_id=101', + 'ko' => 'http://laconi.ca/translate/download.php?file_id=102', + 'no_NB' => 'http://laconi.ca/translate/download.php?file_id=104', + 'pt' => 'http://laconi.ca/translate/download.php?file_id=106', + 'pt_BR' => 'http://laconi.ca/translate/download.php?file_id=107', + 'ru_RU' => 'http://laconi.ca/translate/download.php?file_id=109', + 'es' => 'http://laconi.ca/translate/download.php?file_id=110', + 'tr_TR' => 'http://laconi.ca/translate/download.php?file_id=114', + 'uk_UA' => 'http://laconi.ca/translate/download.php?file_id=115', + 'he_IL' => 'http://laconi.ca/translate/download.php?file_id=116', + 'mk_MK' => 'http://laconi.ca/translate/download.php?file_id=103', + 'ja_JP' => 'http://laconi.ca/translate/download.php?file_id=117', + 'cs_CZ' => 'http://laconi.ca/translate/download.php?file_id=96', + 'ca_ES' => 'http://laconi.ca/translate/download.php?file_id=95', + 'pl_PL' => 'http://laconi.ca/translate/download.php?file_id=105', + 'sv_SE' => 'http://laconi.ca/translate/download.php?file_id=128' ); /* Update the languages */ -- cgit v1.2.3-54-g00ecf From d1cbd756366580962e58bcc8216dd88fe0b5ef2f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 19 Jan 2009 21:37:31 -0500 Subject: Change inboxes to have 1000 items rather than last full month --- scripts/inbox_users.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/inbox_users.php b/scripts/inbox_users.php index 0543abb2a..7b029e142 100755 --- a/scripts/inbox_users.php +++ b/scripts/inbox_users.php @@ -78,11 +78,11 @@ foreach ($ids as $id) { 'FROM subscription JOIN notice ON subscription.subscribed = notice.profile_id ' . 'WHERE subscription.subscriber = ' . $user->id . ' ' . 'AND notice.created >= subscription.created ' . - 'AND now() - notice.created < ' . (7 * 24 * 3600) . ' ' . 'AND NOT EXISTS (SELECT user_id, notice_id ' . 'FROM notice_inbox ' . 'WHERE user_id = ' . $user->id . ' ' . - 'AND notice_id = notice.id)'); + 'AND notice_id = notice.id) ' . + 'LIMIT 0, 1000'); if (is_null($result) || $result === false) { common_log_db_error($inbox, 'INSERT', __FILE__); -- cgit v1.2.3-54-g00ecf From b28e11a7e3ae071b127694c498f08cc1fddfa4b0 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Jan 2009 03:06:34 +0000 Subject: Some production requirements for making inbox_users.php work --- scripts/inbox_users.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/inbox_users.php b/scripts/inbox_users.php index 7b029e142..7d14f0efe 100755 --- a/scripts/inbox_users.php +++ b/scripts/inbox_users.php @@ -82,6 +82,7 @@ foreach ($ids as $id) { 'FROM notice_inbox ' . 'WHERE user_id = ' . $user->id . ' ' . 'AND notice_id = notice.id) ' . + 'ORDER BY notice.created DESC ' . 'LIMIT 0, 1000'); if (is_null($result) || $result === false) { @@ -105,5 +106,6 @@ foreach ($ids as $id) { if ($cache) { $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); + $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last')); } } -- cgit v1.2.3-54-g00ecf From 2f6152f2f3613311e23b9021a7ae0ff8357ecd6c Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Jan 2009 03:07:10 +0000 Subject: A script to uncache a bunch of users, in case you made changes --- scripts/uncache_users.php | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 scripts/uncache_users.php (limited to 'scripts') diff --git a/scripts/uncache_users.php b/scripts/uncache_users.php new file mode 100644 index 000000000..fa0fb64cd --- /dev/null +++ b/scripts/uncache_users.php @@ -0,0 +1,59 @@ +#!/usr/bin/env php +. + */ + +# Abort if called from a web server + +if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { + print "This script must be run from the command line\n"; + exit(); +} + +ini_set("max_execution_time", "0"); +ini_set("max_input_time", "0"); +set_time_limit(0); +mb_internal_encoding('UTF-8'); + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); +define('LACONICA', true); + +require_once(INSTALLDIR . '/lib/common.php'); + +$id_file = ($argc > 1) ? $argv[1] : 'ids.txt'; + +common_log(LOG_INFO, 'Updating user inboxes.'); + +$ids = file($id_file); + +foreach ($ids as $id) { + + $user = User::staticGet('id', $id); + + if (!$user) { + common_log(LOG_WARNING, 'No such user: ' . $id); + continue; + } + + $user->decache(); + + $memc = common_memcache(); + + $memc->delete(common_cache_key('user:notices_with_friends:'. $user->id)); + $memc->delete(common_cache_key('user:notices_with_friends:'. $user->id . ';last')); +} -- cgit v1.2.3-54-g00ecf