]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of gitorious.org:social/mainline
authorRoland Haeder <roland@mxchange.org>
Tue, 10 Mar 2015 23:18:33 +0000 (00:18 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 10 Mar 2015 23:19:08 +0000 (00:19 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
536 files changed:
.gitignore
actions/addpeopletag.php
actions/allrss.php
actions/apiaccountratelimitstatus.php
actions/apiaccountupdatedeliverydevice.php
actions/apiaccountverifycredentials.php
actions/apiatomservice.php
actions/apiattachment.php
actions/apicheckhub.php
actions/apiconversation.php
actions/apiexternalprofileshow.php
actions/apifriendshipsdestroy.php
actions/apifriendshipsexists.php
actions/apifriendshipsshow.php
actions/apignusocialconfig.php
actions/apignusocialversion.php
actions/apigroupadmins.php
actions/apigroupismember.php
actions/apigrouplist.php
actions/apigrouplistall.php
actions/apigroupmembership.php
actions/apigroupshow.php
actions/apihelptest.php
actions/apilist.php
actions/apilistmemberships.php
actions/apilists.php
actions/apilistsubscriber.php
actions/apilistsubscriptions.php
actions/apimediaupload.php
actions/apioauthaccesstoken.php
actions/apioauthauthorize.php
actions/apioauthrequesttoken.php
actions/apisearchatom.php
actions/apisearchjson.php
actions/apistatusesdestroy.php
actions/apistatusesretweets.php
actions/apistatusesshow.php
actions/apisubscriptions.php
actions/apitimelinefriends.php
actions/apitimelinegroup.php
actions/apitimelinehome.php
actions/apitimelinelist.php
actions/apitimelinementions.php
actions/apitimelinepublic.php
actions/apitimelineretweetedbyme.php
actions/apitimelineretweetedtome.php
actions/apitimelineretweetsofme.php
actions/apitimelinetag.php
actions/apitimelineuser.php
actions/apitrends.php
actions/apiuserprofileimage.php
actions/apiusershow.php
actions/approvegroup.php
actions/approvesub.php
actions/atompubshowsubscription.php
actions/attachment.php
actions/avatarbynickname.php
actions/backupaccount.php
actions/block.php
actions/blockedfromgroup.php
actions/cancelgroup.php
actions/confirmaddress.php
actions/deleteaccount.php
actions/deleteapplication.php
actions/deletegroup.php
actions/deletenotice.php
actions/deleteuser.php
actions/doc.php
actions/editapplication.php
actions/editpeopletag.php
actions/featured.php
actions/foaf.php
actions/foafgroup.php
actions/geocode.php
actions/getfile.php
actions/grantrole.php
actions/groupblock.php
actions/groupbyid.php
actions/groupmembers.php
actions/groupqueue.php
actions/grouprss.php
actions/groups.php
actions/groupunblock.php
actions/invite.php
actions/logout.php
actions/makeadmin.php
actions/microsummary.php
actions/noticesearch.php
actions/noticesearchrss.php
actions/nudge.php
actions/oauthappssettings.php
actions/oauthconnectionssettings.php
actions/opensearch.php
actions/otp.php
actions/peopletag.php
actions/peopletagautocomplete.php
actions/peopletagged.php
actions/peopletagsbyuser.php
actions/peopletagsforuser.php
actions/peopletagsubscribers.php
actions/peopletagsubscriptions.php
actions/pluginenable.php
actions/profilecompletion.php
actions/profiletagbyid.php
actions/public.php
actions/publicrss.php
actions/publictagcloud.php
actions/publicxrds.php
actions/recoverpassword.php
actions/redirect.php
actions/redirecturl.php
actions/register.php
actions/removepeopletag.php
actions/replies.php
actions/repliesrss.php
actions/restoreaccount.php
actions/revokerole.php
actions/robotstxt.php
actions/rsd.php
actions/sandbox.php
actions/selftag.php
actions/showapplication.php
actions/showgroup.php
actions/shownotice.php
actions/showprofiletag.php
actions/showstream.php
actions/silence.php
actions/subedit.php
actions/subqueue.php
actions/subscribe.php
actions/subscribepeopletag.php
actions/subscribers.php
actions/subscriptions.php
actions/sup.php
actions/tag.php
actions/tagrss.php
actions/unblock.php
actions/unsandbox.php
actions/unsilence.php
actions/unsubscribe.php
actions/unsubscribepeopletag.php
actions/userbyid.php
actions/userrss.php
actions/version.php
classes/Avatar.php
classes/Memcached_DataObject.php
classes/Notice.php
classes/User_group.php
extlib/DB/DataObject.php [changed mode: 0755->0644]
extlib/DB/DataObject/Cast.php [changed mode: 0755->0644]
extlib/DB/DataObject/Error.php [changed mode: 0755->0644]
extlib/DB/DataObject/Generator.php [changed mode: 0755->0644]
extlib/DB/DataObject/createTables.php [changed mode: 0755->0644]
extlib/Mail.php [changed mode: 0755->0644]
extlib/Mail/RFC822.php [changed mode: 0755->0644]
extlib/Mail/mail.php [changed mode: 0755->0644]
extlib/Mail/mock.php [changed mode: 0755->0644]
extlib/Mail/null.php [changed mode: 0755->0644]
extlib/Mail/sendmail.php [changed mode: 0755->0644]
extlib/Mail/smtp.php [changed mode: 0755->0644]
extlib/Mail/smtpmx.php [changed mode: 0755->0644]
extlib/Net/URL2.php [changed mode: 0755->0644]
htaccess.sample
index.php
installer.txt [new file with mode: 0644]
lib/action.php
lib/activityimporter.php
lib/activityutils.php
lib/adminpanelaction.php
lib/apilistusers.php
lib/apioauthaction.php
lib/attachmentlist.php
lib/attachmentlistitem.php
lib/clienterroraction.php
lib/default.php
lib/docfile.php
lib/formaction.php
lib/framework.php
lib/fullthreadednoticelist.php
lib/groupaction.php
lib/grouplist.php
lib/groupmemberlist.php
lib/imagefile.php
lib/implugin.php
lib/infoaction.php
lib/inlineattachmentlist.php
lib/installer.php
lib/inviteform.php
lib/iomaster.php
lib/menu.php
lib/noticeform.php
lib/noticelistitem.php
lib/plugin.php
lib/pluginlist.php
lib/profileaction.php
lib/profileformaction.php
lib/profilelist.php
lib/profileminilist.php
lib/router.php
lib/rssaction.php
lib/schemaupdater.php
lib/searchaction.php
lib/servererroraction.php
lib/settingsaction.php
lib/subscriptionlist.php
lib/urlmapper.php
lib/urlshortenerplugin2.php [new file with mode: 0644]
lib/util.php
plugins/APC/APCPlugin.php
plugins/AccountManager/AccountManagerPlugin.php
plugins/AccountManager/actions/accountmanagementcontroldocument.php
plugins/AccountManager/actions/accountmanagementsessionstatus.php
plugins/Activity/ActivityPlugin.php
plugins/ActivitySpam/ActivitySpamPlugin.php
plugins/ActivitySpam/actions/spam.php
plugins/ActivitySpam/scripts/silencespammer.php
plugins/ActivitySpam/scripts/testuser.php
plugins/ActivitySpam/scripts/trainuser.php
plugins/Adsense/AdsensePlugin.php
plugins/Aim/AimPlugin.php
plugins/Aim/lib/aimmanager.php
plugins/AnonymousFave/AnonymousFavePlugin.php
plugins/AnonymousFave/actions/anondisfavor.php
plugins/AnonymousFave/actions/anonfavor.php
plugins/AnonymousFave/scripts/initialize_fave_tallys.php
plugins/ApiLogger/ApiLoggerPlugin.php
plugins/AuthCrypt/AuthCryptPlugin.php
plugins/AutoSandbox/AutoSandboxPlugin.php
plugins/Autocomplete/AutocompletePlugin.php
plugins/Autocomplete/actions/autocomplete.php
plugins/Awesomeness/AwesomenessPlugin.php
plugins/BitlyUrl/BitlyUrlPlugin.php
plugins/Blacklist/BlacklistPlugin.php
plugins/BlankAd/BlankAdPlugin.php
plugins/Blog/BlogPlugin.php
plugins/BlogspamNet/BlogspamNetPlugin.php
plugins/Bookmark/BookmarkPlugin.php
plugins/Bookmark/actions/apitimelinebookmarks.php
plugins/Bookmark/actions/bookmarkforurl.php
plugins/Bookmark/actions/bookmarks.php
plugins/Bookmark/actions/bookmarksrss.php
plugins/Bookmark/actions/importdelicious.php
plugins/Bookmark/actions/newbookmark.php
plugins/Bookmark/actions/noticebyurl.php
plugins/Bookmark/scripts/importbookmarks.php
plugins/CacheLog/CacheLogPlugin.php
plugins/CasAuthentication/CasAuthenticationPlugin.php
plugins/CasAuthentication/actions/caslogin.php
plugins/ClientSideShorten/ClientSideShortenPlugin.php
plugins/ClientSideShorten/actions/shorten.php
plugins/Comet/CometPlugin.php
plugins/ConversationTree/lib/conversationtree.php
plugins/Cronish/CronishPlugin.php
plugins/DirectMessage/DirectMessagePlugin.php
plugins/DirectMessage/actions/apidirectmessage.php
plugins/DirectMessage/actions/showmessage.php
plugins/DirectMessage/classes/Message.php
plugins/DirectMessage/lib/inboxmessagelist.php
plugins/DirectionDetector/DirectionDetectorPlugin.php
plugins/Directory/DirectoryPlugin.php
plugins/Directory/actions/groupdirectory.php
plugins/Directory/actions/userdirectory.php
plugins/Directory/lib/sortablegrouplist.php
plugins/Directory/lib/sortablesubscriptionlist.php
plugins/DiskCache/DiskCachePlugin.php
plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php
plugins/DomainStatusNetwork/actions/globalapi.php
plugins/DomainStatusNetwork/scripts/installforemail.php
plugins/DomainStatusNetwork/scripts/proposesite.php
plugins/DomainStatusNetwork/scripts/sitefordomain.php
plugins/DomainWhitelist/DomainWhitelistPlugin.php
plugins/EmailAuthentication/EmailAuthenticationPlugin.php
plugins/EmailRegistration/EmailRegistrationPlugin.php
plugins/EmailRegistration/actions/emailregister.php
plugins/EmailRegistration/scripts/cancelemailregistration.php
plugins/EmailRegistration/scripts/registeremailuser.php
plugins/EmailReminder/EmailReminderPlugin.php
plugins/EmailReminder/scripts/sendemailreminder.php
plugins/EmailSummary/EmailSummaryPlugin.php
plugins/EmailSummary/scripts/sendemailsummary.php
plugins/Event/EventPlugin.php
plugins/Event/actions/cancelrsvp.php
plugins/Event/actions/newevent.php
plugins/Event/actions/newrsvp.php
plugins/Event/actions/timelist.php
plugins/ExtendedProfile/ExtendedProfilePlugin.php
plugins/ExtendedProfile/actions/profiledetail.php
plugins/ExtendedProfile/actions/userautocomplete.php
plugins/FacebookBridge/FacebookBridgePlugin.php
plugins/FacebookBridge/actions/facebookdeauthorize.php
plugins/FacebookBridge/actions/facebookfinishlogin.php
plugins/FacebookBridge/actions/facebooklogin.php
plugins/FacebookBridge/actions/facebooksettings.php
plugins/Favorite/actions/apifavoritecreate.php
plugins/Favorite/actions/apifavoritedestroy.php
plugins/Favorite/actions/apistatusesfavs.php
plugins/Favorite/actions/apitimelinefavorites.php
plugins/Favorite/actions/atompubfavoritefeed.php
plugins/Favorite/actions/atompubshowfavorite.php
plugins/Favorite/actions/favorited.php
plugins/Favorite/actions/favoritesrss.php
plugins/Favorite/actions/showfavorites.php
plugins/FirePHP/FirePHPPlugin.php
plugins/FollowEveryone/FollowEveryonePlugin.php
plugins/ForceGroup/ForceGroupPlugin.php
plugins/GNUsocialPhoto/GNUsocialPhotoPlugin.php
plugins/GNUsocialPhoto/actions/newphoto.php
plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php
plugins/GNUsocialPhotos/actions/editphoto.php
plugins/GNUsocialPhotos/actions/photos.php
plugins/GNUsocialPhotos/actions/photoupload.php
plugins/GNUsocialProfileExtensions/GNUsocialProfileExtensionsPlugin.php
plugins/GNUsocialProfileExtensions/actions/bio.php
plugins/GNUsocialProfileExtensions/lib/noticetree.php
plugins/GNUsocialVideo/GNUsocialVideoPlugin.php
plugins/GNUsocialVideo/actions/postvideo.php
plugins/GNUsocialVideo/actions/showvideo.php
plugins/GeoURL/GeoURLPlugin.php
plugins/Geonames/GeonamesPlugin.php
plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php
plugins/Gravatar/GravatarPlugin.php
plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
plugins/GroupPrivateMessage/actions/groupinbox.php
plugins/GroupPrivateMessage/actions/showgroupmessage.php
plugins/Imap/ImapPlugin.php
plugins/InProcessCache/InProcessCachePlugin.php
plugins/InfiniteScroll/InfiniteScrollPlugin.php
plugins/Irc/IrcPlugin.php
plugins/Irc/extlib/phergie/Tests/Phergie/Plugin/HandlerTest.php
plugins/Irc/lib/ircmanager.php
plugins/LRDD/LRDDPlugin.php
plugins/LdapAuthentication/LdapAuthenticationPlugin.php
plugins/LdapAuthorization/LdapAuthorizationPlugin.php
plugins/LdapCommon/LdapCommon.php
plugins/LilUrl/LilUrlPlugin.php
plugins/LinkPreview/LinkPreviewPlugin.php
plugins/LinkPreview/actions/oembedproxy.php
plugins/Linkback/LinkbackPlugin.php
plugins/LogFilter/LogFilterPlugin.php
plugins/Mapstraction/MapstractionPlugin.php
plugins/Mapstraction/actions/allmap.php
plugins/Mapstraction/actions/map.php
plugins/Mapstraction/actions/usermap.php
plugins/Memcache/MemcachePlugin.php
plugins/Memcached/MemcachedPlugin.php
plugins/Meteor/MeteorPlugin.php
plugins/Minify/MinifyPlugin.php
plugins/Minify/actions/minify.php
plugins/Minify/extlib/minify/min/lib/Solar/Dir.php
plugins/MobileProfile/MobileProfilePlugin.php
plugins/ModHelper/ModHelperPlugin.php
plugins/ModLog/ModLogPlugin.php
plugins/ModPlus/ModPlusPlugin.php
plugins/NoticeTitle/NoticeTitlePlugin.php
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/actions/ostatusinit.php
plugins/OStatus/actions/ostatustag.php
plugins/OStatus/classes/FeedSub.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OStatus/lib/magicenvelope.php
plugins/OStatus/lib/ostatusqueuehandler.php
plugins/OStatus/lib/salmonaction.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/gettext-speedtest.php
plugins/OStatus/tests/slap.php
plugins/Oembed/actions/oembed.php
plugins/Oembed/scripts/fixup_files.php
plugins/OfflineBackup/OfflineBackupPlugin.php
plugins/OfflineBackup/lib/offlinebackupqueuehandler.php
plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php
plugins/OpenID/OpenIDPlugin.php
plugins/OpenID/actions/finishaddopenid.php
plugins/OpenID/actions/finishopenidlogin.php
plugins/OpenID/actions/openidlogin.php
plugins/OpenID/actions/openidserver.php
plugins/OpenID/actions/openidtrust.php
plugins/OpenID/openid.php
plugins/OpenX/OpenXPlugin.php
plugins/OpportunisticQM/OpportunisticQMPlugin.php
plugins/OpportunisticQM/lib/opportunisticqueuemanager.php
plugins/Orbited/OrbitedPlugin.php
plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php
plugins/Poll/PollPlugin.php
plugins/Poll/actions/newpoll.php
plugins/Poll/actions/respondpoll.php
plugins/Poll/classes/Poll.php
plugins/Poll/classes/Poll_response.php
plugins/PostDebug/PostDebugPlugin.php
plugins/PtitUrl/PtitUrlPlugin.php
plugins/QnA/QnAPlugin.php
plugins/QnA/actions/qnaclosequestion.php
plugins/QnA/actions/qnanewanswer.php
plugins/QnA/actions/qnanewquestion.php
plugins/QnA/actions/qnareviseanswer.php
plugins/QnA/actions/qnavote.php
plugins/QnA/classes/QnA_Answer.php
plugins/QnA/classes/QnA_Question.php
plugins/QnA/classes/QnA_Vote.php
plugins/RSSCloud/RSSCloudPlugin.php
plugins/RSSCloud/actions/loggingaggregator.php
plugins/RSSCloud/actions/rsscloudrequestnotify.php
plugins/Realtime/RealtimePlugin.php
plugins/Realtime/actions/closechannel.php
plugins/Realtime/actions/keepalivechannel.php
plugins/Realtime/scripts/cleanupchannels.php
plugins/Recaptcha/RecaptchaPlugin.php
plugins/RegisterThrottle/RegisterThrottlePlugin.php
plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
plugins/RequireValidatedEmail/scripts/registerbyemail.php
plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php
plugins/SQLProfile/SQLProfilePlugin.php
plugins/SQLStats/SQLStatsPlugin.php
plugins/Sample/SamplePlugin.php
plugins/Sample/actions/hello.php
plugins/SearchSub/SearchSubPlugin.php
plugins/SearchSub/actions/searchsub.php
plugins/SearchSub/actions/searchsubs.php
plugins/SearchSub/actions/searchunsub.php
plugins/ShareNotice/ShareNoticePlugin.php
plugins/SimpleUrl/SimpleUrlPlugin.php
plugins/SiteNoticeInSidebar/SiteNoticeInSidebarPlugin.php
plugins/Sitemap/SitemapPlugin.php
plugins/Sitemap/actions/noticesitemap.php
plugins/Sitemap/actions/sitemap.php
plugins/Sitemap/actions/sitemapindex.php
plugins/Sitemap/actions/usersitemap.php
plugins/Sitemap/scripts/updatecounts.php
plugins/SlicedFavorites/SlicedFavoritesPlugin.php
plugins/SlicedFavorites/actions/favoritedslice.php
plugins/SphinxSearch/SphinxSearchPlugin.php
plugins/SphinxSearch/scripts/gen_config.php
plugins/SphinxSearch/scripts/index_update.php
plugins/Spotify/SpotifyPlugin.php
plugins/StrictTransportSecurity/StrictTransportSecurityPlugin.php
plugins/SubMirror/SubMirrorPlugin.php
plugins/SubMirror/actions/mirrorsettings.php
plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php
plugins/TabFocus/TabFocusPlugin.php
plugins/TagSub/TagSubPlugin.php
plugins/TagSub/actions/tagsub.php
plugins/TagSub/actions/tagsubs.php
plugins/TagSub/actions/tagunsub.php
plugins/TightUrl/TightUrlPlugin.php
plugins/TinyMCE/TinyMCEPlugin.php
plugins/TwitterBridge/TwitterBridgePlugin.php
plugins/TwitterBridge/actions/twitterauthorization.php
plugins/TwitterBridge/actions/twitterlogin.php
plugins/TwitterBridge/daemons/synctwitterfriends.php
plugins/TwitterBridge/daemons/twitterdaemon.php
plugins/TwitterBridge/daemons/twitterstatusfetcher.php
plugins/TwitterBridge/lib/jsonstreamreader.php
plugins/TwitterBridge/lib/tweetinqueuehandler.php
plugins/TwitterBridge/scripts/fakestream.php
plugins/TwitterBridge/scripts/initialize_notice_to_status.php
plugins/TwitterBridge/scripts/streamtest.php
plugins/UserFlag/UserFlagPlugin.php
plugins/UserFlag/actions/adminprofileflag.php
plugins/UserFlag/actions/clearflag.php
plugins/UserFlag/actions/flagprofile.php
plugins/UserLimit/UserLimitPlugin.php
plugins/VideoThumbnails/VideoThumbnailsPlugin.php
plugins/WebFinger/WebFingerPlugin.php
plugins/WebFinger/lib/xrdaction.php
plugins/WikiHashtags/WikiHashtagsPlugin.php
plugins/WikiHowProfile/WikiHowProfilePlugin.php
plugins/XCache/XCachePlugin.php
plugins/Xmpp/XmppPlugin.php
plugins/Xmpp/lib/xmppmanager.php
plugins/YammerImport/actions/yammeradminpanel.php
plugins/YammerImport/actions/yammerauth.php
plugins/YammerImport/lib/yammerimporter.php
scripts/allsites.php
scripts/backupuser.php
scripts/checkschema.php
scripts/clean_thumbnails.php
scripts/clear_jabber.php
scripts/clearcache.php
scripts/command.php
scripts/commandline.inc [deleted file]
scripts/commandline.inc.php [new file with mode: 0644]
scripts/console.php
scripts/createsim.php
scripts/deletegroup.php
scripts/deleteuser.php
scripts/docgen.php
scripts/dumpschema.php
scripts/fixup_deletions.php
scripts/flushrouter.php
scripts/flushsite.php
scripts/getpiddir.php
scripts/getvaliddaemons.php
scripts/gnusocialversion.php
scripts/handlequeued.php
scripts/imdaemon.php
scripts/importtwitteratom.php
scripts/joingroup.php
scripts/leavegroup.php
scripts/maildaemon.php
scripts/make-release.php
scripts/makegroupadmin.php
scripts/moveuser.php
scripts/queuectl.php
scripts/queuedaemon.php
scripts/registeruser.php
scripts/restoreuser.php
scripts/sendemail.php
scripts/sessiongc.php
scripts/setconfig.php
scripts/setpassword.php
scripts/settag.php
scripts/showcache.php
scripts/showplugins.php
scripts/showtable.php
scripts/startdaemons.sh
scripts/stopdaemons.sh
scripts/strip_geo.php
scripts/uncache_users.php
scripts/updatelocation.php
scripts/updateurls.php
scripts/upgrade.php
scripts/useremail.php
scripts/userrole.php
tests/UserRightsTest.php
tests/atompub/atompub_test.php
tests/oauth/fetch_temp_creds.php
tests/oauth/fetch_token_creds.php
tests/oauth/oauth_post_notice.php
tests/oauth/oauth_verify_creds.php

index 41084c45cd1cf2e0a198bef83e7fffcc2cf1d5ae..f724ded80816fe670c51be813850d81068f4656c 100644 (file)
@@ -29,4 +29,7 @@ php.log
 .DS_Store
 nbproject
 *.mo
-
+*log*
+htaccess-sample
+installer.txt
+extlib/DB.php
index b501ce0fd9679b245d36f300164f7b433e9cce26..56bb206dc44016aeacbd7f062312ccc371934ae0 100644 (file)
@@ -65,7 +65,7 @@ class AddpeopletagAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -119,7 +119,7 @@ class AddpeopletagAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         // Throws exception on error
         $ptag = Profile_tag::setTag($this->user->id, $this->tagged->id,
@@ -127,7 +127,8 @@ class AddpeopletagAction extends Action
 
         if (!$ptag) {
             $user = User::getKV('id', $id);
-            if ($user) {
+
+            if ($user instanceof User) {
                 $this->clientError(
                         // TRANS: Client error displayed when an unknown error occurs when adding a user to a list.
                         // TRANS: %s is a username.
index fee52c79ab3c7301f307865c6504b12ec39d6d5e..486232c092812676cf9024dc90a78c894bb66854 100644 (file)
@@ -58,7 +58,7 @@ class AllrssAction extends Rss10Action
      * @return boolean false if user doesn't exist
      *
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $nickname   = $this->trimmed('nickname');
index 0883425513fa2f4584fdc59dffede0cd0cbabf17..ee3fdd86ace529c77c3d205df99ec9614ccfaa8e 100644 (file)
@@ -58,7 +58,7 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -115,7 +115,7 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index a3cbb418b65d60c899ca865fbbe9a34efcbc69e1..370423ad2e9bd37d8e63e28e3ee7d2f58e525ce8 100644 (file)
@@ -54,7 +54,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -73,7 +73,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 9b98fa6d810ba384fbea24599c7f47ae4285c3bc..12daf3e1e6fe68150ea652154ee420bf32bf0ba8 100644 (file)
@@ -48,6 +48,13 @@ if (!defined('STATUSNET')) {
  */
 class ApiAccountVerifyCredentialsAction extends ApiAuthAction
 {
+    /**
+     * Handle the request
+     *
+     * Check whether the credentials are valid and output the result
+     *
+     * @return void
+     */
     protected function handle()
     {
         parent::handle();
@@ -78,7 +85,7 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 9e45a30fcc2e883434254f4ddd421b2b3747b714..6ee3eba5957766b01a78ef2986bfa50ab6265b68 100644 (file)
@@ -51,7 +51,7 @@ class ApiAtomServiceAction extends ApiBareAuthAction
      * @return boolean success flag
      *
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->user = $this->getTargetUser($this->arg('id'));
@@ -71,7 +71,7 @@ class ApiAtomServiceAction extends ApiBareAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 505d50330e045ab5a095043c0eb6aa60d3967188..b92709f5d6419b9407f407c42fd2a91bb68f1324 100644 (file)
@@ -99,7 +99,7 @@ class ApiAttachmentAction extends ApiAuthAction
      * @return boolean is read only action?
      */
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index e11b7da4b75793a2cbf74382c1519ab9f2cf5ecb..19cc4d19f63041ec46480ef9335054357ba0761e 100644 (file)
@@ -108,7 +108,7 @@ class ApiCheckHubAction extends ApiAuthAction
      * @return boolean is read only action?
      */
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 0e292303d58b2791e052f4da9d8c50eb63e096d2..7de7b668379bbb2cd7a505162f73a888b33bc2d9 100644 (file)
@@ -163,7 +163,7 @@ class ApiconversationAction extends ApiAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index 4e8419cf6b60723f2a561a4a5717ac26865fd2ee..2fe7450034f404adb108798abb4eb01d4d4c841f 100644 (file)
@@ -92,7 +92,7 @@ class ApiExternalProfileShowAction extends ApiPrivateAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 5f7c85e0aff62bd725a48f634e81e67237fca7b2..610c912cb65f19c10dd6532e547af31f161f91dc 100644 (file)
@@ -58,7 +58,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
      * @return boolean success flag
      *
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -77,7 +77,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 1f76e00b1a7ab7c2a641f372b8ea9486c55e8fb3..2f07b3ec7c665b8d147fa0a7e40481ca5052c5f9 100644 (file)
@@ -57,7 +57,7 @@ class ApiFriendshipsExistsAction extends ApiPrivateAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -76,7 +76,7 @@ class ApiFriendshipsExistsAction extends ApiPrivateAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -117,7 +117,7 @@ class ApiFriendshipsExistsAction extends ApiPrivateAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 5810e148747452ba808ccc4319429b56fd0b3ca7..1cbb98891ae2c01c6f05623938908ba8e9faa577 100644 (file)
@@ -56,7 +56,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -113,7 +113,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -166,7 +166,7 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
      * @return boolean is read only action?
      */
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 813073a9edcb4bf959b4e713bb77b365734c81b0..e86a5636e3cb4e117c9c8a5e62454ec003d0e847 100644 (file)
@@ -141,7 +141,7 @@ class ApiGNUsocialConfigAction extends ApiAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index a56630c666f5d33e6531f66e4f3c7cabe8fba0b7..772e40270d5c4e2050d82e4bb39e7c2fc724949d 100644 (file)
@@ -75,7 +75,7 @@ class ApiGNUsocialVersionAction extends ApiPrivateAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index e0b2475072c5dd9ed32321c4a439bb1a37ddd020..3754a831d4efe587c8d3f2a7a1557e807166c0ce 100644 (file)
@@ -139,7 +139,7 @@ class ApiGroupAdminsAction extends ApiPrivateAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index c085f7b3c1fbefaa7e1ae36d66f741512da99a5e..97ae325cb56c125d5489a15e6a785a66f8692424 100644 (file)
@@ -118,7 +118,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 1953752b020f6a67b07b3a83499c60b2c1759242..2f288bf04fe0d3d8fe674fdc2754cc13b2d922a2 100644 (file)
@@ -160,7 +160,7 @@ class ApiGroupListAction extends ApiBareAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 2fb3714257f7677258a07390539d807771633888..6d7000e6b85f841e1be72bb5d8686863a4daf9f2 100644 (file)
@@ -58,7 +58,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -77,7 +77,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -159,7 +159,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 0e01f92f001dd1db76da5874b4feedba0bdb41f7..86ae091162fe1781b0a134391b12fef229469455 100644 (file)
@@ -130,7 +130,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index a1643302e1cab8b8ed11b51a484d403671efdf09..9a45d231a99e7fc94020e92499c4cb8cdeb0f68e 100644 (file)
@@ -156,7 +156,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index a9cd7394c92817b845246931f661039f80d407f6..a41ebc936732a2e8962267e099f61778175db796 100644 (file)
@@ -51,7 +51,7 @@ class ApiHelpTestAction extends ApiPrivateAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         return true;
@@ -64,7 +64,7 @@ class ApiHelpTestAction extends ApiPrivateAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -95,7 +95,7 @@ class ApiHelpTestAction extends ApiPrivateAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index dc909e62a603bceca70929918ef3f7320997172f..94d95df5ef71f1744cb44747a8be3fa94bcd6e64 100644 (file)
@@ -194,7 +194,7 @@ class ApiListAction extends ApiBareAuthAction
      *
      * @return boolean is_read-only=false
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index 04c771536306fa4779ea13165e24e98a944c716b..c1aa017deab1d1c35ada2db868df4210ff264092 100644 (file)
@@ -108,7 +108,7 @@ class ApiListMembershipsAction extends ApiBareAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 4134577e099d27a2b4c9aa9368df8aba5f466e24..129691a3b42f8c58b09835c38b906c179f12dea4 100644 (file)
@@ -188,7 +188,7 @@ class ApiListsAction extends ApiBareAuthAction
              $this->prev_cursor) = Profile_list::getAtCursor($fn, array($this->auth_user), $cursor, $count);
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index f5cda15ae94aa8ce17d47b74f1d797ac722536f8..a19ceec2fd93b18cf92550a04aedbc8a698b5045 100644 (file)
@@ -33,7 +33,7 @@ class ApiListSubscriberAction extends ApiBareAuthAction
 {
     var $list   = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -52,7 +52,7 @@ class ApiListSubscriberAction extends ApiBareAuthAction
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index e5d8aebc4f7b74e5db898ae4c0fddf10fa061a55..5fe4c378ae40d4c0cc655cc2841fa0bfebd77664 100644 (file)
@@ -95,7 +95,7 @@ class ApiListSubscriptionsAction extends ApiBareAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 8e59fec59c963c728b4c96456bcbd5def2247a86..8580b209a541893c0a699c32660a1ae2835dd751 100644 (file)
@@ -48,9 +48,6 @@ class ApiMediaUploadAction extends ApiAuthAction
      * Grab the file from the 'media' param, then store, and shorten
      *
      * @todo Upload throttle!
-     *
-     * @param array $args $_REQUEST data (unused)
-     *
      * @return void
      */
     protected function handle()
index a1a70a9b9e2be36aa949c163b1a142cca48863a9..20802466073f2cfc275327d4236d4fca5d0a2c00 100644 (file)
@@ -52,7 +52,7 @@ class ApiOAuthAccessTokenAction extends ApiOAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index d0dcf9c9c7a48f065258eb4b27dc112b74d140db..68d19a398e2264fa6c9655f47248657e6f6f2c83 100644 (file)
@@ -55,12 +55,12 @@ class ApiOAuthAuthorizeAction extends ApiOAuthAction
      *
      * @return boolean false
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -88,7 +88,7 @@ class ApiOAuthAuthorizeAction extends ApiOAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index e961f4f46464cf8463af219ba41a45f5a0cfb460..4f5a469caa9dbb1a5bb3db1ad83bb01052578577 100644 (file)
@@ -49,7 +49,7 @@ class ApiOAuthRequestTokenAction extends ApiOAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -69,7 +69,7 @@ class ApiOAuthRequestTokenAction extends ApiOAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index b686edb00aeabb9a89e0243e23f1bf93ec6a59ae..18a1aa24cc4418f861e18d45923c0e876e7597e5 100644 (file)
@@ -88,7 +88,7 @@ class ApiSearchAtomAction extends ApiPrivateAuthAction
      *
      * @return boolean success
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -128,7 +128,7 @@ class ApiSearchAtomAction extends ApiPrivateAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         common_debug("In apisearchatom handle()");
index 794f23077bacbc1184c972888dad3c7db2b774c8..424773f12bf6bb41e7aea20b4ca780f447e764d8 100644 (file)
@@ -57,7 +57,7 @@ class ApiSearchJSONAction extends ApiPrivateAuthAction
      *
      * @return boolean true if nothing goes wrong
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -95,7 +95,7 @@ class ApiSearchJSONAction extends ApiPrivateAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showResults();
@@ -129,7 +129,7 @@ class ApiSearchJSONAction extends ApiPrivateAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index db41c87ad0f5cca2f443d4e247e53e5df1bf8959..8641518733d7db6efed08d31bc2a2579a8594b67 100644 (file)
@@ -64,7 +64,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -89,7 +89,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 7af4cd3ec6649959832917de0019e43188df2ee0..82e86b9264689c453f6ddd56c8f3c050de8feaa3 100644 (file)
@@ -54,7 +54,7 @@ class ApiStatusesRetweetsAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -89,7 +89,7 @@ class ApiStatusesRetweetsAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -119,7 +119,7 @@ class ApiStatusesRetweetsAction extends ApiAuthAction
      * @return boolean is read only action?
      */
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 8b9cc347797bdfeb4b7bbff62def398e354edd2c..9dec06c390fdec731cdab432d176dcd32c9dfd61 100644 (file)
@@ -176,7 +176,7 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
      * @return boolean true
      */
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD');
     }
index 081445129dfd37e4f35785cd0a3f2a84aa4cd592..3f5d5f797b32d84f408ee4a922623b1115ff435d 100644 (file)
@@ -129,7 +129,7 @@ abstract class ApiSubscriptionsAction extends ApiBareAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index b14635ac33e5fcf6662d05f7d79f098639476317..b809699c7f4d154d845452b78c413c85b64f1b9f 100644 (file)
@@ -295,7 +295,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 4201eb55f83b0eaf59d0d515786314a551170aa3..c9d375d4c98bcd769eeb5452dbf74054e2d94f72 100644 (file)
@@ -171,7 +171,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 42cd08cad75e276f93396d8dc5168fbec156c195..5dca9a42cd19d9536a5141556c1d007543ffb805 100644 (file)
@@ -199,7 +199,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 91b26bf6c7714dc3465e963d7c961a88a9a39504..75c9da034da347ad23a21628602d8eaeb741201d 100644 (file)
@@ -199,7 +199,7 @@ class ApiTimelineListAction extends ApiPrivateAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index c1811ac01bb77e9fcdc23385f7136cb3581f8b2e..6465cdf85e58ec6e525a866b233a69567679a56d 100644 (file)
@@ -204,7 +204,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 07dcace942457b254660005ca48b18135c5e837d..957c187f9ff6b938a2cb403781b465b203cccd0e 100644 (file)
@@ -286,7 +286,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 01f3fe378b17bc948aadbaf587fa0774187e60e6..4ad4e269af5544bfa563e227f0547400eb979f41 100644 (file)
@@ -60,7 +60,7 @@ class ApiTimelineRetweetedByMeAction extends ApiAuthAction
      * @return boolean success flag
      *
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -77,7 +77,7 @@ class ApiTimelineRetweetedByMeAction extends ApiAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 85f52f7388f88c27314534c8c1736b6a4587b74d..a3ffa7db3037a6262cb4678f067cdb146f72fad1 100644 (file)
@@ -59,7 +59,7 @@ class ApiTimelineRetweetedToMeAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -83,7 +83,7 @@ class ApiTimelineRetweetedToMeAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -159,7 +159,7 @@ class ApiTimelineRetweetedToMeAction extends ApiAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index fe90213665074e7e6b4e430946c22200c4c6925e..49990a53358acf17a7f56bf5434a16d2c373135c 100644 (file)
@@ -59,7 +59,7 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -83,7 +83,7 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -165,7 +165,7 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index b3f17d0712019c9578f92f5fd8aa6dccbfe4b0f2..434c22bb041adfdcb2549f4325a5a5eb35fa8dee 100644 (file)
@@ -58,7 +58,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -79,7 +79,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showTimeline();
@@ -196,7 +196,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 26c960fa0429b9e1d176713cd4e65e60be43ddfa..81b8fcc88f3c5856e1bae420444a8639d42de904 100644 (file)
@@ -268,7 +268,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
      * @return boolean true
      */
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD');
     }
index a39769a34e60024fb1744d2ecc2cba109d2bf678..6e6810b95d2ffad61f2cefcd0c02afa8d673d1d3 100644 (file)
@@ -53,7 +53,7 @@ class ApiTrendsAction extends ApiPrivateAuthAction
      *
      * @return boolean false if user doesn't exist
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         return true;
@@ -66,7 +66,7 @@ class ApiTrendsAction extends ApiPrivateAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showTrends();
index 47fc5e69ac1d0b33dd6d56d71de732badfca4bf2..c9c8eab9af5fce75c3bcf2876a53dc9c752063b5 100644 (file)
@@ -110,7 +110,7 @@ class ApiUserProfileImageAction extends ApiPrivateAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 35b50698609baa6ea84da23ddb641925e57e43aa..04fcb7dd8961f500a259ae5dc9a42735632d3678 100644 (file)
@@ -118,7 +118,7 @@ class ApiUserShowAction extends ApiPrivateAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 2c8b354d347539bba7a630b81a640ef09e6bdf1a..b532a9b95541837273fdc41ff4ef540e703c55cd 100644 (file)
@@ -50,7 +50,7 @@ class ApprovegroupAction extends Action
     /**
      * Prepare to run
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -139,7 +139,7 @@ class ApprovegroupAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index c9fa804412a97b4abd0669c38be051b77cc81a64..0e70e3429ec995781b8989d6da9a9340d2f6d9d5 100644 (file)
@@ -50,7 +50,7 @@ class ApprovesubAction extends Action
     /**
      * Prepare to run
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -97,7 +97,7 @@ class ApprovesubAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $cur = common_current_user();
index ee5a477d49eca4a75d04264b8137f8dd4c33260e..d80dd609e3aba1dfcff24f222d3127f7d8e9d01a 100644 (file)
@@ -132,7 +132,7 @@ class AtompubshowsubscriptionAction extends AtompubAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'DELETE') {
             return false;
index 1126759832a65799744a29c67c6c257d80a8ddb5..0bdead84a07e62806c4a7306c1c8d3c9f197e52e 100644 (file)
@@ -76,7 +76,7 @@ class AttachmentAction extends ManagedAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 10a22e77bc199c61627b836135aaa600e3c0f898..b366c62d80259181ee07f793a2f82ff24461d9d0 100644 (file)
@@ -85,7 +85,7 @@ class AvatarbynicknameAction extends Action
         common_redirect($url, 302);
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 8f642f3b7708e61463237cfe74f80916fb955f3f..4d7b6fcfcd653f4ed2b5f0d978b3ed83ffb5e9f4 100644 (file)
@@ -149,7 +149,7 @@ class BackupaccountAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 53d8ae7ae0600c17a800cfc5e927a7efd40facfd..018c6782fcbd5f368b1a856dfcde64c62e5e03e8 100644 (file)
@@ -53,7 +53,7 @@ class BlockAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
@@ -78,7 +78,7 @@ class BlockAction extends ProfileFormAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             if ($this->arg('no')) {
@@ -220,7 +220,8 @@ class BlockAction extends ProfileFormAction
     function defaultReturnTo()
     {
         $user = common_current_user();
-        if ($user) {
+
+        if ($user instanceof User) {
             return common_local_url('subscribers',
                                     array('nickname' => $user->nickname));
         } else {
index a2e7c5767f64be9610681f638be8ef899140ff0a..60f108dee383a333a35dbcec167655cd1c10512d 100644 (file)
@@ -44,7 +44,7 @@ class BlockedfromgroupAction extends GroupAction
 {
     var $page = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -151,7 +151,7 @@ class GroupBlockList extends ProfileList
         $this->group = $group;
     }
 
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new GroupBlockListItem($profile, $this->group, $this->action);
     }
index 93f630e0609123a59757bc96fc880279b1bdcffe..90675d79bc8146177eb51c63aa73bc5f09ab7c2c 100644 (file)
@@ -50,7 +50,7 @@ class CancelgroupAction extends Action
     /**
      * Prepare to run
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -127,7 +127,7 @@ class CancelgroupAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 806851001e3cf45e4a0f13717b9589b8cd89060d..e2e8c1b834100b85a961341fa8c5b9c53dcb1a99 100644 (file)
@@ -60,7 +60,7 @@ class ConfirmaddressAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (!common_logged_in()) {
index 8b80c6c6f23c503f1d52d82c80cd6535b035aa62..cd7f6578fcbb5eec2afa2c30afeaa64841edfb93 100644 (file)
@@ -108,7 +108,7 @@ class DeleteaccountAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index 5d7441098c8f73f1068491d5509208935626420e..1d9e6d1bb5bf84c6ebc715c882782d1522541772 100644 (file)
@@ -51,7 +51,7 @@ class DeleteapplicationAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
@@ -89,7 +89,7 @@ class DeleteapplicationAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
 
index c64bc1d8e90fd47fb91cfd4d0cd4743b358f8ad0..87f518eb41ca22b702cae9db8b5479bd32012785 100644 (file)
@@ -55,7 +55,7 @@ class DeletegroupAction extends RedirectingAction
      * @fixme merge common setup code with other group actions
      * @fixme allow group admins to delete their own groups
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -114,7 +114,7 @@ class DeletegroupAction extends RedirectingAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
index eb84b4f3ae5d877281e4d205bf4ebc5fa42359b9..f278300838bb0e29267d43fa0bab2860cc92c22b 100644 (file)
@@ -41,7 +41,7 @@ class DeletenoticeAction extends Action
     var $profile      = null;
     var $user_profile = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -68,7 +68,7 @@ class DeletenoticeAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 6b74575ab435e0d149b53ef788ca4fafde95c4d5..fd0beb80acd0b8b9b6d00e7bd64ea3d1bd5d846a 100644 (file)
@@ -51,7 +51,7 @@ class DeleteuserAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
@@ -85,7 +85,7 @@ class DeleteuserAction extends ProfileFormAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             if ($this->arg('no')) {
index 6db3830ce1bcf3477e12a27c5823e503924acbcc..8d6c16c594e3c787c65f7f1f7dc5df0d7d6e1c12 100644 (file)
@@ -48,7 +48,7 @@ class DocAction extends Action
     var $filename = null;
     var $title    = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -69,7 +69,7 @@ class DocAction extends Action
      *
      * @return nothing
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -138,7 +138,7 @@ class DocAction extends Action
      *
      * @return boolean read-only flag (false)
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index c7e5f9052c77fc81271687f72fd09edd34496c18..95ed98ad90ddf57e74cfa40eabbb9af0f97f2c38 100644 (file)
@@ -57,7 +57,7 @@ class EditApplicationAction extends Action
     /**
      * Prepare to run
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -94,7 +94,7 @@ class EditApplicationAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 45c8adaa7d59fc933a4ec70ddb157c5dfebfdc0f..4e00cb2442e1c6a36b129ce78f5d074c954b5b20 100644 (file)
@@ -60,7 +60,7 @@ class EditpeopletagAction extends Action
      * Prepare to run
      */
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -135,7 +135,7 @@ class EditpeopletagAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
index 394cfe6a8b9ef456325179533a3e5c00dbb48cc5..dfd9f6f3befd834dee8b9443b882945042e6d26c 100644 (file)
@@ -49,12 +49,12 @@ class FeaturedAction extends Action
 {
     var $page = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
@@ -74,7 +74,7 @@ class FeaturedAction extends Action
         }
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index bcdc86d886c97348ce42d74c5280552a389654a9..a17962b97e49d70f04d525fb82e3ccb06f717f3f 100644 (file)
@@ -26,12 +26,12 @@ define('BOTH', 0);
 // @todo XXX: Documentation missing.
 class FoafAction extends Action
 {
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -69,7 +69,7 @@ class FoafAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index f9c61ac5dcda9f7a409917ec569fc82e59d84af9..a9cf5d9dc0964e7fe01049c82030a3829ef85609 100644 (file)
@@ -30,12 +30,12 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 // @todo XXX: Documentation missing.
 class FoafGroupAction extends Action
 {
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -76,7 +76,7 @@ class FoafGroupAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 9e208914c16ca088cf63cd7f08c43e07eb83cefc..a0cd2fa159ff127e3b80e29377bc25af00da3235 100644 (file)
@@ -47,7 +47,7 @@ class GeocodeAction extends Action
     var $lon = null;
     var $location = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $token = $this->trimmed('token');
@@ -70,7 +70,7 @@ class GeocodeAction extends Action
      * @return nothing
      *
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         header('Content-Type: application/json; charset=utf-8');
         $location_object = array();
@@ -90,7 +90,7 @@ class GeocodeAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index f0c98f74167702ef6bcdc4daeffb2f5e1d67f055..abdf5b69fc3904928e06419fff0ce467a967cf00 100644 (file)
@@ -86,7 +86,7 @@ class GetfileAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 35f0dcf961d02fc328466cc163f56fbec3407fd7..59cb1cdd8eb39d320bc79b1db9e34a72ff3b5f75 100644 (file)
@@ -49,7 +49,7 @@ class GrantRoleAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
index d65b62bdff7980128e5d634ddc687729448973d0..209284a85d5a003dfb1d81dd8288194c68289534 100644 (file)
@@ -52,7 +52,7 @@ class GroupblockAction extends RedirectingAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         if (!common_logged_in()) {
@@ -110,7 +110,7 @@ class GroupblockAction extends RedirectingAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
index b82a861e97319931b3f322cd1024e59e241969bf..befd526de11a6472e432ab1a7153d4866e65d7e2 100644 (file)
@@ -57,12 +57,12 @@ class GroupbyidAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -93,7 +93,7 @@ class GroupbyidAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         common_redirect($this->group->homeUrl(), 303);
     }
index 44c4dd6f9963d27dbda9bbcf1a8be576f03e306b..b83854d043f74d4cbf1a9571e31eae0aab779f9f 100644 (file)
@@ -47,7 +47,7 @@ class GroupmembersAction extends GroupAction
 {
     var $page = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index c50eff36f83c5bc9279bacdc5d3095db15000ec0..060b5a2e7d10753a61feca6f0bb4c2cb6e2896c4 100644 (file)
@@ -47,7 +47,7 @@ class GroupqueueAction extends GroupAction
 {
     var $page = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -153,7 +153,7 @@ class GroupqueueAction extends GroupAction
 // @todo FIXME: documentation missing.
 class GroupQueueList extends GroupMemberList
 {
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new GroupQueueListItem($profile, $this->group, $this->action);
     }
index 87e34d73f80eccb6eb9020bd5ac005a606dea475..9647f06e65071e085d374037a207158255413c02 100644 (file)
@@ -55,7 +55,7 @@ class groupRssAction extends Rss10Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -69,7 +69,7 @@ class groupRssAction extends Rss10Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
index d1bc8d94583bd67169dfaad27d7bde211d1934a1..1bbce26f20cf2f6ba3ca71fb9462175004f06ffc 100644 (file)
@@ -50,7 +50,7 @@ class GroupsAction extends Action
     var $page = null;
     var $profile = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -67,14 +67,14 @@ class GroupsAction extends Action
         }
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
index a24177f64c0d94d8a50dd5b06abfa7066ac2ec09..a72486be487ce31acccd6b0616d95dfa01c3fb22 100644 (file)
@@ -52,7 +52,7 @@ class GroupunblockAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         if (!common_logged_in()) {
@@ -103,7 +103,7 @@ class GroupunblockAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
index f99dd4d783497a0cd76f8f170de7254362cd4e32..b6e0ba8dd17dffb23151548219844316c90f29d1 100644 (file)
@@ -33,12 +33,12 @@ class InviteAction extends Action
         return;
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (!common_config('invite', 'enabled')) {
@@ -74,6 +74,7 @@ class InviteAction extends Action
             $bestname = $profile->getBestName();
             $sitename = common_config('site', 'name');
             $personal = $this->trimmed('personal');
+            $language = $this->trimmed('language');
 
             $addresses = explode("\n", $this->trimmed('addresses'));
             foreach ($addresses as $email) {
@@ -128,7 +129,7 @@ class InviteAction extends Action
                 } catch (NoSuchUserException $e) {
                     // If email was not known, let's send an invite!
                     $this->sent[] = $email;
-                    $this->sendInvitation($email, $user, $personal);
+                    $this->sendInvitation($email, $user, $personal, $language);
                 }
             }
 
@@ -248,7 +249,7 @@ class InviteAction extends Action
         }
     }
 
-    function sendInvitation($email, $user, $personal)
+    function sendInvitation($email, $user, $personal, $language)
     {
         $profile = $user->getProfile();
         $bestname = $profile->getBestName();
@@ -284,7 +285,7 @@ class InviteAction extends Action
         $title = (empty($personal)) ? 'invite' : 'invitepersonal';
 
         // @todo FIXME: i18n issue.
-        $inviteTemplate = DocFile::forTitle($title, DocFile::mailPaths());
+        $inviteTemplate = DocFile::forTitle($title, DocFile::mailPaths(), $language);
 
         $body = $inviteTemplate->toHTML(array('inviter' => $bestname,
                                               'inviterurl' => $profile->profileurl,
index 60aec3c83a48d37a21bf435fff4d0da2aa513424..b6d4efbf2303008034ea2c9357a53d71afe6007f 100644 (file)
@@ -47,11 +47,16 @@ class LogoutAction extends ManagedAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
 
+    /**
+     * Class handler.
+     *
+     * @return nothing
+     */
     protected function doPreparation()
     {
         if (!common_logged_in()) {
index 05912e150cc4d493b537394c836edba78705aa1c..24a7c02ee8ae8d459c32b99aa162706976796de4 100644 (file)
@@ -54,7 +54,7 @@ class MakeadminAction extends RedirectingAction
      * @return boolean success flag
      */
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         if (!common_logged_in()) {
@@ -111,7 +111,7 @@ class MakeadminAction extends RedirectingAction
      * @return void
      */
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
index 2742eb9a048f8977dcc0e674949a25605826b490..03348617da9b1541b9094f1b85129dea234eda5b 100644 (file)
@@ -51,7 +51,7 @@ class MicrosummaryAction extends Action
      *
      * @return nothing
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -75,7 +75,7 @@ class MicrosummaryAction extends Action
         print $user->nickname . ': ' . $notice->content;
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index ee7bb86f40a28f7fac5aba0dc8a848a4268c68d8..f1d6d1551640b9d771c780a22f4d7f080d648b5f 100644 (file)
@@ -50,7 +50,7 @@ class NoticesearchAction extends SearchAction
 {
     protected $q = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -186,7 +186,7 @@ class SearchNoticeList extends NoticeList {
         $this->terms = $terms;
     }
 
-    function newListItem($notice)
+    function newListItem(Notice $notice)
     {
         return new SearchNoticeListItem($notice, $this->out, $this->terms);
     }
index 14c280f62cfd3f973f5c64703ce0734b16949c6c..b12ea8de9cab4ffeac8aa94431fa451254ce128f 100644 (file)
@@ -53,7 +53,7 @@ class NoticesearchrssAction extends Rss10Action
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->notices = $this->getNotices();
@@ -106,7 +106,7 @@ class NoticesearchrssAction extends Rss10Action
         return null;
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 801d1f06810aa343dbfe78e2cb37e005db519cd8..5ceaa180636c76e743fa4d587b355d0dba9e7299 100644 (file)
@@ -55,7 +55,7 @@ class NudgeAction extends Action
      *
      * @return nothing
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -125,7 +125,7 @@ class NudgeAction extends Action
         }
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 29e6d5607333e9e3d17fd2ab21316df45c927339..ce532bdf321e601e26260b57dba6f3f5f8a5ae99 100644 (file)
@@ -49,7 +49,7 @@ class OauthappssettingsAction extends SettingsAction
 {
     var $page = 0;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->page = ($this->arg('page')) ? ($this->arg('page') + 0) : 1;
index 9aa3ad434f452b7a3335d4e51e4b08911e17bdaf..2256dc397ffab15eecc91d49f9fba6b9ee686075 100644 (file)
@@ -49,7 +49,7 @@ class OauthconnectionssettingsAction extends SettingsAction
     var $page        = null;
     var $oauth_token = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->oauth_token = $this->arg('oauth_token');
index b1529860a87487cd3382211e3fe4e7260a49e0c6..c3a494be1be23d65012b0da05791a3d64c619fd5 100644 (file)
@@ -53,7 +53,7 @@ class OpensearchAction extends Action
      *
      * @return boolean false if user doesn't exist
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $type       = $this->trimmed('type');
@@ -85,7 +85,7 @@ class OpensearchAction extends Action
         $this->endXML();
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index c44f3673ae7524f2902158a67fa645dcfec10fb9..143eb6bdc189c05d0362761e1012b9f51e2cd4ff 100644 (file)
@@ -53,7 +53,7 @@ class OtpAction extends Action
     var $returnto;
     var $lt;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -110,7 +110,7 @@ class OtpAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index b0a6e2635deb72b94a2cb63b2de2ebe2e72418f9..46bdd165cf3566ad9f193b2e7c1ac21034bb480e 100644 (file)
@@ -44,7 +44,7 @@ class PeopletagAction extends Action
     var $page = null;
     var $tag = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -62,7 +62,7 @@ class PeopletagAction extends Action
         }
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
@@ -84,7 +84,7 @@ class PeopletagAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
index 86d63545dcb0b4ed2aa4040e78aef8e8ebf9899e..dc083fd0282b3d7c39862d53a9a49b211d2a088e 100644 (file)
@@ -44,7 +44,7 @@ class PeopletagautocompleteAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -112,9 +112,9 @@ class PeopletagautocompleteAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
-        //common_log(LOG_DEBUG, 'Autocomplete data: ' . json_encode($this->tags));
+        //common_debug('Autocomplete data: ' . json_encode($this->tags));
         if ($this->tags) {
             print(json_encode($this->tags));
             exit(0);
index cf9ec053ed404b64b243c8bfeeb8ccde3a0bb46d..98e0cd7125c009b8306881c7ddf2e88816117c9c 100644 (file)
@@ -48,12 +48,12 @@ class PeopletaggedAction extends Action
     var $peopletag = null;
     var $tagger = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
@@ -117,7 +117,7 @@ class PeopletaggedAction extends Action
         }
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -167,7 +167,7 @@ class PeopletagMemberList extends ProfileList
         $this->peopletag = $peopletag;
     }
 
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new PeopletagMemberListItem($profile, $this->peopletag, $this->action);
     }
index 8b3a91917a5f0611b7fbebbc8b847edba393e67f..9a5f9106f41086885f271459874b0448632b3af8 100644 (file)
@@ -39,7 +39,7 @@ class PeopletagsbyuserAction extends Action
     var $tagger = null;
     var $tags = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -68,7 +68,7 @@ class PeopletagsbyuserAction extends Action
         }
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -135,15 +135,15 @@ class PeopletagsbyuserAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
-               # Post from the tag dropdown; redirect to a GET
+        // Post from the tag dropdown; redirect to a GET
 
-               if ($_SERVER['REQUEST_METHOD'] == 'POST') {
-                   common_redirect(common_local_url('peopletagsbyuser', $this->getSelfUrlArgs()), 303);
-               }
+        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+            common_redirect(common_local_url('peopletagsbyuser', $this->getSelfUrlArgs()), 303);
+        }
 
         $this->showPage();
     }
index 827b284d5c3acf567cf550f5afdae99ed06c721b..9dcee09f1a1b44ca9eeb1789f3ed761703c39f27 100644 (file)
@@ -38,7 +38,7 @@ class PeopletagsforuserAction extends Action
     var $page = null;
     var $tagged = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -54,7 +54,7 @@ class PeopletagsforuserAction extends Action
         }
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -95,7 +95,7 @@ class PeopletagsforuserAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
index 589d49caa3be8469eddc6c3b7ba456039bf482c8..dcb3af5c9fba43f3032832931c4c472e8bde2512 100644 (file)
@@ -48,12 +48,12 @@ class PeopletagsubscribersAction extends Action
     var $peopletag = null;
     var $tagger = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
@@ -117,7 +117,7 @@ class PeopletagsubscribersAction extends Action
         }
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -167,7 +167,7 @@ class PeopletagSubscriberList extends ProfileList
         $this->peopletag = $peopletag;
     }
 
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new PeopletagSubscriberListItem($profile, $this->peopletag, $this->action);
     }
index 64edd0929025b6c126955cfb8d22d4810b3c3d3f..4b84bb368834e73cbb708cd47be74091e48c5d3b 100644 (file)
@@ -38,7 +38,7 @@ class PeopletagsubscriptionsAction extends Action
     var $page = null;
     var $profile = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -56,7 +56,7 @@ class PeopletagsubscriptionsAction extends Action
         }
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -97,7 +97,7 @@ class PeopletagsubscriptionsAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
index 707cbdecaab45870995a43d0d08c2354e1c9a9b1..711b1b2c56d273149f65c50c87651307d625082a 100644 (file)
@@ -64,7 +64,7 @@ class PluginEnableAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -121,7 +121,7 @@ class PluginEnableAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         $key = 'disable-' . $this->plugin;
         Config::save('plugins', $key, $this->overrideValue());
index aaf6026eb58115c0ccef5134f0cc5e6da8c2e3b9..5880752fcf933faa069ad60a3b9761c4ef450a4e 100644 (file)
@@ -68,7 +68,7 @@ class ProfilecompletionAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -120,7 +120,7 @@ class ProfilecompletionAction extends Action
      * @return void
      */
 
-    function handle($args)
+    function handle(array $args=array())
     {
         $this->msg = null;
 
index ce7298a2f6b7038829c872533aff2026d2d700dd..af27b245c879a9085005fcb127ec61ef3e6f377e 100644 (file)
@@ -40,12 +40,12 @@ class ProfiletagbyidAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -83,7 +83,7 @@ class ProfiletagbyidAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         common_redirect($this->peopletag->homeUrl(), 303);
     }
index 06ee75b8d1c5fa9b72b52393b0554c90f1669f3a..b45bbeae7f78d4284dea3bf9c323231441c577f7 100644 (file)
@@ -56,11 +56,18 @@ class PublicAction extends ManagedAction
 
     protected $stream = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
+    /**
+     * Read and validate arguments
+     *
+     * @param array $args URL parameters
+     *
+     * @return boolean success value
+     */
     protected function doPreparation()
     {
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
@@ -91,6 +98,15 @@ class PublicAction extends ManagedAction
         return true;
     }
 
+    /**
+     * handle request
+     *
+     * Show the public stream, using recipe method showPage()
+     *
+     * @param array $args arguments, mostly unused
+     *
+     * @return void
+     */
     protected function streamPrepare()
     {
         if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
index 11db3b37a48c57a3252323fa358c670215a8970e..ee127b51aca1ddcaa0d0c03bf5317c1c5ba4ede8 100644 (file)
@@ -54,7 +54,7 @@ class PublicrssAction extends Rss10Action
      * @param array $args Arguments from $_REQUEST
      * @return boolean success
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->notices = $this->getNotices($this->limit);
@@ -117,7 +117,7 @@ class PublicrssAction extends Rss10Action
         // nop
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index db8185bb13d8a7eb142b0b9a29621d9a4eab12a8..6d0d4237e9d74ce1788863f43eeb9ed14603d96c 100644 (file)
@@ -46,7 +46,7 @@ define('TAGS_PER_PAGE', 100);
  */
 class PublictagcloudAction extends Action
 {
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -92,7 +92,7 @@ class PublictagcloudAction extends Action
         $this->elementEnd('div');
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -103,13 +103,15 @@ class PublictagcloudAction extends Action
         // This should probably be cached rather than recalculated
         $tags = new Notice_tag();
 
-        #Need to clear the selection and then only re-add the field
-        #we are grouping by, otherwise it's not a valid 'group by'
-        #even though MySQL seems to let it slide...
+        /*
+         * Need to clear the selection and then only re-add the field
+         * we are grouping by, otherwise it's not a valid 'group by'
+         * even though MySQL seems to let it slide...
+         */
         $tags->selectAdd();
         $tags->selectAdd('tag');
 
-        #Add the aggregated columns...
+        // Add the aggregated columns...
         $tags->selectAdd('max(notice_id) as last_notice_id');
         $calc = common_sql_weight('created', common_config('tag', 'dropoff'));
         $cutoff = sprintf("notice_tag.created > '%s'",
index aac6f423cf6ff263b317b9a7222b3431f29c84aa..979fe249d68b3d3fe84341496e97fb2fd871d41f 100644 (file)
@@ -58,7 +58,7 @@ class PublicxrdsAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -70,7 +70,7 @@ class PublicxrdsAction extends Action
      *
      * @return nothing
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $xrdsOutputter = new XRDSOutputter();
index 4839a036c0e4be2dcb0f632f3d3fd32c71204336..c17ed85a39101c417a1e72d04cbf05ac8ecc4626 100644 (file)
@@ -29,7 +29,7 @@ class RecoverpasswordAction extends Action
     var $msg = null;
     var $success = null;
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (common_logged_in()) {
index 9cb03708db8a94ba0b78553cf7911fe0c05be856..c18a27f3a3a05ee8de0764eae47b68e8d95bce1c 100644 (file)
@@ -51,7 +51,7 @@ class RedirectAction extends Action
      * @return boolean read-only flag (false)
      */
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -63,7 +63,7 @@ class RedirectAction extends Action
      *
      * @return nothing
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         common_redirect(common_local_url($this->arg('nextAction'), $this->arg('args')));
     }
index 4befa4ab840c843c014c712f2b4d3e6e611593f1..62418df21709640c2bc79f56aca461cf7928ae09 100644 (file)
@@ -104,7 +104,7 @@ class RedirecturlAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index c97201b666762b67611233e60544a0e134ad78a5..6b7764d37a35d001623da92da2933a32c3daebc5 100644 (file)
@@ -122,7 +122,7 @@ class RegisterAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 8192e86b44fd4246c932136a92f6c01eee9f5022..ee33517fdab1606e8c711487cc8209f6209c995c 100644 (file)
@@ -66,7 +66,7 @@ class RemovepeopletagAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -120,7 +120,7 @@ class RemovepeopletagAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         // Throws exception on error
 
@@ -129,7 +129,7 @@ class RemovepeopletagAction extends Action
 
         if (!$ptag) {
             $user = User::getKV('id', $this->tagged->id);
-            if ($user) {
+            if ($user instanceof User) {
                 $this->clientError(
                         // TRANS: Client error displayed when an unknown error occurs while delisting a user.
                         // TRANS: %s is a username.
index 2b5455e23cb0d8a34f4bf14104bc5309a2cbd343..11d9c7c706cc29a777a326fa5b3e96ece2799e56 100644 (file)
@@ -59,7 +59,7 @@ class RepliesAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -106,7 +106,7 @@ class RepliesAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -229,7 +229,7 @@ class RepliesAction extends Action
         $this->elementEnd('div');
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 145b51aaea99dfc58cb252c7c1210897dd773a39..df632fb4ce5ebbb36bd8229a873f7869605a34a3 100644 (file)
@@ -27,7 +27,7 @@ class RepliesrssAction extends Rss10Action
 {
     var $user = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $nickname = $this->trimmed('nickname');
@@ -81,7 +81,7 @@ class RepliesrssAction extends Rss10Action
         return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 81c792bd008b7b0afb1f172cc62b5aeb6ac7c452..6b6cd64f9412dcb7b7dd660a32033dae279afdfe 100644 (file)
@@ -258,7 +258,7 @@ class RestoreaccountAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index b55399598eebd81c4e982de0b1d2d7ac71e4e0a9..d3ec2ecdfa1f5f6eda4c09c1d260156e181b4b26 100644 (file)
@@ -49,7 +49,7 @@ class RevokeRoleAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
index d686042cb12fe8e52a2a74a4fb910c1a57a05582..5845e197b6fe9811aa4ee246063b9c6acd9445d8 100644 (file)
@@ -52,7 +52,7 @@ class RobotstxtAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if (Event::handle('StartRobotsTxt', array($this))) {
 
@@ -88,7 +88,7 @@ class RobotstxtAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 1ad3b815e8b542a77b7e74fbbde55f23173a60e7..6a070aeb1a525a22a992d5817e3d29460a2f5369 100644 (file)
@@ -85,7 +85,7 @@ class RsdAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -126,7 +126,7 @@ class RsdAction extends Action
      *
      * @return nothing
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         header('Content-Type: application/rsd+xml');
 
@@ -207,7 +207,7 @@ class RsdAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index af2eab3842d268add1d5a8c0693464a81fb91871..9397a093031ee046cfb510b2de372256bcd222c3 100644 (file)
@@ -49,7 +49,7 @@ class SandboxAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
index b886c3d9f731cc28e4e041df35c3e40159eb5365..58f0460997536a662c8d59ba235a4fc226bf75eb 100644 (file)
@@ -158,7 +158,7 @@ class SelftagAction extends Action
 
 class SelfTagProfileList extends ProfileList
 {
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new SelfTagProfileListItem($profile, $this->action);
     }
index d8ac293d404138719d69e6f79bfd0c93ac44d218..c10883942f5f19f5377494262fdf7a5832adf08b 100644 (file)
@@ -65,7 +65,7 @@ class ShowApplicationAction extends Action
      *
      * @return success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -101,7 +101,7 @@ class ShowApplicationAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 46d0a227f536ecc4253212e6b55cb5fe2ba71d1b..da95b6a411b4b811c4ae4bc81edb21fdd27c2130 100644 (file)
@@ -56,7 +56,7 @@ class ShowgroupAction extends GroupAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 2576bcc111fc65b394f48f2acd74b8f763803087..33bfa6bf61728dba8f17d1166d9fd790b3d37a2a 100644 (file)
@@ -134,7 +134,7 @@ class ShownoticeAction extends ManagedAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 6ba0c18f90fdb65d3ad6b6cd1b1483402b626913..1bb126bfbed879e31a248939f0cd7e015b212d1e 100644 (file)
@@ -35,12 +35,12 @@ class ShowprofiletagAction extends Action
 {
     var $notice, $tagger, $peopletag, $userProfile;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -103,7 +103,7 @@ class ShowprofiletagAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 7c38eca14a7637e99248f0d1f1844c338cc1f2d5..a3c461915a8c79ab3a3d34727e7e42fc0d26c497 100644 (file)
@@ -310,7 +310,7 @@ class ShowstreamAction extends ProfileAction
  */
 class ProfileNoticeList extends NoticeList
 {
-    function newListItem($notice)
+    function newListItem(Notice $notice)
     {
         return new ProfileNoticeListItem($notice, $this->out);
     }
index 6a4f84deb9a15390d89548750597af81a7735630..ac25a0d18440153db23c6d7efc35ca9f63ffaf05 100644 (file)
@@ -49,7 +49,7 @@ class SilenceAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
index 47fe19ea244f0c2cee9ed8cc77a9e4e08cfb0d3f..4dc3e855aa3b0f4dd3d804149c8e756b2476ea10 100644 (file)
@@ -24,7 +24,7 @@ class SubeditAction extends Action
 {
     var $profile = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -58,7 +58,7 @@ class SubeditAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
index ba473456004ef06ffa364d1fc7ad4b59e56415bd..c87202ddf1cc602ff8bc996c61d435c3824cc1cf 100644 (file)
@@ -106,7 +106,7 @@ class SubqueueAction extends GalleryAction
 
 class SubQueueList extends ProfileList
 {
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new SubQueueListItem($profile, $this->action);
     }
index 4002c9fbb0164267250333f87255f782489616b1..6a232e38351b6bee461c914b501361c042852508 100644 (file)
@@ -64,7 +64,7 @@ class SubscribeAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -118,7 +118,7 @@ class SubscribeAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         // Throws exception on error
 
index b83ff70010e15c60a42a61de89d70b5a9a5d0d34..ed9f282cfdd241bf504cdc539dab6f3c30cc5618 100644 (file)
@@ -50,7 +50,7 @@ class SubscribepeopletagAction extends Action
     /**
      * Prepare to run
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -106,7 +106,7 @@ class SubscribepeopletagAction extends Action
      * @return void
      */
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 2724927878c586d640c0a827317dd61e59993f3a..682faf869e44d437728c63d62afa87f78f9a8b24 100644 (file)
@@ -135,7 +135,7 @@ class SubscribersAction extends GalleryAction
 
 class SubscribersList extends SubscriptionList
 {
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new SubscribersListItem($profile, $this->owner, $this->action);
     }
index 231a697230601822f3eaf3c4ff2f28fad80de05e..39f794a045d722567076812dca1f29e5a50a1194 100644 (file)
@@ -161,7 +161,7 @@ class SubscriptionsAction extends GalleryAction
 
 class SubscriptionsList extends SubscriptionList
 {
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new SubscriptionsListItem($profile, $this->owner, $this->action);
     }
index 911f0d9e5551955916e45c1dcbb4c9b815452352..b871983185a5f66fff3e944ab354ff730810eea2 100644 (file)
@@ -22,7 +22,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 // @todo FIXME: documentation needed.
 class SupAction extends Action
 {
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -84,7 +84,7 @@ class SupAction extends Action
         return $updates;
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 09de8b3c25638973434ced16539b2c5e78716c42..8631082467b44ccf71cdf1bb7599dd455fcd7a00 100644 (file)
@@ -121,7 +121,7 @@ class TagAction extends ManagedAction
         }
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 468944d11f117a99c4819c693e99dc57bb367bec..62ca3a81d73934a32a4341850f1dbfa0ddb1745a 100644 (file)
@@ -26,7 +26,7 @@ class TagrssAction extends Rss10Action
 {
     var $tag;
 
-    function prepare($args) {
+    function prepare(array $args=array()) {
         parent::prepare($args);
         $tag = common_canonical_tag($this->trimmed('tag'));
         $this->tag = Notice_tag::getKV('tag', $tag);
@@ -68,7 +68,7 @@ class TagrssAction extends Rss10Action
         return $c;
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 82d0d32c109149f3e732754c3bfffb61fd9e0121..cb03214a9f02db44144b720e0c86da2275ed62b4 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
  */
 class UnblockAction extends ProfileFormAction
 {
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
index b87736fcffffbf54d7537cd1a307eded9c2b7c86..5e1110aa87c3de30342fa3c90b98d44384d4bcca 100644 (file)
@@ -49,7 +49,7 @@ class UnsandboxAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
index c01c141b1c193fd6337365b26497d9438bc71094..cde37201b16f66779c4879789c5e20a27f1e2963 100644 (file)
@@ -49,7 +49,7 @@ class UnsilenceAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
index 4b85ba427ca1b18d611434865ffb0dfce1dcbff3..ddc222923b8264c844613b29d96c602283b7dae1 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
  */
 class UnsubscribeAction extends Action
 {
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (!common_logged_in()) {
index b5757ad6fdb7d719b7ba78e46b5635fe635de6d4..42f0c20e6f1e75b64896b6769f3fe1a97def469f 100644 (file)
@@ -51,7 +51,7 @@ class UnsubscribepeopletagAction extends Action
      * Prepare to run
      */
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -106,7 +106,7 @@ class UnsubscribepeopletagAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 09fb4258d9c4a3c4fd0a27813c47707d77e6042e..27b6b7bb5b684084b693dd750ec1fa198eb02aad 100644 (file)
@@ -49,7 +49,7 @@ class UserbyidAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 308db948918c079a9d4a1ce63463840c3b564a82..1ae94ee93f9ae1a60153300ac2240b44d4b3db06 100644 (file)
@@ -27,7 +27,7 @@ class UserrssAction extends Rss10Action
 {
     var $tag  = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $nickname   = $this->trimmed('nickname');
@@ -113,7 +113,7 @@ class UserrssAction extends Rss10Action
         parent::initRss($limit);
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 97115d23cd364089fadffe1bd270adcde5c5286a..49b2682c066b2bcab139f4cdf96b60d90f15dbe6 100644 (file)
@@ -55,7 +55,7 @@ class VersionAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 55abc81b33b3850891b6c3ca6ca80ceddd3efdfd..d86ffdfcdb8514e8132ac61bf44da2411b2a4137 100644 (file)
@@ -70,10 +70,14 @@ class Avatar extends Managed_DataObject
     public static function deleteFromProfile(Profile $target, $original=true) {
         try {
             $avatars = self::getProfileAvatars($target);
+
             foreach ($avatars as $avatar) {
+                assert($avatar instanceof Avatar);
+
                 if ($avatar->original && !$original) {
                     continue;
                 }
+
                 $avatar->delete();
             }
         } catch (NoAvatarException $e) {
@@ -97,6 +101,7 @@ class Avatar extends Managed_DataObject
         }
 
         $size = "{$width}x{$height}";
+
         if (!isset(self::$_avatars[$target->id])) {
             self::$_avatars[$target->id] = array();
         } elseif (isset(self::$_avatars[$target->id][$size])){
@@ -104,6 +109,7 @@ class Avatar extends Managed_DataObject
         }
 
         $avatar = null;
+
         if (Event::handle('StartProfileGetAvatar', array($target, $width, &$avatar))) {
             $avatar = self::pkeyGet(
                 array(
@@ -112,6 +118,7 @@ class Avatar extends Managed_DataObject
                     'height'     => $height,
                 )
             );
+
             Event::handle('EndProfileGetAvatar', array($target, $width, &$avatar));
         }
 
@@ -184,7 +191,7 @@ class Avatar extends Managed_DataObject
         }
 
         if ($path[0] != '/') {
-            $path = '/'.$path;
+            $path = '/' . $path;
         }
 
         $server = common_config('avatar', 'server');
@@ -223,6 +230,12 @@ class Avatar extends Managed_DataObject
         try {
             return self::byProfile($target,  $width, $height)->displayUrl();
         } catch (Exception $e) {
+            common_debug(sprintf('target=>id=%s,width=%s,height=%s,message=%s',
+                $target->id,
+                $width,
+                $height,
+                $e->getMessage()
+            ));
             return self::defaultImage($width);
         }
     }
@@ -232,7 +245,7 @@ class Avatar extends Managed_DataObject
         static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
                                   AVATAR_STREAM_SIZE => 'stream',
                                   AVATAR_MINI_SIZE => 'mini');
-        return Theme::path('default-avatar-'.$sizenames[$size].'.png');
+        return Theme::path('default-avatar-' . $sizenames[$size] . '.png');
     }
 
     static function newSize(Profile $target, $width) {
index 2bd9581cf6dcf17fe4454f8244c7bc4d2942c7da..76358cbe13e892a84d660736a820e3a083c648cf 100644 (file)
@@ -650,7 +650,7 @@ class Memcached_DataObject extends Safe_DataObject
             } else {
                 $msg = sprintf("DB query (%0.3fs): %s", $delta, $clean);
             }
-            common_log(LOG_DEBUG, $msg);
+            common_debug($msg);
         }
 
         if ($fail) {
index a69efc45aeadae79c43fcc92d763278a6192caab..3825e07a0f51745cd770f23c6c6e77491acc7e85 100644 (file)
@@ -332,7 +332,7 @@ class Notice extends Managed_DataObject
      * Record the given set of hash tags in the db for this notice.
      * Given tag strings will be normalized and checked for dupes.
      */
-    function saveKnownTags($hashtags)
+    function saveKnownTags(array $hashtags)
     {
         //turn each into their canonical tag
         //this is needed to remove dupes before saving e.g. #hash.tag = #hashtag
@@ -1115,7 +1115,7 @@ class Notice extends Managed_DataObject
      *
      * @return void
      */
-    function saveKnownUrls($urls)
+    function saveKnownUrls(array $urls)
     {
         if (common_config('attachments', 'process_links')) {
             // @fixme validation?
@@ -1689,12 +1689,12 @@ class Notice extends Managed_DataObject
             $ids[] = $reply->profile_id;
         }
 
-        $this->_replies[$this->id] = $ids;
+        $this->_setReplies($ids);
 
         return $ids;
     }
 
-    function _setReplies($replies)
+    function _setReplies(array $replies)
     {
         $this->_replies[$this->id] = $replies;
     }
@@ -1772,13 +1772,11 @@ class Notice extends Managed_DataObject
                }
                
                $groups = User_group::multiGet('id', $ids);
-               
-               $this->_groups[$this->id] = $groups->fetchAll();
-               
+               $this->_setGroups($groups->fetchAll());
                return $this->_groups[$this->id];
     }
-    
-    function _setGroups($groups)
+
+    function _setGroups(array $groups)
     {
         $this->_groups[$this->id] = $groups;
     }
@@ -2656,7 +2654,7 @@ class Notice extends Managed_DataObject
      *
      * @return boolean whether the profile is in the notice's scope
      */
-    function inScope($profile)
+    function inScope(Profile $profile=null)
     {
         if (is_null($profile)) {
             $keypart = sprintf('notice:in-scope-for:%d:null', $this->id);
@@ -2679,7 +2677,7 @@ class Notice extends Managed_DataObject
         return ($result == 1) ? true : false;
     }
 
-    protected function _inScope($profile)
+    protected function _inScope(Profile $profile=null)
     {
         if (!is_null($this->scope)) {
             $scope = $this->scope;
@@ -2768,8 +2766,8 @@ class Notice extends Managed_DataObject
         }
     }
 
-    function isHiddenSpam($profile) {
-        
+    function isHiddenSpam(Profile $profile=null) {
+
         // Hide posts by silenced users from everyone but moderators.
 
         if (common_config('notice', 'hidespam')) {
@@ -2833,7 +2831,7 @@ class Notice extends Managed_DataObject
        return $scope;
     }
 
-       static function fillProfiles($notices)
+       static function fillProfiles(array $notices)
        {
                $map = self::getProfiles($notices);
                
@@ -2850,8 +2848,8 @@ class Notice extends Managed_DataObject
                
                return array_values($map);
        }
-       
-       static function getProfiles(&$notices)
+
+       static function getProfiles(array &$notices)
        {
                $ids = array();
                foreach ($notices as $notice) {
@@ -2862,8 +2860,8 @@ class Notice extends Managed_DataObject
                
                return Profile::pivotGet('id', $ids); 
        }
-       
-       static function fillGroups(&$notices)
+
+       static function fillGroups(array &$notices)
        {
         $ids = self::_idsOf($notices);
                
@@ -2903,7 +2901,7 @@ class Notice extends Managed_DataObject
                return array_keys($ids);
     }
 
-    static function fillAttachments(&$notices)
+    static function fillAttachments(array &$notices)
     {
         $ids = self::_idsOf($notices);
 
@@ -2932,7 +2930,7 @@ class Notice extends Managed_DataObject
                }
     }
 
-    static function fillReplies(&$notices)
+    static function fillReplies(array &$notices)
     {
         $ids = self::_idsOf($notices);
         $replyMap = Reply::listGet('notice_id', $ids);
@@ -2954,21 +2952,21 @@ class Notice extends Managed_DataObject
             return $this->_repeats[$this->id];
         }
         $repeatMap = Notice::listGet('repeat_of', array($this->id));
-        $this->_repeats[$this->id] = $repeatMap[$this->id];
+        $this->_setRepeats($repeatMap[$this->id]);
         return $this->_repeats[$this->id];
     }
 
-    function _setRepeats($repeats)
+    function _setRepeats(array $repeats)
     {
         $this->_repeats[$this->id] = $repeats;
     }
 
-    static function fillRepeats(&$notices)
+    static function fillRepeats(array &$notices)
     {
         $ids = self::_idsOf($notices);
         $repeatMap = Notice::listGet('repeat_of', $ids);
         foreach ($notices as $notice) {
-               $repeats = $repeatMap[$notice->id];
+            $repeats = $repeatMap[$notice->id];
             $notice->_setRepeats($repeats);
         }
     }
index 875f5d650e9ca5d036217e36896f5933e2b7d961..78a7b9f1fdce87f6a5fa347807c0b97369da3952 100644 (file)
@@ -85,9 +85,22 @@ class User_group extends Managed_DataObject
     {
         if (!isset($this->_profile[$this->profile_id])) {
             $profile = Profile::getKV('id', $this->profile_id);
+
             if (!$profile instanceof Profile) {
-                throw new GroupNoProfileException($this);
+
+                $profile = new Profile();
+                $profile->nickname   = $this->nickname;
+                $profile->fullname   = $this->fullname;
+                $profile->profileurl = $this->mainpage;
+                $profile->homepage   = $this->homepage;
+                $profile->bio        = $this->description;
+                $profile->location   = $this->location;
+                $profile->created    = common_sql_now();
+                $this->profile_id = $profile->insert();
+
+                //throw new GroupNoProfileException($this);
             }
+
             $this->_profile[$this->profile_id] = $profile;
         }
         return $this->_profile[$this->profile_id];
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 90e18e72e678e68a818b5051d73dd26a0477a937..c7be2d86a0cd30b23ca5ed737e118ed90dcb20dd 100644 (file)
@@ -19,6 +19,7 @@
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule (.*) index.php?p=$1 [L,QSA]
+<<<<<<< HEAD
 
   ## You can also use PATHINFO by using this RewriteRule instead:
   # RewriteRule (.*) index.php/$1 [L,QSA]
   # Use this instead for Apache >2.4 (mod_authz_host)
   # Require all denied
 </FilesMatch>
+=======
+</IfModule>
+
+<FilesMatch "\.(ini)">
+  Order allow,deny
+</FilesMatch>
+
+>>>>>>> Adding htaccess.sample back*shame*
index 674099e7128c1193547cf1fe689a1e6032e0eb50..3289d29b34215858c738024713ecd09ac696fe31 100644 (file)
--- a/index.php
+++ b/index.php
@@ -37,6 +37,9 @@
  * @license  GNU Affero General Public License http://www.gnu.org/licenses/
  */
 
+// Comment in if you have xdebug installed and need a detailed backtrace:
+//xdebug_start_trace();
+
 $_startTime = microtime(true);
 $_perfCounters = array();
 
@@ -314,14 +317,14 @@ function main()
     } else {
         try {
             call_user_func("$action_class::run", $args);
-        } catch (ClientException $cex) {
-            $cac = new ClientErrorAction($cex->getMessage(), $cex->getCode());
+        } catch (ClientException $e) {
+            $cac = new ClientErrorAction($e->getMessage(), $e->getCode());
             $cac->showPage();
-        } catch (ServerException $sex) { // snort snort guffaw
-            $sac = new ServerErrorAction($sex->getMessage(), $sex->getCode(), $sex);
+        } catch (ServerException $e) { // snort snort guffaw
+            $sac = new ServerErrorAction($e->getMessage(), $e->getCode(), $e);
             $sac->showPage();
-        } catch (Exception $ex) {
-            $sac = new ServerErrorAction($ex->getMessage(), 500, $ex);
+        } catch (Exception $e) {
+            $sac = new ServerErrorAction($e->getMessage(), 500, $e);
             $sac->showPage();
         }
     }
diff --git a/installer.txt b/installer.txt
new file mode 100644 (file)
index 0000000..b649dc3
--- /dev/null
@@ -0,0 +1,649 @@
+<?php
+
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2009-2010, StatusNet, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Installation
+ * @package  Installation
+ *
+ * @author   Adrian Lang <mail@adrianlang.de>
+ * @author   Brenda Wallace <shiny@cpan.org>
+ * @author   Brett Taylor <brett@webfroot.co.nz>
+ * @author   Brion Vibber <brion@pobox.com>
+ * @author   CiaranG <ciaran@ciarang.com>
+ * @author   Craig Andrews <candrews@integralblue.com>
+ * @author   Eric Helgeson <helfire@Erics-MBP.local>
+ * @author   Evan Prodromou <evan@status.net>
+ * @author   Mikael Nordfeldth <mmn@hethane.se>
+ * @author   Robin Millette <millette@controlyourself.ca>
+ * @author   Sarven Capadisli <csarven@status.net>
+ * @author   Tom Adams <tom@holizz.com>
+ * @author   Zach Copley <zach@status.net>
+ * @copyright 2009-2010 StatusNet, Inc http://status.net
+ * @copyright 2009-2014 Free Software Foundation, Inc http://www.fsf.org
+ * @license  GNU Affero General Public License http://www.gnu.org/licenses/
+ * @version  1.0.x
+ * @link     http://status.net
+ */
+
+abstract class Installer
+{
+    /** Web site info */
+    public $sitename, $server, $path, $fancy, $siteProfile, $ssl;
+    /** DB info */
+    public $host, $database, $dbtype, $username, $password, $db;
+    /** Administrator info */
+    public $adminNick, $adminPass, $adminEmail, $adminUpdates;
+    /** Should we skip writing the configuration file? */
+    public $skipConfig = false;
+
+    public static $dbModules = array(
+        'mysql' => array(
+            'name' => 'MySQL',
+            'check_module' => 'mysqli',
+            'scheme' => 'mysqli', // DSN prefix for PEAR::DB
+        ),
+        'pgsql' => array(
+            'name' => 'PostgreSQL',
+            'check_module' => 'pgsql',
+            'scheme' => 'pgsql', // DSN prefix for PEAR::DB
+        ),
+    );
+
+    /**
+     * Attempt to include a PHP file and report if it worked, while
+     * suppressing the annoying warning messages on failure.
+     */
+    private function haveIncludeFile($filename) {
+        $old = error_reporting(error_reporting() & ~E_WARNING);
+        $ok = include_once($filename);
+        error_reporting($old);
+        return $ok;
+    }
+
+    /**
+     * Check if all is ready for installation
+     *
+     * @return void
+     */
+    function checkPrereqs()
+    {
+        $pass = true;
+
+        $config = INSTALLDIR.'/config.php';
+        if (file_exists($config)) {
+            if (!is_writable($config) || filesize($config) > 0) {
+                if (filesize($config) == 0) {
+                    $this->warning('Config file "config.php" already exists and is empty, but is not writable.');
+                } else {
+                    $this->warning('Config file "config.php" already exists.');
+                }
+                $pass = false;
+            }
+        }
+
+        if (version_compare(PHP_VERSION, '5.3.2', '<')) {
+            $this->warning('Require PHP version 5.3.2 or greater.');
+            $pass = false;
+        }
+
+        $reqs = array('gd', 'curl', 'json',
+                      'xmlwriter', 'mbstring', 'xml', 'dom', 'simplexml');
+
+        foreach ($reqs as $req) {
+            if (!$this->checkExtension($req)) {
+                $this->warning(sprintf('Cannot load required extension: <code>%s</code>', $req));
+                $pass = false;
+            }
+        }
+
+        // Make sure we have at least one database module available
+        $missingExtensions = array();
+        foreach (self::$dbModules as $type => $info) {
+            if (!$this->checkExtension($info['check_module'])) {
+                $missingExtensions[] = $info['check_module'];
+            }
+        }
+
+        if (count($missingExtensions) == count(self::$dbModules)) {
+            $req = implode(', ', $missingExtensions);
+            $this->warning(sprintf('Cannot find a database extension. You need at least one of %s.', $req));
+            $pass = false;
+        }
+
+        // @fixme this check seems to be insufficient with Windows ACLs
+        if (!is_writable(INSTALLDIR)) {
+            $this->warning(sprintf('Cannot write config file to: <code>%s</code></p>', INSTALLDIR),
+                           sprintf('On your server, try this command: <code>chmod a+w %s</code>', INSTALLDIR));
+            $pass = false;
+        }
+
+        // Check the subdirs used for file uploads
+        $fileSubdirs = array('avatar', 'background', 'file');
+        foreach ($fileSubdirs as $fileSubdir) {
+            $fileFullPath = INSTALLDIR."/$fileSubdir/";
+            if (!is_writable($fileFullPath)) {
+                $this->warning(sprintf('Cannot write to %s directory: <code>%s</code>', $fileSubdir, $fileFullPath),
+                               sprintf('On your server, try this command: <code>chmod a+w %s</code>', $fileFullPath));
+                $pass = false;
+            }
+        }
+
+        return $pass;
+    }
+
+    /**
+     * Checks if a php extension is both installed and loaded
+     *
+     * @param string $name of extension to check
+     *
+     * @return boolean whether extension is installed and loaded
+     */
+    function checkExtension($name)
+    {
+        if (extension_loaded($name)) {
+            return true;
+        } elseif (function_exists('dl') && ini_get('enable_dl') && !ini_get('safe_mode')) {
+            // dl will throw a fatal error if it's disabled or we're in safe mode.
+            // More fun, it may not even exist under some SAPIs in 5.3.0 or later...
+            $soname = $name . '.' . PHP_SHLIB_SUFFIX;
+            if (PHP_SHLIB_SUFFIX == 'dll') {
+                $soname = "php_" . $soname;
+            }
+            return @dl($soname);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Basic validation on the database paramters
+     * Side effects: error output if not valid
+     *
+     * @return boolean success
+     */
+    function validateDb()
+    {
+        $fail = false;
+
+        if (empty($this->host)) {
+            $this->updateStatus("No hostname specified.", true);
+            $fail = true;
+        }
+
+        if (empty($this->database)) {
+            $this->updateStatus("No database specified.", true);
+            $fail = true;
+        }
+
+        if (empty($this->username)) {
+            $this->updateStatus("No username specified.", true);
+            $fail = true;
+        }
+
+        if (empty($this->sitename)) {
+            $this->updateStatus("No sitename specified.", true);
+            $fail = true;
+        }
+
+        return !$fail;
+    }
+
+    /**
+     * Basic validation on the administrator user paramters
+     * Side effects: error output if not valid
+     *
+     * @return boolean success
+     */
+    function validateAdmin()
+    {
+        $fail = false;
+
+        if (empty($this->adminNick)) {
+            $this->updateStatus("No initial user nickname specified.", true);
+            $fail = true;
+        }
+        if ($this->adminNick && !preg_match('/^[0-9a-z]{1,64}$/', $this->adminNick)) {
+            $this->updateStatus('The user nickname "' . htmlspecialchars($this->adminNick) .
+                         '" is invalid; should be plain letters and numbers no longer than 64 characters.', true);
+            $fail = true;
+        }
+        // @fixme hardcoded list; should use Nickname::isValid()
+        // if/when it's safe to have loaded the infrastructure here
+        $blacklist = array('main', 'panel', 'twitter', 'settings', 'rsd.xml', 'favorited', 'featured', 'favoritedrss', 'featuredrss', 'rss', 'getfile', 'api', 'groups', 'group', 'peopletag', 'tag', 'user', 'message', 'conversation', 'bookmarklet', 'notice', 'attachment', 'search', 'index.php', 'doc', 'opensearch', 'robots.txt', 'xd_receiver.html', 'facebook');
+        if (in_array($this->adminNick, $blacklist)) {
+            $this->updateStatus('The user nickname "' . htmlspecialchars($this->adminNick) .
+                         '" is reserved.', true);
+            $fail = true;
+        }
+
+        if (empty($this->adminPass)) {
+            $this->updateStatus("No initial user password specified.", true);
+            $fail = true;
+        }
+
+        return !$fail;
+    }
+
+    /**
+     * Make sure a site profile was selected
+     *
+     * @return type boolean success
+     */
+    function validateSiteProfile()
+    {
+        if (empty($this->siteProfile))  {
+            $this->updateStatus("No site profile selected.", true);
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Set up the database with the appropriate function for the selected type...
+     * Saves database info into $this->db.
+     *
+     * @fixme escape things in the connection string in case we have a funny pass etc
+     * @return mixed array of database connection params on success, false on failure
+     */
+    function setupDatabase()
+    {
+        if ($this->db) {
+            throw new Exception("Bad order of operations: DB already set up.");
+        }
+        $this->updateStatus("Starting installation...");
+
+        if (empty($this->password)) {
+            $auth = '';
+        } else {
+            $auth = ":$this->password";
+        }
+        $scheme = self::$dbModules[$this->dbtype]['scheme'];
+        $dsn = "{$scheme}://{$this->username}{$auth}@{$this->host}/{$this->database}";
+
+        $this->updateStatus("Checking database...");
+        $conn = $this->connectDatabase($dsn);
+
+        // ensure database encoding is UTF8
+        if ($this->dbtype == 'mysql') {
+            // @fixme utf8m4 support for mysql 5.5?
+            // Force the comms charset to utf8 for sanity
+            // This doesn't currently work. :P
+            //$conn->executes('set names utf8');
+        } else if ($this->dbtype == 'pgsql') {
+            $record = $conn->getRow('SHOW server_encoding');
+            if ($record->server_encoding != 'UTF8') {
+                $this->updateStatus("GNU social requires UTF8 character encoding. Your database is ". htmlentities($record->server_encoding));
+                return false;
+            }
+        }
+
+        $res = $this->updateStatus("Creating database tables...");
+        if (!$this->createCoreTables($conn)) {
+            $this->updateStatus("Error creating tables.", true);
+            return false;
+        }
+
+        foreach (array('sms_carrier' => 'SMS carrier',
+                    'notice_source' => 'notice source',
+                    'foreign_services' => 'foreign service')
+              as $scr => $name) {
+            $this->updateStatus(sprintf("Adding %s data to database...", $name));
+            $res = $this->runDbScript($scr.'.sql', $conn);
+            if ($res === false) {
+                $this->updateStatus(sprintf("Can't run %s script.", $name), true);
+                return false;
+            }
+        }
+
+        $db = array('type' => $this->dbtype, 'database' => $dsn);
+        return $db;
+    }
+
+    /**
+     * Open a connection to the database.
+     *
+     * @param <type> $dsn
+     * @return <type>
+     */
+    function connectDatabase($dsn)
+    {
+        global $_DB;
+        return $_DB->connect($dsn);
+    }
+
+    /**
+     * Create core tables on the given database connection.
+     *
+     * @param DB_common $conn
+     */
+    function createCoreTables(DB_common $conn)
+    {
+        $schema = Schema::get($conn);
+        $tableDefs = $this->getCoreSchema();
+        foreach ($tableDefs as $name => $def) {
+            if (defined('DEBUG_INSTALLER')) {
+                echo " $name ";
+            }
+            $schema->ensureTable($name, $def);
+        }
+        return true;
+    }
+
+    /**
+     * Fetch the core table schema definitions.
+     *
+     * @return array of table names => table def arrays
+     */
+    function getCoreSchema()
+    {
+        $schema = array();
+        include INSTALLDIR . '/db/core.php';
+        return $schema;
+    }
+
+    /**
+     * Return a parseable PHP literal for the given value.
+     * This will include quotes for strings, etc.
+     *
+     * @param mixed $val
+     * @return string
+     */
+    function phpVal($val)
+    {
+        return var_export($val, true);
+    }
+
+    /**
+     * Return an array of parseable PHP literal for the given values.
+     * These will include quotes for strings, etc.
+     *
+     * @param mixed $val
+     * @return array
+     */
+    function phpVals($map)
+    {
+        return array_map(array($this, 'phpVal'), $map);
+    }
+
+    /**
+     * Write a stock configuration file.
+     *
+     * @return boolean success
+     *
+     * @fixme escape variables in output in case we have funny chars, apostrophes etc
+     */
+    function writeConf()
+    {
+        $vals = $this->phpVals(array(
+            'sitename' => $this->sitename,
+            'server' => $this->server,
+            'path' => $this->path,
+            'ssl' => in_array($this->ssl, array('never', 'sometimes', 'always'))
+                     ? $this->ssl
+                     : 'never',
+            'db_database' => $this->db['database'],
+            'db_type' => $this->db['type']
+        ));
+
+        // assemble configuration file in a string
+        $cfg =  "<?php\n".
+                "if (!defined('GNUSOCIAL')) { exit(1); }\n\n".
+
+                // site name
+                "\$config['site']['name'] = {$vals['sitename']};\n\n".
+
+                // site location
+                "\$config['site']['server'] = {$vals['server']};\n".
+                "\$config['site']['path'] = {$vals['path']}; \n\n".
+                "\$config['site']['ssl'] = {$vals['ssl']}; \n\n".
+
+                // checks if fancy URLs are enabled
+                ($this->fancy ? "\$config['site']['fancy'] = true;\n\n":'').
+
+                // database
+                "\$config['db']['database'] = {$vals['db_database']};\n\n".
+                ($this->db['type'] == 'pgsql' ? "\$config['db']['quote_identifiers'] = true;\n\n":'').
+                "\$config['db']['type'] = {$vals['db_type']};\n\n";
+
+        // Normalize line endings for Windows servers
+        $cfg = str_replace("\n", PHP_EOL, $cfg);
+
+        // write configuration file out to install directory
+        $res = file_put_contents(INSTALLDIR.'/config.php', $cfg);
+
+        return $res;
+    }
+
+    /**
+     * Write the site profile. We do this after creating the initial user
+     * in case the site profile is set to single user. This gets around the
+     * 'chicken-and-egg' problem of the system requiring a valid user for
+     * single user mode, before the intial user is actually created. Yeah,
+     * we should probably do this in smarter way.
+     *
+     * @return int res number of bytes written
+     */
+    function writeSiteProfile()
+    {
+        $vals = $this->phpVals(array(
+            'site_profile' => $this->siteProfile,
+            'nickname' => $this->adminNick
+        ));
+
+        $cfg =
+        // site profile
+        "\$config['site']['profile'] = {$vals['site_profile']};\n";
+
+        if ($this->siteProfile == "singleuser") {
+            $cfg .= "\$config['singleuser']['nickname'] = {$vals['nickname']};\n\n";
+        } else {
+            $cfg .= "\n";
+        }
+
+        // Normalize line endings for Windows servers
+        $cfg = str_replace("\n", PHP_EOL, $cfg);
+
+        // write configuration file out to install directory
+        $res = file_put_contents(INSTALLDIR.'/config.php', $cfg, FILE_APPEND);
+
+        return $res;
+    }
+
+    /**
+     * Install schema into the database
+     *
+     * @param string    $filename location of database schema file
+     * @param DB_common $conn     connection to database
+     *
+     * @return boolean - indicating success or failure
+     */
+    function runDbScript($filename, DB_common $conn)
+    {
+        $sql = trim(file_get_contents(INSTALLDIR . '/db/' . $filename));
+        $stmts = explode(';', $sql);
+        foreach ($stmts as $stmt) {
+            $stmt = trim($stmt);
+            if (!mb_strlen($stmt)) {
+                continue;
+            }
+            try {
+                $res = $conn->simpleQuery($stmt);
+            } catch (Exception $e) {
+                $error = $e->getMessage();
+                $this->updateStatus("ERROR ($error) for SQL '$stmt'");
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Create the initial admin user account.
+     * Side effect: may load portions of GNU social framework.
+     * Side effect: outputs program info
+     */
+    function registerInitialUser()
+    {
+        require_once INSTALLDIR . '/lib/common.php';
+
+        $data = array('nickname' => $this->adminNick,
+                      'password' => $this->adminPass,
+                      'fullname' => $this->adminNick);
+        if ($this->adminEmail) {
+            $data['email'] = $this->adminEmail;
+        }
+        $user = User::register($data);
+
+        if (empty($user)) {
+            return false;
+        }
+
+        // give initial user carte blanche
+
+        $user->grantRole('owner');
+        $user->grantRole('moderator');
+        $user->grantRole('administrator');
+
+        // Attempt to do a remote subscribe to update@status.net
+        // Will fail if instance is on a private network.
+
+        if ($this->adminUpdates && class_exists('Ostatus_profile')) {
+            try {
+                $oprofile = Ostatus_profile::ensureProfileURL('http://update.status.net/');
+                Subscription::start($user->getProfile(), $oprofile->localProfile());
+                $this->updateStatus("Set up subscription to <a href='http://update.status.net/'>update@status.net</a>.");
+            } catch (Exception $e) {
+                $this->updateStatus("Could not set up subscription to <a href='http://update.status.net/'>update@status.net</a>.", true);
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * The beef of the installer!
+     * Create database, config file, and admin user.
+     *
+     * Prerequisites: validation of input data.
+     *
+     * @return boolean success
+     */
+    function doInstall()
+    {
+        global $config;
+
+        $this->updateStatus("Initializing...");
+        ini_set('display_errors', 1);
+        error_reporting(E_ALL);
+        if (!defined('GNUSOCIAL')) {
+            define('GNUSOCIAL', true);
+        }
+        if (!defined('STATUSNET')) {
+            define('STATUSNET', true);
+        }
+
+        require_once INSTALLDIR . '/lib/framework.php';
+        StatusNet::initDefaults($this->server, $this->path);
+
+        if ($this->siteProfile == "singleuser") {
+            // Until we use ['site']['profile']==='singleuser' everywhere
+            $config['singleuser']['enabled'] = true;
+        }
+
+        try {
+            $this->db = $this->setupDatabase();
+            if (!$this->db) {
+                // database connection failed, do not move on to create config file.
+                return false;
+            }
+        } catch (Exception $e) {
+            // Lower-level DB error!
+            $this->updateStatus("Database error: " . $e->getMessage(), true);
+            return false;
+        }
+
+        // Make sure we can write to the file twice
+        $oldUmask = umask(000); 
+
+        if (!$this->skipConfig) {
+            $this->updateStatus("Writing config file...");
+            $res = $this->writeConf();
+
+            if (!$res) {
+                $this->updateStatus("Can't write config file.", true);
+                return false;
+            }
+        }
+
+        if (!empty($this->adminNick)) {
+            // Okay, cross fingers and try to register an initial user
+            if ($this->registerInitialUser()) {
+                $this->updateStatus(
+                    "An initial user with the administrator role has been created."
+                );
+            } else {
+                $this->updateStatus(
+                    "Could not create initial user account.",
+                    true
+                );
+                return false;
+            }
+        }
+
+        if (!$this->skipConfig) {
+            $this->updateStatus("Setting site profile...");
+            $res = $this->writeSiteProfile();
+
+            if (!$res) {
+                $this->updateStatus("Can't write to config file.", true);
+                return false;
+            }
+        }
+
+        // Restore original umask
+        umask($oldUmask);
+        // Set permissions back to something decent
+        chmod(INSTALLDIR.'/config.php', 0644);
+        
+        $scheme = $this->ssl === 'always' ? 'https' : 'http';
+        $link = "{$scheme}://{$this->server}/{$this->path}";
+
+        $this->updateStatus("GNU social has been installed at $link");
+        $this->updateStatus(
+            '<strong>DONE!</strong> You can visit your <a href="'.htmlspecialchars($link).'">new GNU social site</a> (log in as "'.htmlspecialchars($this->adminNick).'"). If this is your first GNU social install, make your experience the best possible by visiting our resource site to join the mailing list and <a href="http://gnu.io/resources/">good documentation</a>.'
+        );
+
+        return true;
+    }
+
+    /**
+     * Output a pre-install-time warning message
+     * @param string $message HTML ok, but should be plaintext-able
+     * @param string $submessage HTML ok, but should be plaintext-able
+     */
+    abstract function warning($message, $submessage='');
+
+    /**
+     * Output an install-time progress message
+     * @param string $message HTML ok, but should be plaintext-able
+     * @param boolean $error true if this should be marked as an error condition
+     */
+    abstract function updateStatus($status, $error=false);
+
+}
index 7c57cbc432a9e8ba7f911bca38652ddbf3b39e6b..c019b65dc92f40e38f2acfe74991cbc5149d8bb4 100644 (file)
@@ -1216,7 +1216,7 @@ class Action extends HTMLOutputter // lawsuit
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index 4e13419ae7482ccd0aed3eac7ffad9e15e6ca789..2cf950183005a3477352488f68e965cb94200626 100644 (file)
@@ -306,7 +306,7 @@ class ActivityImporter extends QueueHandler
             // Is the recipient a remote group?
             $oprofile = Ostatus_profile::ensureProfileURI($recipient);
 
-            if ($oprofile) {
+            if ($oprofile instanceof Ostatus_profile) {
                 if (!$oprofile->isGroup()) {
                     // may be canonicalized or something
                     $replies[] = $oprofile->uri;
@@ -321,10 +321,11 @@ class ActivityImporter extends QueueHandler
 
             if ($id) {
                 $group = User_group::getKV('id', $id);
-                if ($group) {
+                if ($group instanceof User_group) {
                     // Deliver to all members of this local group if allowed.
-                    $profile = $sender->localProfile();
-                    if ($profile->isMember($group)) {
+                    $profile = Profile::getKV('id', $recipient);
+
+                    if (($profile instanceof Profile) && ($profile->isMember($group))) {
                         $groups[] = $group->id;
                     } else {
                         common_log(LOG_INFO, "Skipping reply to local group {$group->nickname} as sender {$profile->id} is not a member");
index d4c01232ec283e8e97ae5d54dcb96040de37df60..a0fc4872328e0f5103aea0797727098e9f5196db 100644 (file)
@@ -300,7 +300,7 @@ class ActivityUtils
         return false;
     }
 
-    static function getFeedAuthor($feedEl)
+    static function getFeedAuthor(DOMElement $feedEl)
     {
         // Try old and deprecated activity:subject
 
@@ -347,10 +347,10 @@ class ActivityUtils
         return null;
     }
 
-    static function compareTypes($type, $objects)    // this does verbs too!
+    static function compareTypes($type, array $objects)    // this does verbs too!
     {
         $type = self::resolveUri($type);
-        foreach ((array)$objects as $object) {
+        foreach ($objects as $object) {
             if ($type === self::resolveUri($object)) {
                 return true;
             }
index 2ac92cb5c6522a38f8b6e6d789e9b21c20a0b890..af6e11a511487805f7c5aaf337c584f2d270fcd4 100644 (file)
@@ -60,7 +60,7 @@ class AdminPanelAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -119,7 +119,7 @@ class AdminPanelAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $this->checkSessionToken();
index 13d1a8c580d44e92f18c347040d5ff330a1708a4..cf3a86553869d3ce52944174e5cbeade7759282d 100644 (file)
@@ -163,7 +163,7 @@ class ApiListUsersAction extends ApiBareAuthAction
     {
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index 8da7e5c61c5daee73aa40a5ad76ab61fe99bcd84..0a6c934b833614f9244a203d569bf52990b2b7ef 100644 (file)
@@ -49,12 +49,12 @@ class ApiOAuthAction extends ApiAction
      *
      * @return boolean false
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         return true;
@@ -69,7 +69,7 @@ class ApiOAuthAction extends ApiAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         self::cleanRequest();
index d6cfda6f95961b4f3bd74be7a1a52d384df947bc..a784066fdadf78b413051a53682e82e1b11062c5 100644 (file)
@@ -100,12 +100,12 @@ class AttachmentList extends Widget
 
     function showListStart()
     {
-        $this->out->elementStart('ol', array('class' => 'attachments'));
+        $this->out->elementStart('div', array('class' => 'attachments'));
     }
 
     function showListEnd()
     {
-        $this->out->elementEnd('ol');
+        $this->out->elementEnd('div');
     }
 
     /**
index 919727bc1f8ff69beab70f7c573bdd6efad20974..3dbce148f8644d4985fa59af17b377ded7fac84b 100644 (file)
@@ -215,7 +215,7 @@ class AttachmentListItem extends Widget
             $scripts[] = $script;
         }
         foreach ($scripts as $script) {
-            common_log(LOG_DEBUG, $script->textContent);
+            common_debug($script->textContent);
             $script->parentNode->removeChild($script);
         }
 
index 9233c9bde6d202996ba61d24ddd6087fc4245fb4..5c42a79bb6457311395fe0eb65e3faa0d3c30766 100644 (file)
@@ -72,7 +72,7 @@ class ClientErrorAction extends ErrorAction
 
     // XXX: Should these error actions even be invokable via URI?
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 6ca61f191b2c6160802434bb60e4351ac78204dc..6d6677f2872de15232f448b9b835259536db160e 100644 (file)
@@ -132,7 +132,7 @@ $default =
               'delete' => false,
               'move' => true),
         'image' =>
-        array('jpegquality' => 85),
+        array('jpegquality' => 95),
         'avatar' =>
         array('server' => null,
               'dir' => INSTALLDIR . '/avatar/',
index e3968706953003e5a88e752930c956f22ec0967f..2e2afbd014de511f6c3acb75fa04eee8e56e9006 100644 (file)
@@ -55,12 +55,8 @@ class DocFile
         $this->filename = $filename;
     }
 
-    static function forTitle($title, $paths)
+    static function forTitle($title, array $paths, $language=null)
     {
-        if (!is_array($paths)) {
-            $paths = array($paths);
-        }
-
         $filename = null;
 
         if (Event::handle('StartDocFileForTitle', array($title, &$paths, &$filename))) {
@@ -80,7 +76,7 @@ class DocFile
                 }
 
                 if (!empty($lang) || !empty($def)) {
-                    $filename = self::negotiateLanguage($lang, $def);
+                    $filename = self::negotiateLanguage($lang, $def, $language);
                     break;
                 }
             }
@@ -95,12 +91,8 @@ class DocFile
         }
     }
 
-    function toHTML($args=null)
+    function toHTML(array $args=array())
     {
-        if (is_null($args)) {
-            $args = array();
-        }
-
         if (empty($this->contents)) {
             $this->contents = file_get_contents($this->filename);
         }
@@ -114,7 +106,7 @@ class DocFile
                        INSTALLDIR.'/doc-src/');
 
         $site = StatusNet::currentSite();
-        
+
         if (!empty($site)) {
             array_unshift($paths, INSTALLDIR.'/local/doc-src/'.$site.'/');
         }
@@ -128,7 +120,7 @@ class DocFile
                        INSTALLDIR.'/mail-src/');
 
         $site = StatusNet::currentSite();
-        
+
         if (!empty($site)) {
             array_unshift($paths, INSTALLDIR.'/local/mail-src/'.$site.'/');
         }
@@ -136,12 +128,20 @@ class DocFile
         return $paths;
     }
 
-    static function negotiateLanguage($filenames, $defaultFilename=null)
+    private static function negotiateLanguage(array $filenames, $defaultFilename=null, $language = null)
     {
-        // XXX: do this better
-
+        // Default is current language
         $langcode = common_language();
 
+        // Is a language set?
+        if (!empty($language)) {
+            // And is it valid?
+            if (common_valid_language($language)) {
+                // Use this as language (e.g. from form)
+                $langcode = strval($language);
+            }
+        }
+
         foreach ($filenames as $filename) {
             if (preg_match('/\.'.$langcode.'$/', $filename)) {
                 return $filename;
index 73576bf46a464604cafb8af2e847f82eb514dedc..2599153870cf426c54adaba956fed7a14523776b 100644 (file)
@@ -65,7 +65,7 @@ class FormAction extends ManagedAction
         return true;
     }
 
-    public function isReadOnly($args) {
+    public function isReadOnly(array $args=array()) {
         return !$this->isPost();
     }
 
index 30b98d259fe001af84f54d2451362459204a7a7f..6e71fea62cbf5773852aa66725772e27192d4cf7 100644 (file)
@@ -105,6 +105,28 @@ function _have_config()
     return StatusNet::haveConfig();
 }
 
+function common_get_temp_dir()
+{
+    // Try to get it from php.ini first
+    $temp_path = trim(ini_get('upload_tmp_dir'));
+
+    // Is it empty?
+    if (strlen($temp_path) == 0) {
+        // Then try sys_get_temp_dir()
+        $temp_path = trim(sys_get_temp_dir());
+
+        // Still empty?
+        if (strlen($temp_path) == 0) {
+            // Then set it to /tmp (ugly)
+            // @TODO Hard-coded non-Windows stuff!
+            $temp_path = '/tmp';
+        }
+    }
+
+    // Return found path
+    return $temp_path;
+}
+
 function GNUsocial_class_autoload($cls)
 {
     if (file_exists(INSTALLDIR.'/classes/' . $cls . '.php')) {
@@ -121,6 +143,7 @@ function GNUsocial_class_autoload($cls)
     }
 }
 
+
 // Autoload function queue, starting with our own discovery method
 spl_autoload_register('GNUsocial_class_autoload');
 
index 52b5f279c9436b1114548076ed32f4ef5e3dca4f..0cc023ca5dbc6ca25e62698923eeb74d70f975e0 100644 (file)
@@ -48,7 +48,7 @@ if (!defined('STATUSNET')) {
 
 class FullThreadedNoticeList extends ThreadedNoticeList
 {
-    function newListItem($notice)
+    function newListItem(Notice $notice)
     {
         return new FullThreadedNoticeListItem($notice, $this->out, $this->userProfile);
     }
index 5d11e6acddc7e2cdeeee5ae5c4e85ae82acf1f13..b1a5d771979caf5c432882ada033e0eddedd3d8c 100644 (file)
@@ -325,7 +325,7 @@ class GroupAdminSection extends ProfileSection
 
 class GroupMembersMiniList extends ProfileMiniList
 {
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new GroupMembersMiniListItem($profile, $this->action);
     }
@@ -347,7 +347,7 @@ class GroupMembersMiniListItem extends ProfileMiniListItem
 
 class GroupBlockedMiniList extends ProfileMiniList
 {
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new GroupBlockedMiniListItem($profile, $this->action);
     }
index 39e904222adc719af04cd06773ff4c639ede9d42..d29a149573323b56ffd612643de9a7aa59d49d0e 100644 (file)
@@ -136,7 +136,7 @@ class GroupList extends Widget
 
         $this->out->elementEnd('div');
 
-        if ($user) {
+        if ($user instanceof User) {
             $this->out->elementStart('div', 'entity_actions');
             $this->out->elementStart('ul');
             $this->out->elementStart('li', 'entity_subscribe');
index ba608213a43e2d37a3b68a1010b998ce6ae581a6..f055e24731fca0dcea02593938e31c6d8ee032f3 100644 (file)
@@ -12,7 +12,7 @@ class GroupMemberList extends ProfileList
         $this->group = $group;
     }
 
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new GroupMemberListItem($profile, $this->group, $this->action);
     }
index 2dc260b1bf8cad511abe131d254ab4648db659d8..d2f281254b028f6f8f4b078a2140a8588a53cdf6 100644 (file)
@@ -62,13 +62,12 @@ class ImageFile
 
         $info = @getimagesize($this->filepath);
 
-        if (!(
-            ($info[2] == IMAGETYPE_GIF && function_exists('imagecreatefromgif')) ||
-            ($info[2] == IMAGETYPE_JPEG && function_exists('imagecreatefromjpeg')) ||
-            $info[2] == IMAGETYPE_BMP ||
-            ($info[2] == IMAGETYPE_WBMP && function_exists('imagecreatefromwbmp')) ||
-            ($info[2] == IMAGETYPE_XBM && function_exists('imagecreatefromxbm')) ||
-            ($info[2] == IMAGETYPE_PNG && function_exists('imagecreatefrompng')))) {
+        if (
+            ($info[2] == IMAGETYPE_GIF && !function_exists('imagecreatefromgif')) ||
+            ($info[2] == IMAGETYPE_JPEG && !function_exists('imagecreatefromjpeg')) ||
+            ($info[2] == IMAGETYPE_WBMP && !function_exists('imagecreatefromwbmp')) ||
+            ($info[2] == IMAGETYPE_XBM && !function_exists('imagecreatefromxbm')) ||
+            ($info[2] == IMAGETYPE_PNG && !function_exists('imagecreatefrompng'))) {
 
             // TRANS: Exception thrown when trying to upload an unsupported image file format.
             throw new UnsupportedMediaException(_('Unsupported image format.'), $this->filepath);
index 4ee9d854663e22cd240df05d189da15b28a938b4..9542d4d206d604633691360ad05cc391a26fc4b3 100644 (file)
@@ -528,7 +528,7 @@ abstract class ImPlugin extends Plugin
      *
      * @return boolean hook return
      */
-    function onEndInitializeQueueManager($manager)
+    function onEndInitializeQueueManager(QueueManager $manager)
     {
         $manager->connect($this->transport . '-in', new ImReceiverQueueHandler($this), 'im');
         $manager->connect($this->transport, new ImQueueHandler($this));
@@ -542,7 +542,7 @@ abstract class ImPlugin extends Plugin
         return true;
     }
 
-    function onStartEnqueueNotice($notice, &$transports)
+    function onStartEnqueueNotice(Notice $notice, array &$transports)
     {
         $profile = Profile::getKV($notice->profile_id);
 
index f72bed59d62a437b3714c7807c7c9ad357cc5775..d6c85d13d25ee6ff069541e902c17ac993b2dd72 100644 (file)
@@ -72,7 +72,7 @@ class InfoAction extends Action
         return empty($this->title) ? '' : $this->title;
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 9016daf3f19845ef4289e1b48b36fe628fdc2e83..a8f383c3fe80b2a5e0191d4e57238dc14abfd545 100644 (file)
@@ -35,7 +35,6 @@ class InlineAttachmentList extends AttachmentList
 {
     function showListStart()
     {
-        $this->out->element('h3', null, _('Attachments'));
         parent::showListStart();
     }
 
@@ -55,7 +54,6 @@ class InlineAttachmentList extends AttachmentList
 class InlineAttachmentListItem extends AttachmentListItem
 {
     function showLink() {
-        $this->out->element('a', $this->linkAttr(), $this->title());
         $this->showRepresentation();
     }
 
index cea7d29ec7df621801ffaeb934fc5fd7462b65ed..9a167618f7db42e8b4069ee759f32e39859833c2 100644 (file)
@@ -293,7 +293,10 @@ abstract class Installer
             }
         }
 
-        if (!$conn instanceof DB_common) {
+        if (!is_object($conn)) {
+            // No object at all
+            throw new Exception('Fatal error: conn is no object.');
+        } elseif (!$conn instanceof DB_common) {
             // Is not the right instance
             throw new Exception('Cannot connect to database: ' . $conn->getMessage());
         }
index 364ca75b9b32217b05ff245e195286ca6f9db1c2..be4dc163b059c56257b601f53188e08396f415e1 100644 (file)
@@ -93,6 +93,7 @@ class InviteForm extends Form
     function formData()
     {
         $this->out->elementStart('ul', 'form_data');
+
         $this->out->elementStart('li');
         $this->out->textarea(
             'addresses',
@@ -103,6 +104,7 @@ class InviteForm extends Form
             _('Addresses of friends to invite (one per line).')
         );
         $this->out->elementEnd('li');
+
         $this->out->elementStart('li');
         $this->out->textarea(
             // TRANS: Field label for a personal message to send to invitees.
@@ -112,6 +114,16 @@ class InviteForm extends Form
             _('Optionally add a personal message to the invitation.')
         );
         $this->out->elementEnd('li');
+
+        $language = common_language();
+
+        $this->out->elementStart('li');
+        $this->out->dropdown('language', _('Language'),
+            // TRANS: Tooltip for dropdown list label in form for profile settings.
+            get_nice_language_list(), _('Preferred language.'),
+            false, $language);
+        $this->out->elementEnd('li');
+
         $this->out->elementEnd('ul');
     }
 
index 7072761f2d2a03be6f34e5a66aae6eb445826044..e53fc6511e1eebce4694d4bc187a1c00fd60d605 100644 (file)
@@ -152,7 +152,7 @@ abstract class IoMaster
 
             if ($timeout > 0 && empty($sockets)) {
                 // If we had no listeners, sleep until the pollers' next requested wakeup.
-                common_log(LOG_DEBUG, "Sleeping $timeout seconds until next poll cycle...");
+                common_debug("Sleeping $timeout seconds until next poll cycle...");
                 $this->logState('sleep');
                 sleep($timeout);
             }
@@ -190,7 +190,7 @@ abstract class IoMaster
                 }
             } else if (common_config('queue', 'debug_memory')) {
                 $fmt = number_format($usage);
-                common_log(LOG_DEBUG, "Memory usage $fmt");
+                common_debug("Memory usage $fmt");
             }
         }
     }
index 27503aa06bf59d4e48dc67e1dd57909342031680..b9dfb88c7327570bfb8dac300aaa84cb686cf5c3 100644 (file)
@@ -94,16 +94,20 @@ class Menu extends Widget
             $this->out->elementStart('ul', $attrs);
 
             foreach ($items as $item) {
+                assert(is_array($item));
+                assert(count($item) == 5);
+
                 list($actionName, $args, $label, $description, $id) = $item;
+
                 $this->item($actionName, $args, $label, $description, $id);
             }
-        
+
             $this->out->elementEnd('ul');
-            
+
             Event::handle('EndNav', array($this, $tag, $items));
         }
     }
-    
+
     function item($actionName, array $args, $label, $description, $id=null, $cls=null)
     {
         if (empty($id)) {
@@ -124,6 +128,12 @@ class Menu extends Widget
     {
         if ($actionName != $this->actionName) {
             return false;
+        } elseif (!is_array($args)) {
+            /*
+             * No array, then the below loop doesn't need to run and
+             * 'return false' will never be reached.
+             */
+            return true;
         }
 
         foreach ($this->actionArgs as $k => $v) {
@@ -134,11 +144,11 @@ class Menu extends Widget
 
         return true;
     }
-    
+
     function menuItemID($actionName, $args = null)
     {
         $id = sprintf('nav_%s', $actionName);
-        
+
         if (!is_null($args)) {
             foreach ($args as $key => $value) {
                 $id .= '_' . $key . '_' . $value;
index e241b5812c6af7b0ab73ea459b2d610921f0c655..f1f322ae332de9d75ba55e8199613155dd0d17df 100644 (file)
@@ -103,7 +103,9 @@ class NoticeForm extends Form
         // Do we have to worry about sub-second race conditions?
         // XXX: Needs to be above the parent::__construct() call...?
 
-        $this->id_suffix = rand();
+        // When creating a notice form we don't want to collide with
+        // possibly existing HTML elements, as naming conventions are similar.
+        $this->id_suffix = mt_rand();
 
         parent::__construct($action);
 
@@ -262,7 +264,7 @@ class NoticeForm extends Form
                     'type' => 'checkbox',
                     'class' => 'checkbox',
                     'id' => $this->id() . '-notice_data-geo',
-                    'checked' => true, // ?
+                    'checked' => false, // Must be unchecked by default
                 ));
                 $this->out->text(' ');
                 // TRANS: Field label to add location to a notice.
index 4a50f548cb00fc0de53e48416d6817d842fbfa58..c8bf2c312d51d87ed891ee28d80cdd80da94a550 100644 (file)
@@ -188,7 +188,8 @@ class NoticeListItem extends Widget
     {
         if (Event::handle('StartShowNoticeOptions', array($this))) {
             $user = common_current_user();
-            if ($user) {
+
+            if ($user instanceof User) {
                 $this->out->elementStart('div', 'notice-options');
                 if (Event::handle('StartShowNoticeOptionItems', array($this))) {
                     $this->showReplyLink();
@@ -198,6 +199,7 @@ class NoticeListItem extends Widget
                 }
                 $this->out->elementEnd('div');
             }
+
             Event::handle('EndShowNoticeOptions', array($this));
         }
     }
index 5acdc1c2ba5e076be788deb9206010767be1606a..c43faef5575fa5904456b83813afda42ec9c0f7c 100644 (file)
@@ -178,7 +178,7 @@ class Plugin
                 . ' (' . get_class($this) . ' v' . $this->version() . ')';
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $name = $this->name();
 
index 51c02aa2454a69d969e9900531d0ce4e93592ace..40a889abd5b63ee899223ddd3e54b1e24ae1d305 100644 (file)
@@ -78,7 +78,7 @@ class PluginList extends Widget
         }
     }
 
-    function newListItem($plugin)
+    function newListItem(Plugin $plugin)
     {
         return new PluginListItem($plugin, $this->out);
     }
index 83b3170bed170c48e2d907908565c978346c9ba5..79008f3bfcb2397d6b13fdba0448732fc243a39d 100644 (file)
@@ -109,7 +109,7 @@ class ProfileAction extends ManagedAction
         return true;
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -345,7 +345,7 @@ class ProfileAction extends ManagedAction
 
 class SubscribersMiniList extends ProfileMiniList
 {
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new SubscribersMiniListItem($profile, $this->action);
     }
index 9ace6676c3b82fa16797c735f4b0630518dd429d..75f4359c9d8dd6c8b7c8780d4eff21cdde867c4e 100644 (file)
@@ -51,7 +51,7 @@ class ProfileFormAction extends RedirectingAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -96,7 +96,7 @@ class ProfileFormAction extends RedirectingAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 767e12bc25a7dbc2360bd65d1bddd270fd919989..57559b5bb27d4d43069dcc443e3ff0e88b9632b2 100644 (file)
@@ -97,7 +97,7 @@ class ProfileList extends Widget
         return $cnt;
     }
 
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new ProfileListItem($profile, $this->action);
     }
index 33624a3c7059440298a23e3e829b13c5b59b5f5d..9c10d62b183ab7028060deaa82db62f488071e67 100644 (file)
@@ -54,7 +54,7 @@ class ProfileMiniList extends ProfileList
         $this->out->elementStart('ul', 'entities users xoxo');
     }
 
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new ProfileMiniListItem($profile, $this->action);
     }
index 4a3f27819e53f78c7077535d28d9fcc649edc7e5..cab98022b320a9dba678ae6daee0006f0c1d525c 100644 (file)
@@ -34,7 +34,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
 /**
  * URL Router
  *
- * Cheap wrapper around Net_URL_Mapper
+ * Cheap wrapper around URLMapper
  *
  * @category URL
  * @package  StatusNet
@@ -212,7 +212,7 @@ class Router
 
             // The second of these is needed to make the link work correctly
             // when inserted into the page. The first is needed to match the
-            // route on the way in. Seems to be another Net_URL_Mapper bug to me.
+            // route on the way in. Seems to be another URLMapper bug to me.
             $m->connect('search/notice/rss?q=:q', array('action' => 'noticesearchrss'),
                         array('q' => '.+'));
             $m->connect('search/notice/rss', array('action' => 'noticesearchrss'));
@@ -1143,7 +1143,7 @@ class Router
         }
 
         $url = $this->m->generate($args, $params, $fragment);
-        // Due to a bug in the Net_URL_Mapper code, the returned URL may
+        // Due to a bug in the URLMapper code, the returned URL may
         // contain a malformed query of the form ?p1=v1?p2=v2?p3=v3. We
         // repair that here rather than modifying the upstream code...
 
index 684ecd6d8c1f1370e088e83e3f60d03bbc377882..dfaad06358f3021f2e063389b85ea22ccc1a7d9c 100644 (file)
@@ -75,7 +75,7 @@ class Rss10Action extends Action
      * @return boolean success
      */
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -120,7 +120,7 @@ class Rss10Action extends Action
      * @return void
      */
 
-    function handle($args)
+    function handle(array $args=array())
     {
         // Parent handling, including cache check
         parent::handle($args);
index 1960a0693001c6948191dcf629b71c1bab38945e..d336135464a54c6ff083411f5ee12056334f416a 100644 (file)
@@ -60,12 +60,12 @@ class SchemaUpdater
         foreach ($this->tables as $table => $def) {
             $checksum = $this->checksum($def);
             if (empty($checksums[$table])) {
-                common_log(LOG_DEBUG, "No previous schema_version for $table: updating to $checksum");
+                common_debug("No previous schema_version for $table: updating to $checksum");
             } else if ($checksums[$table] == $checksum) {
-                common_log(LOG_DEBUG, "Last schema_version for $table up to date: $checksum");
+                common_debug("Last schema_version for $table up to date: $checksum");
                 continue;
             } else {
-                common_log(LOG_DEBUG, "Last schema_version for $table is {$checksums[$table]}: updating to $checksum");
+                common_debug("Last schema_version for $table is {$checksums[$table]}: updating to $checksum");
             }
             //$this->conn->query('BEGIN');
             $this->schema->ensureTable($table, $def);
@@ -106,7 +106,7 @@ class SchemaUpdater
             return $checksums;
         } catch (Exception $e) {
             // no dice!
-            common_log(LOG_DEBUG, "Possibly schema_version table doesn't exist yet.");
+            common_debug("Possibly schema_version table doesn't exist yet.");
         }
         PEAR::popErrorHandling();
 
@@ -134,7 +134,7 @@ class SchemaUpdater
             }
         } catch (Exception $e) {
             // no dice!
-            common_log(LOG_DEBUG, "Possibly schema_version table doesn't exist yet.");
+            common_debug("Possibly schema_version table doesn't exist yet.");
         }
         PEAR::popErrorHandling();
         $this->checksums[$table] = $checksum;
index f8acf34f072d69b5ca8f88cbdf4b2b9c96c409f6..450b04ba7a825140646f9e2a3a73eec9697761f4 100644 (file)
@@ -51,12 +51,12 @@ class SearchAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
index 54cc99099a5abef5e27e56c70315a31dc5525216..200711b84d8deda6552e76686aab61ef268efc04 100644 (file)
@@ -78,7 +78,7 @@ class ServerErrorAction extends ErrorAction
 
     // XXX: Should these error actions even be invokable via URI?
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index fd4885c830223072a9421435def6fb756b448613..bed478f135d09c8c91cf20b39fe6d0416f620cea 100644 (file)
@@ -65,7 +65,7 @@ class SettingsAction extends Action
      * @return void
      */
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (!common_logged_in()) {
index 29c12744076b301527ed8837ced2226ef2e6268e..f882b90c7f30b6e76094521914986943626ebd40 100644 (file)
@@ -53,7 +53,7 @@ class SubscriptionList extends ProfileList
         $this->owner = $owner;
     }
 
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new SubscriptionListItem($profile, $this->owner, $this->action);
     }
index d17493e21d5a8cfd645cecbf57da84eea3304b94..bb288f8322f7c3e71b6b8109b2e4bbe3fc621fef 100644 (file)
@@ -39,7 +39,7 @@ if (!defined('STATUSNET')) {
  *
  * Converts a path into a set of parameters, and vice versa
  *
- * We used to use Net_URL_Mapper, so there's a wrapper class at Router, q.v.
+ * We used to use URLMapper, so there's a wrapper class at Router, q.v.
  *
  * NUM's vagaries are the main reason we have weirdnesses here.
  *
diff --git a/lib/urlshortenerplugin2.php b/lib/urlshortenerplugin2.php
new file mode 100644 (file)
index 0000000..cb11b12
--- /dev/null
@@ -0,0 +1,212 @@
+<?php
+error_reporting(E_ALL );
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Superclass(Version2) for plugins that do URL shortening
+ *
+ * PHP version >= 5.2
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Plugin
+ * @package  StatusNet
+ * @author   Craig Andrews <candrews@integralblue.com>
+ * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link     http://gnu.io
+ */
+define("STATUSNET", 1);
+if (!defined('STATUSNET') && !defined('LACONICA')) {
+    exit(1);
+}
+
+
+/**
+ * Class to handle Plugin exceptions
+ *
+ * @category Exception
+ * @package StatusNet
+ * @author   Craig Andrews <candrews@integralblue.com>
+ * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link     http://gnu.io
+ */
+class PluginErrorException extends Exception {
+    protected $severity=0;
+    /**
+     * Setup costumizable Exceptions
+     * @var array $HTML Codes for Exceptionlists(see PluginErrorException::getFull())
+     */
+    protected $HTML=array(
+    'code'=>array("start"=>'<code>', "end"=>'</code'),
+    'ulist'=>array("start"=>'<ul>',  "end"=>'</ul>' ),
+    'list'=>array("start"=>"<li>", "end"=>"</li>"));
+    /**
+     * Create specific extension for PluginExceptions
+     * @
+     */
+    public function __construct($message, $code, $severity, $filename, $lineno, $HTML='') {
+        $this->message = $message;
+        $this->code = $code;
+        $this->severity = $severity;
+        $this->file = $filename;
+        $this->line = $lineno;
+    }
+
+    public function getSeverity() {
+        return $this->severity;
+    }
+    public function printFull() {
+      echo "Catched Exception: <ul><br />";
+      echo "<li>Message: <code>".$this->getMessage()."</code></li>  ";
+      echo "<li>Code: <code>".$this->getCode()."</code></li>        ";
+      echo "<li>Line: <code>".$this->getLine()."</code></li>        ";
+      echo "<li>File: <code>".$this->getFile()."</code></li>        ";
+      echo "<li>Severity: <code>".$this->getSeverity()."</code></li>";
+      echo "</ul><p>Code: 0 means an uncatched Exception, triggered ";
+      echo "by PHP's parsing. This is probally an Syntax-Error.</p> ";
+    }
+}
+/* Do done some exceptionrelated things done, befor
+ * we can start coding the real.
+ */
+function exception_error_handler($errno, $errstr, $errfile, $errline ) {
+    throw new PluginErrorException($errstr, 0, $errno, $errfile, $errline);
+}
+
+/* the Exceptionhandler for Syntax-Errors, throwed by PHP itself */
+/**
+ * Superclass for plugins that perform a url shortening
+ *
+ * @category Plugin
+ * @package  StatusNet
+ * @author   Craig Andrews <candrews@integralblue.com>
+ * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link     http://darksider3.de/sn/urlshortenerplugin2.html
+ */
+
+abstract class UrlShortenerPlugin2
+{
+  public $shortenerName;
+  public $freeService = true;
+  /**
+  * Make an URL shorter.
+  *
+  * @param string $url URL to shorten
+  *
+  * @return string shortened version of the url/Null/Error
+  * @todo dont support old "shorten", name it to "shortUrl" to get well-named code.
+  */
+  protected abstract function shorten($url);
+
+
+  /**
+   * Utility to get the data at an URL
+   *
+   * @param     string $url             URL to fetch
+   * @exception PluginErrorExcpetion $e If HTTPClient throws an exception, print out.
+   * @return    string                  response body
+   * @todo throw an exception in HTTPClient and make the PluginErrorException more generally
+   *       so that we can use it more then ones, in every libfile.
+   */
+  protected function httpGet($url)
+  {
+    try
+    {
+      $request  = HTTPClient::start();
+      $response = $request->get($url);
+    } catch(PluginErrorException $e)
+    {
+      $e->printFull();
+      return false;
+    }
+    return $response->getBody();
+  }
+ /**
+  * Utility to post a request and get a response URL
+  *
+  * @param string $url  URL to fetch
+  * @param array  $data post parameters
+  *
+  * @return string response body
+  *
+  */
+  protected function httpPost($url, $data)
+  {
+    
+    $request  = HTTPClient::start();
+    $response = $request->post($url, null, $data);
+    return $response->getBody();
+  }
+  // Hook handlers
+
+  /**
+   * Called when all plugins have been initialized
+   *
+   * @return boolean hook value
+   */
+
+  function onInitializePlugin()
+  {
+    if (!isset($this->shortenerName))
+    {
+      throw new Exception("@Admin must specifiy $this->shortenerName");
+    }
+    return true;
+  }
+  /**
+   * Called when a showing the URL shortener drop-down box
+   *
+   * Properties of the shortening service currently only
+   * include whether it's a free service.
+   *
+   * @param array &$shorteners array mapping shortener name to properties
+   *
+   * @return boolean hook value
+   */
+  function onGetUrlShorteners(&$shorteners)
+  {
+    $shorteners[$this->shortenerName] =array('freeService' => $this->freeService);
+    return true;
+  }
+
+  /**
+   * Called to shorten an URL
+   *
+   * @param string $url           URL to shorten
+   * @param string $shortenerName Shortening service. Don't handle if it's
+   *                              not you!
+   * @param string &$shortenedUrl URL after shortening; out param.
+   *
+   * @return boolean hook value
+   */
+
+  function onStartShortenUrl($url, $shortenerName, &$shortenedUrl)
+  {
+    if ($shortenerName == $this->shortenerName)
+    {
+      $result = $this->shorten($url);
+      if (isset($result) && $result != null && $result !== false)
+      {
+        $shortenedUrl = $result;
+        //dont create an exception, so we can do that without.
+        common_log(LOG_INFO,
+                   __CLASS__ . ": $this->shortenerName ".
+                   "shortened $url to $shortenedUrl");
+        return false;
+      }
+    }
+    return true;
+  }
+}
+?>
index a32c35395eb91ba004f48d43b828110195d54159..b802f7b2a1800f85e6e3ce64da746f52e7ee195b 100644 (file)
@@ -322,7 +322,7 @@ function common_set_user($user)
         return false;
     }
 
-    if ($user) {
+    if ($user instanceof User) {
         if (Event::handle('StartSetUser', array(&$user))) {
             if (!empty($user)) {
                 if (!$user->hasRight(Right::WEBLOGIN)) {
@@ -539,7 +539,7 @@ function common_user_cache_hash($user=false)
     if ($user === false) {
         $user = common_current_user();
     }
-    if ($user) {
+    if ($user instanceof User) {
         return crc32($user->id . ':' . $user->nickname);
     } else {
         return '0';
@@ -2313,7 +2313,7 @@ function common_perf_counter($key, $val=null)
                 $_perfCounters[$key] = array($val);
             }
             if (common_config('site', 'logperf_detail')) {
-                common_log(LOG_DEBUG, "PERF COUNTER HIT: $key $val");
+                common_debug("PERF COUNTER HIT: $key $val");
             }
         }
     }
@@ -2327,14 +2327,14 @@ function common_log_perf_counters()
         if (isset($_startTime)) {
             $endTime = microtime(true);
             $diff = round(($endTime - $_startTime) * 1000);
-            common_log(LOG_DEBUG, "PERF runtime: ${diff}ms");
+            common_debug("PERF runtime: ${diff}ms");
         }
         $counters = $_perfCounters;
         ksort($counters);
         foreach ($counters as $key => $values) {
             $count = count($values);
             $unique = count(array_unique($values));
-            common_log(LOG_DEBUG, "PERF COUNTER: $key $count ($unique unique)");
+            common_debug("PERF COUNTER: $key $count ($unique unique)");
         }
     }
 }
index 284a658239c09ad584c7dbc0da24b5e8100f980b..8f2659d8e15bf377848b362ca09f991440dd114d 100644 (file)
@@ -102,7 +102,7 @@ class APCPlugin extends Plugin
         return false;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'APC',
                             'version' => GNUSOCIAL_VERSION,
index c4edce74e85ba5dbc07ee6c441d7a03067c43e00..768f71510f24c334752c9e223042eaf8008dd50e 100644 (file)
@@ -87,7 +87,7 @@ class AccountManagerPlugin extends Plugin
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'AccountManager',
                             'version' => GNUSOCIAL_VERSION,
index 955779b4ee6477bdea4ba4fcaea58c237a381d9f..c3c7c5955b44234a0a7a98562a7765f924365ca9 100644 (file)
@@ -49,7 +49,7 @@ class AccountManagementControlDocumentAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 9eeff72402658bafdc365596b1e17e79715c76a3..b61fa59719f067abbf4f539e89d824e261cd6a66 100644 (file)
@@ -49,7 +49,7 @@ class AccountManagementSessionStatusAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 0d8508e06d9cf5bbc1427cf188b60377ac3e9049..5144eb46662f3f86a4c1c25969b008aef3da4c99 100644 (file)
@@ -339,7 +339,7 @@ class ActivityPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Activity',
                             'version' => self::VERSION,
index a3974b3a7879a46d2103388e3236336537d6040b..ae4bf9a7fbbd1c57fbaf61e6158abb518c9cf7c8 100644 (file)
@@ -191,7 +191,7 @@ class ActivitySpamPlugin extends Plugin
         return true;
     }
 
-    function onEndShowStyles($action)
+    function onEndShowStyles(Action $action)
     {
         $action->element('style', null,
                          '.form-train-spam input.submit { background: url('.$this->path('icons/bullet_black.png').') no-repeat 0px 0px } ' . "\n" .
@@ -215,7 +215,7 @@ class ActivitySpamPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'ActivitySpam',
                             'version' => GNUSOCIAL_VERSION,
index a66b73a8294db0a1495d1560d56c6d3d08520af8..667b0a3612ad6a9fbf9aa6c3f25fde4214cf5d60 100644 (file)
@@ -154,11 +154,9 @@ class SpamAction extends Action
      * MAY override
      *
      * @param array $args other arguments
-     *
      * @return boolean is read only action?
      */
-
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 3a5e585fd5218c4296678459990c37f3569f3981..4e710d10a7bac3735dbcef765fd442947eae4ebc 100644 (file)
@@ -31,7 +31,7 @@ Users who post a lot of spam get silenced
   -a --all      All users
 END_OF_SILENCESPAMMER_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function testAllUsers($filter, $minimum, $percent) {
     $found = false;
index 0eee9324bf289bedf2992d31370b964e00592fdf..af3cc5b47a67ca18438e13fa1b605a9ed9e0858e 100644 (file)
@@ -31,7 +31,7 @@ Test user activities against the spam filter
   -a --all      All users
 END_OF_TESTUSER_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function testAllUsers($filter) {
     $found = false;
index 974048b4c911211e63c9975031490344372d1460..a0d60b9a7b96943a44bd18ae843526e5da9bc65f 100644 (file)
@@ -32,7 +32,7 @@ Train user activities against the spam filter
 
 END_OF_TRAINUSER_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function trainUser($filter, $user, $category) {
 
index 742e7bf3666ffd9619567c330a19fab9f6de2ba3..80d90facaadb5d1691073d9e3eefddf1febb7237 100644 (file)
@@ -166,7 +166,7 @@ class AdsensePlugin extends UAPPlugin
         $action->script($this->adScript);
     }
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('panel/adsense',
                     array('action' => 'adsenseadminpanel'));
@@ -174,7 +174,7 @@ class AdsensePlugin extends UAPPlugin
         return true;
     }
 
-    function onEndAdminPanelNav($menu) {
+    function onEndAdminPanelNav(Menu $menu) {
         if (AdminPanelAction::canAdmin('adsense')) {
             // TRANS: Menu item title/tooltip
             $menu_title = _m('AdSense configuration');
@@ -185,7 +185,7 @@ class AdsensePlugin extends UAPPlugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'BlankAdPlugin',
                             'version' => GNUSOCIAL_VERSION,
index 034c40fa843ddbf3dcdd1d8c8cc099978343a006..1a90861e529aa5254d1b76e0432ba181a02f0c2c 100644 (file)
@@ -151,7 +151,7 @@ class AimPlugin extends ImPlugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'AIM',
                             'version' => GNUSOCIAL_VERSION,
index 619a9ad0a7946618bb2a835236340ed1bd7cbc7e..dab41755b3bec30ab3d6ac81ce8fefa23bf4144b 100644 (file)
@@ -63,7 +63,7 @@ class AimManager extends ImManager
      */
     public function handleInput($socket)
     {
-        common_log(LOG_DEBUG, "Servicing the AIM queue.");
+        common_debug("Servicing the AIM queue.");
         $this->stats('aim_process');
         $this->conn->receive();
     }
index c817578ec222f570cb222bcd5aff45d3bde9ba24..c00e0ecb509b17aa3bc5ff239f1b2fb7dd719eb4 100644 (file)
@@ -62,7 +62,7 @@ class AnonymousFavePlugin extends Plugin
     // that anonymous faving is allowed for all users.
     public $restricted = array();
 
-    function onArgsInitialize() {
+    function onArgsInitialize(array &$args) {
         // We always want a session because we're tracking anon users
         common_ensure_session();
     }
@@ -85,7 +85,7 @@ class AnonymousFavePlugin extends Plugin
         return true;
     }
 
-    function onEndShowHTML($action)
+    function onEndShowHTML(Action $action)
     {
         if (!common_logged_in()) {
             // Set a place to return to when submitting forms
@@ -93,7 +93,7 @@ class AnonymousFavePlugin extends Plugin
         }
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         // Setup ajax calls for favoriting. Usually this is only done when
         // a user is logged in.
@@ -271,7 +271,7 @@ class AnonymousFavePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:AnonymousFave';
 
index 6b0fae82c1584a58a621ab2cc831afa414f6f1db..1e42ca652bef22ca4763976cf0ec3d7308876ecd 100644 (file)
@@ -47,7 +47,7 @@ class AnonDisfavorAction extends RedirectingAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 4029154d7208b804409fce2b41d293848ea61bf2..eacd7753310f4753d1f0607b44ea6015e397f3a9 100644 (file)
@@ -47,7 +47,7 @@ class AnonFavorAction extends RedirectingAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index a955620db57b3efa636bbdc62b39df7028a3e477..e0d0213d8f440b2dd8192a650f8fce52b6adad1d 100755 (executable)
@@ -27,7 +27,7 @@ Offline script to initialize notice fave tallys
 
 ENDOFHELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $notice = new Notice();
 $notice->find();
index ba09e35f24a5d5cd4dcc23c712be25aa5bdf5765..0db34fd5aa1283334f3049ea2522945456db1689 100644 (file)
@@ -32,7 +32,7 @@ class ApiLoggerPlugin extends Plugin
     // 0.1 will check about 10% of hits, etc.
     public $frequency = 1.0;
 
-    function onArgsInitialize($args)
+    function onArgsInitialize(array &$args)
     {
         if (isset($args['action'])) {
             $action = strtolower($args['action']);
@@ -75,7 +75,7 @@ class ApiLoggerPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'ApiLogger',
                             'version' => GNUSOCIAL_VERSION,
index 5e9d9835077dbe3c05fb39c2a605795c70387015..5fbbfb512446bfed689d273d167ef9113b93c56e 100644 (file)
@@ -146,7 +146,7 @@ class AuthCryptPlugin extends AuthenticationPlugin
         return true;
     }
 
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'AuthCrypt',
                             'version' => GNUSOCIAL_VERSION,
index bffb84057297c3102c8aa1e3ae748b6c759650b1..e914977cc90cf61e9ee7cf2de450950211980d77 100644 (file)
@@ -56,7 +56,7 @@ class AutoSandboxPlugin extends Plugin
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'AutoSandbox',
                             'version' => GNUSOCIAL_VERSION,
index ff56b60fc463cb210f1c4e83f90cf0cc440e2106..0d3fdfc91dceab86f73c52ff39bddd96aef8021a 100644 (file)
@@ -39,7 +39,7 @@ class AutocompletePlugin extends Plugin
         parent::__construct();
     }
 
-    function onEndShowScripts($action){
+    function onEndShowScripts(Action $action){
         if (common_logged_in()) {
             $action->element('span', array('id' => 'autocomplete-api',
                                            'data-url' => common_local_url('autocomplete')));
@@ -47,12 +47,12 @@ class AutocompletePlugin extends Plugin
         }
     }
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('main/autocomplete/suggest', array('action'=>'autocomplete'));
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Autocomplete',
                             'version' => GNUSOCIAL_VERSION,
index 6c8775d65a7946bf74f688637d61ffee4924aa18..db2d7b0152f54a4aa6d54de1257372184df5dd81 100644 (file)
@@ -173,7 +173,7 @@ class AutocompleteAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 55a596b5694e7f9bd2fb1e11b739e6fdc13bd2cd..ca3b281df681c80ebb288f01d070c39bbb674607 100644 (file)
@@ -44,7 +44,7 @@ class AwesomenessPlugin extends Plugin
 {
     const VERSION = '0.0.42';
 
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array(
             'name' => 'Awesomeness',
index d4d56c1be2bf5970a9a5d3e79e1e78610ff4f062..3b6474dd86dd50b65d1a311039f1b546d3e61046 100644 (file)
@@ -145,7 +145,7 @@ class BitlyUrlPlugin extends UrlShortenerPlugin
                return null;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => sprintf('BitlyUrl (%s)', $this->shortenerName),
                             'version' => GNUSOCIAL_VERSION,
@@ -188,7 +188,7 @@ class BitlyUrlPlugin extends UrlShortenerPlugin
     /**
      * Add the bit.ly admin panel to the list...
      */
-    function onEndAdminPanelNav($nav)
+    function onEndAdminPanelNav(Menu $nav)
     {
         if (AdminPanelAction::canAdmin('bitly')) {
             $action_name = $nav->action->trimmed('action');
index fc26cd77c631e63a21351005408a1555e133a2cd..c223049781041ea00059d53e551d9a7bd6392edd 100644 (file)
@@ -291,7 +291,7 @@ class BlacklistPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Blacklist',
                             'version' => self::VERSION,
@@ -330,7 +330,7 @@ class BlacklistPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndAdminPanelNav($nav)
+    function onEndAdminPanelNav(Menu $nav)
     {
         if (AdminPanelAction::canAdmin('blacklist')) {
 
@@ -348,7 +348,7 @@ class BlacklistPlugin extends Plugin
         return true;
     }
 
-    function onEndDeleteUserForm($action, $user)
+    function onEndDeleteUserForm(Action $action, User $user)
     {
         $cur = common_current_user();
 
@@ -386,7 +386,7 @@ class BlacklistPlugin extends Plugin
         $action->elementEnd('ul');
     }
 
-    function onEndDeleteUser($action, $user)
+    function onEndDeleteUser(Action $action, User $user)
     {
         if ($action->boolean('blacklisthomepage')) {
             $pattern = $action->trimmed('blacklisthomepagepattern');
@@ -401,7 +401,7 @@ class BlacklistPlugin extends Plugin
         return true;
     }
 
-    function checkboxAndText($action, $checkID, $label, $textID, $value)
+    private function checkboxAndText(Action $action, $checkID, $label, $textID, $value)
     {
         $action->element('input', array('name' => $checkID,
                                         'type' => 'checkbox',
index 49f70e68a4e8fb4ea3aee7912b1e6e9ef29aafa0..b5cd968c7fc7b2e065fdd7a4752ba8696f03c0c3 100644 (file)
@@ -117,7 +117,7 @@ class BlankAdPlugin extends UAPPlugin
                          '');
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'BlankAd',
                             'version' => GNUSOCIAL_VERSION,
index 8d5532b8b17c508c1cce18f1960c20aaf07e7a9c..723146221c13ebe561382e56385dc221f7580d99 100644 (file)
@@ -91,7 +91,7 @@ class BlogPlugin extends MicroAppPlugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Blog',
                             'version' => GNUSOCIAL_VERSION,
@@ -111,7 +111,7 @@ class BlogPlugin extends MicroAppPlugin
 
     function tag()
     {
-        return 'blog';
+        return 'blogentry';
     }
 
     function types()
@@ -189,7 +189,7 @@ class BlogPlugin extends MicroAppPlugin
         return null;
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $action->script(common_path('plugins/TinyMCE/js/jquery.tinymce.js'));
         $action->inlineScript('var _tinymce_path = "'.common_path('plugins/TinyMCE/js/tiny_mce.js').'";'."\n".
index f4de0d6c8868d5ad77a75b71383be6b61fe98ad6..2cab69be30e03672b33dd1aab8926baf0d69fdb7 100644 (file)
@@ -148,7 +148,7 @@ class BlogspamNetPlugin extends Plugin
         return BLOGSPAMNETPLUGIN_VERSION;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'BlogspamNet',
                             'version' => BLOGSPAMNETPLUGIN_VERSION,
index 2426deb93f5658dc538dcacab602b5f17316f766..47663271aa4864938c84724cc267de629f57adfa 100644 (file)
@@ -94,13 +94,13 @@ class BookmarkPlugin extends MicroAppPlugin
      *
      * @return boolean hook value
      */
-    function onEndShowStyles($action)
+    function onEndShowStyles(Action $action)
     {
         $action->cssLink($this->path('css/bookmark.css'));
         return true;
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $action->script($this->path('js/bookmark.js'));
         return true;
@@ -167,7 +167,7 @@ class BookmarkPlugin extends MicroAppPlugin
      *
      * @return boolean hook value
      */
-    function onEndInitializeQueueManager($qm)
+    function onEndInitializeQueueManager(QueueManager $qm)
     {
         $qm->connect('dlcsback', 'DeliciousBackupImporter');
         $qm->connect('dlcsbkmk', 'DeliciousBookmarkImporter');
@@ -181,7 +181,7 @@ class BookmarkPlugin extends MicroAppPlugin
      *
      * @return value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Bookmark',
                             'version' => self::VERSION,
index ee43617127630e4859cf2bce4229063f19db424f..ac65722480e8166de9ecdcce05059f2ce48d892c 100644 (file)
@@ -57,7 +57,7 @@ class ApiTimelineBookmarksAction extends ApiBareAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -82,7 +82,7 @@ class ApiTimelineBookmarksAction extends ApiBareAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showTimeline();
@@ -207,7 +207,7 @@ class ApiTimelineBookmarksAction extends ApiBareAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index c4cc4a8487cd81ed8c00f73036ca1b24c9d527ed..9fc0166b08b8661167c1f13be624d1e7d2a3e72e 100644 (file)
@@ -59,7 +59,7 @@ class BookmarkforurlAction extends Action
      *
      * @return boolean true
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -103,11 +103,9 @@ class BookmarkforurlAction extends Action
      * Handler method
      *
      * @param array $args is ignored since it's now passed in in prepare()
-     *
      * @return void
      */
-
-    function handle($args=null)
+    function handle(array $args=array())
     {
         $this->startHTML('text/xml;charset=utf-8');
         $this->elementStart('head');
@@ -126,11 +124,9 @@ class BookmarkforurlAction extends Action
      * MAY override
      *
      * @param array $args other arguments
-     *
      * @return boolean is read only action?
      */
-
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index 6c79fa1d024ecdacac30111a3780964f1455974e..65a61a0bfb474c1e9f29abfccfbc8ee63f42f478 100644 (file)
@@ -60,7 +60,7 @@ class BookmarksAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -74,7 +74,7 @@ class BookmarksAction extends Action
             $nickname = $this->returnToArgs();
             $nickname = $nickname[1]['nickname'];
         }
-        
+
         $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
@@ -107,7 +107,7 @@ class BookmarksAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -223,7 +223,7 @@ class BookmarksAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index fc3331482f9538b752d6d20818f47ad079c433fe..0f8320de0158eae2ca4a5e0532b305c0f060ba90 100644 (file)
@@ -61,8 +61,8 @@ class BookmarksrssAction extends Rss10Action
      *
      * @return boolean success
      */
-    function prepare($args)
-    {        
+    function prepare(array $args=array())
+    {
         parent::prepare($args);
 
         $nickname   = $this->trimmed('nickname');
index 85a63e847063645f87abf69c4157e335d6b9e35a..149e8073432fa6503325c353c47c3440b3a602af 100644 (file)
@@ -245,7 +245,7 @@ class ImportdeliciousAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return !$this->isPost();
     }
index bc043f41ed51e01eafdde5878efde1fb4e07f4ae..c3987a28b8dfa730c07d60e642680a222c330e94 100644 (file)
@@ -229,7 +229,7 @@ class NewbookmarkAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index d5f9940805ef74b1689add1540b121de163044a7..e0eb61a05e6eafc207cb21d9fb426d4284b8132a 100644 (file)
@@ -142,7 +142,7 @@ class NoticebyurlAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index c47a042973724f9b70ab008e87aee61757b4fe4a..af7dd2d1e06456b67e276e3c3a9eea1d9a394111 100644 (file)
@@ -42,7 +42,7 @@ Restore a backed-up Delicious.com bookmark file
 -f --file     file to read from (STDIN by default)
 END_OF_IMPORTBOOKMARKS_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 /**
  * Get the bookmarks file as a string
index e722972bfce6dfe7251e69d83b3f244819c5ef78..5c1b57e0e6f36eb2db34983b8c7bb85a3e14cae5 100644 (file)
@@ -96,7 +96,7 @@ class CacheLogPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'CacheLog',
                             'version' => GNUSOCIAL_VERSION,
index 2f17492a8e2dd4c35356a954272eabc40644c6aa..7f467173b0766616d5f3d53575a8ca2520c42e77 100644 (file)
@@ -60,7 +60,7 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
         return parent::onAutoload($cls);
     }
 
-    function onArgsInitialize(&$args)
+    function onArgsInitialize(array &$args)
     {
         if($this->takeOverLogin && $args['action'] == 'login')
         {
@@ -147,7 +147,7 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
         $casSettings['takeOverLogin']=$this->takeOverLogin;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'CAS Authentication',
                             'version' => GNUSOCIAL_VERSION,
index 09377c62ebb8b763a6584dcb19a293d95f1dcedb..96e252b824c8bb1205b5ef74a52fa783b6953087 100644 (file)
@@ -21,7 +21,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
 class CasloginAction extends Action
 {
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (common_is_real_login()) {
index 0c2c9b76cc3aac751c3a8e22418a518abdcab108..9dd3b1f5152157f2b94a2b8acdf2c103edbb94f6 100644 (file)
@@ -38,7 +38,7 @@ class ClientSideShortenPlugin extends Plugin
         parent::__construct();
     }
 
-    function onEndShowScripts($action){
+    function onEndShowScripts(Action $action){
         if (common_logged_in()) {
             $user = common_current_user();
             $action->inlineScript('var maxNoticeLength = ' . User_urlshortener_prefs::maxNoticeLength($user));
@@ -47,14 +47,14 @@ class ClientSideShortenPlugin extends Plugin
         }
     }
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         if (common_logged_in()) {
             $m->connect('plugins/ClientSideShorten/shorten', array('action'=>'shorten'));
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Shorten',
                             'version' => GNUSOCIAL_VERSION,
index 6840d532aab720d4d21d2bdbf47431d9ccc3383f..376e245fc7f35b580e61ec28d45dc64addeeefc4 100644 (file)
@@ -45,7 +45,7 @@ class ShortenAction extends Action
 {
     private $text;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->groups=array();
@@ -58,7 +58,7 @@ class ShortenAction extends Action
         return true;
     }
 
-    function handle($args=null)
+    function handle(array $args=array())
     {
         parent::handle($args);
         header('Content-Type: text/plain');
index d669626a67d30611d976782fbb15f666a67e77e8..5b38b2ae11dfaf731bebd9e8d3e4ea8d51e827f8 100644 (file)
@@ -104,7 +104,7 @@ class CometPlugin extends RealtimePlugin
         return '/' . implode('/', $path);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Comet',
                             'version' => GNUSOCIAL_VERSION,
index 144902fce2316775a08b527467835f4fc2ae835d..ff39b3e4f4487ad97ecc2a5bc018f62f4e0017bd 100644 (file)
@@ -140,7 +140,7 @@ class ConversationTree extends NoticeList
      *
      * @return NoticeListItem a list item to show
      */
-    function newListItem($notice)
+    function newListItem(Notice $notice)
     {
         return new ConversationTreeItem($notice, $this->out);
     }
index fb12000c4665e76514bdbed4eb75eff29f74e411..d8e52a141fd11aad77904e073913edae30bfcd32 100644 (file)
@@ -45,7 +45,7 @@ class CronishPlugin extends Plugin {
         return true;
     }
 
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Cronish',
                             'version' => GNUSOCIAL_VERSION,
index de13ef680fa3cee7865ad5912519131794d77981..34533ba9e82cf5406c960aeb484168ca60d91c2e 100644 (file)
@@ -149,7 +149,7 @@ class DirectMessagePlugin extends Plugin
         return true;
     }
 
-    public function onProfileDeleteRelated(Profile $profile, &$related)
+    public function onProfileDeleteRelated(Profile $profile, array &$related)
     {
         $msg = new Message();
         $msg->from_profile = $profile->id;
index c18559f49daaf1a4419e7ff53923c1b9e11f99cb..294f600deff3467c751e0cbdda5cf9370af9b5e6 100644 (file)
@@ -62,7 +62,7 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -123,7 +123,7 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showMessages();
@@ -199,7 +199,7 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 86fbee8b73f95c303ac21f477da1a474d997b00c..0987ee3aa76d7d0f799c76ed9c2e4ec6bf4610a3 100644 (file)
@@ -62,7 +62,7 @@ class ShowmessageAction extends Action
      *
      * @return success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -89,7 +89,7 @@ class ShowmessageAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         $this->showPage();
     }
@@ -124,7 +124,7 @@ class ShowmessageAction extends Action
         $this->elementEnd('ul');
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 3818a38f48ffcc6dfee7635036644866cf160685..bd568b6209f136501273db1aadfe36ec806db013 100644 (file)
@@ -83,12 +83,14 @@ class Message extends Managed_DataObject
 
         $msg->from_profile = $from;
         $msg->to_profile = $to;
-        if ($user) {
+
+        if ($user instanceof User) {
             // Use the sender's URL shortening options.
             $msg->content = $user->shortenLinks($content);
         } else {
             $msg->content = common_shorten_links($content);
         }
+
         $msg->rendered = common_render_text($msg->content);
         $msg->created = common_sql_now();
         $msg->source = $source;
index 3c7281e9852121d2b948b39eac803d092058e313..bc5ff76661a67925f47538d52cdcbcc0362effc3 100644 (file)
@@ -46,7 +46,7 @@ class MailboxAction extends Action
 {
     var $page = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -70,7 +70,7 @@ class MailboxAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -154,7 +154,7 @@ class MailboxAction extends Action
      *
      * @return boolean
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
          return true;
     }
index 890af068073321373e4f10dde075afd608641073..289196b4a9627a6d60e5176895b2bfae73a79ae7 100644 (file)
@@ -118,7 +118,7 @@ class DirectionDetectorPlugin extends Plugin {
      *
      * @param Action $action
      */
-    function onEndShowScripts($action){
+    function onEndShowScripts(Action $action){
         if (common_logged_in()) {
             $action->script($this->path('jquery.DirectionDetector.js'));
         }
@@ -244,7 +244,7 @@ class DirectionDetectorPlugin extends Plugin {
     /**
      * plugin details
      */
-    function onPluginVersion(&$versions){
+    function onPluginVersion(array &$versions){
         $url = 'http://status.net/wiki/Plugin:DirectionDetector';
 
         $versions[] = array(
index 7ac0f9326588684d1dc61b9d383f7db513f7251c..bb4101139f15e9de459876c1b88591aa980a2fc5 100644 (file)
@@ -82,37 +82,36 @@ class DirectoryPlugin extends Plugin
         $m->connect(
             'directory/users/:filter/sort_by/:sort/reverse/:reverse',
             array('action' => 'userdirectory'),
-            array('filter' => '[0-9a-zA-Z]|(0-9)'),            
+            array('filter' => '[0-9a-zA-Z]|(0-9)'),
             array('sort' => '[a-z]+'),
-            array('reverse' => '[0-9]')                        
+            array('reverse' => '[0-9]')
         );
 
         $m->connect(
             'directory/users/:filter/sort_by/:sort',
             array('action' => 'userdirectory'),
-            array('filter' => '[0-9a-zA-Z]|(0-9)'),            
-            array('sort' => '[a-z]+')            
-        );  
-
+            array('filter' => '[0-9a-zA-Z]|(0-9)'),
+            array('sort' => '[a-z]+')
+        );
 
         $m->connect(
             'directory/users/:filter',
             array('action' => 'userdirectory'),
             array('filter' => '[0-9a-zA-Z]|(0-9)')
         );
-        
+
         $m->connect(
             'directory/users/sort_by/:sort/reverse/:reverse',
             array('action' => 'userdirectory'),
             array('sort' => '[a-z]+'),
-            array('reverse' => '[0-9]')                        
+            array('reverse' => '[0-9]')
         );
 
         $m->connect(
             'directory/users/sort_by/:sort',
             array('action' => 'userdirectory'),
-            array('sort' => '[a-z]+')            
-        );        
+            array('sort' => '[a-z]+')
+        );
 
         $m->connect(
             'directory/users',
@@ -135,7 +134,6 @@ class DirectoryPlugin extends Plugin
             array('action' => 'groupdirectory')
         );
 
-
         return true;
     }
 
@@ -251,7 +249,7 @@ class DirectoryPlugin extends Plugin
     /*
      * Version info
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array(
             'name' => 'Directory',
index 5e532fc214202cd909717be1cae84d09aadde98b..a4bd1f55e83c6c2aebb264ae12858bd319595fe8 100644 (file)
@@ -133,7 +133,7 @@ class GroupdirectoryAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -145,7 +145,7 @@ class GroupdirectoryAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -169,7 +169,7 @@ class GroupdirectoryAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
index 77ffb5206b22ee24d33930cdd1050110e2ec43ed..24bdd5c9fa848e7eddadc6d16bea206d81806ff6 100644 (file)
@@ -132,7 +132,7 @@ class UserdirectoryAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -144,7 +144,7 @@ class UserdirectoryAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -168,7 +168,7 @@ class UserdirectoryAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
index 7474d0daa608f9cfa9a037a8da1b4f71bf11e13a..756b078416f87ee40e2e03f40ffe6a137f0e7046 100644 (file)
@@ -119,7 +119,7 @@ class SortableGroupList extends SortableSubscriptionList
         $this->out->elementStart('tbody');
     }
 
-    function newListItem($profile, $odd)
+    function newListItem(Profile $profile, $odd)
     {
         return new SortableGroupListItem($profile, $this->owner, $this->action, $odd);
     }
@@ -251,8 +251,8 @@ class SortableGroupListItem extends SortableSubscriptionListItem
     function showJoinButton()
     {
         $user = $this->owner;
-        if ($user) {
 
+        if ($user instanceof User) {
             $this->out->elementStart('li', 'entity_subscribe');
             // XXX: special-case for user looking at own
             // subscriptions page
index 75c42a5fdfc06fd254d6aca69b482295d0822dcc..7e9c3103583767ab350717d36407e2df1d913b1d 100644 (file)
@@ -151,7 +151,7 @@ class SortableSubscriptionList extends SubscriptionList
         return $cnt;
     }
 
-    function newListItem($profile, $odd)
+    function newListItem(Profile $profile, $odd)
     {
         return new SortableSubscriptionListItem($profile, $this->owner, $this->action, $odd);
     }
index 5d23d45f590f2f3fda92e063c35794b6034cb067..967990c12fae0afcda1df95b19db2b2dc0fc2c7f 100644 (file)
@@ -161,7 +161,7 @@ class DiskCachePlugin extends Plugin
         return false;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'DiskCache',
                             'version' => GNUSOCIAL_VERSION,
index 0d0f74427722841a6045e7988b5c24d308ae2de5..6fc14e68e5736b820055c136025477ad24432e69 100644 (file)
@@ -124,7 +124,7 @@ class DomainStatusNetworkPlugin extends Plugin
         return true;
     }
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         if (common_config('globalapi', 'enabled')) {
             foreach (array('register', 'login', 'recover') as $method) {
@@ -190,7 +190,7 @@ class DomainStatusNetworkPlugin extends Plugin
         return null;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'DomainStatusNetwork',
                             'version' => GNUSOCIAL_VERSION,
index cd0c7f9526232549e9e8076940abb621df44ca82..faf38378ecbb73f00bf968f67daac65e214410e2 100644 (file)
@@ -57,7 +57,7 @@ class GlobalApiAction extends Action
      * @return boolean continuation flag
      */
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         StatusNet::setApi(true); // reduce exception reports to aid in debugging
 
index f773094a74c426e9ccc023b43468d08e5a61cef2..1815b977596fe267ce731a1bf59a1de7b16a4040 100644 (file)
@@ -35,7 +35,7 @@ Create a new account and, if necessary, a new network for the given email addres
 
 END_OF_INSTALLFOREMAIL_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $email = $args[0];
 
index 96a722fdab775767ae943be3483be888905789eb..28741a5d4fb94a6cca6630d26c525e038e94ba8a 100644 (file)
@@ -28,7 +28,7 @@ Prints site information for the domain given
 
 END_OF_SITEFORDOMAIN_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $domain   = DomainStatusNetworkPlugin::toDomain($args[0]);
 
index 59412ccebab6929169091d7ccddae77aa837d6b4..2eaa600d2598009bffb075811eaabbbc133fe8b6 100644 (file)
@@ -28,7 +28,7 @@ Prints site information for the domain given
 
 END_OF_SITEFORDOMAIN_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $domain = DomainStatusNetworkPlugin::toDomain($args[0]);
 
index 20073a07c409a1a3af67727fb10ca3fa5f5105bb..2e15dd809a2c521974002006b39ae00603a9598a 100644 (file)
@@ -267,7 +267,7 @@ class DomainWhitelistPlugin extends Plugin
        return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'DomainWhitelist',
                             'version' => GNUSOCIAL_VERSION,
index a17748fe3208d66286ddaa4de44f25fb161966a1..524f1a6411f5732be01086d58fee466c2a93ca50 100644 (file)
@@ -49,7 +49,7 @@ class EmailAuthenticationPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Email Authentication',
                             'version' => GNUSOCIAL_VERSION,
index 741f24305b9cdd6bdec67c88f592020fd3c363b0..77ac763bd030df7a2a942afef7ec97c457dca1c6 100644 (file)
@@ -49,7 +49,7 @@ class EmailRegistrationPlugin extends Plugin
 {
     const CONFIRMTYPE = 'register';
 
-    function onArgsInitialize(&$args)
+    function onArgsInitialize(array &$args)
     {
         if (array_key_exists('action', $args) && $args['action'] == 'register') {
             // YOINK!
@@ -72,7 +72,7 @@ class EmailRegistrationPlugin extends Plugin
         $dir = dirname(__FILE__);
 
         // @todo FIXME: i18n issue.
-        $docFile = DocFile::forTitle($title, $dir.'/doc-src/');
+        $docFile = DocFile::forTitle($title, array($dir . '/doc-src/'));
 
         if (!empty($docFile)) {
             $output = $docFile->toHTML();
@@ -163,7 +163,7 @@ class EmailRegistrationPlugin extends Plugin
         mail_send($recipients, $headers, $body);
     }
 
-    function onEndDocFileForTitle($title, $paths, &$filename)
+    function onEndDocFileForTitle($title, array $paths, &$filename)
     {
         if ($title == 'confirmemailreg' && empty($filename)) {
             $filename = dirname(__FILE__).'/mail-src/'.$title;
@@ -172,7 +172,7 @@ class EmailRegistrationPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'EmailRegistration',
                             'version' => GNUSOCIAL_VERSION,
index aa7f4d6ab6fc145ca1f29c6eeb6d63fa80180d5f..3ad9c63f13ee814fc0ce3fd72105be94c25b909e 100644 (file)
@@ -394,7 +394,7 @@ class EmailregisterAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index d834aade600abdb032570d35fb9dc1f9b7bf5b36..7ae81f7ccf8f48ead06666ce58052fa3c03817fc 100644 (file)
@@ -33,7 +33,7 @@ Cancel an email registration code
 
 END_OF_REGISTEREMAILUSER_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 if (count($args) == 0) {
     show_help();
index 02915240d32d2e57b3abbff7f280e6dfd9256921..a785a76a6649080aefba71cc0323ed8172971292 100644 (file)
@@ -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 51950542b2b93a0487f089c3e02936048616f4f3..9ba3d125e11b0281279ab3a83d2fdffb7c34e27c 100644 (file)
@@ -68,7 +68,7 @@ class EmailReminderPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndInitializeQueueManager($qm)
+    function onEndInitializeQueueManager(QueueManager $qm)
     {
         $qm->connect('siterem', 'SiteConfirmReminderHandler');
         $qm->connect('uregrem', 'UserConfirmRegReminderHandler');
@@ -77,7 +77,7 @@ class EmailReminderPlugin extends Plugin
         return true;
     }
 
-    function onEndDocFileForTitle($title, $paths, &$filename)
+    function onEndDocFileForTitle($title, array $paths, &$filename)
     {
         if (empty($filename)) {
             $filename = dirname(__FILE__) . '/mail-src/' . $title;
@@ -127,6 +127,7 @@ class EmailReminderPlugin extends Plugin
      * Send a real live email reminder
      *
      * @todo This would probably be better as two or more sep functions
+     * @todo Add language support?
      *
      * @param string $type      type of reminder
      * @param mixed  $object    Confirm_address or Invitation object
@@ -179,7 +180,7 @@ class EmailReminderPlugin extends Plugin
      * @param type $versions
      * @return type
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array(
             'name'           => 'EmailReminder',
index 2cc214a671c04e11bd874563099e3f0f0029e59d..707bb4090782059375d77a612e3f8efda424972f 100644 (file)
@@ -35,7 +35,7 @@ Send an email summary of the inbox to users
 
 END_OF_SENDEMAILREMINDER_HELP;
 
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
 
 $quiet = have_option('q', 'quiet');
 
index da682e0454e2834054ff298bb95ed894a5d278a5..e00617ee3d44c464411be52f23e96fbb7a4576cc 100644 (file)
@@ -66,7 +66,7 @@ class EmailSummaryPlugin extends Plugin
      *
      * @return boolean hook value; true means continue processing, false means stop.
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'EmailSummary',
                             'version' => GNUSOCIAL_VERSION,
@@ -85,7 +85,7 @@ class EmailSummaryPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndInitializeQueueManager($qm)
+    function onEndInitializeQueueManager(QueueManager $qm)
     {
         $qm->connect('sitesum', 'SiteEmailSummaryHandler');
         $qm->connect('usersum', 'UserEmailSummaryHandler');
index 06a5327f619560e7d65cc2cd473dfdb11509af59..5ee5596e58564d550fb9ebd26c3cb17925f12150 100644 (file)
@@ -33,7 +33,7 @@ Send an email summary of the inbox to users
 
 END_OF_SENDEMAILSUMMARY_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 if (have_option('u', 'universe')) {
     $sn = new Status_network();
index 8d661bbd8525d62e49a2217dfaacb4c92225e561..3afab5f13b1afaf0c2e34bc32dd71eedd88dfe3b 100644 (file)
@@ -90,7 +90,7 @@ class EventPlugin extends MicroAppPlugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Event',
                             'version' => GNUSOCIAL_VERSION,
@@ -274,29 +274,29 @@ class EventPlugin extends MicroAppPlugin
     {
         switch ($notice->object_type) {
         case Happening::OBJECT_TYPE:
-            common_log(LOG_DEBUG, "Deleting event from notice...");
+            common_debug("Deleting event from notice...");
             $happening = Happening::fromNotice($notice);
             $happening->delete();
             break;
         case RSVP::POSITIVE:
         case RSVP::NEGATIVE:
         case RSVP::POSSIBLE:
-            common_log(LOG_DEBUG, "Deleting rsvp from notice...");
+            common_debug("Deleting rsvp from notice...");
             $rsvp = RSVP::fromNotice($notice);
-            common_log(LOG_DEBUG, "to delete: $rsvp->id");
+            common_debug("to delete: $rsvp->id");
             $rsvp->delete();
             break;
         default:
-            common_log(LOG_DEBUG, "Not deleting related, wtf...");
+            common_debug("Not deleting related, wtf...");
         }
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $action->script($this->path('js/event.js'));
     }
 
-    function onEndShowStyles($action)
+    function onEndShowStyles(Action $action)
     {
         $action->cssLink($this->path('css/event.css'));
         return true;
index 1a30e86a1e8e87eb0d51ef380f2895d5b094ff2c..1669226523d04f03e1ec324130d6c18b2b717ee1 100644 (file)
@@ -137,10 +137,10 @@ class CancelrsvpAction extends Action
             $notice = $this->rsvp->getNotice();
             // NB: this will delete the rsvp, too
             if (!empty($notice)) {
-                common_log(LOG_DEBUG, "Deleting notice...");
+                common_debug("Deleting notice...");
                 $notice->delete();
             } else {
-                common_log(LOG_DEBUG, "Deleting RSVP alone...");
+                common_debug("Deleting RSVP alone...");
                 $this->rsvp->delete();
             }
         } catch (ClientException $ce) {
@@ -190,7 +190,7 @@ class CancelrsvpAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index 9483db7b4e55ab5360410560bcbfef389ff407b6..017d8d6c3e964939bb98efefb55672adf1ad8168 100644 (file)
@@ -300,7 +300,7 @@ class NeweventAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index 7a87d359e07c77a9b81a094ec30fd7d9b80b2973..2ba90070a50accc5aad6515fddaea884a1d315d5 100644 (file)
@@ -197,7 +197,7 @@ class NewrsvpAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index 092fa6bda5922793551846452bc452a56a10e45c..580cfab74eb8f2468dd91b9379ef1430c22e7edf 100644 (file)
@@ -42,7 +42,7 @@ class TimelistAction extends Action {
      *
      * @return boolean true
      */
-    function prepare($args) {
+    function prepare(array $args=array()) {
         parent::prepare($args);
         $this->start = $this->arg('start');
         $this->duration = $this->boolean('duration', false);
@@ -56,7 +56,7 @@ class TimelistAction extends Action {
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index a5cd823bb76ff14c5e6c37f0ed0c1892a6c409a9..12541437020c7ced92cd3b73852d294d9d94a630 100644 (file)
@@ -29,7 +29,7 @@ if (!defined('STATUSNET')) {
  */
 class ExtendedProfilePlugin extends Plugin
 {
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array(
             'name' => 'ExtendedProfile',
@@ -81,7 +81,8 @@ class ExtendedProfilePlugin extends Plugin
 
     function onEndShowAccountProfileBlock(HTMLOutputter $out, Profile $profile) {
         $user = User::getKV('id', $profile->id);
-        if ($user) {
+
+        if ($user instanceof User) {
             $url = common_local_url('profiledetail', array('nickname' => $user->nickname));
             // TRANS: Link text on user profile page leading to extended profile page.
             $out->element('a', array('href' => $url, 'class' => 'profiledetail'), _m('More details...'));
index a777a28e031cacbab9a47b2335fc97ad12c689da..37660175fac3ce52efbd2c2504a4416b5cf3e03e 100644 (file)
@@ -24,7 +24,7 @@ if (!defined('STATUSNET')) {
 class ProfileDetailAction extends ShowstreamAction
 {
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index d4857429e0488df77507b116e92b834c6ffec3a2..a77c1ec49242c5cd6565cdb9f917cb0e6cf4a0e0 100644 (file)
@@ -43,7 +43,7 @@ class UserautocompleteAction extends Action
      *
      * @return boolean true if nothing goes wrong
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->query = $this->trimmed('term');
@@ -57,7 +57,7 @@ class UserautocompleteAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showResults();
@@ -106,7 +106,7 @@ class UserautocompleteAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index fff5a7621b426b7a49063df2c4ff93de7b8db3ad..e323a475e1576c021b8bba9dccd2051ca33110d3 100644 (file)
@@ -229,7 +229,7 @@ class FacebookBridgePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndAdminPanelNav($nav)
+    function onEndAdminPanelNav(Menu $nav)
     {
         if (AdminPanelAction::canAdmin('facebook')) {
 
@@ -329,7 +329,7 @@ class FacebookBridgePlugin extends Plugin
      * @param Action $action the current action
      *
      */
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         if ($this->needsScripts($action)) {
 
@@ -449,7 +449,7 @@ ENDOFSCRIPT;
      *
      * @return boolean hook return
      */
-    function onStartEnqueueNotice($notice, &$transports)
+    function onStartEnqueueNotice(Notice $notice, array &$transports)
     {
         if (self::hasApplication() && $notice->isLocal() && $notice->inScope(null)) {
             array_push($transports, 'facebook');
@@ -464,7 +464,7 @@ ENDOFSCRIPT;
      *
      * @return boolean hook return
      */
-    function onEndInitializeQueueManager($manager)
+    function onEndInitializeQueueManager(QueueManager $manager)
     {
         if (self::hasApplication()) {
             $manager->connect('facebook', 'FacebookQueueHandler');
@@ -612,7 +612,7 @@ ENDOFSCRIPT;
      *
      * @param array &$versions    plugin version descriptions
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array(
             'name' => 'Facebook Bridge',
index 443b768f5c83215db241e3ed132c7000abfa26cd..e714f4878965d93e1819ce62d826fd225c6106d1 100644 (file)
@@ -48,7 +48,7 @@ class FacebookdeauthorizeAction extends Action
      *
      * @return boolean true
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         $this->facebook = Facebookclient::getFacebook();
 
@@ -60,7 +60,7 @@ class FacebookdeauthorizeAction extends Action
      *
      * @param array $args is ignored since it's now passed in in prepare()
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 53815ad264b1cb5a8815c8193fbfc330c7852425..da0dbc2b72081a5f14d8aba73e422edd117606f8 100644 (file)
@@ -37,7 +37,7 @@ class FacebookfinishloginAction extends Action
     private $fbuser      = null; // Facebook user object (JSON)
     private $accessToken = null; // Access token provided by Facebook JS API
 
-    function prepare($args) {
+    function prepare(array $args=array()) {
         parent::prepare($args);
 
         // Check cookie for a valid access_token
@@ -79,7 +79,7 @@ class FacebookfinishloginAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index f30822b63f536dfd78fbb89304d8c4495774033f..558dd1bfb720b19db388c15eac4e48a26e1ff675 100644 (file)
@@ -34,7 +34,7 @@ if (!defined('STATUSNET')) {
 
 class FacebookloginAction extends Action
 {
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 31e020a3ce7a42351856245ae2d13b0a82007946..faf307cd61a29de2c2de35eb5730d6767e027711 100644 (file)
@@ -53,7 +53,7 @@ class FacebooksettingsAction extends SettingsAction {
      *
      * @return boolean true
      */
-    function prepare($args) {
+    function prepare(array $args=array()) {
         parent::prepare($args);
 
         $this->facebook = new Facebook(
index 736bd7b0a19eaa720cf49040bd9255912f9c4afa..8a273740534c639b6f681a78cbd2677681b23c2f 100644 (file)
@@ -52,14 +52,19 @@ class ApiFavoriteCreateAction extends ApiAuthAction
 
     protected $needPost = true;
 
+    /**
+     * Take arguments for running
+     *
+     * @return boolean success flag
+     */
     protected function prepare(array $args=array())
     {
         parent::prepare($args);
 
         $this->notice = Notice::getKV($this->arg('id'));
         if (!empty($this->notice->repeat_of)) {
-                common_log(LOG_DEBUG, 'Trying to Fave '.$this->notice->id.', repeat of '.$this->notice->repeat_of);
-                common_log(LOG_DEBUG, 'Will Fave '.$this->notice->repeat_of.' instead');
+                common_debug('Trying to Fave '.$this->notice->id.', repeat of '.$this->notice->repeat_of);
+                common_debug('Will Fave '.$this->notice->repeat_of.' instead');
                 $real_notice_id = $this->notice->repeat_of;
                 $this->notice = Notice::getKV($real_notice_id);
         }
@@ -67,6 +72,13 @@ class ApiFavoriteCreateAction extends ApiAuthAction
         return true;
     }
 
+    /**
+     * Handle the request
+     *
+     * Check the format and show the user info
+     *
+     * @return void
+     */
     protected function handle()
     {
         parent::handle();
index 1c63ad26285c5da0b52214cf087f831c3baba8d9..03472ce6ba12f14ab33e6601b6410f559adc5daf 100644 (file)
@@ -57,15 +57,15 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
         $this->user   = $this->auth_user;
         $this->notice = Notice::getKV($this->arg('id'));
         if ($this->notice->repeat_of != '' ) {
-                common_log(LOG_DEBUG, 'Trying to unFave '.$this->notice->id);
-                common_log(LOG_DEBUG, 'Will unFave '.$this->notice->repeat_of.' instead');
+                common_debug('Trying to unFave '.$this->notice->id);
+                common_debug('Will unFave '.$this->notice->repeat_of.' instead');
                 $real_notice_id = $this->notice->repeat_of;
                 $this->notice = Notice::getKV($real_notice_id);
         }
@@ -82,7 +82,7 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 01a5d3014e1637ee51e4475cf6832b38e6bf1ba6..baba0c8db8cb9a7964ce9cc9f469c85360c1a59d 100644 (file)
@@ -105,12 +105,12 @@ class ApiStatusesFavsAction extends ApiAuthAction
                        $profile = Profile::getKV('id', $id);
                        $ids_with_profile_data[$i]['user_id'] = $id;
                        $ids_with_profile_data[$i]['nickname'] = $profile->nickname;
-                       $ids_with_profile_data[$i]['fullname'] = $profile->fullname;                    
-                       $ids_with_profile_data[$i]['profileurl'] = $profile->profileurl;                                                
+                       $ids_with_profile_data[$i]['fullname'] = $profile->fullname;
+                       $ids_with_profile_data[$i]['profileurl'] = $profile->profileurl;
                        $profile = new Profile();
                        $profile->id = $id;
                        $avatarurl = $profile->avatarUrl(24);
-                       $ids_with_profile_data[$i]['avatarurl'] = $avatarurl;                                                           
+                       $ids_with_profile_data[$i]['avatarurl'] = $avatarurl;
                        $i++;
                }
                
@@ -129,7 +129,7 @@ class ApiStatusesFavsAction extends ApiAuthAction
      * @return boolean is read only action?
      */
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 366177078fd6b5ed98c6df1087010239a484340a..e3f6fd13b8e28759c3b60c29c5e17d5a8c1aff73 100644 (file)
@@ -203,7 +203,7 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index b8dae707b38fd900695c6a54026c945e7d0d01bd..cd8e8daddf781aafa7df3b1c6d683d134af23294 100644 (file)
@@ -233,7 +233,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index 2b8c9704aaa02adc23067aed0d3ecdc8fb89047f..bbdddc07d934e8aed4814d2d2c06ae76e731689b 100644 (file)
@@ -161,7 +161,7 @@ class AtompubshowfavoriteAction extends ApiAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index 849a1c8b07a5662799b33b84f2c7fa1ed25d6d14..6914bd61f5eb32dd3b0e0e48796ba909e36ccc4d 100644 (file)
@@ -81,7 +81,7 @@ class FavoritedAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -95,7 +95,7 @@ class FavoritedAction extends Action
      *
      * @todo move queries from showContent() to here
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
@@ -114,7 +114,7 @@ class FavoritedAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 0cbebd723cf6ad430818134bb601119f3ce05af1..a3775971b73e8b3a760aa09a2133890839f90cb9 100644 (file)
@@ -60,7 +60,7 @@ class FavoritesrssAction extends Rss10Action
      *
      * @return boolean success
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
index 98a6bfc5bfbe30dfb7a7e05903b0c446792fa470..0734ab98657d3647a27da1c134b636a1fa46f20a 100644 (file)
@@ -56,7 +56,7 @@ class ShowfavoritesAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -93,7 +93,7 @@ class ShowfavoritesAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -146,7 +146,7 @@ class ShowfavoritesAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -245,7 +245,7 @@ class ShowfavoritesAction extends Action
 
 class FavoritesNoticeList extends NoticeList
 {
-    function newListItem($notice)
+    function newListItem(Notice $notice)
     {
         return new FavoritesNoticeListItem($notice, $this->out);
     }
index b6d3773c2082f343745767703bfb5dd4ed164d6f..f884cd9c699d88e779530a56a87dd552c656025d 100644 (file)
@@ -58,7 +58,7 @@ class FirePHPPlugin extends Plugin
         $this->firephp->fb($msg, $fp_priority);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'FirePHP',
                             'version' => GNUSOCIAL_VERSION,
index ee38c7a3117f78f289a7b33e1c7483e3dc9bcfd2..3c26963e3e400c6b70c46f18d07c0e329c46f112 100644 (file)
@@ -165,7 +165,7 @@ class FollowEveryonePlugin extends Plugin
      * @return boolean hook value
      *
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'FollowEveryone',
                             'version' => GNUSOCIAL_VERSION,
index a79c9d312bbbdd88dba8f3e164c46fdb890fe890..56e33355e86703ecc5d356ccf911d46a07704141 100644 (file)
@@ -105,7 +105,7 @@ class ForceGroupPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:ForceGroup';
 
index 44a6e3fe346ebc895e1fa469ba20d7a11058bd7c..78fe21d26d58b684866a12ad9bf2cafb28c62bc4 100644 (file)
@@ -44,7 +44,7 @@ class GNUsocialPhotoPlugin extends MicroAppPlugin
         return true;
     }
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('main/photo/new', array('action' => 'newphoto'));
         $m->connect('main/photo/:id', array('action' => 'showphoto'));
index 18ae5523a05aee25e8aa241eb1b2c9ca3cce5645..77c05e3807a3cda19445da805518350ccb2c9768 100644 (file)
@@ -33,7 +33,7 @@ class NewphotoAction extends Action
 {
     var $user = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->user = common_current_user();
@@ -50,7 +50,7 @@ class NewphotoAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 36956e5b9b3b750a90f15c4aacb691b3826c4526..906509fef5d52573b1b07c53810bc7465ef0efde 100644 (file)
@@ -44,7 +44,7 @@ class GNUsocialPhotosPlugin extends Plugin
         $schema->ensureTable('GNUsocialPhotoAlbum', GNUsocialPhotoAlbum::schemaDef());
     }
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect(':nickname/photos', array('action' => 'photos'));
         $m->connect(':nickname/photos/:albumid', array('action' => 'photos'));
@@ -157,12 +157,12 @@ class GNUsocialPhotosPlugin extends Plugin
                            _('Photo gallery'), $nav->action->trimmed('action') == 'photos', 'nav_photos');
     }
 
-    function onEndShowStyles($action)
+    function onEndShowStyles(Action $action)
     {
         $action->cssLink('/plugins/GNUsocialPhotos/res/style.css');
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $action->script('plugins/GNUsocialPhotos/res/gnusocialphotos.js');
     }
index 8f719919f970ffdf4255c603d368e740e7f257fa..71c1e9fb28d20286e7e80652054856b5a3124428 100644 (file)
@@ -36,7 +36,7 @@ class EditphotoAction extends Action
 {
     var $user = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $args = $this->returnToArgs();
@@ -46,7 +46,7 @@ class EditphotoAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if($_SERVER['REQUEST_METHOD'] == 'POST') {
index b1e1b73ff1198cb97b681477fab25b09e5994420..a180be8c12098295c3724287184dc8d5c218681a 100644 (file)
@@ -38,7 +38,7 @@ class PhotosAction extends Action
 {
     var $user = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -53,7 +53,7 @@ class PhotosAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -82,7 +82,7 @@ class PhotosAction extends Action
         $this->element('option', array('value' => '120'), _("Medium"));
         $this->element('option', array('value' => '400'), _("Normal"));
         $this->elementEnd('select');
-    }        
+    }
 
     function showAlbums()
     {
index 25bd4f84d0e585ed0282968066698c7fc99fda35..a8874ea13b17a3da215e41c652d5ee005549ec46 100644 (file)
@@ -36,14 +36,14 @@ class PhotouploadAction extends Action
 {
     var $user = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->user = common_current_user();
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if($_SERVER['REQUEST_METHOD'] == 'POST') {
index 6b3c757b1e68845a95a80acea90e61fb1dfb0305..9d8d4acb12eddcc833c23a50e0dfba048c3abf6c 100644 (file)
@@ -40,10 +40,9 @@ class GNUsocialProfileExtensionsPlugin extends Plugin
         $schema = Schema::get();
         $schema->ensureTable('GNUsocialProfileExtensionField', GNUsocialProfileExtensionField::schemaDef());
         $schema->ensureTable('GNUsocialProfileExtensionResponse', GNUsocialProfileExtensionResponse::schemaDef());
-                                          
     }
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect(':nickname/bio', array('action' => 'bio'));
         $m->connect('admin/profilefields', array('action' => 'profilefieldsAdminPanel'));
@@ -103,17 +102,17 @@ class GNUsocialProfileExtensionsPlugin extends Plugin
         }
     }
     
-    function onEndShowStyles($action)
+    function onEndShowStyles(Action $action)
     {
         $action->cssLink('/plugins/GNUsocialProfileExtensions/res/style.css');
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $action->script('plugins/GNUsocialProfileExtensions/js/profile.js');
     }
 
-    function onEndAdminPanelNav($nav)
+    function onEndAdminPanelNav(Menu $nav)
     {
         if (AdminPanelAction::canAdmin('profilefields')) {
 
index 269389e07dff451c2de832f3564745fe4c15f279..fc49003cb46ef8e6de867c747206046dc4d8eba9 100644 (file)
@@ -38,7 +38,7 @@ class BioAction extends Action
 {
     var $user = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -51,7 +51,7 @@ class BioAction extends Action
 
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
index 95df52838846d218ce296052f35bab5444b552a8..380672ebb535d688dafeaf7f1a216d68a61c00f1 100644 (file)
@@ -103,7 +103,7 @@ class NoticeTree extends NoticeList
         $this->out->elementEnd('li');
     }
 
-    function newListItem($notice)
+    function newListItem(Notice $notice)
     {
         return new NoticeTreeItem($notice, $this->out);
     }
index 3310712ba76da6b470a6ea6383fd3eb7212044d2..abf0f304301df01b419b226af352e04e561377d9 100644 (file)
@@ -44,7 +44,7 @@ class GNUsocialVideoPlugin extends MicroAppPlugin
         return true;
     }
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('main/postvideo', array('action' => 'postvideo'));
         $m->connect('showvideo/:id', array('action' => 'showvideo'));
index bdd86abc9e15b33b050c81c43a0ccd3fbde0ffbc..aae0fe98e649a4e3b5cc4280929a8b049c805851 100644 (file)
@@ -34,7 +34,7 @@ class PostvideoAction extends Action {
     var $user = null;
     var $url = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->user = common_current_user();
@@ -54,7 +54,7 @@ class PostvideoAction extends Action {
         return true;
     }
    
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 628d08642af2147cb064ec2c78bdd5e9bf3ebaaa..5021c19c9953fc723ce0b561b23b200581e85580 100644 (file)
@@ -34,7 +34,7 @@ class ShowvideoAction extends ShownoticeAction
     protected $id = null;
     protected $vid = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         OwnerDesignAction::prepare($args);
         $this->id = $this->trimmed('id');
index d548de925adec7d2674f07ea94460d9cdbcbb838..caad8fde11f0a77da6e6ee9441791c93cbda560e 100644 (file)
@@ -114,7 +114,7 @@ class GeoURLPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'GeoURL',
                             'version' => GNUSOCIAL_VERSION,
index 68d66bc0b15a5d19f2808ef02f5d14167283709d..ff9192283f62ccf73b15c07e8a8769c5f6cf1ac0 100644 (file)
@@ -487,7 +487,7 @@ class GeonamesPlugin extends Plugin
         return $document->geoname;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Geonames',
                             'version' => GNUSOCIAL_VERSION,
index 640330b85007305b5cd7cb0548b30b49ecb9a504..2f07747a4d9d065369705e0c59919306bad259e4 100644 (file)
@@ -64,7 +64,7 @@ class GoogleAnalyticsPlugin extends Plugin
         parent::__construct();
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $code = common_config('googleanalytics', 'code');
         if (empty($code)) {
@@ -105,7 +105,7 @@ ENDOFSCRIPT2;
        $action->inlineScript($js);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'GoogleAnalytics',
                             'version' => self::VERSION,
index d7163988895ff02e1b218e32b50e1c36f1abf833..637674b1db0f7c1c0dd4b421d507cbe1d12764a1 100644 (file)
@@ -30,7 +30,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
 
 class GravatarPlugin extends Plugin
 {
-    function onEndProfileGetAvatar($profile, $size, &$avatar)
+    function onEndProfileGetAvatar(Profile $profile, $size, &$avatar)
     {
         if (empty($avatar)) {
             try {
@@ -52,14 +52,14 @@ class GravatarPlugin extends Plugin
 
     function gravatar_url($email, $size)
     {
-        $url = "https://secure.gravatar.com/avatar.php?gravatar_id=".
-                md5(strtolower($email)).
-                "&default=".urlencode(Avatar::defaultImage($size)).
-                "&size=".$size;
+        $url = 'https://secure.gravatar.com/avatar.php?gravatar_id=' .
+                md5(strtolower($email)) .
+                '&default=' . urlencode(Avatar::defaultImage($size)) .
+                '&size=' . $size;
             return $url;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Gravatar',
                             'version' => GNUSOCIAL_VERSION,
index 73d7201e6f726c179a5c99041e17945c454373d7..0f5c1a88309a35d1f0f02bf8e6b9b5956750ea4b 100644 (file)
@@ -124,7 +124,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @result boolean hook value
      */
-    function onEndGroupSave($group)
+    function onEndGroupSave(User_group $group)
     {
         $gps = new Group_privacy_settings();
 
@@ -193,9 +193,10 @@ class GroupPrivateMessagePlugin extends Plugin
         assert(is_callable(array($action, 'getGroup')));
 
         $gps = null;
+        $group = $action->getGroup();
 
-        if ($action->getGroup() instanceof User_group) {
-            $gps = Group_privacy_settings::getKV('group_id', $action->getGroup()->id);
+        if ($group instanceof User_group) {
+            $gps = Group_privacy_settings::getKV('group_id', $group->id);
         }
 
         $orig = null;
@@ -324,7 +325,7 @@ class GroupPrivateMessagePlugin extends Plugin
             foreach (array_unique($match[1]) as $nickname) {
                 $group = User_group::getForNickname($nickname, $profile);
 
-                if (empty($group)) {
+                if (!$group instanceof User_group) {
                     continue;
                 }
 
@@ -405,7 +406,7 @@ class GroupPrivateMessagePlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'GroupPrivateMessage',
                             'version' => GNUSOCIAL_VERSION,
index f4656bfd8e4588fdf460a628750b0d5d7bedb37e..09bcbda3235f7518ad3dad4a6fe149bd0ad39cf2 100644 (file)
@@ -155,7 +155,7 @@ class GroupinboxAction extends GroupAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 4c2e7a71f6331e8752b18d584a5946527a6edb77..0c4d1342a9aa463db3703898b6dcd439bd6eda2a 100644 (file)
@@ -146,7 +146,7 @@ class ShowgroupmessageAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 5711951e264f11157c917909ff40b3da37f761bb..ea6eaabef88598ecda07764443efe4126e444ddb 100644 (file)
@@ -76,7 +76,7 @@ class ImapPlugin extends Plugin
         $classes[] = new ImapManager($this);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'IMAP',
                             'version' => GNUSOCIAL_VERSION,
index af3d822dfd034b4c442639b9f744a0c888da986b..4684d0169ff201e0771670c585f6724cde658ae2 100644 (file)
@@ -170,7 +170,7 @@ class InProcessCachePlugin extends Plugin
      *
      * @return boolean true
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:InProcessCache';
 
index 44c5c5e880bc555c5e07421fb8f269ecfdeea9cd..713e9ef61ae3cf8c73fbc16979225b7a5ce90784 100644 (file)
@@ -41,7 +41,7 @@ class InfiniteScrollPlugin extends Plugin
         parent::__construct();
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $action->inlineScript('var infinite_scroll_on_next_only = ' . ($this->on_next_only?'true':'false') . ';');
         $action->inlineScript('var ajax_loader_url = "' . ($this->path('ajax-loader.gif')) . '";');
@@ -49,7 +49,7 @@ class InfiniteScrollPlugin extends Plugin
         $action->script($this->path('infinitescroll.js'));
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'InfiniteScroll',
                             'version' => GNUSOCIAL_VERSION,
index 7fe58e06aca2e4616f1c7e77e13a168a9679dadb..99dc4b2bc125e54e22b86b6e4beca3fded6cf301 100644 (file)
@@ -372,7 +372,7 @@ class IrcPlugin extends ImPlugin {
      * @param array $versions Array to insert information into
      * @return void
      */
-    public function onPluginVersion(&$versions) {
+    public function onPluginVersion(array &$versions) {
         $versions[] = array('name' => 'IRC',
                             'version' => GNUSOCIAL_VERSION,
                             'author' => 'Luke Fitzgerald',
index 9ecdd327ae4f2eb52f01cea60321c942a9845ff1..98c70dfceeae881439fcd5137e6a699faa845b6e 100644 (file)
@@ -493,7 +493,7 @@ class Phergie_Plugin_HandlerTest extends PHPUnit_Framework_TestCase
      */
     public function testAddPluginThrowsExceptionWhenPluginClassNotFound()
     {
-        $path = sys_get_temp_dir() . '/Phergie/Plugin';
+        $path = common_get_temp_dir() . '/Phergie/Plugin';
         $this->removeDirectory(dirname($path));
         mkdir($path, 0777, true);
         touch($path . '/TestPlugin.php');
index 021fe190e34ae11e2aaa8cc1d0a47305146cac19..11ba2bd7edb594b2f8e3112cb7d7441ec559eb92 100644 (file)
@@ -126,7 +126,7 @@ class IrcManager extends ImManager {
      * @return void
      */
     public function handleInput($socket) {
-        common_log(LOG_DEBUG, 'Servicing the IRC queue.');
+        common_debug('Servicing the IRC queue.');
         $this->stats('irc_process');
 
         try {
index e8bf82ec315f572f53e098dd84fac00f600491b8..16eee335a3079050eb326ee69e68820d5d10fcbf 100644 (file)
@@ -51,7 +51,7 @@ class LRDDPlugin extends Plugin
         $disco->registerMethod('LRDDMethod_LinkHTML');
     }
 
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'LRDD',
                             'version' => GNUSOCIAL_VERSION,
index df28c5a09f5566113c775354af6302f3269295a9..0efaec99b201b8b6d61e0d42f54070242393bfec 100644 (file)
@@ -142,7 +142,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
         return common_nicknamize($nickname);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'LDAP Authentication',
                             'version' => GNUSOCIAL_VERSION,
index 9a666d15518030a267b7641ddbfcfb5717d3665b..eca8e037a03d066598d0033d6880cf93f970c342 100644 (file)
@@ -118,7 +118,7 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
         return false;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'LDAP Authorization',
                             'version' => GNUSOCIAL_VERSION,
index 7d052d5b24ec84a0de0fe703b65787bcc195d24b..aea1b72ea4f409f4a641b3542721ed20102adcb2 100644 (file)
@@ -370,7 +370,7 @@ class LdapCommon
         mt_srand((double)microtime() * 1000000);
 
         while( strlen( $str ) < $length )
-            $str .= substr( $possible, ( rand() % strlen( $possible ) ), 1 );
+            $str .= substr( $possible, ( mt_rand() % strlen( $possible ) ), 1 );
 
         return $str;
     }
index f871a956307e33285dee8d3499462f4e62777a3b..fcbee2b56dcc896ab9f53036167a7a66a93e562d 100644 (file)
@@ -57,7 +57,7 @@ class LilUrlPlugin extends UrlShortenerPlugin
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => sprintf('LilUrl (%s)', $this->shortenerName),
                             'version' => GNUSOCIAL_VERSION,
index effb105e2ba0fcb128ddcd5bc76e3890e7ccfc38..5e04d4d1546f10297642b019820956176307cd5c 100644 (file)
@@ -29,7 +29,7 @@ if (!defined('STATUSNET')) {
  */
 class LinkPreviewPlugin extends Plugin
 {
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'LinkPreview',
                             'version' => GNUSOCIAL_VERSION,
@@ -48,7 +48,7 @@ class LinkPreviewPlugin extends Plugin
      * @param Action $action
      * @return boolean hook result
      */
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $user = common_current_user();
         if ($user && common_config('attachments', 'process_links')) {
index 7e54aca57067de6bce92a0e4d76f7f85c22181a5..095cfe03d7cbe765b891f97433e9576756f022c7 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
  */
 class OembedproxyAction extends OembedAction
 {
-    function handle($args)
+    function handle(array $args=array())
     {
         // Trigger short error responses; not a human-readable web page.
         StatusNet::setApi(true);
index 597ac1f4469f8948e88f328408ee60d3f1894b0a..a710abd7bf8c8c5f80c59b16db87143323638d67 100644 (file)
@@ -232,7 +232,7 @@ class LinkbackPlugin extends Plugin
         return LINKBACKPLUGIN_VERSION;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Linkback',
                             'version' => LINKBACKPLUGIN_VERSION,
index 430e89594e91b9300bc494c75c82b1b1372bb9e4..028af9bc9cb99436718b1f870df6ccdd30f09643 100644 (file)
@@ -39,7 +39,7 @@ class LogFilterPlugin extends Plugin
     public $priority = array(); // override by priority: array(LOG_ERR => true, LOG_DEBUG => false)
     public $regex = array();    // override by regex match of message: array('/twitter/i' => false)
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'LogFilter',
                             'version' => GNUSOCIAL_VERSION,
index e2551de184ea4b04d8a7ec9148e3c6705b1cb333..7356607ce248db2fe9f6efabcf0796478c9bfa4a 100644 (file)
@@ -63,7 +63,7 @@ class MapstractionPlugin extends Plugin
      *
      * @return boolean event handler return
      */
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect(':nickname/all/map',
                     array('action' => 'allmap'),
@@ -83,7 +83,7 @@ class MapstractionPlugin extends Plugin
      *
      * @return boolean event handler return
      */
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $actionName = $action->trimmed('action');
 
@@ -169,7 +169,7 @@ class MapstractionPlugin extends Plugin
         $action->elementEnd('div');
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Mapstraction',
                             'version' => self::VERSION,
index 21bdf62eaa94594a5c7615e3dcaa46ddcc61f09c..173629853cda442ce80a438461e45053823b649f 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('STATUSNET')) {
  */
 class AllmapAction extends MapAction
 {
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (parent::prepare($args)) {
             $stream = new InboxNoticeStream($this->user->getProfile(), $this->scoped);
index be59f5ba0b5ecb63f755dbeb8ac853a9e4a3649f..3fad900b5a3e9754bb4daf906ba0e1ee9aa935fa 100644 (file)
@@ -48,7 +48,7 @@ class MapAction extends Action
     var $page    = null;
     var $notices = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -94,7 +94,7 @@ class MapAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -133,7 +133,7 @@ class MapAction extends Action
         return true;
     }
 
-    function noticeAsJson($notice)
+    function noticeAsJson(Notice $notice)
     {
         // FIXME: this code should be abstracted to a neutral third
         // party, like Notice::asJson(). I'm not sure of the ethics
index 99a43e538a5c81fb09ac551fec98b101450ba936..4aef1400abd363a74f3b7e465c87ac1d34958311 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('STATUSNET')) {
  */
 class UsermapAction extends MapAction
 {
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if(parent::prepare($args)) {
             $this->notice = empty($this->tag)
index 8e674e62b8634716be03698e328875fc436c8053..7efb5e028437b26aaf6ffd147879b1defc1fe94d 100644 (file)
@@ -236,7 +236,7 @@ class MemcachePlugin extends Plugin
         return $out;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Memcache',
                             'version' => GNUSOCIAL_VERSION,
index 55c21cd923520152d7f444139944dc82bee43645..ca24b7b7d1c838ad26f29ba32a105fd13ff6fcd0 100644 (file)
@@ -207,7 +207,7 @@ class MemcachedPlugin extends Plugin
         return $flag;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Memcached',
                             'version' => GNUSOCIAL_VERSION,
index d2341980d2298ec8d3507d5102719736f2150d3b..64c2fd3d6902b39e3c36e89a683ce3c6fae02ba4 100644 (file)
@@ -160,7 +160,7 @@ class MeteorPlugin extends RealtimePlugin
         return implode('-', $path);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Meteor',
                             'version' => GNUSOCIAL_VERSION,
index 1e13f8d80114db370523c1f133ffe42f08d65ee4..1dd3bdcf345fcd685cabdfe9ba3ad304d3e3ced0 100644 (file)
@@ -157,7 +157,7 @@ class MinifyPlugin extends Plugin
         return Minify_CSS::minify($code,$options);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Minify',
                             'version' => GNUSOCIAL_VERSION,
index d7ec5d1392003cd0499584e169648e91424c836e..671e22f5a64889d3d98d658d5d4581a8b70d7917 100644 (file)
@@ -30,12 +30,12 @@ class MinifyAction extends Action
     var $file;
     var $v;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->v = $args['v'];
@@ -70,7 +70,7 @@ class MinifyAction extends Action
         return filemtime($this->file);
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 37f7169624c58b7d0ea1b6bbeff294a9d21b7b75..0d1555c9473cb6e47d24e8a258c09e1b5c9a8c97 100644 (file)
@@ -134,8 +134,8 @@ class Solar_Dir {
         if (! Solar_Dir::$_tmp) {
             
             // use the system if we can
-            if (function_exists('sys_get_temp_dir')) {
-                $tmp = sys_get_temp_dir();
+            if (function_exists('common_get_temp_dir')) {
+                $tmp = common_get_temp_dir();
             } else {
                 $tmp = Solar_Dir::_tmp();
             }
index 98fcb472fae2214967f944ce3a2a1722693e300b..5d0fd2ddb9a041ed6666c262155448e4d5f35b4b 100644 (file)
@@ -332,7 +332,7 @@ class MobileProfilePlugin extends WAP20Plugin
         }
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         // @todo FIXME: "Show Navigation" / "Hide Navigation" needs i18n
         $action->inlineScript('
@@ -406,7 +406,7 @@ class MobileProfilePlugin extends WAP20Plugin
         return $proto.'://'.$serverpart.'/'.$pathpart.$relative;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'MobileProfile',
                             'version' => GNUSOCIAL_VERSION,
index 4b4bf8f447d24d203a3807eb4160b7225e263198..2752a2153947302d251aabf8374d381e32412f44 100644 (file)
@@ -29,7 +29,7 @@ class ModHelperPlugin extends Plugin
 {
     static $rights = array(Right::SILENCEUSER, Right::TRAINSPAM, Right::REVIEWSPAM);
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'ModHelper',
                             'version' => GNUSOCIAL_VERSION,
index bbf283f8c41369858d763d8f734c5ce3cbb80895..32c96be0e8c0722b5d7249adc0012beacc7455d6 100644 (file)
@@ -183,7 +183,7 @@ class ModLogPlugin extends Plugin
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'ModLog',
                             'version' => GNUSOCIAL_VERSION,
index 1ca024e9aca29c77d829d90c8a9bdf5cd3761e0d..8433f2737b920d250b8a10785d47f756fdd6176a 100644 (file)
@@ -29,7 +29,7 @@ if (!defined('STATUSNET')) {
  */
 class ModPlusPlugin extends Plugin
 {
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'ModPlus',
                             'version' => GNUSOCIAL_VERSION,
index 1b910cc4084045c5f1718fcfb02780a9ac5ab40b..960cb935f715ced90e5ec2102c353a2e8f619351 100644 (file)
@@ -84,7 +84,7 @@ class NoticeTitlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:NoticeTitle';
 
index 15af953b8cc1853cf74ed764c7e7258a29cc6983..66c8e47f8cb53ede29c88668c02f6c387158384e 100644 (file)
@@ -123,7 +123,7 @@ class OStatusPlugin extends Plugin
     /**
      * Put saved notices into the queue for pubsub distribution.
      */
-    function onStartEnqueueNotice($notice, &$transports)
+    function onStartEnqueueNotice(Notice $notice, array &$transports)
     {
         if ($notice->inScope(null)) {
             // put our transport first, in case there's any conflict (like OMB)
@@ -539,7 +539,7 @@ class OStatusPlugin extends Plugin
         if ($oprofile instanceof Ostatus_profile) {
             $oprofile->processFeed($feed, 'push');
         } else {
-            common_log(LOG_DEBUG, "No ostatus profile for incoming feed $feedsub->uri");
+            common_debug("No ostatus profile for incoming feed $feedsub->uri");
         }
     }
 
@@ -1143,7 +1143,7 @@ class OStatusPlugin extends Plugin
         $oprofile->query(sprintf($sql, $profile->id, $profile->id));
 
         if ($oprofile->N == 0) {
-            common_log(LOG_DEBUG, "No OStatus remote subscribees for $profile->nickname");
+            common_debug("No OStatus remote subscribees for $profile->nickname");
             return true;
         }
 
@@ -1210,7 +1210,7 @@ class OStatusPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'OStatus',
                             'version' => GNUSOCIAL_VERSION,
@@ -1373,7 +1373,7 @@ class OStatusPlugin extends Plugin
         return true;
     }
 
-    public function onProfileDeleteRelated($profile, &$related)
+    public function onProfileDeleteRelated(Profile $profile, array &$related)
     {
         // Ostatus_profile has a 'profile_id' property, which will be used to find the object
         $related[] = 'Ostatus_profile';
index 5666c898af4e91938e91c2c412174579089865f0..85ba31c2d8da1d0eb4897c816fdd84d2452417f8 100644 (file)
@@ -210,7 +210,8 @@ class OStatusInitAction extends Action
     {
         if ($this->nickname) {
             $user = User::getKV('nickname', $this->nickname);
-            if ($user) {
+
+            if ($user instanceof User) {
                 return common_local_url('userbyid', array('id' => $user->id));
             } else {
                 // TRANS: Client error.
index fa999fe09a759b6b4d70d3fc5173e669d764bba9..d054c3e59f646e6cc89796cb143749f57d1aae48 100644 (file)
@@ -31,7 +31,7 @@ class OStatusTagAction extends OStatusInitAction
     var $profile;
     var $err;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
index adc1aa11be6506eb9041a85db5b1924c53180131..f6dcd72856a5df993ba90dde5c89889a002ea514 100644 (file)
@@ -487,7 +487,7 @@ class FeedSub extends Managed_DataObject
                     return true;
                 }
                 if (common_config('feedsub', 'debug')) {
-                    $tempfile = tempnam(sys_get_temp_dir(), 'feedsub-receive');
+                    $tempfile = tempnam(common_get_temp_dir(), 'feedsub-receive');
                     if ($tempfile) {
                         file_put_contents($tempfile, $post);
                     }
index 79098c64048ed31705b54ecfb94259619dad826d..d5ad33a91e8c258582d0f7cc33d473af55a602e6 100644 (file)
@@ -372,9 +372,10 @@ class Ostatus_profile extends Managed_DataObject
      * send immediately but won't get the return value.
      *
      * @param mixed $entry XML string, Notice, or Activity
+     * @param Profile $actor Acting profile
      * @return boolean success
      */
-    public function notifyDeferred($entry, $actor)
+    public function notifyDeferred($entry, Profile $actor)
     {
         if ($this->salmonuri) {
             $data = array('salmonuri' => $this->salmonuri,
@@ -480,14 +481,14 @@ class Ostatus_profile extends Managed_DataObject
      *
      * @return Notice Notice representing the new (or existing) activity
      */
-    public function processEntry($entry, $feed, $source)
+    public function processEntry(DOMElement $entry, DOMElement $feed, $source)
     {
         $activity = new Activity($entry, $feed);
         return $this->processActivity($activity, $source);
     }
 
     // TODO: Make this throw an exception
-    public function processActivity($activity, $source)
+    public function processActivity(Activity $activity, $source)
     {
         $notice = null;
 
@@ -527,7 +528,7 @@ class Ostatus_profile extends Managed_DataObject
         return $notice;
     }
 
-    public function processShare($activity, $method)
+    public function processShare(Activity $activity, $method)
     {
         $notice = null;
 
@@ -742,7 +743,7 @@ class Ostatus_profile extends Managed_DataObject
      * @return mixed saved Notice or false
      * @todo FIXME: Break up this function, it's getting nasty long
      */
-    public function processPost($activity, $method)
+    public function processPost(Activity $activity, $method)
     {
         $notice = null;
 
@@ -933,7 +934,7 @@ class Ostatus_profile extends Managed_DataObject
      */
     static public function filterAttention(Profile $sender, array $attention)
     {
-        common_log(LOG_DEBUG, "Original reply recipients: " . implode(', ', array_keys($attention)));
+        common_debug("Original reply recipients: " . implode(', ', array_keys($attention)));
         $groups = array();
         $replies = array();
         foreach ($attention as $recipient=>$type) {
@@ -955,11 +956,11 @@ class Ostatus_profile extends Managed_DataObject
                     if ($sender->isMember($group)) {
                         $groups[] = $group->id;
                     } else {
-                        common_log(LOG_DEBUG, sprintf('Skipping reply to local group %s as sender %d is not a member', $group->getNickname(), $sender->id));
+                        common_debug(sprintf('Skipping reply to local group %s as sender %d is not a member', $group->getNickname(), $sender->id));
                     }
                     continue;
                 } else {
-                    common_log(LOG_DEBUG, "Skipping reply to bogus group $recipient");
+                    common_debug("Skipping reply to bogus group $recipient");
                 }
             }
 
@@ -977,12 +978,12 @@ class Ostatus_profile extends Managed_DataObject
                 continue;
             } catch (Exception $e) {
                 // Neither a recognizable local nor remote user!
-                common_log(LOG_DEBUG, "Skipping reply to unrecognized profile $recipient: " . $e->getMessage());
+                common_debug("Skipping reply to unrecognized profile $recipient: " . $e->getMessage());
             }
 
         }
-        common_log(LOG_DEBUG, "Local reply recipients: " . implode(', ', $replies));
-        common_log(LOG_DEBUG, "Local group recipients: " . implode(', ', $groups));
+        common_debug("Local reply recipients: " . implode(', ', $replies));
+        common_debug("Local group recipients: " . implode(', ', $groups));
         return array($groups, $replies);
     }
 
@@ -1259,7 +1260,7 @@ class Ostatus_profile extends Managed_DataObject
 
         // @todo FIXME: This should be better encapsulated
         // ripped from oauthstore.php (for old OMB client)
-        $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+        $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
         try {
             $imgData = HTTPClient::quickGet($url);
             // Make sure it's at least an image file. ImageFile can do the rest.
@@ -1485,7 +1486,7 @@ class Ostatus_profile extends Managed_DataObject
         $discover = false;
 
         if (!$homeuri) {
-            common_log(LOG_DEBUG, __METHOD__ . " empty actor profile URI: " . var_export($activity, true));
+            common_debug(__METHOD__ . " empty actor profile URI: " . var_export($activity, true));
             // TRANS: Exception.
             throw new Exception(_m('No profile URI.'));
         }
@@ -1727,7 +1728,7 @@ class Ostatus_profile extends Managed_DataObject
         // @todo tags from categories
 
         if ($profile->id) {
-            common_log(LOG_DEBUG, "Updating OStatus profile $profile->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
+            common_debug("Updating OStatus profile $profile->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
             $profile->update($orig);
         }
     }
@@ -1751,12 +1752,12 @@ class Ostatus_profile extends Managed_DataObject
         $group->homepage = self::getActivityObjectHomepage($object, $hints);
 
         if ($group->id) {   // If no id, we haven't called insert() yet, so don't run update()
-            common_log(LOG_DEBUG, "Updating OStatus group $group->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
+            common_debug("Updating OStatus group $group->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
             $group->update($orig);
         }
     }
 
-    protected static function updatePeopletag($tag, ActivityObject $object, array $hints=array()) {
+    protected static function updatePeopletag(Peopletag $tag, ActivityObject $object, array $hints=array()) {
         $orig = clone($tag);
 
         $tag->tag = $object->title;
@@ -1772,7 +1773,7 @@ class Ostatus_profile extends Managed_DataObject
         $tag->tagger = $tagger->profile_id;
 
         if ($tag->id) {
-            common_log(LOG_DEBUG, "Updating OStatus peopletag $tag->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
+            common_debug("Updating OStatus peopletag $tag->id from remote info $object->id: " . var_export($object, true) . var_export($hints, true));
             $tag->update($orig);
         }
     }
@@ -2176,7 +2177,7 @@ class Ostatus_profile extends Managed_DataObject
         } else {
             $actor = $activity->actor;
 
-            if (empty($actor)) {
+            if (!$actor instanceof Profile) {
                 // OK here! assume the default
             } else if ($actor->id == $this->getUri() || $actor->link == $this->getUri()) {
                 $this->updateFromActivityObject($actor);
index 9e02f5eab5e3f8963ae7020bb3223058a86f8498..09b0f452f9f6ffee98f564d620334a4b48a0493d 100644 (file)
@@ -274,19 +274,19 @@ class MagicEnvelope
     public function verify(Profile $profile)
     {
         if ($this->alg != 'RSA-SHA256') {
-            common_log(LOG_DEBUG, "Salmon error: bad algorithm");
+            common_debug("Salmon error: bad algorithm");
             return false;
         }
 
         if ($this->encoding != self::ENCODING) {
-            common_log(LOG_DEBUG, "Salmon error: bad encoding");
+            common_debug("Salmon error: bad encoding");
             return false;
         }
 
         try {
             $magicsig = $this->getKeyPair($profile, true);    // Do discovery too if necessary
         } catch (Exception $e) {
-            common_log(LOG_DEBUG, "Salmon error: ".$e->getMessage());
+            common_debug("Salmon error: ".$e->getMessage());
             return false;
         }
 
index 3e9c4828fb5584e3d077d6e6d5b4fd626bdb352c..964580cf49a208b8e2129857f8cc20a78587d468 100644 (file)
@@ -146,14 +146,14 @@ class OStatusQueueHandler extends QueueHandler
         $this->pushFeed($feed, array($this, 'peopletagFeedForNotice'), $ptag);
     }
 
-    function pingReply($oprofile)
+    function pingReply(OStatus_profile $oprofile)
     {
         if ($this->user) {
             // For local posts, send a Salmon ping to the mentioned
             // remote user or group.
             // @fixme as an optimization we can skip this if the
             // remote profile is subscribed to the author.
-            $oprofile->notifyDeferred($this->notice, $this->user);
+            $oprofile->notifyDeferred($this->notice, $this->user->getProfile());
         }
     }
 
index 5e7d8f35a34517a6ef1937094d373a3c0d497563..eb68632d38ff3f5e4821f530803ef6d6c07bbd2f 100644 (file)
@@ -67,7 +67,7 @@ class SalmonAction extends Action
 
         // Cryptographic verification test
         if (!$magic_env->verify($this->actor)) {
-            common_log(LOG_DEBUG, "Salmon signature verification failed.");
+            common_debug("Salmon signature verification failed.");
             // TRANS: Client error.
             $this->clientError(_m('Salmon signature verification failed.'));
         }
@@ -83,7 +83,7 @@ class SalmonAction extends Action
     {
         parent::handle();
 
-        common_log(LOG_DEBUG, "Got a " . $this->activity->verb);
+        common_debug("Got a " . $this->activity->verb);
         try {
             if (Event::handle('StartHandleSalmonTarget', array($this->activity, $this->target)) &&
                     Event::handle('StartHandleSalmon', array($this->activity))) {
index ffaae5588d1eae757e07e15ac654f27056d168fc..817ef4eb166cc9f97225443fd57ac564e4a63bb2 100644 (file)
@@ -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 @@ 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>';
@@ -165,11 +165,13 @@ while ($oprofile->fetch()) {
     } 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 a95cd54dbc8d8b636106e598a4ddeca56b7bcc62..f1db4b358ff35b0497457ad75ef27086a411ee30 100644 (file)
@@ -31,7 +31,7 @@ Clean up feeds that no longer have subscribers.
 
 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 8f8ac3ee1d968416dacd8557e6e5fba7360181a4..01136de4173c5e04e871bc966d1b6deab49106fe 100644 (file)
@@ -26,7 +26,7 @@ Resubscribe to any soon expiring feeds. Default time to expiration is 1 day.
 
 END_OF_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 try {
     $sub = FeedSub::renewalCheck();
index 3d13724f7db1336979a951e6f5616c8bae1dba9a..edf64cd5f6247c047dbe01c5c95bef1caab103a9 100644 (file)
@@ -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 ce1698a60c2bff4751a228127965bf6422e176e4..1957f95cb368f3cafce9cf6b36ce25acbb156a25 100644 (file)
@@ -41,7 +41,7 @@ the hub is probably either broken or doesn't exist.'
 
 END_OF_HELP;
 
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
 
 $dry = false;
 
index 84b470c3b251dbfc1f31bfe7823fa628d1657643..e22f22ac501abe91143dceac0141ed2cdfacfae5 100644 (file)
@@ -33,7 +33,7 @@ Mainly intended for testing funky feed formats.
 
 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 e024ed95a780f3b09b8771f0d7360671b7303320..772cc073e2f1a9af816aa658c1a9b3cdcd322ebb 100644 (file)
@@ -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 ece19804420a1841d6a598ff98d1274137dae9ca..5b0c8b92e6af62a5f215019a3b8dba3aaee2e9b4 100644 (file)
@@ -30,7 +30,7 @@ things restarted if the hub or feed URLs have changed for the profile.
 
 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 2a32ae0491f5fc238a5da390ea842f10917d4f01..707dbe61f808d0c8c162843e589a23888d3f6c6e 100644 (file)
@@ -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 @@ class LooseOstatusProfile extends Ostatus_profile
      * @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 0584af8ef45669b789e08f8b9015825fe59e3683..52c8252c1394cf1058d42c738e9821a5097928a3 100644 (file)
@@ -9,7 +9,7 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
 define('GNUSOCIAL', true);
 define('STATUSNET', true);  // compatibility
 
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
 require_once INSTALLDIR . '/extlib/php-gettext/gettext.inc';
 
 common_init_locale("en_US");
index e3f5439aed69bd239da22149538dfbbade619819..eaef76d8cdeb1f1e2e59b5cb568f1b0856395268 100644 (file)
@@ -34,7 +34,7 @@ Test generation and sending of magic envelopes for Salmon slaps.
 
 END_OF_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 if (!have_option('--notice')) {
     print "$helptext";
index bf3e71c5056578e3ae86ea0e6ed0627e38e4bd39..78c2aa86af8112d1e4d884fc9f104de6d6ba964f 100644 (file)
@@ -230,7 +230,7 @@ class OembedAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
index 50ddc8a9943b2035885fc8ec88cf28de6f50ef4c..d2fb6b9ccb425e8ff6c1d8acc26120fecc6d3fe3 100755 (executable)
@@ -30,7 +30,7 @@ Patches up file entries with corrupted types and titles (the "h bug").
 
 END_OF_USERROLE_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $dry = have_option('dry-run');
 
index a2e3d8c49b781868e67c1e1cf5b061b6b79a6abc..2cc2ae00a0de811582bf08db86841009b59a46af 100644 (file)
@@ -50,7 +50,7 @@ if (!defined('STATUSNET')) {
 class OfflineBackupPlugin extends Plugin
 {
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('main/backupaccount',
                     array('action' => 'offlinebackup'));
@@ -65,13 +65,13 @@ class OfflineBackupPlugin extends Plugin
      * @return boolean hook value
      */
 
-    function onEndInitializeQueueManager($qm)
+    function onEndInitializeQueueManager(QueueManager $qm)
     {
         $qm->connect('backoff', 'OfflineBackupQueueHandler');
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'OfflineBackup',
                             'version' => GNUSOCIAL_VERSION,
index 9f96193d95758ed85c67db31bfd4a4c6216a42c2..82384f60bcc35765bb1df557e5c7be57ad9848ab 100644 (file)
@@ -73,7 +73,7 @@ class OfflineBackupQueueHandler extends QueueHandler
     {
         // XXX: this is pretty lose-y;  try another way
 
-        $tmpdir = sys_get_temp_dir() . '/offline-backup/' . $user->nickname . '/' . common_date_iso8601(common_sql_now());
+        $tmpdir = common_get_temp_dir() . '/offline-backup/' . $user->nickname . '/' . common_date_iso8601(common_sql_now());
 
         common_log(LOG_INFO, 'Writing backup data to ' . $tmpdir . ' for ' . $user->nickname);
 
index d5b9dfa0da5138020f3763ae23ec9d305a434eb9..a597f829963ac4336874fae1d05628176171137a 100644 (file)
@@ -42,14 +42,14 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
  */
 class OpenExternalLinkTargetPlugin extends Plugin
 {
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $action->inlineScript('$(document).on("click", "a[rel~=external]:not([class~=attachment])", function () { window.open(this.href); return false; });');
 
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'OpenExternalLinkTarget',
                             'version' => GNUSOCIAL_VERSION,
index fab35fe2f4eafb09faa95ffc54d374330b45a7d7..da38ad5dc9cd4c3577afda129b032db9469766b5 100644 (file)
@@ -125,7 +125,7 @@ class OpenIDPlugin extends Plugin
      *
      * @return boolean hook return
      */
-    function onArgsInitialize($args)
+    function onArgsInitialize(array &$args)
     {
         if (common_config('site', 'openidonly')) {
             if (array_key_exists('action', $args)) {
@@ -592,7 +592,7 @@ class OpenIDPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndAdminPanelNav($nav)
+    function onEndAdminPanelNav(Menu $nav)
     {
         if (AdminPanelAction::canAdmin('openid')) {
 
@@ -641,7 +641,7 @@ class OpenIDPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'OpenID',
                             'version' => GNUSOCIAL_VERSION,
index 5182e50778736d2325f3e6a20de29bfcf8ae07df..0661f2acfa11887b440011c0da21f9113f675c21 100644 (file)
@@ -58,7 +58,7 @@ class FinishaddopenidAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (!common_logged_in()) {
index 3a99988fb59093fccf76e6b064ab35482abdae26..090ef8d45054963ba3de0019ff63c1047a4fe356 100644 (file)
@@ -29,7 +29,7 @@ class FinishopenidloginAction extends Action
     var $username = null;
     var $message = null;
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (common_is_real_login()) {
@@ -271,16 +271,18 @@ class FinishopenidloginAction extends Action
 
             $user = oid_get_user($canonical);
 
-            if ($user) {
+            if ($user instanceof User) {
                 oid_set_last($display);
                 // XXX: commented out at @edd's request until better
                 // control over how data flows from OpenID provider.
                 // oid_update_user($user, $sreg);
                 common_set_user($user);
                 common_real_login(true);
+
                 if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
                     common_rememberme($user);
                 }
+
                 unset($_SESSION['openid_rememberme']);
                 $this->goHome($user->nickname);
             } else {
index 86ebcae2e1d26335944938d1b1a20afb73d777a5..1728ff7d0120a6e904455518e0e36127a78f2c23 100644 (file)
@@ -25,7 +25,7 @@ require_once INSTALLDIR.'/plugins/OpenID/openid.php';
 
 class OpenidloginAction extends Action
 {
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (common_is_real_login()) {
index b50a9129d72cb1da03e0c8fe75f8b7d914f7a648..512dc37467c78bad44ed3da3c9c2275f5b983966 100644 (file)
@@ -50,14 +50,14 @@ class OpenidserverAction extends Action
 {
     var $oserver;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->oserver = oid_server();
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $request = $this->oserver->decodeRequest();
index 3f8a3a93b77afb73b0e6d3457684172cbda11b2f..1c09be85d9cef225f0e1f74f18c1eecce96fb96d 100644 (file)
@@ -35,7 +35,7 @@ class OpenidtrustAction extends Action
      *
      * @return boolean false
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
@@ -51,7 +51,7 @@ class OpenidtrustAction extends Action
         return _m('OpenID Identity Verification');
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         common_ensure_session();
@@ -71,7 +71,7 @@ class OpenidtrustAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if($_SERVER['REQUEST_METHOD'] == 'POST'){
index 91a34bd6e364edbe58b291519ef2dc938b6f2080..0c48906b5d3abd451af562256934a1169d4acbb6 100644 (file)
@@ -346,7 +346,7 @@ function oid_check_teams($response)
 
         $match = in_array($requiredTeam, $teams);
         $is = $match ? 'is' : 'is not';
-        common_log(LOG_DEBUG, "Remote user $is in required team $requiredTeam: [" . implode(', ', $teams) . "]");
+        common_debug("Remote user $is in required team $requiredTeam: [" . implode(', ', $teams) . "]");
 
         return $match;
     }
@@ -359,7 +359,7 @@ class AutosubmitAction extends Action
     var $form_html = null;
     var $form_id = null;
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
index 6385d82102b6742f4e485a03c6160edaa88a2a72..1d2b9d53e823be18b5aa64086f12caea2c957b3b 100644 (file)
@@ -173,7 +173,7 @@ ENDOFSCRIPT;
         return true;
     }
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('panel/openx',
                     array('action' => 'openxadminpanel'));
@@ -181,7 +181,7 @@ ENDOFSCRIPT;
         return true;
     }
 
-    function onEndAdminPanelNav($menu) {
+    function onEndAdminPanelNav(Menu $menu) {
         if (AdminPanelAction::canAdmin('openx')) {
             // TRANS: Menu item title.
             $menu_title = _m('OpenX configuration.');
@@ -199,7 +199,7 @@ ENDOFSCRIPT;
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'OpenX',
                             'version' => GNUSOCIAL_VERSION,
index 89bd15a1a0210f087349322c0ae4e7685b021ed7..32f11f12ce4fefacbf1b9dc1c4e9c327cbe9b22a 100644 (file)
@@ -1,11 +1,37 @@
 <?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  OpportunisticQMPlugin
+ * @package   StatusNet
+ * @author    Brion Vibber <brion@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
 
 class OpportunisticQMPlugin extends Plugin {
     public $qmkey = false;
     public $secs_per_action = 1; // total seconds to run script per action
     public $rel_to_pageload = true;  // relative to pageload or queue start
 
-    public function onRouterInitialized($m)
+    public function onRouterInitialized(URLMapper $m)
     {
         $m->connect('main/runqueue', array('action' => 'runqueue'));
     }
@@ -32,7 +58,7 @@ class OpportunisticQMPlugin extends Plugin {
         return true;
     }
 
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'OpportunisticQM',
                             'version' => GNUSOCIAL_VERSION,
index 6356afcd088e781daa7e6e3341a19daf7bbbfebd..0ad4411bf278bea98053d2ea2a0d2abb26cdaa77 100644 (file)
@@ -92,6 +92,7 @@ class OpportunisticQueueManager extends DBQueueManager
             try {
                 $this->poll();
             } catch (RunQueueOutOfWorkException $e) {
+                common_debug('Opportunistic queue manager finished: ' . $e->getMessage());
                 return true;
             }
         }
index e788c464e605f42b36d90f3fa9578ad774d13f97..5abd27e9ee52854b094c87b92a90cc0888f7c5c3 100644 (file)
@@ -159,7 +159,7 @@ class OrbitedPlugin extends RealtimePlugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Orbited',
                             'version' => GNUSOCIAL_VERSION,
index 7b8be7900f10beb0d83901a7fe14471013b4daea..59ef822cb26c1cae6fbc6e03db21d7afd4526d92 100644 (file)
@@ -76,7 +76,7 @@ class PiwikAnalyticsPlugin extends Plugin
      *
      * @return boolean ignored
      */
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         // Slight modification to the default code.
         // Loading the piwik.js file from a <script> created in a document.write
@@ -103,7 +103,7 @@ ENDOFPIWIK;
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'PiwikAnalytics',
                             'version' => GNUSOCIAL_VERSION,
index 92886dcc28defac7a39bb83d5a9b0a842fe69dcb..64b254e41866793cbfded262c62d3c46644b083b 100644 (file)
@@ -77,7 +77,7 @@ class PollPlugin extends MicroAppPlugin
      *
      * @return boolean hook value
      */
-    function onEndShowStyles($action)
+    function onEndShowStyles(Action $action)
     {
         $action->cssLink($this->path('css/poll.css'));
         return true;
@@ -120,7 +120,7 @@ class PollPlugin extends MicroAppPlugin
      *
      * @return value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Poll',
                             'version' => self::VERSION,
@@ -167,9 +167,9 @@ class PollPlugin extends MicroAppPlugin
     function saveNoticeFromActivity(Activity $activity, Profile $profile, array $options=array())
     {
         // @fixme
-        common_log(LOG_DEBUG, "XXX activity: " . var_export($activity, true));
-        common_log(LOG_DEBUG, "XXX profile: " . var_export($profile, true));
-        common_log(LOG_DEBUG, "XXX options: " . var_export($options, true));
+        common_debug("XXX activity: " . var_export($activity, true));
+        common_debug("XXX profile: " . var_export($profile, true));
+        common_debug("XXX options: " . var_export($options, true));
 
         // Ok for now, we can grab stuff from the XML entry directly.
         // This won't work when reading from JSON source
@@ -189,10 +189,10 @@ class PollPlugin extends MicroAppPlugin
                 }
                 try {
                     $notice = Poll::saveNew($profile, $question, $opts, $options);
-                    common_log(LOG_DEBUG, "Saved Poll from ActivityStream data ok: notice id " . $notice->id);
+                    common_debug("Saved Poll from ActivityStream data ok: notice id " . $notice->id);
                     return $notice;
                 } catch (Exception $e) {
-                    common_log(LOG_DEBUG, "Poll save from ActivityStream data failed: " . $e->getMessage());
+                    common_debug("Poll save from ActivityStream data failed: " . $e->getMessage());
                 }
             } else if ($responseElements->length) {
                 $data = $responseElements->item(0);
@@ -210,13 +210,13 @@ class PollPlugin extends MicroAppPlugin
                 }
                 try {
                     $notice = Poll_response::saveNew($profile, $poll, $selection, $options);
-                    common_log(LOG_DEBUG, "Saved Poll_response ok, notice id: " . $notice->id);
+                    common_debug("Saved Poll_response ok, notice id: " . $notice->id);
                     return $notice;
                 } catch (Exception $e) {
-                    common_log(LOG_DEBUG, "Poll response  save fail: " . $e->getMessage());
+                    common_debug("Poll response  save fail: " . $e->getMessage());
                 }
             } else {
-                common_log(LOG_DEBUG, "YYY no poll data");
+                common_debug("YYY no poll data");
             }
         }
     }
@@ -343,7 +343,7 @@ class PollPlugin extends MicroAppPlugin
      */
     public function activityObjectOutputJson(ActivityObject $obj, array &$out)
     {
-        common_log(LOG_DEBUG, 'QQQ: ' . var_export($obj, true));
+        common_debug('QQQ: ' . var_export($obj, true));
         if (isset($obj->pollQuestion)) {
             /**
              * "poll": {
index 071778aaa2109486618b515a3ce8d4b091a20a47..e313bef5487e75b720d5c98d42206176dee1a15e 100644 (file)
@@ -217,7 +217,7 @@ class NewPollAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index 13d3abf683702a8742d24ead105ef3553b4552ad..c2b577209e29b54acc2112f809a7e1bfb508367a 100644 (file)
@@ -186,7 +186,7 @@ class RespondPollAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index fe51c667d510f8415af47b0f31cd7877a96b2125..15441420285d332cdf5daac06fac8b2c44d04e1a 100644 (file)
@@ -193,7 +193,7 @@ class Poll extends Managed_DataObject
                                         array('id' => $p->id));
         }
 
-        common_log(LOG_DEBUG, "Saving poll: $p->id $p->uri");
+        common_debug("Saving poll: $p->id $p->uri");
         $p->insert();
 
         // TRANS: Notice content creating a poll.
index 20b7700147bc1006c2a89200b0c2488ed71f5e40..0fc08443fa7ee3ecd5fb71cce05fc60c9dbe2c60 100644 (file)
@@ -155,7 +155,7 @@ class Poll_response extends Managed_DataObject
                                         array('id' => $pr->id));
         }
 
-        common_log(LOG_DEBUG, "Saving poll response: $pr->id $pr->uri");
+        common_debug("Saving poll response: $pr->id $pr->uri");
         $pr->insert();
 
         // TRANS: Notice content voting for a poll.
index 3b4ccd272b258afd485a758e6866b7106e142008..72492deacac968b14b304d394a3a39211bba2ccb 100644 (file)
@@ -40,7 +40,7 @@ class PostDebugPlugin extends Plugin
      */
     public $dir=false;
 
-    public function onArgsInitialize(&$args)
+    public function onArgsInitialize(array &$args)
     {
         if (isset($_SERVER['REQUEST_METHOD']) &&
             $_SERVER['REQUEST_METHOD'] == 'POST') {
@@ -48,7 +48,7 @@ class PostDebugPlugin extends Plugin
         }
     }
 
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'PostDebug',
                             'version' => GNUSOCIAL_VERSION,
@@ -81,7 +81,7 @@ class PostDebugPlugin extends Plugin
             $file = $this->dir . DIRECTORY_SEPARATOR . $this->logFileName();
             file_put_contents($file, $output);
         } else {
-            common_log(LOG_DEBUG, "PostDebug: $output");
+            common_debug("PostDebug: $output");
         }
     }
 
index 7696333145afd0106753e1c62561fcfa7556a20b..3a3e767e43df2f58805eb4124a8cdc8a0818a876 100644 (file)
@@ -51,13 +51,14 @@ class PtitUrlPlugin extends UrlShortenerPlugin
         @$dom->loadHTML($response);
         $y = @simplexml_import_dom($dom);
         if (!isset($y->body)) return;
+        // @TODO Super-ugly style???
         $xml = $y->body->center->table->tr->td->pre->a->attributes();
         if (isset($xml['href'])) {
             return strval($xml['href']);
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => sprintf('PtitUrl (%s)', $this->shortenerName),
                             'version' => GNUSOCIAL_VERSION,
index bdd54afd2ea7ca995c394be2a1995017fab0ba37..056d7a2582dd24bc3444151dedafd0607259b2c0 100644 (file)
@@ -124,7 +124,7 @@ class QnAPlugin extends MicroAppPlugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array(
             'name'        => 'QnA',
@@ -424,28 +424,28 @@ class QnAPlugin extends MicroAppPlugin
     {
         switch ($notice->object_type) {
         case QnA_Question::OBJECT_TYPE:
-            common_log(LOG_DEBUG, "Deleting question from notice...");
+            common_debug("Deleting question from notice...");
             $question = QnA_Question::fromNotice($notice);
             $question->delete();
             break;
         case QnA_Answer::OBJECT_TYPE:
-            common_log(LOG_DEBUG, "Deleting answer from notice...");
+            common_debug("Deleting answer from notice...");
             $answer = QnA_Answer::fromNotice($notice);
-            common_log(LOG_DEBUG, "to delete: $answer->id");
+            common_debug("to delete: $answer->id");
             $answer->delete();
             break;
         default:
-            common_log(LOG_DEBUG, "Not deleting related, wtf...");
+            common_debug("Not deleting related, wtf...");
         }
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $action->script($this->path('js/qna.js'));
         return true;
     }
 
-    function onEndShowStyles($action)
+    function onEndShowStyles(Action $action)
     {
         $action->cssLink($this->path('css/qna.css'));
         return true;
index b8fed19480263d6e5da5dad09cc4ef3d16b22372..52e69a3aa62d6571220fc381d6e32e7e3dca15e2 100644 (file)
@@ -185,7 +185,7 @@ class QnaclosequestionAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index aad207fba215e5f2df1c1087af8fbf6aecd58ccf..1a16a3fa6b9ad790950781b283d020825e729e22 100644 (file)
@@ -197,7 +197,7 @@ class QnanewanswerAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index ab3c9db136d76ec22ad89de334be5af620de1c69..c7a126e703bf88c1976bd4952e201d8460ae8b66 100644 (file)
@@ -208,7 +208,7 @@ class QnanewquestionAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index e2e76a787356b768bceea32094c81f507c1cfc21..43ce50429c1cdb9838dee790efcab8dfc9d562b9 100644 (file)
@@ -256,7 +256,7 @@ class QnareviseanswerAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index 6cda1ff827fef15e8d008a04411f793424a029e9..ee0cd45860d7b4a75bea9617d696d5b0af3fd04f 100644 (file)
@@ -184,7 +184,7 @@ class Qnavote extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
index f4bf7a9d412ee7c21e072d69b71a00cb4fc372fe..57f55c2748552c808207da5908d9f7735f1f57e4 100644 (file)
@@ -256,7 +256,7 @@ class QnA_Answer extends Managed_DataObject
             array('id' => $answer->id)
         );
 
-        common_log(LOG_DEBUG, "Saving answer: $answer->id, $answer->uri");
+        common_debug("Saving answer: $answer->id, $answer->uri");
         $answer->insert();
 
         $content  = sprintf(
index b421b0aed19a952c98ea5a69ff2762e84afe944d..66eb1b12362b7b826f307212bb20f5fded21946d 100644 (file)
@@ -261,7 +261,7 @@ class QnA_Question extends Managed_DataObject
             );
         }
 
-        common_log(LOG_DEBUG, "Saving question: $q->id $q->uri");
+        common_debug("Saving question: $q->id $q->uri");
         $q->insert();
 
         if (Notice::contentTooLong($q->title . ' ' . $q->uri)) {
index 13679acd2c8c878aa3b6271108fbb12434e33f35..9bed5b15b3439e5742662bc1dd8aa5ba3c314fe0 100644 (file)
@@ -120,7 +120,7 @@ class QnA_Vote extends Managed_DataObject
         $v->vote        = $vote;
         $v->created     = common_sql_now();
 
-        common_log(LOG_DEBUG, "Saving vote: $v->id $v->vote");
+        common_debug("Saving vote: $v->id $v->vote");
 
         $v->insert();
     }
index 823094f269eace621d530cf66a4ca0e80f4ff46f..dca884a0f6abbad660df45b7e9876fc9532054a4 100644 (file)
@@ -102,7 +102,7 @@ class RSSCloudPlugin extends Plugin
      *
      * @return boolean hook return
      */
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('/main/rsscloud/request_notify',
                     array('action' => 'RSSCloudRequestNotify'));
@@ -153,7 +153,7 @@ class RSSCloudPlugin extends Plugin
      * @return boolean hook return
      */
 
-    function onStartEnqueueNotice($notice, &$transports)
+    function onStartEnqueueNotice(Notice $notice, array &$transports)
     {
         if ($notice->isLocal()) {
             array_push($transports, 'rsscloud');
@@ -192,13 +192,13 @@ class RSSCloudPlugin extends Plugin
      *
      * @return boolean hook return
      */
-    function onEndInitializeQueueManager($manager)
+    function onEndInitializeQueueManager(QueueManager $manager)
     {
         $manager->connect('rsscloud', 'RSSCloudQueueHandler');
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'RSSCloud',
                             'version' => RSSCLOUDPLUGIN_VERSION,
index 824fa9ee9c7d678fe50f65b0d28a40209c282f4f..7dc6252af887cee5cc99c70cd466969b1659bdc7 100644 (file)
@@ -57,7 +57,7 @@ class LoggingAggregatorAction extends Action
      *
      * @return boolean false if user doesn't exist
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -77,7 +77,7 @@ class LoggingAggregatorAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index 7fd6da05098bc401f9073812ca372dbcd6f0df76..91b01e21d9ee4eb6deba692053d7f16c71a88603 100644 (file)
@@ -50,7 +50,7 @@ class RSSCloudRequestNotifyAction extends Action
      *
      * @return boolean false if user doesn't exist
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -82,7 +82,7 @@ class RSSCloudRequestNotifyAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index d41f8eca425e57367999a0e2b05809ab9cee06ac..2ef20277e7798cf209a3f1d5f6110eaf32928627 100644 (file)
@@ -85,7 +85,7 @@ class RealtimePlugin extends Plugin
         return true;
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $channel = $this->_getChannel($action);
 
@@ -310,7 +310,7 @@ class RealtimePlugin extends Plugin
         return false; // No default processing
     }
 
-    function noticeAsJson($notice)
+    function noticeAsJson(Notice $notice)
     {
         // FIXME: this code should be abstracted to a neutral third
         // party, like Notice::asJson(). I'm not sure of the ethics
@@ -346,7 +346,7 @@ class RealtimePlugin extends Plugin
         return $arr;
     }
 
-    function getNoticeTags($notice)
+    function getNoticeTags(Notice $notice)
     {
         $tags = null;
 
@@ -381,7 +381,7 @@ class RealtimePlugin extends Plugin
      *
      * @return boolean hook return value
      */
-    function onEndScriptMessages($action, &$messages)
+    function onEndScriptMessages(Action $action, &$messages)
     {
         // TRANS: Text label for realtime view "play" button, usually replaced by an icon.
         $messages['realtime_play'] = _m('BUTTON', 'Play');
index ee092ce2bc45e38674d47409b1d447397d2dac7c..5439db9ed65b4a9c6b8a796d2993896af5e4c927 100644 (file)
@@ -104,10 +104,9 @@ class ClosechannelAction extends Action
      * MAY override
      *
      * @param array $args other arguments
-     *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index e9319ed916e5b99899e8b27a7477f10939a618bf..72618001f3c86842e3b89aecfc33ffaa546cebe2 100644 (file)
@@ -104,10 +104,9 @@ class KeepalivechannelAction extends Action
      * MAY override
      *
      * @param array $args other arguments
-     *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index ea195b02cddccb7b113f82f31329e9247ae54696..220d85b7e4b10355e4f64ac021524bacb37c4e78 100644 (file)
@@ -33,7 +33,7 @@ Garbage-collects old realtime channels
 
 END_OF_CLEANUPCHANNELS_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function cleanupChannels()
 {
index 10bf2a3c0488a2ae40dec0b132ec334597019777..13709e23ab7cb769a7d57f80ba316022b3378ed3 100644 (file)
@@ -67,7 +67,7 @@ class RecaptchaPlugin extends Plugin
         return true;
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         if (isset($action->recaptchaPluginNeedsOutput) && $action->recaptchaPluginNeedsOutput) {
             // Load the AJAX API
@@ -85,7 +85,7 @@ class RecaptchaPlugin extends Plugin
         return true;
     }
 
-    function onStartRegistrationTry($action)
+    function onStartRegistrationTry(Action $action)
     {
         $resp = recaptcha_check_answer ($this->private_key,
                                         $_SERVER["REMOTE_ADDR"],
@@ -104,7 +104,7 @@ class RecaptchaPlugin extends Plugin
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Recaptcha',
                             'version' => GNUSOCIAL_VERSION,
index dbff2bace8c853842a75f0e95da6eba93679187f..4a965608e1bf3aefb3e0aaf483e9127b59cf4553 100644 (file)
@@ -91,7 +91,7 @@ class RegisterThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    public function onStartRegistrationTry($action)
+    public function onStartRegistrationTry(Action $action)
     {
         $ipaddress = $this->_getIpAddress();
 
@@ -175,7 +175,7 @@ class RegisterThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'RegisterThrottle',
                             'version' => GNUSOCIAL_VERSION,
index f7e17f80c8dd190549be5ad252d2c172722ac4c5..99f61dcf02ce5e97d019f9f9cbb54640ee4e5967 100644 (file)
@@ -80,7 +80,7 @@ class RequireValidatedEmailPlugin extends Plugin
      */
     public $disallowLogin = false;
 
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('main/confirmfirst/:code',
                     array('action' => 'confirmfirstemail'));
@@ -209,7 +209,7 @@ class RequireValidatedEmailPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] =
           array('name' => 'Require Validated Email',
index 4d2000ab0fe714903549880f040c1f97dc77cad0..6935e00ee5ff192073faf1faf3c99ba6ed5a1a5e 100644 (file)
@@ -30,7 +30,7 @@ Registers a new user by email address and sends a confirmation email
 
 END_OF_REGISTERBYEMAIL_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $email = get_option_value('e', 'email');
 
index 959648bc8909ee3fb833c62e68a02b4cacbfc2ab..9a85a974aec9a4498e1ae0492ad07c332d715419 100644 (file)
@@ -57,7 +57,7 @@ class ReverseUsernameAuthenticationPlugin extends AuthenticationPlugin
         return User::register($registration_data);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Reverse Username Authentication',
                             'version' => GNUSOCIAL_VERSION,
index a29a7f5bea218237b870c58e636c56df94bb5853..bacb1f2a95cf95c6f08ee6c6cd7f9d69bb5824e9 100644 (file)
@@ -31,7 +31,7 @@ class SQLProfilePlugin extends Plugin
 {
     private $recursionGuard = false;
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'SQLProfile',
                             'version' => GNUSOCIAL_VERSION,
@@ -58,7 +58,7 @@ class SQLProfilePlugin extends Plugin
                         (strpos($extra, 'Using temporary') !== false);
                 if ($evil) {
                     $xquery = $xobj->sanitizeQuery($query);
-                    common_log(LOG_DEBUG, "$extra | $xquery");
+                    common_debug("$extra | $xquery");
                 }
             }
         }
index b20f72be424cd396ad28c511acbb7a4f377846d7..f67ed03012e695b1847f51f55eb3b7f06a3993d7 100644 (file)
@@ -34,7 +34,7 @@ class SQLStatsPlugin extends Plugin
     protected $queryTimes = array();
     protected $queries    = array();
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'SQLStats',
                             'version' => GNUSOCIAL_VERSION,
index 8758013a4147fc85dd7f98906df5a88405190c9a..80c46d17c4887e13975d730f5fbe5548edfc211e 100644 (file)
@@ -222,7 +222,7 @@ class SamplePlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Sample',
                             'version' => GNUSOCIAL_VERSION,
index da5682b332a0b4e6eadace042f393b725a049df5..70e8ec10a7ae56f89dd3350488167100509dcc26 100644 (file)
@@ -66,7 +66,7 @@ class HelloAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -91,7 +91,7 @@ class HelloAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -163,7 +163,7 @@ class HelloAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
index dc7ff7b19a2fff843bb2db3e85ec3d696cd0d2af..4c8d2121047fd528a8f6006dc8aaf8843d66067f 100644 (file)
@@ -88,7 +88,7 @@ class SearchSubPlugin extends Plugin
      *
      * @return value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'SearchSub',
                             'version' => self::VERSION,
@@ -165,7 +165,8 @@ class SearchSubPlugin extends Plugin
     function onStartNoticeSearchShowResults($action, $q, $notice)
     {
         $user = common_current_user();
-        if ($user) {
+
+        if ($user instanceof User) {
             $search = $q;
             $searchsub = SearchSub::pkeyGet(array('search' => $search,
                                                   'profile_id' => $user->id));
@@ -174,6 +175,7 @@ class SearchSubPlugin extends Plugin
             } else {
                 $form = new SearchSubForm($action, $search);
             }
+
             $action->elementStart('div', 'entity_actions');
             $action->elementStart('ul');
             $action->elementStart('li', 'entity_subscribe');
@@ -182,6 +184,7 @@ class SearchSubPlugin extends Plugin
             $action->elementEnd('ul');
             $action->elementEnd('div');
         }
+
         return true;
     }
 
index cf9e5e5e949f3de1c4f2ee8ca499e6f026e4c5da..ee7a88e2dfc163b70600ebc3e4aceb99b9a2ef18 100644 (file)
@@ -63,7 +63,7 @@ class SearchsubAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         if ($this->boolean('ajax')) {
@@ -118,7 +118,7 @@ class SearchsubAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         // Throws exception on error
 
index 54563ed0e7162c862092d9fd3fb004e081cbe9b8..99879319dcf4910ff7c2660180fa82c5ef6d2b63 100644 (file)
@@ -140,7 +140,7 @@ class SearchSubsAction extends GalleryAction
 
 class SearchSubscriptionsList extends SubscriptionList
 {
-    function newListItem($searchsub)
+    function newListItem(SearchSub $searchsub)
     {
         return new SearchSubscriptionsListItem($searchsub, $this->owner, $this->action);
     }
index a6ce0f07c5b9e0e681e0da9e39bc42c8b7cb03f3..8e135e62fa26adfad9fb7ca2386c082929ccc659 100644 (file)
@@ -62,7 +62,7 @@ class SearchunsubAction extends SearchsubAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         // Throws exception on error
 
index bb09b94605dd853f28eeea8e18f2c2c7b8bea33a..7a6fd28feee10b5d9776611df46f3c2fc8957543 100644 (file)
@@ -209,7 +209,7 @@ class FacebookShareTarget extends NoticeShareTarget
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:ShareNotice';
 
index 574b466df659b43fd9df0571d7fb218d65c13f77..41e1998483b771928b37b8f6bb9647c966bb271c 100644 (file)
@@ -47,7 +47,7 @@ class SimpleUrlPlugin extends UrlShortenerPlugin
         return $this->http_get(sprintf($this->serviceUrl,urlencode($url)));
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => sprintf('SimpleUrl (%s)', $this->shortenerName),
                             'version' => GNUSOCIAL_VERSION,
index 3131847349f80b9eb1f434001ab47b4bfa73c0d1..869a88dfc9278233485ce6ec9490a5cd9c9dd728 100644 (file)
@@ -55,7 +55,7 @@ class SiteNoticeInSidebarPlugin extends Plugin
      * @return
      */
 
-    function onStartShowSiteNotice($action)
+    function onStartShowSiteNotice(Action $action)
     {
         return false;
     }
@@ -70,7 +70,7 @@ class SiteNoticeInSidebarPlugin extends Plugin
         return true;
     }
 
-    function onEndShowStyles($action)
+    function onEndShowStyles(Action $action)
     {
         $action->element('style', null, '#site_notice { width: 100% }');
         return true;
index 3d83629bb2dc1acfa59b6f2d1e61bcaf6d6d752d..bab0d9fa9bb1ade283a28e72cc9296aca42cc0d7 100644 (file)
@@ -154,7 +154,7 @@ class SitemapPlugin extends Plugin
         return true;
     }
 
-    function onEndAdminPanelNav($menu) {
+    function onEndAdminPanelNav(Menu $menu) {
         if (AdminPanelAction::canAdmin('sitemap')) {
             // TRANS: Menu item title/tooltip
             $menu_title = _m('Sitemap configuration');
@@ -174,7 +174,7 @@ class SitemapPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:Sitemap';
 
index efa23b94010e27589c92725faaa13f8083f9a789..d91dc4fc5689d2cdc15209d48fc04daa41b9d09f 100644 (file)
@@ -45,7 +45,7 @@ class NoticesitemapAction extends SitemapAction
     var $notices = null;
     var $j = 0;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
index ef77645c3166133aeeff59eddfd43574d0a7c2e1..6401f8f311c2c597a31fdbb10d658fdbac5f1c65 100644 (file)
@@ -49,7 +49,7 @@ class SitemapAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index ab89c2156c936afd18b52f6ea5b64502bd6b80e0..e18c7d6ac5a446dcf1915035dbf1d16a80d5592c 100644 (file)
@@ -49,7 +49,7 @@ class SitemapindexAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         header('Content-Type: text/xml; charset=UTF-8');
         $this->startXML();
index c39165d0edb97bf34f6a628a1ca21aae0a2b2795..eea79d4b1d8f82eb271299829736b2f7e13850c9 100644 (file)
@@ -45,7 +45,7 @@ class UsersitemapAction extends SitemapAction
     var $users = null;
     var $j     = 0;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
index 91bc0ac4e9720a23532973182c7bb749a06e1bb7..744dab82876e816f023fe1cd0878873eb7855bfe 100644 (file)
@@ -26,7 +26,7 @@ Update the notice and user counts cached in the database.
 
 END_OF_UPDATECOUNTS_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 // Will fill the cache
 
index 92d1f55c3f5d365bcb50d2d36601a57dfa6ba0fd..e8435fa05a4c423b3ab17ea22dfc60557796a876 100644 (file)
@@ -65,7 +65,7 @@ class SlicedFavoritesPlugin extends Plugin
     }
 
     // Take over the default... :D
-    function onArgsInitialize($args)
+    function onArgsInitialize(array &$args)
     {
         if (array_key_exists('action', $args)) {
             $action = trim($args['action']);
@@ -95,7 +95,7 @@ class SlicedFavoritesPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:SlicedFavorites';
 
index 5c9fb31f8f97a790364d872a996b2a11e13bba27..285bfbbc67cd06a4376cbd5ed90565f8565302ed 100644 (file)
@@ -45,7 +45,7 @@ class FavoritedSliceAction extends FavoritedAction
      *
      * @todo move queries from showContent() to here
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -121,13 +121,13 @@ class FavoritedSliceAction extends FavoritedAction
         $exclude = $this->nicknamesToIds($this->excludeUsers);
 
         if (count($include) == 1) {
-            return "profile_id = " . intval($include[0]);
+            return '`profile_id` = ' . intval($include[0]);
         } else if (count($include) > 1) {
-            return "profile_id IN (" . implode(',', $include) . ")";
+            return '`profile_id` IN (' . implode(',', $include) . ')';
         } else if (count($exclude) == 1) {
-            return "profile_id != " . intval($exclude[0]);
+            return '`profile_id` != ' . intval($exclude[0]);
         } else if (count($exclude) > 1) {
-            return "profile_id NOT IN (" . implode(',', $exclude) . ")";
+            return '`profile_id` NOT IN (' . implode(',', $exclude) . ')';
         } else {
             return false;
         }
@@ -144,7 +144,8 @@ class FavoritedSliceAction extends FavoritedAction
         foreach ($nicks as $nick) {
             // not the most efficient way for a big list!
             $user = User::getKV('nickname', $nick);
-            if ($user) {
+
+            if ($user instanceof User) {
                 $ids[] = intval($user->id);
             }
         }
index be7fc9536861c7f3bc77066e355ea437e849a2a0..74744f18e63bd7439c1004b6f1499160d52c2fc3 100644 (file)
@@ -105,7 +105,7 @@ class SphinxSearchPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:SphinxSearch';
 
index e7f397747807755a169557d3ee77441da7eb3849..000a929243cf0469a436d8ce5ba3a3f76ac9834a 100755 (executable)
@@ -32,7 +32,7 @@ Generates sphinx.conf file based on StatusNet configuration.
 
 END_OF_TRIM_HELP;
 
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
 require dirname(__FILE__) . '/sphinx-utils.php';
 
 
index abac5434f7d33ba1946ba49bd075bc3a5e0b891c..79d9040e0e65bd4e3da5d554bbe4406de00bfdde 100755 (executable)
@@ -34,7 +34,7 @@ Runs Sphinx search indexer.
 
 END_OF_TRIM_HELP;
 
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
 require dirname(__FILE__) . '/sphinx-utils.php';
 
 sphinx_iterate_sites('sphinx_index_update');
index 5877694e0f0d7e1851d4589e4530bfd8e422b697..f001fc39092c200369c7f41e3805eb8ac2459e5a 100644 (file)
@@ -67,7 +67,7 @@ class SpotifyPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Spotify',
                             'version' => SPOTIFYPLUGIN_VERSION,
index 682b10cad287f01bfbece89e61fd5f80b18d1ee5..f94abb9b2010a151e7088ddbf6fe929835755ea5 100644 (file)
@@ -41,15 +41,15 @@ class StrictTransportSecurityPlugin extends Plugin
         parent::__construct();
     }
 
-    function onArgsInitialize($args)
+    function onArgsInitialize(array &$args)
     {
         $path = common_config('site', 'path');
         if(common_config('site', 'ssl') == 'always' && ($path == '/' || ! $path )) {
-            header('Strict-Transport-Security: max-age=' . $this->max_age . + ($this->includeSubDomains?'; includeSubDomains':''));
+            header('Strict-Transport-Security: max-age=' . $this->max_age . + ($this->includeSubDomains ? '; includeSubDomains' : ''));
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'StrictTransportSecurity',
                             'version' => GNUSOCIAL_VERSION,
index a21cb4355131d5c658fac811b27dcd566563d409..13a8a9fd71633151a8dad946602fc675c927cc1e 100644 (file)
@@ -57,7 +57,7 @@ class SubMirrorPlugin extends Plugin
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'SubMirror',
                             'version' => GNUSOCIAL_VERSION,
@@ -115,7 +115,7 @@ class SubMirrorPlugin extends Plugin
         return true;
     }
 
-    function onStartEnqueueNotice($notice, &$transports)
+    function onStartEnqueueNotice(Notice $notice, array &$transports)
     {
         $transports[] = 'mirror';
     }
index b5a49fe4fadb84846ef0968e46c01e3e60bede6e..f0d00d6e55923008cccda46a1ae2b7a9e5b4e0ee 100644 (file)
@@ -90,7 +90,8 @@ class MirrorSettingsAction extends SettingsAction
     function showFeedForm($mirror)
     {
         $profile = Profile::getKV('id', $mirror->subscribed);
-        if ($profile) {
+
+        if ($profile instanceof Profile) {
             $form = new EditMirrorForm($this, $profile);
             $form->show();
         }
@@ -118,7 +119,7 @@ class MirrorSettingsAction extends SettingsAction
      *
      * @todo move the ajax display handling to common code
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($this->boolean('ajax')) {
             $this->startHTML('text/xml;charset=utf-8');
index b19a03d11c1d554d799be0514a440b4d0dd76d51..fec91afdb78d859efd0ed72be1028802e079596f 100644 (file)
@@ -157,7 +157,7 @@ class SubscriptionThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'SubscriptionThrottle',
                             'version' => GNUSOCIAL_VERSION,
index 0dd7a902efe1d8868a5607a83468ed43791c9181..4affc42c3f867bc94bdfda3bcbf2b80d7feed2c6 100644 (file)
@@ -39,12 +39,12 @@ class TabFocusPlugin extends Plugin
         parent::__construct();
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $action->script($this->path('tabfocus.js'));
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'TabFocus',
                             'version' => GNUSOCIAL_VERSION,
index ef58553d2eb3f28a548d251efcfdc977ab98c490..ed65665ecc6c3f7dc0d6b4fbc6fd660c9dc763e4 100644 (file)
@@ -89,7 +89,7 @@ class TagSubPlugin extends Plugin
      *
      * @return value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'TagSub',
                             'version' => self::VERSION,
@@ -136,7 +136,8 @@ class TagSubPlugin extends Plugin
     function onStartTagShowContent(TagAction $action)
     {
         $user = common_current_user();
-        if ($user) {
+
+        if ($user instanceof User) {
             $tag = $action->trimmed('tag');
             $tagsub = TagSub::pkeyGet(array('tag' => $tag,
                                             'profile_id' => $user->id));
@@ -153,6 +154,7 @@ class TagSubPlugin extends Plugin
             $action->elementEnd('ul');
             $action->elementEnd('div');
         }
+
         return true;
     }
 
index 4550716cab8f39bb63c004dbbe15dff70e577f53..f60d78e526b42b0eeb86c8a05600abfa04ec4600 100644 (file)
@@ -63,7 +63,7 @@ class TagsubAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
         if ($this->boolean('ajax')) {
@@ -118,7 +118,7 @@ class TagsubAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         // Throws exception on error
 
index be195250f679027c715177dc6e1dc9c8cd0fe617..12d15aa620c3db9e1c869681292aa934f482241a 100644 (file)
@@ -140,7 +140,7 @@ class TagSubsAction extends GalleryAction
 
 class TagSubscriptionsList extends SubscriptionList
 {
-    function newListItem($tagsub)
+    function newListItem(TagSub $tagsub)
     {
         return new TagSubscriptionsListItem($tagsub, $this->owner, $this->action);
     }
index 43afab08e374c5e2b9dbbcf826b9f746887dcb27..58626d626da9e78968f17079b50bdd807d5126eb 100644 (file)
@@ -62,7 +62,7 @@ class TagunsubAction extends TagsubAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         // Throws exception on error
 
index d9414a8e8c427866d1e01ddff33ea9edc6c18182..52e51843923a95952f2a9c48b46c5e6de34a3032 100644 (file)
@@ -57,7 +57,7 @@ class TightUrlPlugin extends UrlShortenerPlugin
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => sprintf('TightUrl (%s)', $this->shortenerName),
                             'version' => GNUSOCIAL_VERSION,
index 08da1048fc12f282fee1cac7988c904bd13b6836..03d45e881fbef5b1bd36d824645aed38b452cf3b 100644 (file)
@@ -58,7 +58,7 @@ class TinyMCEPlugin extends Plugin
     // "richedit" role get it.
     public $restricted = false;
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         if (common_logged_in() && $this->isAllowedRichEdit()) {
             $action->script(common_path('plugins/TinyMCE/js/jquery.tinymce.js'));
@@ -68,7 +68,7 @@ class TinyMCEPlugin extends Plugin
         return true;
     }
 
-    function onEndShowStyles($action)
+    function onEndShowStyles(Action $action)
     {
         if ($this->isAllowedRichEdit()) {
             $action->style('span#notice_data-text_container, span#notice_data-text_parent { float: left }');
@@ -76,7 +76,7 @@ class TinyMCEPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'TinyMCE',
             'version' => GNUSOCIAL_VERSION,
index 643591cf775e1fb8d62ad6c75964e43e78c656b8..811a9cca30c99fabdd09172088f01dd07b728291 100644 (file)
@@ -193,7 +193,7 @@ class TwitterBridgePlugin extends Plugin
      *
      * @return boolean hook return
      */
-    function onStartEnqueueNotice($notice, &$transports)
+    function onStartEnqueueNotice(Notice $notice, array &$transports)
     {
         if (self::hasKeys() && $notice->isLocal() && $notice->inScope(null)) {
             // Avoid a possible loop
@@ -211,7 +211,7 @@ class TwitterBridgePlugin extends Plugin
      *
      * @return boolean hook return
      */
-    function onGetValidDaemons(&$daemons)
+    function onGetValidDaemons(array &$daemons)
     {
         if (self::hasKeys()) {
             array_push(
@@ -238,7 +238,7 @@ class TwitterBridgePlugin extends Plugin
      *
      * @return boolean hook return
      */
-    function onEndInitializeQueueManager($manager)
+    function onEndInitializeQueueManager(QueueManager $manager)
     {
         if (self::hasKeys()) {
             // Outgoing notices -> twitter
@@ -270,7 +270,7 @@ class TwitterBridgePlugin extends Plugin
      * @return boolean hook value
      */
 
-    function onEndAdminPanelNav($nav)
+    function onEndAdminPanelNav(Menu $nav)
     {
         if (AdminPanelAction::canAdmin('twitter')) {
 
@@ -297,7 +297,7 @@ class TwitterBridgePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array(
             'name' => 'TwitterBridge',
index ce6af091e2d5adcd61a8ccca503ad024417e7b52..30f8141a97d4051be97930d688d109018d0724c1 100644 (file)
@@ -65,7 +65,7 @@ class TwitterauthorizationAction extends Action
      *
      * @return boolean true
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -83,7 +83,7 @@ class TwitterauthorizationAction extends Action
      *
      * @return nothing
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index ee00714c9f18f14f9adfb369da93b4b5cd6921b5..3b2dc2103968ab599ca5fe94b185adfe85bc8ead 100644 (file)
@@ -48,7 +48,7 @@ require_once dirname(__DIR__) . '/twitter.php';
  */
 class TwitterloginAction extends Action
 {
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
index a3862eedfde45e9fcd67da1aa4101cb71b8fd87a..335bc2c7542fb79b692d37561dca8bfcd0bfc09e 100755 (executable)
@@ -30,7 +30,7 @@ Batch script for synching local friends with Twitter friends.
 
 END_OF_TRIM_HELP;
 
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
 require_once dirname(__DIR__) . '/twitter.php';
 
 /**
index 8b774889d19722214cea7595862bd8e8eb48359e..e563f534934ce2a4ce09c8eeaa99079a95b53e51 100644 (file)
@@ -33,7 +33,7 @@ Daemon script for receiving new notices from Twitter users.
 
 END_OF_TWITTERDAEMON_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 class TwitterDaemon extends SpawningDaemon
 {
index d444b8aa5dd70cd3f5c66ae090ad3d0ff33edaa3..7860a1fedf3b0d2086c82d4ca714835b17434856 100755 (executable)
@@ -36,7 +36,7 @@ Batch script for retrieving Twitter messages from foreign service.
 
 END_OF_TRIM_HELP;
 
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
 require_once INSTALLDIR . '/lib/common.php';
 require_once INSTALLDIR . '/lib/daemon.php';
 require_once dirname(__DIR__) . '/twitter.php';
@@ -157,7 +157,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
             return;
         }
 
-        common_log(LOG_DEBUG, $this->name() . ' - Trying to get ' . $timelineUri .
+        common_debug($this->name() . ' - Trying to get ' . $timelineUri .
                    ' timeline for Twitter user ' . $flink->foreign_id);
 
         $client = null;
@@ -165,7 +165,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
         if (TwitterOAuthClient::isPackedToken($flink->credentials)) {
             $token = TwitterOAuthClient::unpackToken($flink->credentials);
             $client = new TwitterOAuthClient($token->key, $token->secret);
-            common_log(LOG_DEBUG, $this->name() . ' - Grabbing ' . $timelineUri . ' timeline with OAuth.');
+            common_debug($this->name() . ' - Grabbing ' . $timelineUri . ' timeline with OAuth.');
         } else {
             common_log(LOG_ERR, "Skipping " . $timelineUri . " timeline for " .
                        $flink->foreign_id . " since not OAuth.");
@@ -175,7 +175,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
 
         $lastId = Twitter_synch_status::getLastId($flink->foreign_id, $timelineUri);
 
-        common_log(LOG_DEBUG, "Got lastId value '" . $lastId . "' for foreign id '" .
+        common_debug("Got lastId value '" . $lastId . "' for foreign id '" .
                      $flink->foreign_id . "' and timeline '" . $timelineUri. "'");
 
         try {
index f6ec1f3f5093495e09846e8cb6bf160350b2dda2..147f398da29e5705746f1c71d3e7cea97e4b3ec8 100644 (file)
@@ -55,7 +55,7 @@ abstract class JsonStreamReader
      */
     public function connect($url)
     {
-        common_log(LOG_DEBUG, "$this->id opening connection to $url");
+        common_debug("$this->id opening connection to $url");
 
         $scheme = parse_url($url, PHP_URL_SCHEME);
         if ($scheme == 'http') {
@@ -143,7 +143,7 @@ abstract class JsonStreamReader
     public function close()
     {
         if ($this->isConnected()) {
-            common_log(LOG_DEBUG, "$this->id closing connection.");
+            common_debug("$this->id closing connection.");
             fclose($this->socket);
             $this->socket = null;
         }
@@ -242,7 +242,7 @@ abstract class JsonStreamReader
             // TRANS: %1$s is the response code, %2$s is the line.
             throw new Exception(sprintf(_m('Bad HTTP response code %1$s: %2$s.'),$status,$line));
         }
-        common_log(LOG_DEBUG, "$this->id $line");
+        common_debug("$this->id $line");
         $this->state = 'headers';
     }
 
@@ -250,9 +250,9 @@ abstract class JsonStreamReader
     {
         if ($line == '') {
             $this->state = 'active';
-            common_log(LOG_DEBUG, "$this->id connection is active!");
+            common_debug("$this->id connection is active!");
         } else {
-            common_log(LOG_DEBUG, "$this->id read HTTP header: $line");
+            common_debug("$this->id read HTTP header: $line");
             $this->responseHeaders[] = $line;
         }
     }
index cc0c05f9a669abbe2bfd4496c526021f2341dda4..3fd5b607a8441e15f43bfa2c0d979153b2f77027 100644 (file)
@@ -53,7 +53,7 @@ class TweetInQueueHandler extends QueueHandler
         if ($notice instanceof Notice) {
             $flink = Foreign_link::getByForeignID($receiver, TWITTER_SERVICE);
             if ($flink instanceof Foreign_link) {
-                common_log(LOG_DEBUG, "TweetInQueueHandler - Got flink so add notice ".
+                common_debug("TweetInQueueHandler - Got flink so add notice ".
                            $notice->id." to attentions for user ".$flink->user_id);
                 try {
                     Attention::saveNew($notice, $flink->getProfile());
@@ -64,7 +64,7 @@ class TweetInQueueHandler extends QueueHandler
                                         $e->getMessage());
                 }
             } else {
-               common_log(LOG_DEBUG, "TweetInQueueHandler - No flink found for foreign user ".$receiver);
+               common_debug("TweetInQueueHandler - No flink found for foreign user ".$receiver);
             }
         }
 
index e827a07117ca7b44623c0db3875c323cfc3341f3..f112f4f1907971b5bffc86c2e7b9348e57e11252 100644 (file)
@@ -42,7 +42,7 @@ data as it comes.
 
 ENDOFHELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 if (have_option('n')) {
     $nickname = get_option_value('n');
index f4a60c479d62498474f45710d7aae87535126b47..12fb2457482399bdacc8662b95d5c781f34dbd08 100644 (file)
@@ -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
index 4e8340bb3f7c9a27473a22d3ccf4a67458446653..dc427a19fa1f73314676bb5dafba9812f83f8e42 100644 (file)
@@ -43,7 +43,7 @@ data as it comes.
 
 ENDOFHELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 require_once dirname(dirname(__FILE__)) . '/lib/jsonstreamreader.php';
 require_once dirname(dirname(__FILE__)) . '/lib/twitterstreamreader.php';
 
index a5fc470e079e19af0d9294837945130f8b0656cf..27ebefb05377612d783d8bb41d391dc4dbef0327 100644 (file)
@@ -175,7 +175,7 @@ class UserFlagPlugin extends Plugin
      *
      * @return boolean hook result
      */
-    function onEndBlockProfile($user, $profile)
+    function onEndBlockProfile(User $user, Profile $profile)
     {
         if ($this->flagOnBlock && !User_flag_profile::exists($profile->id,
                                                              $user->id)) {
@@ -196,9 +196,9 @@ class UserFlagPlugin extends Plugin
      *
      * @return boolean hook result
      */
-    function onProfileDeleteRelated($profile, &$related)
+    public function onProfileDeleteRelated(Profile $profile, array &$related)
     {
-        $related[] = 'user_flag_profile';
+        $related[] = 'User_flag_profile';
         return true;
     }
 
@@ -227,7 +227,7 @@ class UserFlagPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:UserFlag';
 
index 9b5b4088bf0f2555c1bf619750fda7a85ea296e6..8a7d478631200deb6cba077df4a47698045721be 100644 (file)
@@ -52,7 +52,7 @@ class AdminprofileflagAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -107,7 +107,7 @@ class AdminprofileflagAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -200,7 +200,7 @@ class FlaggedProfileList extends ProfileList
      *
      * @return ProfileListItem newly-created item
      */
-    function newListItem($profile)
+    function newListItem(Profile $profile)
     {
         return new FlaggedProfileListItem($this->profile, $this->action);
     }
index c2443d6d58e76521199b1da01595b3d70a8bff36..4d17779322399ad158f5cc5e8c91d078787a23fe 100644 (file)
@@ -49,7 +49,7 @@ class ClearflagAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
@@ -73,7 +73,7 @@ class ClearflagAction extends ProfileFormAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $this->handlePost();
index 4c4dc46f60ffcb044a3a7e6e932fa7b6ea3df7fd..707b9ec0ed13dce8b579a366a747e474697ee396 100644 (file)
@@ -49,7 +49,7 @@ class FlagprofileAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
@@ -73,7 +73,7 @@ class FlagprofileAction extends ProfileFormAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $this->handlePost();
index f881e9006a210a66ff227950ca01da7a568e8d1c..bd88ad000c5f46752f93ac8933667d8f8352cdfb 100644 (file)
@@ -55,7 +55,7 @@ class UserLimitPlugin extends Plugin
         return true;
     }
 
-    function onStartRegistrationTry($action)
+    function onStartRegistrationTry(Action $action)
     {
         $this->_checkMaxUsers();
         return true;
@@ -81,7 +81,7 @@ class UserLimitPlugin extends Plugin
         }
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'UserLimit',
                             'version' => GNUSOCIAL_VERSION,
index 254931e5fbc0c9d0286f1f2eb18ca7474171347f..6bd697cd0210012e9a1d9d3aa69b0c5f67c445f3 100644 (file)
@@ -67,7 +67,7 @@ class VideoThumbnailsPlugin extends Plugin
         }
 
         // Let's save our frame to a temporary file. If we fail, remove it.
-        $imgPath = tempnam(sys_get_temp_dir(), 'socialthumb');
+        $imgPath = tempnam(common_get_temp_dir(), 'socialthumb');
         if (!imagejpeg($frame->toGDImage(), $imgPath)) {
             @unlink($imgPath);
             return true;
@@ -75,7 +75,7 @@ class VideoThumbnailsPlugin extends Plugin
         return false;
     }
 
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Video Thumbnails',
                             'version' => GNUSOCIAL_VERSION,
index f7e428e54cd8202caa31b131c604a5fc62ae6925..5b7dc20d8681c50f61b302660dc03e38b21b87af 100644 (file)
@@ -31,7 +31,7 @@ if (!defined('GNUSOCIAL')) { exit(1); }
 
 class WebFingerPlugin extends Plugin
 {
-    public function onRouterInitialized($m)
+    public function onRouterInitialized(URLMapper $m)
     {
         $m->connect('.well-known/host-meta', array('action' => 'hostmeta'));
         $m->connect('.well-known/host-meta.:format',
@@ -137,7 +137,7 @@ class WebFingerPlugin extends Plugin
         }
     }
 
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'WebFinger',
                             'version' => GNUSOCIAL_VERSION,
index 6d22631dc1aa4523cd93795852d48dcfdc2cf41d..1ac5764dc5e147eaa58909d5cc7aef55f1e4a910 100644 (file)
@@ -33,7 +33,7 @@ abstract class XrdAction extends ManagedAction
 
     protected $xrd      = null;
 
-    public function isReadOnly($args)
+    public function isReadOnly(array $args=array())
     {
         return true;
     }
index f0baa597ce8489d923b4be8960efe42595a26cae..db33eb801ab173b886419bae290c53850df6a340 100644 (file)
@@ -104,7 +104,7 @@ class WikiHashtagsPlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'WikiHashtags',
                             'version' => self::VERSION,
index 6f45da6a707cbbbe8efbafad2736ed94f311c0ab..8c2327b385a6611e89957df538923a91794d4714 100644 (file)
@@ -49,7 +49,7 @@ if (!defined('STATUSNET')) {
  */
 class WikiHowProfilePlugin extends Plugin
 {
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'WikiHow avatar fetcher',
                             'version' => GNUSOCIAL_VERSION,
@@ -154,7 +154,7 @@ class WikiHowProfilePlugin extends Plugin
             $absolute = $base->resolve($src);
             $avatarUrl = strval($absolute);
 
-            common_log(LOG_DEBUG, "WikiHow avatar found for $profileUrl - $avatarUrl");
+            common_debug("WikiHow avatar found for $profileUrl - $avatarUrl");
             $data['avatar'] = $avatarUrl;
         }
 
@@ -178,7 +178,7 @@ class WikiHowProfilePlugin extends Plugin
 
         // @todo FIXME: This should be better encapsulated
         // ripped from OStatus via oauthstore.php (for old OMB client)
-        $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+        $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
         try {
             if (!copy($url, $temp_filename)) {
                 // TRANS: Exception thrown when fetching an avatar from a URL fails.
index 794356f60aaace681ae97e2935d4d8766e4921e7..66a3b889b740d9b607f2eb7402c7859c480bebd9 100644 (file)
@@ -106,7 +106,7 @@ class XCachePlugin extends Plugin
         return false;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'XCache',
                             'version' => GNUSOCIAL_VERSION,
index 2974e8b2ab40e29ed30f0371652f2751868a65c1..002055309d7e7090072b2ef277d1696aa966e416 100644 (file)
@@ -444,7 +444,7 @@ class XmppPlugin extends ImPlugin
      *
      * @return boolean hook return
      */
-    function onGetValidDaemons(&$daemons)
+    function onGetValidDaemons(array &$daemons)
     {
         if( isset($this->server) &&
             isset($this->port)   &&
@@ -462,7 +462,7 @@ class XmppPlugin extends ImPlugin
     }
 
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'XMPP',
                             'version' => GNUSOCIAL_VERSION,
index 372824ce54dc2f960958ad63af71fafdba55d40b..954639f18019ce82f4d238f7d53e7b32dc931e04 100644 (file)
@@ -81,7 +81,7 @@ class XmppManager extends ImManager
     {
         // Process the queue for as long as needed
         try {
-            common_log(LOG_DEBUG, "Servicing the XMPP queue.");
+            common_debug("Servicing the XMPP queue.");
             $this->stats('xmpp_process');
             $this->conn->processTime(0);
         } catch (XMPPHP_Exception $e) {
@@ -182,7 +182,7 @@ class XmppManager extends ImManager
             $this->pingid++;
         }
 
-        common_log(LOG_DEBUG, "Sending ping #{$this->pingid}");
+        common_debug("Sending ping #{$this->pingid}");
                $this->conn->send("<iq from='{" . $this->plugin->daemonScreenname() . "}' to='{$this->plugin->server}' id='ping_{$this->pingid}' type='get'><ping xmlns='urn:xmpp:ping'/></iq>");
         $this->lastping = $now;
         return true;
index d1b9259f8b81dcc18c00c30212d9e3498e2807a7..83f3f19ed0f0583535ef8cedc68a1c723d1ad184 100644 (file)
@@ -61,7 +61,7 @@ class YammeradminpanelAction extends AdminPanelAction
                 'imports done by verified administrators on the Yammer side.');
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         $ok = parent::prepare($args);
 
@@ -71,7 +71,7 @@ class YammeradminpanelAction extends AdminPanelAction
         return $ok;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         // @fixme move this to saveSettings and friends?
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
index 8a648702ca663dbfe984a29ad149d04b28ec8cae..cfd126fe52793e9ecd5d3da36629978de1030432 100644 (file)
@@ -38,7 +38,7 @@ class YammerauthAction extends AdminPanelAction
      *
      * @return void
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -54,7 +54,7 @@ class YammerauthAction extends AdminPanelAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($this->verify_token) {
             $runner->saveAuthToken($this->verify_token);
index 0992882670f251b633d654c9e362f39c0567109a..abd41dd99e271028e44acdf54d1524e5fd8e6695 100644 (file)
@@ -50,7 +50,8 @@ class YammerImporter
             return Profile::getKV('id', $profileId);
         } else {
             $user = User::getKV('nickname', $nickname);
-            if ($user) {
+
+            if ($user instanceof User) {
                 common_log(LOG_WARNING, "Copying Yammer profile info onto existing user $nickname");
                 $profile = $user->getProfile();
                 $this->savePropertiesOn($profile, $data['options'],
@@ -59,6 +60,7 @@ class YammerImporter
                 $user = User::register($data['options']);
                 $profile = $user->getProfile();
             }
+
             if ($data['avatar']) {
                 try {
                     $this->saveAvatar($data['avatar'], $profile);
@@ -159,7 +161,7 @@ class YammerImporter
             // Save "likes" as favorites...
             foreach ($data['faves'] as $nickname) {
                 $user = User::getKV('nickname', $nickname);
-                if ($user) {
+                if ($user instanceof User) {
                     try {
                         Fave::addNew($user->getProfile(), $notice);
                     } catch (Exception $e) {
@@ -339,7 +341,7 @@ class YammerImporter
 
                 // @fixme if we see a group link inline, don't add this?
                 $group = User_group::getKV('id', $groupId);
-                if ($group) {
+                if ($group instanceof User_group) {
                     $content .= ' !' . $group->nickname;
                 }
             }
@@ -447,7 +449,7 @@ class YammerImporter
 
         // @fixme this should be better encapsulated
         // ripped from oauthstore.php (for old OMB client)
-        $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+        $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
         try {
             if (!copy($url, $temp_filename)) {
                 // TRANS: Server exception thrown when an avatar could not be fetched.
index 211728c497fa9381bf53671738d1f2b8172768c7..59c4be2b912b93d82a87c53893f09f22946f24de 100755 (executable)
@@ -34,7 +34,7 @@ USAGE: allsites.php [OPTIONS]
 
 ENDOFHELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function print_all_sites() {
 
index 740ae25d446bbd0210f9af4aa6945b57a9d41fa1..409c2737e28b9120b6d1b00d115b87c9711137aa 100644 (file)
@@ -33,7 +33,7 @@ Export a StatusNet user history to a file
 
 END_OF_EXPORTACTIVITYSTREAM_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 try {
     $user = getUser();
index cec5773683ef8ef52d7c7b13ab615fe896a2163c..6a4c8c972ce6f396b072e3f97b8076c65ba93f46 100755 (executable)
@@ -32,7 +32,7 @@ Gives plugins a chance to update the database schema.
 
 END_OF_CHECKSCHEMA_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function tableDefs()
 {
index aef3f54aff50e1e305e402bee73a6ed1d9522bfd..04bf1083eef8e65b4261657bbe6b41f684c2a3f8 100755 (executable)
@@ -35,7 +35,7 @@ If the script seems to stop, it is processing correct File_thumbnail entries.
 
 END_OF_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 if (!have_option('y', 'yes')) {
     print "About to delete locally generated thumbnails to allow regeneration. Are you sure? [y/N] ";
index 4ba24c275a37031ac0efe583cdde5affb0d376b0..c6756a5cd623865ab798e59d984c937fa76a408c 100755 (executable)
@@ -34,7 +34,7 @@ Deletes a user's confirmed Jabber/XMPP address from the database.
 
 END_OF_DELETEUSER_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 c67d6275d89194cbcaf1641443e695a9ce14cd03..5904681edd8a7fbea0ad96b0e76373d37f09d6c4 100644 (file)
@@ -33,7 +33,7 @@ clears the cached object based on the args
 
 END_OF_CLEARCACHE_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $karg = get_option_value('k', 'key');
 
index 256743f5353bc43ff2c3a4c33957bd432d389223..5ffa5bda0de9e0611cc402d0c69da82869782828 100755 (executable)
@@ -33,7 +33,7 @@ Perform commands on behalf of a user, such as sub, unsub, join, drop
 
 END_OF_USERROLE_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function interpretCommand($user, $body)
 {
diff --git a/scripts/commandline.inc b/scripts/commandline.inc
deleted file mode 100644 (file)
index 89b61a3..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-<?php
-/*
- * StatusNet - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, StatusNet, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-// -*- mode: 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();
-}
-
-define('GNUSOCIAL', true);
-define('STATUSNET', true); //compatibility
-
-// Set various flags so we don't time out on long-running processes
-
-ini_set("max_execution_time", "0");
-ini_set("max_input_time", "0");
-set_time_limit(0);
-mb_internal_encoding('UTF-8');
-error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);
-
-// Add extlib to our path so we can get Console_Getopt
-
-$_extra_path = array(INSTALLDIR.'/extlib/');
-
-set_include_path(implode(PATH_SEPARATOR, $_extra_path) . PATH_SEPARATOR . get_include_path());
-
-require_once 'Console/Getopt.php';
-
-// Note: $shortoptions and $longoptions should be pre-defined!
-
-$_default_shortoptions = 'qvhc:s:p:';
-
-$_default_longoptions = array('quiet', 'verbose', 'help', 'conf=', 'server=', 'path=');
-
-if (isset($shortoptions)) {
-    $shortoptions .= $_default_shortoptions;
-} else {
-    $shortoptions = $_default_shortoptions;
-}
-
-if (isset($longoptions)) {
-    $longoptions = array_merge($longoptions, $_default_longoptions);
-} else {
-    $longoptions = $_default_longoptions;
-}
-
-$parser = new Console_Getopt();
-
-$result = $parser->getopt($argv, $shortoptions, $longoptions);
-
-if (PEAR::isError($result)) {
-    print $result->getMessage()."\n";
-    exit(1);
-} else {
-    list($options, $args) = $result;
-}
-
-function show_help()
-{
-    global $helptext;
-
-    $_default_help_text = <<<END_OF_DEFAULT
-      General options:
-
-    -q --quiet           Quiet (little output)
-    -v --verbose         Verbose (lots of output)
-    -c --conf=<filename> Use <filename> as config file
-    -s --server=<name>   Use <name> as server name
-    -p --path=<path>     Use <path> as path name
-    -h --help            Show this message and quit.
-
-END_OF_DEFAULT;
-    if (isset($helptext)) {
-        print $helptext;
-    }
-    print $_default_help_text;
-    exit(0);
-}
-
-foreach ($options as $option) {
-
-    switch ($option[0]) {
-     case '--server':
-     case 's':
-        $server = $option[1];
-        break;
-
-     case '--path':
-     case 'p':
-        $path = $option[1];
-        break;
-
-     case '--conf':
-     case 'c':
-        $conffile = $option[1];
-        break;
-
-     case '--help':
-     case 'h':
-        show_help();
-    }
-}
-
-require_once INSTALLDIR . '/lib/common.php';
-
-set_error_handler('common_error_handler');
-
-// Set up the language infrastructure so we can localize anything that
-// needs to be sent out to users, such as mail notifications.
-common_init_language();
-
-function _make_matches($opt, $alt)
-{
-    $matches = array();
-
-    if (strlen($opt) > 1 && 0 != strncmp($opt, '--', 2)) {
-        $matches[] = '--'.$opt;
-    } else {
-        $matches[] = $opt;
-    }
-
-    if (!empty($alt)) {
-        if (strlen($alt) > 1 && 0 != strncmp($alt, '--', 2)) {
-            $matches[] = '--'.$alt;
-        } else {
-            $matches[] = $alt;
-        }
-    }
-
-    return $matches;
-}
-
-function have_option($opt, $alt=null)
-{
-    global $options;
-
-    $matches = _make_matches($opt, $alt);
-
-    foreach ($options as $option) {
-        if (in_array($option[0], $matches)) {
-            return true;
-        }
-    }
-
-    return false;
-}
-
-function get_option_value($opt, $alt=null)
-{
-    global $options;
-
-    $matches = _make_matches($opt, $alt);
-
-    foreach ($options as $option) {
-        if (in_array($option[0], $matches)) {
-            return $option[1];
-        }
-    }
-
-    return null;
-}
-
-class NoUserArgumentException extends Exception
-{
-}
-
-function getUser()
-{
-    $user = null;
-
-    if (have_option('i', 'id')) {
-        $id = get_option_value('i', 'id');
-        $user = User::getKV('id', $id);
-        if (empty($user)) {
-            throw new Exception("Can't find user with id '$id'.");
-        }
-    } else if (have_option('n', 'nickname')) {
-        $nickname = get_option_value('n', 'nickname');
-        $user = User::getKV('nickname', $nickname);
-        if (empty($user)) {
-            throw new Exception("Can't find user with nickname '$nickname'");
-        }
-    } else {
-        throw new NoUserArgumentException("No user argument specified.");
-    }
-
-    return $user;
-}
-
-/** "Printf not quiet" */
-
-function printfnq()
-{
-    if (have_option('q', 'quiet')) {
-        return null;
-    }
-
-    $cargs  = func_num_args();
-
-    if ($cargs == 0) {
-        return 0;
-    }
-
-    $args   = func_get_args();
-    $format = array_shift($args);
-
-    return vprintf($format, $args);
-}
-
-/** "Print when verbose" */
-
-function printfv()
-{
-    if (!have_option('v', 'verbose')) {
-        return null;
-    }
-
-    $cargs  = func_num_args();
-
-    if ($cargs == 0) {
-        return 0;
-    }
-
-    $args   = func_get_args();
-    $format = array_shift($args);
-
-    return vprintf($format, $args);
-}
diff --git a/scripts/commandline.inc.php b/scripts/commandline.inc.php
new file mode 100644 (file)
index 0000000..1244187
--- /dev/null
@@ -0,0 +1,248 @@
+<?php
+/*
+ * StatusNet - a distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// -*- mode: 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();
+}
+
+define('GNUSOCIAL', true);
+define('STATUSNET', true); //compatibility
+
+// Set various flags so we don't time out on long-running processes
+
+ini_set("max_execution_time", "0");
+ini_set("max_input_time", "0");
+set_time_limit(0);
+mb_internal_encoding('UTF-8');
+error_reporting(0);
+# DEBUG: error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);
+
+// Add extlib to our path so we can get Console_Getopt
+
+$_extra_path = array(INSTALLDIR.'/extlib/');
+
+set_include_path(implode(PATH_SEPARATOR, $_extra_path) . PATH_SEPARATOR . get_include_path());
+
+require_once 'Console/Getopt.php';
+
+// Note: $shortoptions and $longoptions should be pre-defined!
+
+$_default_shortoptions = 'qvhc:s:p:';
+
+$_default_longoptions = array('quiet', 'verbose', 'help', 'conf=', 'server=', 'path=');
+
+if (isset($shortoptions)) {
+    $shortoptions .= $_default_shortoptions;
+} else {
+    $shortoptions = $_default_shortoptions;
+}
+
+if (isset($longoptions)) {
+    $longoptions = array_merge($longoptions, $_default_longoptions);
+} else {
+    $longoptions = $_default_longoptions;
+}
+
+$parser = new Console_Getopt();
+
+$result = $parser->getopt($argv, $shortoptions, $longoptions);
+
+if (PEAR::isError($result)) {
+    print $result->getMessage()."\n";
+    exit(1);
+} else {
+    list($options, $args) = $result;
+}
+
+function show_help()
+{
+    global $helptext;
+
+    $_default_help_text = <<<END_OF_DEFAULT
+      General options:
+
+    -q --quiet           Quiet (little output)
+    -v --verbose         Verbose (lots of output)
+    -c --conf=<filename> Use <filename> as config file
+    -s --server=<name>   Use <name> as server name
+    -p --path=<path>     Use <path> as path name
+    -h --help            Show this message and quit.
+
+END_OF_DEFAULT;
+    if (isset($helptext)) {
+        print $helptext;
+    }
+    print $_default_help_text;
+    exit(0);
+}
+
+foreach ($options as $option) {
+
+    switch ($option[0]) {
+     case '--server':
+     case 's':
+        $server = $option[1];
+        break;
+
+     case '--path':
+     case 'p':
+        $path = $option[1];
+        break;
+
+     case '--conf':
+     case 'c':
+        $conffile = $option[1];
+        break;
+
+     case '--help':
+     case 'h':
+        show_help();
+    }
+}
+
+require_once INSTALLDIR . '/lib/common.php';
+
+set_error_handler('common_error_handler');
+
+// Set up the language infrastructure so we can localize anything that
+// needs to be sent out to users, such as mail notifications.
+common_init_language();
+
+function _make_matches($opt, $alt)
+{
+    $matches = array();
+
+    if (strlen($opt) > 1 && 0 != strncmp($opt, '--', 2)) {
+        $matches[] = '--'.$opt;
+    } else {
+        $matches[] = $opt;
+    }
+
+    if (!empty($alt)) {
+        if (strlen($alt) > 1 && 0 != strncmp($alt, '--', 2)) {
+            $matches[] = '--'.$alt;
+        } else {
+            $matches[] = $alt;
+        }
+    }
+
+    return $matches;
+}
+
+function have_option($opt, $alt=null)
+{
+    global $options;
+
+    $matches = _make_matches($opt, $alt);
+
+    foreach ($options as $option) {
+        if (in_array($option[0], $matches)) {
+            return true;
+        }
+    }
+
+    return false;
+}
+
+function get_option_value($opt, $alt=null)
+{
+    global $options;
+
+    $matches = _make_matches($opt, $alt);
+
+    foreach ($options as $option) {
+        if (in_array($option[0], $matches)) {
+            return $option[1];
+        }
+    }
+
+    return null;
+}
+
+class NoUserArgumentException extends Exception
+{
+}
+
+function getUser()
+{
+    $user = null;
+
+    if (have_option('i', 'id')) {
+        $id = get_option_value('i', 'id');
+        $user = User::getKV('id', $id);
+        if (empty($user)) {
+            throw new Exception("Can't find user with id '$id'.");
+        }
+    } else if (have_option('n', 'nickname')) {
+        $nickname = get_option_value('n', 'nickname');
+        $user = User::getKV('nickname', $nickname);
+        if (empty($user)) {
+            throw new Exception("Can't find user with nickname '$nickname'");
+        }
+    } else {
+        throw new NoUserArgumentException("No user argument specified.");
+    }
+
+    return $user;
+}
+
+/** "Printf not quiet" */
+
+function printfnq()
+{
+    if (have_option('q', 'quiet')) {
+        return null;
+    }
+
+    $cargs  = func_num_args();
+
+    if ($cargs == 0) {
+        return 0;
+    }
+
+    $args   = func_get_args();
+    $format = array_shift($args);
+
+    return vprintf($format, $args);
+}
+
+/** "Print when verbose" */
+
+function printfv()
+{
+    if (!have_option('v', 'verbose')) {
+        return null;
+    }
+
+    $cargs  = func_num_args();
+
+    if ($cargs == 0) {
+        return 0;
+    }
+
+    $args   = func_get_args();
+    $format = array_shift($args);
+
+    return vprintf($format, $args);
+}
index c260ffaa0037cb41dc5942deae59589f5c8526b3..44f3934a1fcff1a8f20b8808230a6642595d4205 100755 (executable)
@@ -27,7 +27,7 @@ console.php - provide an interactive PHP interpreter for testing
 
 ENDOFHELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 // Assume we're on a terminal if on Windows, otherwise posix_isatty tells us.
 define('CONSOLE_INTERACTIVE', !function_exists('posix_isatty') || posix_isatty(0));
index 624043161da9f19fe0e3512e760e0f770e3f2ca4..e5b47df6dee7daf09c13f59de2c74ab82197c470 100644 (file)
@@ -49,7 +49,7 @@ Creates a lot of test users and notices to (loosely) simulate a real server.
 
 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 @@ 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 @@ 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();
 
@@ -97,30 +97,30 @@ function newNotice($i, $tagmax)
         $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) {
@@ -129,7 +129,7 @@ function newNotice($i, $tagmax)
                     $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;
                     }
@@ -140,7 +140,7 @@ function newNotice($i, $tagmax)
                     $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;
                 }
@@ -148,36 +148,36 @@ function newNotice($i, $tagmax)
         }
     }
 
-    $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 @@ 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();
@@ -202,7 +202,7 @@ function newMessage($i)
         return;
     }
 
-    $j = rand(0, count($friends) - 1);
+    $j = mt_rand(0, count($friends) - 1);
     
     $other = $friends[$j];
 
@@ -212,7 +212,7 @@ function newMessage($i)
 function newSub($i)
 {
     global $userprefix;
-    $f = rand(0, $i - 1);
+    $f = mt_rand(0, $i - 1);
 
     $fromnick = sprintf('%s%d', $userprefix, $f);
 
@@ -222,7 +222,7 @@ function newSub($i)
         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 @@ 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);
 
@@ -260,7 +260,7 @@ function newJoin($u, $g)
         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 @@ function newFave($u)
     global $userprefix;
     global $groupprefix;
 
-    $userNumber = rand(0, $u - 1);
+    $userNumber = mt_rand(0, $u - 1);
 
     $userNick = sprintf('%s%d', $userprefix, $userNumber);
 
@@ -293,7 +293,7 @@ function newFave($u)
 
     // 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);
 
@@ -309,7 +309,7 @@ function newFave($u)
         return;
     }
 
-    $idx = rand(0, count($notices) - 1);
+    $idx = mt_rand(0, count($notices) - 1);
 
     $notice = $notices[$idx];
 
@@ -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 @@ function main($usercount, $groupcount, $noticeavg, $subsavg, $joinsavg, $tagmax)
 
     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");
index f76a3dedc780e2207a3446c226fd535027450adb..fc00e70b083b91f9d9d721c17bffc78e7044f116 100755 (executable)
@@ -33,7 +33,7 @@ deletes a group from the database
 
 END_OF_DELETEGROUP_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 25af1c5ce24a294b8f5d74810106f92690336ae7..e815ea208d7bc429e52a65e98028f7ea14291ff2 100755 (executable)
@@ -33,7 +33,7 @@ deletes a user from the database
 
 END_OF_DELETEUSER_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 6341b72706cc0b5e1878c8ce59265334d18029b5..9ca4d9dad5271640ca3a9b3975823451d72bc1d0 100755 (executable)
@@ -95,7 +95,7 @@ var_dump($replacements);
 $template = file_get_contents(dirname(__FILE__) . '/doxygen.tmpl');
 $template = strtr($template, $replacements);
 
-$templateFile = tempnam(sys_get_temp_dir(), 'statusnet-doxygen');
+$templateFile = tempnam(common_get_temp_dir(), 'statusnet-doxygen');
 file_put_contents($templateFile, $template);
 
 $cmd = "doxygen " . escapeshellarg($templateFile);
index 9c5e3cf8b38c2fd9808803ba9c2c8437fcddfb89..05638cda4cb22aed28c57fe79916a8c1b1814a49 100644 (file)
@@ -34,7 +34,7 @@ Attempt to pull a schema definition for a given table.
 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 @@ if (count($args)) {
     }
 } else {
     show_help($helptext);
-}
\ No newline at end of file
+}
index 07ada7f9d95c49089192243f430bcd7f6c39ebb4..c029b1e7d4a31359802e8459eb785b58f805e538 100755 (executable)
@@ -33,7 +33,7 @@ Stray incompletely deleted items cause various fun problems!
 
 END_OF_USERROLE_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 /**
  * Find the highest profile_id currently listed in the notice table;
index 51178a725c6d5acfb369cfcbebcb81387c897b75..a9952b4304fc2d4f01dd5cd03a25eff1b9d70205 100644 (file)
@@ -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";
\ No newline at end of file
+print "OK.\n";
index b7f385ac45f8652990f2849904845726814c470e..3950fb7cf71830b4b51b316bbf4606db130f8fca 100644 (file)
@@ -29,7 +29,7 @@ Flush the site with the given name from memcached.
 
 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 @@ if (empty($sn)) {
 
 print "Flushing cache for {$nickname}...";
 $sn->decache();
-print "OK.\n";
\ No newline at end of file
+print "OK.\n";
index 8274c37c0f89c01e4ce485bc8f04dec7e9bdbbcc..00e845f80db821a8ccd1a2008b2ff3a078cf4968 100755 (executable)
@@ -25,6 +25,6 @@ getpiddir.php - print out the currently configured PID directory
 
 ENDOFHELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 echo common_config('daemon', 'piddir');
index 448fbb6d32cceb9282804fa6a162a66893a23aa2..f7aa0f60f88088cf06857042cf424b3650263ccc 100755 (executable)
@@ -36,7 +36,7 @@ ENDOFHELP;
 // No unnecessary error reporting to avoid invalid daemon names
 error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $daemons = array();
 
index dbe9c54c5ba9d838787dc2affbc3afe0265585f2..91c2dc7f646ec759ddac1bff7008876fbccee86c 100644 (file)
@@ -28,6 +28,6 @@ prints out the current version of the software
 
 END_OF_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 print GNUSOCIAL_VERSION."\n";
index eb7d8297136cdb3dd461752d0ca8bc65439120c1..3b272868c0023753e45ed37b9e2b885db4b79dba 100755 (executable)
@@ -28,7 +28,7 @@ as if it were being run through the queue.
 
 END_OF_QUEUE_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 if (count($args) != 2) {
     show_help();
index 0298c00522b52b9d3d2d0dd3c4324a1fb7ae13bf..7d9ff1fe7dc7d1d65d0007c14e76219e713e196d 100755 (executable)
@@ -33,7 +33,7 @@ Daemon script for receiving new notices from IM users.
 
 END_OF_IM_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 class ImDaemon extends SpawningDaemon
 {
index a29526f27e1726f57f3679dcdab034fbf4350614..d121179f47a9e45e0fa1777d0d9f9c29c419b499 100644 (file)
@@ -33,7 +33,7 @@ import an Atom feed from Twitter as notices by a user
 
 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()
index bd73cbe79460b2c6788147237a7945367f4ebc98..df9aad10edd234c36991d48509b31bacbe32fc11 100644 (file)
@@ -34,7 +34,7 @@ Adds a local user to a local group.
 
 END_OF_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 try {
     $user = getUser();
index 8f9ef33e7edb2d33b2615d0023506e8479f489f5..fd1362ef5ea6672e45bef57d4d2b85003f172bc9 100644 (file)
@@ -34,7 +34,7 @@ Removes a local user from a local group.
 
 END_OF_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 try {
     $user = getUser();
index 3b1ef96a1e898617e86d56870f5c328106239bcc..5e9b6d22324b8b9844c843b431d3303b7b8b7046 100755 (executable)
@@ -26,7 +26,7 @@ as STDIN.
 
 END_OF_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 require_once INSTALLDIR.'/lib/mailhandler.php';
 
 if (common_config('emailpost', 'enabled')) {
index 157cae067db619a491c0ed9d8a07a8f8ae97f1a5..a3d9c70eb061bdb435826dfc78bead11b27e92b3 100644 (file)
@@ -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 345d93c665745896d99c81e5d1623b56a2c3700f..3d3b1d3e841accdfaddcbe98d3af8d091ed8a787 100644 (file)
@@ -32,7 +32,7 @@ makes a user the admin of a group
 
 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');
index 17b3e0fb678e5e06c207f95476d0929e3d169bd6..ff08ee24ce3ac60e8e03b03e7f3b2c543f394495 100644 (file)
@@ -37,7 +37,7 @@ an HTTP or HTTPS URL (http://example.com/social/site/user/nickname).
 
 END_OF_MOVEUSER_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 try {
 
index 1c9ea3353697b6f7d6e883efe100cceee94545d6..7524dabb15cfdf0cf2491e738cfccb62b54aa708 100755 (executable)
@@ -45,7 +45,7 @@ Global events:
 
 END_OF_QUEUECTL_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function doSendControl($message, $event, $param='')
 {
index 582a3dd888f825ed0ff398a77629fffab9bf9628..bdd630f3d5a2e6ef54c8ff3982a5fe7d8a27977b 100755 (executable)
@@ -68,7 +68,7 @@ Daemon script for running queued items.
 
 END_OF_QUEUE_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 require_once(INSTALLDIR.'/lib/daemon.php');
 require_once(INSTALLDIR.'/classes/Queue_item.php');
index 97caf645cd6eb812904d9c68da110e958e30ca49..b7ee9f368ca32aee845c4f429f18a966f5a87199 100644 (file)
@@ -34,7 +34,7 @@ registers a user in the database
 
 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');
index 17f007b41206406c36d13e6711f7bda7d8535d71..c749b41a1253c4f51abe36e31be93a005bd88615 100644 (file)
@@ -33,7 +33,7 @@ neither ID or name provided, will create a new user.
 
 END_OF_RESTOREUSER_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
 
 
index 0441bfe7ee9abef0ebc417ca31d2e4cb8bf9a8b9..9b89cbce7eccedaef96937a6536f4d29a2c852f9 100755 (executable)
@@ -33,7 +33,7 @@ Sends given email text to user.
 
 END_OF_USEREMAIL_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 af55ddf3f0d971d9c8af92636104c9527ecf4cb9..ef452fdb064f61847689f811368abcfb4d4fba47 100644 (file)
@@ -27,7 +27,7 @@ Delete old sessions from the server
 
 END_OF_GC_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $maxlifetime = ini_get('session.gc_maxlifetime');
 
index 009c50dbf291061c4513c918341067780510fcd3..dc6843b92d3e16e56c2b46079061260f59a9aa35 100755 (executable)
@@ -39,7 +39,7 @@ With no args, lists all currently set values.
 
 END_OF_SETCONFIG_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 if (empty($args)) {
     if (have_option('a', 'all')) {
index 3e9f5c17ca3e9ab8473dd8e849e7282eb703ec54..ef439488b273975f5474df15bf7744780af45ff0 100755 (executable)
@@ -27,7 +27,7 @@ Sets the password of user with name <username> to <password>
 
 END_OF_PASSWORD_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 if (count($args) < 2) {
     show_help();
index 19abce43c8018a5d1de97ca83e5740f730c2c294..3c234f2c31cdc430321c17d4abd082c94476a00c 100644 (file)
@@ -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();
index 8ef08467d6be139dd2a50ee11670962cbeb30cf7..b4fe7b63ce9601b8c9d67648597a6bec63e1ce99 100644 (file)
@@ -33,7 +33,7 @@ shows the cached object based on the args
 
 ENDOFHELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $karg = get_option_value('k');
 
index e79b4e72242888f4661eedba444473e27caf6101..8b950eb0aa8e2d02e28da63f42ae4cbe9f35b3db 100755 (executable)
@@ -20,7 +20,7 @@
 
 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 foreach (StatusNet::getActivePlugins() as $plugin=>$args) {
     echo "$plugin: ";
index eb18a98e20d510cb3dfd2d8feee39abbd341dfd7..986260e1d23bdf8d16ac5ad2b425fae4217325a2 100644 (file)
@@ -26,7 +26,7 @@ Shows the structure of a table
 
 END_OF_SHOWTABLE_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 if (count($args) != 1) {
     show_help();
index 2ed3528c5e0d5b28338df53bb43a14d6a6d292f8..c4d86053e92b09d92d26265b292a29d6074ff6fc 100755 (executable)
@@ -35,7 +35,7 @@ if [ $# -gt 1 ]; then
 fi
 
 DIR=`dirname $0`
-DAEMONS=`php $DIR/getvaliddaemons.php $ARGSG`
+DAEMONS=`$DIR/getvaliddaemons.php $ARGSG`
 
 for f in $DAEMONS; do
 
index e725dd0bf0064588e490eecb90def35bc4d10ba9..274f0903e25a75ad1c5ff5347333b06818625885 100755 (executable)
@@ -39,9 +39,9 @@ if [ $# -gt 1 ]; then
 fi
 
 SDIR=`dirname $0`
-DIR=`php $SDIR/getpiddir.php $SITE`
+DIR=`$SDIR/getpiddir.php $SITE`
 
-DAEMONS=`php $SDIR/getvaliddaemons.php $ARGSG`
+DAEMONS=`$SDIR/getvaliddaemons.php $ARGSG`
 
 for f in $DAEMONS; do
     f=$(basename $f .php)
index 021b66885190dacbf944759738895272855256cc..165736816d8396c8d4d96bfb6cad1709d6a0cc63 100755 (executable)
@@ -36,7 +36,7 @@ Removes geolocation info from the given user's notices.
 
 END_OF_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 b5955fd5aa9335a0ae259cdfb7baa24c3ea228bc..6cd2101ad7a4561378cf498456e99f569d3f25f3 100644 (file)
@@ -26,7 +26,7 @@ Uncache users listed in an ID file, default 'ids.txt'.
 
 ENDOFHELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $id_file = (count($args) > 1) ? $args[0] : 'ids.txt';
 
index abf9627cc71e6daffc61c3b26802b7a435bece14..c8024cb769a86fb6d868e52c483b6ef9b9084063 100644 (file)
@@ -34,7 +34,7 @@ set the location for a profile
 
 END_OF_UPDATELOCATION_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 try {
     $user = null;
index 35b835e4944ac435ac24cf6dd43d5090efaa4932..c49187c299407c194b27cb669f75ac3d395b3206 100644 (file)
@@ -29,7 +29,7 @@ update stored URLs in the system
 
 END_OF_UPDATEURLS_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function main()
 {
index c221a495af1cc04489643ce24bb3ce8a10bc1cd8..ec859e8f43e4c4eb033e305763ebff3c181e7b8b 100644 (file)
@@ -29,7 +29,7 @@ Upgrade database schema and data to latest software
 
 END_OF_UPGRADE_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function main()
 {
index 02c34678fb31eb1077a974a997f97c39c6e7ed56..91a9d3152bb7b72eb9abec81f43d730062b96a1b 100755 (executable)
@@ -33,7 +33,7 @@ Queries a user's registered email address, or queries the users with a given reg
 
 END_OF_USEREMAIL_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 d1061b18322417a6afb9c18e634dd5c6c467a78e..a5eddeae5fc3dd5a1525ff6d12bdd2d1b4863b6e 100644 (file)
@@ -34,7 +34,7 @@ modifies a role for the given user
 
 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 bd9124a91d38b1dd0cc6dcb793a9b7c12ff4d7d3..031be0cc4403919b92f225a41c222f6e5344860a 100644 (file)
@@ -18,13 +18,16 @@ class UserRightsTest extends PHPUnit_Framework_TestCase
     function setUp()
     {
         $user = User::getKV('nickname', 'userrightstestuser');
-        if ($user) {
+
+        if ($user instanceof User) {
             // Leftover from a broken test run?
             $profile = $user->getProfile();
             $user->delete();
             $profile->delete();
         }
+
         $this->user = User::register(array('nickname' => 'userrightstestuser'));
+
         if (!$this->user) {
             throw new Exception("Couldn't register userrightstestuser");
         }
index fb675c778e3c33754f7da53da80dd9c92806b973..4259c0cdc701dde222477542b0e59448e3395142 100644 (file)
@@ -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 bea512a9149c227154f4a54a7d23db2da6661673..3d8767a6e1227aeaab7adb7a7e079a64dc82da61 100755 (executable)
@@ -20,7 +20,7 @@
 
 define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..'));
 
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
 require_once INSTALLDIR . '/extlib/OAuth.php';
 
 $ini = parse_ini_file("oauth.ini");
index a508c7240c2c1a786c625fdd02340c1a63c722ec..aac242d0df1ee52c9b93a40ce74e327cda6a2db6 100755 (executable)
@@ -52,7 +52,7 @@ $helptext = <<<END_OF_ETOKENS_HELP
 
 END_OF_ETOKENS_HELP;
 
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
 
 $token = $secret = $verifier = null;
 
index 23fc04b531567aedffc836627fc316eb7b563d88..6742ab1580b1dddd3c35772d70d878d6e2356bd8 100644 (file)
@@ -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');
index a37538d87e4e03ef5ec022bd394127126753ab0e..c20c7eef03e4fc52c46cb2b5bb744e665ec24b67 100755 (executable)
@@ -37,7 +37,7 @@ END_OF_VERIFY_HELP;
 $token        = null;
 $token_secret = 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');