summaryrefslogtreecommitdiff
path: root/scripts/fixup_utf8.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-06-23 14:29:46 -0700
committerZach Copley <zach@controlyourself.ca>2009-06-23 14:29:46 -0700
commitf04a54ed2f70686d67ed50da21bde61c55b07696 (patch)
treed4dbfac2a98e35b6f47696f787a3c2aa551f51ab /scripts/fixup_utf8.php
parent31325f0995bb61413b07f166d253b13fb27d085d (diff)
parent2d3e990ed47ee1c7130e1febabe7133884a85c80 (diff)
Merge branch '0.8.x' of git@gitorious.org:laconica/dev into 0.8.x
* '0.8.x' of git@gitorious.org:laconica/dev: (61 commits) Using default theme design values (it was previously set to identica Updated default colour theme and IE6 colours for transparent values chmod +x delete_status_network.sh rm -Rf, not rmdir script to delete a status network chmod allsites.php script to show all sites on a network use different name for connection and database use /etc/laconica/setup.cfg instead of local file other base directories On XHR notice post, calls NoticeAttachment to trigger thumbnail and oembed and thumbnail don't need sequences add innodb by default to status networks pwgen not pwdgen make pwgen command configurable a little sql script to drop full-text index and use innodb for profile and notice remove common_debug from newnotice append uploads to content rather than showing them double use a subclass for single notice items to show attachments make file command configurable ...
Diffstat (limited to 'scripts/fixup_utf8.php')
-rw-r--r--scripts/fixup_utf8.php27
1 files changed, 12 insertions, 15 deletions
diff --git a/scripts/fixup_utf8.php b/scripts/fixup_utf8.php
index 169376091..8c9a9127f 100644
--- a/scripts/fixup_utf8.php
+++ b/scripts/fixup_utf8.php
@@ -19,21 +19,18 @@
*/
# 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(1);
-}
-
-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');
-require_once('DB.php');
+$helptext = <<<ENDOFHELP
+fixup_utf8.php <maxdate> <maxid> <minid>
+
+Fixup records in a database that stored the data incorrectly (pre-0.7.4 for Laconica).
+
+ENDOFHELP;
+
+require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once 'DB.php';
class UTF8FixerUpper
{
@@ -356,9 +353,9 @@ class UTF8FixerUpper
}
}
-$max_date = ($argc > 1) ? $argv[1] : null;
-$max_id = ($argc > 2) ? $argv[2] : null;
-$min_id = ($argc > 3) ? $argv[3] : null;
+$max_date = (count($args) > 0) ? $args[0] : null;
+$max_id = (count($args) > 1) ? $args[1] : null;
+$min_id = (count($args) > 2) ? $args[2] : null;
$fixer = new UTF8FixerUpper(array('max_date' => $max_date,
'max_notice' => $max_id,