]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge remote-tracking branch 'upstream/master' into social-master
authorRoland Haeder <roland@mxchange.org>
Sun, 16 Aug 2015 20:46:34 +0000 (22:46 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 16 Aug 2015 20:46:34 +0000 (22:46 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
Conflicts:
actions/apitimelinetag.php

43 files changed:
1  2 
actions/apitimelinetag.php
plugins/DomainStatusNetwork/scripts/installforemail.php
plugins/DomainStatusNetwork/scripts/proposesite.php
plugins/DomainStatusNetwork/scripts/sitefordomain.php
plugins/EmailRegistration/scripts/cancelemailregistration.php
plugins/EmailRegistration/scripts/registeremailuser.php
plugins/EmailReminder/scripts/sendemailreminder.php
plugins/OStatus/scripts/fixup-shadow.php
plugins/OStatus/scripts/gcfeeds.php
plugins/OStatus/scripts/renew-feeds.php
plugins/OStatus/scripts/resub-feed.php
plugins/OStatus/scripts/rm_bad_feedsubs.php
plugins/OStatus/scripts/testfeed.php
plugins/OStatus/scripts/update-profile-data.php
plugins/OStatus/scripts/update-profile.php
plugins/OStatus/scripts/update_ostatus_profiles.php
plugins/OStatus/tests/slap.php
plugins/Realtime/scripts/cleanupchannels.php
plugins/RequireValidatedEmail/scripts/registerbyemail.php
plugins/Sitemap/scripts/updatecounts.php
plugins/TwitterBridge/daemons/twitterdaemon.php
plugins/TwitterBridge/scripts/initialize_notice_to_status.php
scripts/clearcache.php
scripts/createsim.php
scripts/dumpschema.php
scripts/flushrouter.php
scripts/flushsite.php
scripts/gnusocialversion.php
scripts/importtwitteratom.php
scripts/make-release.php
scripts/makegroupadmin.php
scripts/registeruser.php
scripts/sessiongc.php
scripts/settag.php
scripts/showcache.php
scripts/showtable.php
scripts/uncache_users.php
scripts/updatelocation.php
scripts/updateurls.php
scripts/upgrade.php
scripts/userrole.php
tests/atompub/atompub_test.php
tests/oauth/oauth_post_notice.php

index 384942a261777e3496d8e4308059ea69024d24d7,04a4727a9d8bfe7ddc0cb3a4dfe8d134509953df..7b51a64a084de648be58adb02f30dbd8d0cebff6
@@@ -51,23 -51,10 +51,10 @@@ class ApiTimelineTagAction extends ApiP
  {
      var $notices = null;
  
-     /**
-      * Take arguments for running
-      *
-      * @param array $args $_REQUEST args
-      *
-      * @return boolean success flag
-      */
-     function prepare(array $args=array())
+     protected function doPreparation()
      {
-         parent::prepare($args);
-         common_debug("apitimelinetag prepare()");
          $this->tag     = $this->arg('tag');
          $this->notices = $this->getNotices();
-         return true;
      }
  
      /**
@@@ -79,9 -66,9 +66,9 @@@
       *
       * @return void
       */
-     function handle(array $args=array())
+     protected function handle()
      {
-         parent::handle($args);
+         parent::handle();
          $this->showTimeline();
      }
  
       *
       * @return boolean true
       */
 -    function isReadOnly($args)
 +    function isReadOnly(array $args=array())
      {
          return true;
      }
index 1815b977596fe267ce731a1bf59a1de7b16a4040,f773094a74c426e9ccc023b43468d08e5a61cef2..1815b977596fe267ce731a1bf59a1de7b16a4040
mode 100644,100755..100755
@@@ -35,7 -35,7 +35,7 @@@ Create a new account and, if necessary
  
  END_OF_INSTALLFOREMAIL_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $email = $args[0];
  
index 28741a5d4fb94a6cca6630d26c525e038e94ba8a,96a722fdab775767ae943be3483be888905789eb..28741a5d4fb94a6cca6630d26c525e038e94ba8a
mode 100644,100755..100755
@@@ -28,7 -28,7 +28,7 @@@ Prints site information for the domain 
  
  END_OF_SITEFORDOMAIN_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $domain   = DomainStatusNetworkPlugin::toDomain($args[0]);
  
index 2eaa600d2598009bffb075811eaabbbc133fe8b6,59412ccebab6929169091d7ccddae77aa837d6b4..2eaa600d2598009bffb075811eaabbbc133fe8b6
mode 100644,100755..100755
@@@ -28,7 -28,7 +28,7 @@@ Prints site information for the domain 
  
  END_OF_SITEFORDOMAIN_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $domain = DomainStatusNetworkPlugin::toDomain($args[0]);
  
index 7ae81f7ccf8f48ead06666ce58052fa3c03817fc,d834aade600abdb032570d35fb9dc1f9b7bf5b36..7ae81f7ccf8f48ead06666ce58052fa3c03817fc
mode 100644,100755..100755
@@@ -33,7 -33,7 +33,7 @@@ Cancel an email registration cod
  
  END_OF_REGISTEREMAILUSER_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  if (count($args) == 0) {
      show_help();
index a785a76a6649080aefba71cc0323ed8172971292,02915240d32d2e57b3abbff7f280e6dfd9256921..a785a76a6649080aefba71cc0323ed8172971292
mode 100644,100755..100755
@@@ -34,7 -34,7 +34,7 @@@ register a new user by email address
  
  END_OF_REGISTEREMAILUSER_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  if (count($args) == 0) {
      show_help();
index b126f9e049329cdd2f56834d9a8f8991b0d8ad8c,5b5b26dde38aa9a4d9a68e216336d64fd80a6dcc..b126f9e049329cdd2f56834d9a8f8991b0d8ad8c
mode 100644,100755..100755
@@@ -35,7 -35,7 +35,7 @@@ Send an email summary of the inbox to u
  
  END_OF_SENDEMAILREMINDER_HELP;
  
 -require_once INSTALLDIR . '/scripts/commandline.inc';
 +require_once INSTALLDIR . '/scripts/commandline.inc.php';
  
  $quiet = have_option('q', 'quiet');
  
index 817ef4eb166cc9f97225443fd57ac564e4a63bb2,ffaae5588d1eae757e07e15ac654f27056d168fc..817ef4eb166cc9f97225443fd57ac564e4a63bb2
mode 100644,100755..100755
@@@ -31,7 -31,7 +31,7 @@@ for local users and groups
  
  END_OF_USERROLE_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $dry = have_option('dry-run');
  
@@@ -156,7 -156,7 +156,7 @@@ while ($oprofile->fetch()) 
      if (preg_match('!/group/(\d+)/id!', $oprofile->getUri(), $matches)) {
          $id = intval($matches[1]);
          $group = Local_group::getKV('group_id', $id);
 -        if ($group) {
 +        if ($group instanceof Local_group) {
              $nick = $group->nickname;
          } else {
              $nick = '<deleted>';
      } else if (preg_match('!/user/(\d+)!', $uri, $matches)) {
          $id = intval($matches[1]);
          $user = User::getKV('id', $id);
 -        if ($user) {
 +
 +        if ($user instanceof User) {
              $nick = $user->nickname;
          } else {
              $nick = '<deleted>';
          }
 +
          echo "user $id ($nick) hidden by $uri";
      } else {
          echo "$uri matched query, but we don't recognize it.\n";
index f1db4b358ff35b0497457ad75ef27086a411ee30,a95cd54dbc8d8b636106e598a4ddeca56b7bcc62..f1db4b358ff35b0497457ad75ef27086a411ee30
mode 100644,100755..100755
@@@ -31,7 -31,7 +31,7 @@@ Clean up feeds that no longer have subs
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $delete_inactive = have_option('d', 'delete-inactive');
  $delcount = 0;
index 01136de4173c5e04e871bc966d1b6deab49106fe,8f8ac3ee1d968416dacd8557e6e5fba7360181a4..01136de4173c5e04e871bc966d1b6deab49106fe
mode 100644,100755..100755
@@@ -26,7 -26,7 +26,7 @@@ Resubscribe to any soon expiring feeds
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  try {
      $sub = FeedSub::renewalCheck();
index edf64cd5f6247c047dbe01c5c95bef1caab103a9,3d13724f7db1336979a951e6f5616c8bae1dba9a..edf64cd5f6247c047dbe01c5c95bef1caab103a9
mode 100644,100755..100755
@@@ -34,7 -34,7 +34,7 @@@ Options
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  if (empty($args[0]) || !Validate::uri($args[0])) {
      print "$helptext";
index 1957f95cb368f3cafce9cf6b36ce25acbb156a25,ce1698a60c2bff4751a228127965bf6422e176e4..1957f95cb368f3cafce9cf6b36ce25acbb156a25
mode 100644,100755..100755
@@@ -41,7 -41,7 +41,7 @@@ the hub is probably either broken or do
  
  END_OF_HELP;
  
 -require_once INSTALLDIR . '/scripts/commandline.inc';
 +require_once INSTALLDIR . '/scripts/commandline.inc.php';
  
  $dry = false;
  
index e22f22ac501abe91143dceac0141ed2cdfacfae5,84b470c3b251dbfc1f31bfe7823fa628d1657643..e22f22ac501abe91143dceac0141ed2cdfacfae5
mode 100644,100755..100755
@@@ -33,7 -33,7 +33,7 @@@ Mainly intended for testing funky feed 
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  if (empty($args[0]) || !Validate::uri($args[0])) {
      print "$helptext";
index 772cc073e2f1a9af816aa658c1a9b3cdcd322ebb,e024ed95a780f3b09b8771f0d7360671b7303320..772cc073e2f1a9af816aa658c1a9b3cdcd322ebb
mode 100644,100755..100755
@@@ -37,7 -37,7 +37,7 @@@ Options
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  function showProfileInfo(Ostatus_profile $oprofile) {
      if ($oprofile->isGroup()) {
index 20073e0750ce2d92bc8195640023ad03689db3a1,3d726749202f82eb1471efc220b63899d174d076..20073e0750ce2d92bc8195640023ad03689db3a1
mode 100644,100755..100755
@@@ -30,7 -30,7 +30,7 @@@ things restarted if the hub or feed URL
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  if (empty($args[0]) || !Validate::uri($args[0])) {
      print "$helptext";
index 707dbe61f808d0c8c162843e589a23888d3f6c6e,2a32ae0491f5fc238a5da390ea842f10917d4f01..707dbe61f808d0c8c162843e589a23888d3f6c6e
mode 100644,100755..100755
@@@ -36,7 -36,7 +36,7 @@@ you have no backup
  
  UPDATE_OSTATUS_PROFILES;
  
 -require_once INSTALLDIR . '/scripts/commandline.inc';
 +require_once INSTALLDIR . '/scripts/commandline.inc.php';
  
  /*
   * Hacky class to remove some checks and get public access to
@@@ -54,7 -54,7 +54,7 @@@ class LooseOstatusProfile extends Ostat
       * @throws Exception on various error conditions
       * @throws OStatusShadowException if this reference would obscure a local user/group
       */
 -    public static function updateProfileURL($profile_url, $hints=array())
 +    public static function updateProfileURL($profile_url, array $hints=array())
      {
          $oprofile = null;
  
index eaef76d8cdeb1f1e2e59b5cb568f1b0856395268,e3f5439aed69bd239da22149538dfbbade619819..eaef76d8cdeb1f1e2e59b5cb568f1b0856395268
mode 100644,100755..100755
@@@ -34,7 -34,7 +34,7 @@@ Test generation and sending of magic en
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  if (!have_option('--notice')) {
      print "$helptext";
index b6035bfac56227814ffb7d0e3b8945577b8a861c,37883b1da65d41f013273b5f8cdc355432b64baa..b6035bfac56227814ffb7d0e3b8945577b8a861c
mode 100644,100755..100755
@@@ -33,7 -33,7 +33,7 @@@ Garbage-collects old realtime channel
  
  END_OF_CLEANUPCHANNELS_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  function cleanupChannels()
  {
index 6935e00ee5ff192073faf1faf3c99ba6ed5a1a5e,4d2000ab0fe714903549880f040c1f97dc77cad0..6935e00ee5ff192073faf1faf3c99ba6ed5a1a5e
mode 100644,100755..100755
@@@ -30,7 -30,7 +30,7 @@@ Registers a new user by email address a
  
  END_OF_REGISTERBYEMAIL_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $email = get_option_value('e', 'email');
  
index 744dab82876e816f023fe1cd0878873eb7855bfe,91bc0ac4e9720a23532973182c7bb749a06e1bb7..744dab82876e816f023fe1cd0878873eb7855bfe
mode 100644,100755..100755
@@@ -26,7 -26,7 +26,7 @@@ Update the notice and user counts cache
  
  END_OF_UPDATECOUNTS_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  // Will fill the cache
  
index e563f534934ce2a4ce09c8eeaa99079a95b53e51,8b774889d19722214cea7595862bd8e8eb48359e..e563f534934ce2a4ce09c8eeaa99079a95b53e51
mode 100644,100755..100755
@@@ -33,7 -33,7 +33,7 @@@ Daemon script for receiving new notice
  
  END_OF_TWITTERDAEMON_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  class TwitterDaemon extends SpawningDaemon
  {
index 12fb2457482399bdacc8662b95d5c781f34dbd08,f4a60c479d62498474f45710d7aae87535126b47..12fb2457482399bdacc8662b95d5c781f34dbd08
mode 100644,100755..100755
@@@ -29,7 -29,7 +29,7 @@@ version 0.9.5
  
  ENDOFHELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  // We update any notices that may have come in from
  // Twitter that we don't have a status_id for. Note that
diff --combined scripts/clearcache.php
index 5904681edd8a7fbea0ad96b0e76373d37f09d6c4,c67d6275d89194cbcaf1641443e695a9ce14cd03..5904681edd8a7fbea0ad96b0e76373d37f09d6c4
mode 100644,100755..100755
@@@ -33,7 -33,7 +33,7 @@@ clears the cached object based on the a
  
  END_OF_CLEARCACHE_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $karg = get_option_value('k', 'key');
  
diff --combined scripts/createsim.php
index e5b47df6dee7daf09c13f59de2c74ab82197c470,624043161da9f19fe0e3512e760e0f770e3f2ca4..e5b47df6dee7daf09c13f59de2c74ab82197c470
mode 100644,100755..100755
@@@ -49,7 -49,7 +49,7 @@@ Creates a lot of test users and notice
  
  END_OF_CREATESIM_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  // XXX: make these command-line options
  
@@@ -71,7 -71,7 +71,7 @@@ function newGroup($i, $j
  
      // Pick a random user to be the admin
  
 -    $n = rand(0, max($j - 1, 0));
 +    $n = mt_rand(0, max($j - 1, 0));
      $user = User::getKV('nickname', sprintf('%s%d', $userprefix, $n));
  
      $group = User_group::register(array('nickname' => sprintf('%s%d', $groupprefix, $i),
@@@ -86,10 -86,10 +86,10 @@@ function newNotice($i, $tagmax
  
      $options = array('scope' => Notice::defaultScope());
  
 -    $n = rand(0, $i - 1);
 +    $n = mt_rand(0, $i - 1);
      $user = User::getKV('nickname', sprintf('%s%d', $userprefix, $n));
  
 -    $is_reply = rand(0, 1);
 +    $is_reply = mt_rand(0, 1);
  
      $content = testNoticeContent();
  
          $stream = new InboxNoticeStream($user->getProfile(), $user->getProfile());
          $notices = $stream->getNotices(0, 20);
          if ($notices->N > 0) {
 -            $nval = rand(0, $notices->N - 1);
 +            $nval = mt_rand(0, $notices->N - 1);
              $notices->fetch(); // go to 0th
              for ($i = 0; $i < $nval; $i++) {
                  $notices->fetch();
              }
              $options['reply_to'] = $notices->id;
 -            $dont_use_nickname = rand(0, 2);
 +            $dont_use_nickname = mt_rand(0, 2);
              if ($dont_use_nickname != 0) {
                  $rprofile = $notices->getProfile();
                  $content = "@".$rprofile->nickname." ".$content;
              }
 -            $private_to_addressees = rand(0, 4);
 +            $private_to_addressees = mt_rand(0, 4);
              if ($private_to_addressees == 0) {
                  $options['scope'] |= Notice::ADDRESSEE_SCOPE;
              }
          }
      } else {
 -        $is_directed = rand(0, 4);
 +        $is_directed = mt_rand(0, 4);
  
          if ($is_directed == 0) {
              $subs = $user->getSubscribed(0, 100)->fetchAll();
              if (count($subs) > 0) {
                  $seen = array();
 -                $f = rand(0, 9);
 +                $f = mt_rand(0, 9);
                  if ($f <= 6) {
                      $addrs = 1;
                  } else if ($f <= 8) {
                      $addrs = 3;
                  }
                  for ($m = 0; $m < $addrs; $m++) {
 -                    $x = rand(0, count($subs) - 1);
 +                    $x = mt_rand(0, count($subs) - 1);
                      if ($seen[$x]) {
                          continue;
                      }
                      $rprofile = $subs[$x];
                      $content = "@".$rprofile->nickname." ".$content;
                  }
 -                $private_to_addressees = rand(0, 4);
 +                $private_to_addressees = mt_rand(0, 4);
                  if ($private_to_addressees == 0) {
                      $options['scope'] |= Notice::ADDRESSEE_SCOPE;
                  }
          }
      }
  
 -    $has_hash = rand(0, 2);
 +    $has_hash = mt_rand(0, 2);
  
      if ($has_hash == 0) {
 -        $hashcount = rand(0, 2);
 +        $hashcount = mt_rand(0, 2);
          for ($j = 0; $j < $hashcount; $j++) {
 -            $h = rand(0, $tagmax);
 +            $h = mt_rand(0, $tagmax);
              $content .= " #tag{$h}";
          }
      }
  
 -    $in_group = rand(0, 5);
 +    $in_group = mt_rand(0, 5);
  
      if ($in_group == 0) {
          $groups = $user->getGroups();
          if ($groups instanceof User_group) {
 -            $gval = rand(0, $groups->N - 1);
 +            $gval = mt_rand(0, $groups->N - 1);
              $groups->fetch(); // go to 0th
              for ($i = 0; $i < $gval; $i++) {
                  $groups->fetch();
              }
              $options['groups'] = array($groups->id);
              $content = "!".$groups->nickname." ".$content;
 -            $private_to_group = rand(0, 2);
 +            $private_to_group = mt_rand(0, 2);
              if ($private_to_group == 0) {
                  $options['scope'] |= Notice::GROUP_SCOPE;
              }
          }
      }
  
 -    $private_to_site = rand(0, 4);
 +    $private_to_site = mt_rand(0, 4);
  
      if ($private_to_site == 0) {
          $options['scope'] |= Notice::SITE_SCOPE;
@@@ -191,7 -191,7 +191,7 @@@ function newMessage($i
  {
      global $userprefix;
  
 -    $n = rand(0, $i - 1);
 +    $n = mt_rand(0, $i - 1);
      $user = User::getKV('nickname', sprintf('%s%d', $userprefix, $n));
  
      $content = testNoticeContent();
          return;
      }
  
 -    $j = rand(0, count($friends) - 1);
 +    $j = mt_rand(0, count($friends) - 1);
      
      $other = $friends[$j];
  
  function newSub($i)
  {
      global $userprefix;
 -    $f = rand(0, $i - 1);
 +    $f = mt_rand(0, $i - 1);
  
      $fromnick = sprintf('%s%d', $userprefix, $f);
  
          throw new Exception("Can't find user '$fromnick'.");
      }
  
 -    $t = rand(0, $i - 1);
 +    $t = mt_rand(0, $i - 1);
  
      if ($t == $f) {
          $t++;
@@@ -250,7 -250,7 +250,7 @@@ function newJoin($u, $g
      global $userprefix;
      global $groupprefix;
  
 -    $userNumber = rand(0, $u - 1);
 +    $userNumber = mt_rand(0, $u - 1);
  
      $userNick = sprintf('%s%d', $userprefix, $userNumber);
  
          throw new Exception("Can't find user '$fromnick'.");
      }
  
 -    $groupNumber = rand(0, $g - 1);
 +    $groupNumber = mt_rand(0, $g - 1);
  
      $groupNick = sprintf('%s%d', $groupprefix, $groupNumber);
  
@@@ -281,7 -281,7 +281,7 @@@ function newFave($u
      global $userprefix;
      global $groupprefix;
  
 -    $userNumber = rand(0, $u - 1);
 +    $userNumber = mt_rand(0, $u - 1);
  
      $userNick = sprintf('%s%d', $userprefix, $userNumber);
  
  
      // NB: it's OK to like your own stuff!
  
 -    $otherNumber = rand(0, $u - 1);
 +    $otherNumber = mt_rand(0, $u - 1);
  
      $otherNick = sprintf('%s%d', $userprefix, $otherNumber);
  
          return;
      }
  
 -    $idx = rand(0, count($notices) - 1);
 +    $idx = mt_rand(0, count($notices) - 1);
  
      $notice = $notices[$idx];
  
@@@ -328,7 -328,7 +328,7 @@@ function testNoticeContent(
          return "test notice content";
      }
  
 -    $cnt = rand(3, 8);
 +    $cnt = mt_rand(3, 8);
  
      $ids = array_rand($words, $cnt);
  
@@@ -393,7 -393,7 +393,7 @@@ function main($usercount, $groupcount, 
  
      for ($i = 0; $i < $events; $i++)
      {
 -        $e = rand(0, $events);
 +        $e = mt_rand(0, $events);
  
          if ($e >= 0 && $e <= $ut) {
              printfv("$i Creating user $n\n");
diff --combined scripts/dumpschema.php
index 05638cda4cb22aed28c57fe79916a8c1b1814a49,9c5e3cf8b38c2fd9808803ba9c2c8437fcddfb89..05638cda4cb22aed28c57fe79916a8c1b1814a49
mode 100644,100755..100755
@@@ -34,7 -34,7 +34,7 @@@ Attempt to pull a schema definition fo
  END_OF_CHECKSCHEMA_HELP;
  
  $longoptions = array('diff', 'all', 'create', 'update', 'raw', 'checksum');
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  function indentOptions($indent)
  {
@@@ -250,4 -250,4 +250,4 @@@ if (count($args)) 
      }
  } else {
      show_help($helptext);
 -}
 +}
diff --combined scripts/flushrouter.php
index a9952b4304fc2d4f01dd5cd03a25eff1b9d70205,51178a725c6d5acfb369cfcbebcb81387c897b75..a9952b4304fc2d4f01dd5cd03a25eff1b9d70205
mode 100644,100755..100755
@@@ -26,9 -26,9 +26,9 @@@ Flush the url router from cache
  
  END_OF_FLUSHROUTER_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $cache = Cache::instance();
  $cache->delete(Router::cacheKey());
  
 -print "OK.\n";
 +print "OK.\n";
diff --combined scripts/flushsite.php
index 3950fb7cf71830b4b51b316bbf4606db130f8fca,b7f385ac45f8652990f2849904845726814c470e..3950fb7cf71830b4b51b316bbf4606db130f8fca
mode 100644,100755..100755
@@@ -29,7 -29,7 +29,7 @@@ Flush the site with the given name fro
  
  END_OF_FLUSHSITE_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $nickname = common_config('site', 'nickname');
  
@@@ -42,4 -42,4 +42,4 @@@ if (empty($sn)) 
  
  print "Flushing cache for {$nickname}...";
  $sn->decache();
 -print "OK.\n";
 +print "OK.\n";
index 91c2dc7f646ec759ddac1bff7008876fbccee86c,dbe9c54c5ba9d838787dc2affbc3afe0265585f2..91c2dc7f646ec759ddac1bff7008876fbccee86c
mode 100644,100755..100755
@@@ -28,6 -28,6 +28,6 @@@ prints out the current version of the s
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  print GNUSOCIAL_VERSION."\n";
index d121179f47a9e45e0fa1777d0d9f9c29c419b499,a29526f27e1726f57f3679dcdab034fbf4350614..d121179f47a9e45e0fa1777d0d9f9c29c419b499
mode 100644,100755..100755
@@@ -33,7 -33,7 +33,7 @@@ import an Atom feed from Twitter as not
  
  END_OF_IMPORTTWITTERATOM_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
  
  function getAtomFeedDocument()
diff --combined scripts/make-release.php
index a3d9c70eb061bdb435826dfc78bead11b27e92b3,157cae067db619a491c0ed9d8a07a8f8ae97f1a5..a3d9c70eb061bdb435826dfc78bead11b27e92b3
mode 100644,100755..100755
@@@ -22,7 -22,7 +22,7 @@@
  
  define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $base = INSTALLDIR;
  $encBase = escapeshellarg($base);
index 3d3b1d3e841accdfaddcbe98d3af8d091ed8a787,345d93c665745896d99c81e5d1623b56a2c3700f..3d3b1d3e841accdfaddcbe98d3af8d091ed8a787
mode 100644,100755..100755
@@@ -32,7 -32,7 +32,7 @@@ makes a user the admin of a grou
  
  END_OF_MAKEGROUPADMIN_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $nickname = get_option_value('n', 'nickname');
  $groupname = get_option_value('g', 'group');
diff --combined scripts/registeruser.php
index b7ee9f368ca32aee845c4f429f18a966f5a87199,97caf645cd6eb812904d9c68da110e958e30ca49..b7ee9f368ca32aee845c4f429f18a966f5a87199
mode 100644,100755..100755
@@@ -34,7 -34,7 +34,7 @@@ registers a user in the databas
  
  END_OF_REGISTERUSER_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $nickname = get_option_value('n', 'nickname');
  $password = get_option_value('w', 'password');
diff --combined scripts/sessiongc.php
index ef452fdb064f61847689f811368abcfb4d4fba47,af55ddf3f0d971d9c8af92636104c9527ecf4cb9..ef452fdb064f61847689f811368abcfb4d4fba47
mode 100644,100755..100755
@@@ -27,7 -27,7 +27,7 @@@ Delete old sessions from the serve
  
  END_OF_GC_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $maxlifetime = ini_get('session.gc_maxlifetime');
  
diff --combined scripts/settag.php
index 3c234f2c31cdc430321c17d4abd082c94476a00c,19abce43c8018a5d1de97ca83e5740f730c2c294..3c234f2c31cdc430321c17d4abd082c94476a00c
mode 100644,100755..100755
@@@ -31,7 -31,7 +31,7 @@@ With -d, delete the tag
  
  END_OF_SETTAG_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  if (count($args) < 1) {
      show_help();
diff --combined scripts/showcache.php
index b4fe7b63ce9601b8c9d67648597a6bec63e1ce99,8ef08467d6be139dd2a50ee11670962cbeb30cf7..b4fe7b63ce9601b8c9d67648597a6bec63e1ce99
mode 100644,100755..100755
@@@ -33,7 -33,7 +33,7 @@@ shows the cached object based on the ar
  
  ENDOFHELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $karg = get_option_value('k');
  
diff --combined scripts/showtable.php
index 986260e1d23bdf8d16ac5ad2b425fae4217325a2,eb18a98e20d510cb3dfd2d8feee39abbd341dfd7..986260e1d23bdf8d16ac5ad2b425fae4217325a2
mode 100644,100755..100755
@@@ -26,7 -26,7 +26,7 @@@ Shows the structure of a tabl
  
  END_OF_SHOWTABLE_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  if (count($args) != 1) {
      show_help();
index 6cd2101ad7a4561378cf498456e99f569d3f25f3,b5955fd5aa9335a0ae259cdfb7baa24c3ea228bc..6cd2101ad7a4561378cf498456e99f569d3f25f3
mode 100644,100755..100755
@@@ -26,7 -26,7 +26,7 @@@ Uncache users listed in an ID file, def
  
  ENDOFHELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $id_file = (count($args) > 1) ? $args[0] : 'ids.txt';
  
index c8024cb769a86fb6d868e52c483b6ef9b9084063,abf9627cc71e6daffc61c3b26802b7a435bece14..c8024cb769a86fb6d868e52c483b6ef9b9084063
mode 100644,100755..100755
@@@ -34,7 -34,7 +34,7 @@@ set the location for a profil
  
  END_OF_UPDATELOCATION_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  try {
      $user = null;
diff --combined scripts/updateurls.php
index c49187c299407c194b27cb669f75ac3d395b3206,35b835e4944ac435ac24cf6dd43d5090efaa4932..c49187c299407c194b27cb669f75ac3d395b3206
mode 100644,100755..100755
@@@ -29,7 -29,7 +29,7 @@@ update stored URLs in the syste
  
  END_OF_UPDATEURLS_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  function main()
  {
diff --combined scripts/upgrade.php
index 0dd70f79f6fc6f6f3d4c9e6735f9ffa703da9855,126ef290360b27a7d8b0abfcf3963816555b18ef..0dd70f79f6fc6f6f3d4c9e6735f9ffa703da9855
mode 100644,100755..100755
@@@ -29,7 -29,7 +29,7 @@@ Upgrade database schema and data to lat
  
  END_OF_UPGRADE_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  function main()
  {
diff --combined scripts/userrole.php
index a5eddeae5fc3dd5a1525ff6d12bdd2d1b4863b6e,d1061b18322417a6afb9c18e634dd5c6c467a78e..a5eddeae5fc3dd5a1525ff6d12bdd2d1b4863b6e
mode 100644,100755..100755
@@@ -34,7 -34,7 +34,7 @@@ modifies a role for the given use
  
  END_OF_USERROLE_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  if (have_option('i', 'id')) {
      $id = get_option_value('i', 'id');
index 4259c0cdc701dde222477542b0e59448e3395142,fb675c778e3c33754f7da53da80dd9c92806b973..4259c0cdc701dde222477542b0e59448e3395142
mode 100644,100755..100755
@@@ -37,7 -37,7 +37,7 @@@ Options
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
  $user = get_option_value('n', 'nickname');
  $pass = get_option_value('p', 'password');
index 6742ab1580b1dddd3c35772d70d878d6e2356bd8,23fc04b531567aedffc836627fc316eb7b563d88..6742ab1580b1dddd3c35772d70d878d6e2356bd8
mode 100644,100755..100755
@@@ -40,7 -40,7 +40,7 @@@ $token        = null
  $token_secret = null;
  $update       = null;
  
 -require_once INSTALLDIR . '/scripts/commandline.inc';
 +require_once INSTALLDIR . '/scripts/commandline.inc.php';
  
  if (have_option('t', 'oauth_token')) {
      $token = get_option_value('t', 'oauth_token');