From de55d8f83bb2ecf9461510768fe7147aec592055 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 28 Aug 2013 15:54:26 +0200 Subject: [PATCH] plugins onAutoload now only overloads if necessary (extlibs etc.) lib/plugin.php now has a parent onAutoload function that finds most common files that are used in plugins (actions, dataobjects, forms, libs etc.) if they are put in the standardised directories ('actions', 'classes', 'forms', 'lib' and perhaps some others in the future). --- lib/plugin.php | 43 +++++++++ .../AccountManager/AccountManagerPlugin.php | 13 --- .../accountmanagementcontroldocument.php} | 0 .../accountmanagementsessionstatus.php} | 0 plugins/Activity/ActivityPlugin.php | 18 ---- plugins/Activity/{ => lib}/followlistitem.php | 0 plugins/Activity/{ => lib}/joinlistitem.php | 0 plugins/Activity/{ => lib}/leavelistitem.php | 0 plugins/Activity/{ => lib}/systemlistitem.php | 0 .../Activity/{ => lib}/unfollowlistitem.php | 0 plugins/ActivitySpam/ActivitySpamPlugin.php | 32 ------- plugins/ActivitySpam/{ => actions}/spam.php | 0 plugins/ActivitySpam/{ => actions}/train.php | 0 .../spam_score.php} | 0 .../{trainhamform.php => forms/trainham.php} | 0 .../trainspam.php} | 0 plugins/ActivitySpam/{ => lib}/spamfilter.php | 0 .../{ => lib}/spamnoticestream.php | 0 plugins/Adsense/AdsensePlugin.php | 14 --- .../{ => actions}/adsenseadminpanel.php | 0 plugins/Aim/AimPlugin.php | 10 +-- plugins/Aim/{ => classes}/Fake_Aim.php | 0 plugins/Aim/{ => lib}/aimmanager.php | 0 plugins/AnonymousFave/AnonymousFavePlugin.php | 25 ------ .../{ => actions}/anondisfavor.php | 0 .../AnonymousFave/{ => actions}/anonfavor.php | 0 .../{ => classes}/Fave_tally.php | 0 .../anondisfavor.php} | 1 + .../anonfavor.php} | 1 + plugins/Autocomplete/AutocompletePlugin.php | 10 --- .../{ => actions}/autocomplete.php | 0 plugins/BitlyUrl/BitlyUrlPlugin.php | 21 ----- .../bitlyadminpanel.php} | 0 plugins/Blacklist/BlacklistPlugin.php | 24 ----- .../{ => actions}/blacklistadminpanel.php | 0 .../{ => classes}/Homepage_blacklist.php | 0 .../{ => classes}/Nickname_blacklist.php | 0 plugins/Blog/BlogPlugin.php | 29 ------ plugins/Blog/{ => actions}/newblogentry.php | 0 plugins/Blog/{ => actions}/showblogentry.php | 0 plugins/Blog/{ => classes}/Blog_entry.php | 0 .../blogentry.php} | 0 plugins/Blog/{ => lib}/blogentrylistitem.php | 0 plugins/Bookmark/BookmarkPlugin.php | 38 -------- .../{ => actions}/apitimelinebookmarks.php | 1 - .../Bookmark/{ => actions}/bookmarkforurl.php | 0 .../Bookmark/{ => actions}/bookmarkpopup.php | 0 plugins/Bookmark/{ => actions}/bookmarks.php | 2 - .../Bookmark/{ => actions}/bookmarksrss.php | 1 - .../{ => actions}/importdelicious.php | 0 .../Bookmark/{ => actions}/newbookmark.php | 0 .../Bookmark/{ => actions}/noticebyurl.php | 0 .../Bookmark/{ => actions}/showbookmark.php | 0 plugins/Bookmark/{ => classes}/Bookmark.php | 0 .../{bookmarkform.php => forms/bookmark.php} | 0 .../initialbookmark.php} | 0 .../Bookmark/{ => lib}/bookmarklistitem.php | 0 .../{ => lib}/bookmarksnoticestream.php | 0 .../{ => lib}/deliciousbackupimporter.php | 0 .../{ => lib}/deliciousbookmarkimporter.php | 0 .../{ => scripts}/importbookmarks.php | 0 .../CasAuthenticationPlugin.php | 6 +- .../{ => actions}/caslogin.php | 0 .../ClientSideShortenPlugin.php | 12 --- .../{ => actions}/shorten.php | 0 plugins/Directory/DirectoryPlugin.php | 35 -------- .../DomainStatusNetworkPlugin.php | 21 ----- .../globalapi.php} | 0 .../DomainWhitelist/DomainWhitelistPlugin.php | 26 ------ .../whitelistinvite.php} | 0 .../EmailRegistrationPlugin.php | 18 ---- .../{ => actions}/emailregister.php | 0 .../confirmregistration.php} | 0 .../emailregistration.php} | 0 plugins/EmailReminder/EmailReminderPlugin.php | 26 ------ plugins/EmailSummary/EmailSummaryPlugin.php | 26 ------ .../{ => classes}/Email_summary_status.php | 0 .../{ => lib}/siteemailsummaryhandler.php | 0 .../{ => lib}/useremailsummaryhandler.php | 0 .../{ => scripts}/sendemailsummary.php | 0 plugins/Event/EventPlugin.php | 38 -------- plugins/Event/{ => actions}/cancelrsvp.php | 0 plugins/Event/{ => actions}/newevent.php | 0 plugins/Event/{ => actions}/newrsvp.php | 0 plugins/Event/{ => actions}/showevent.php | 0 plugins/Event/{ => actions}/showrsvp.php | 0 plugins/Event/{ => actions}/timelist.php | 0 plugins/Event/{ => classes}/Happening.php | 0 plugins/Event/{ => classes}/RSVP.php | 0 .../cancelrsvp.php} | 0 .../Event/{eventform.php => forms/event.php} | 0 .../Event/{rsvpform.php => forms/rsvp.php} | 0 plugins/Event/{ => lib}/eventlistitem.php | 0 plugins/Event/{ => lib}/eventtimelist.php | 0 plugins/Event/{ => lib}/rsvplistitem.php | 0 .../ExtendedProfile/ExtendedProfilePlugin.php | 36 -------- .../FacebookBridge/FacebookBridgePlugin.php | 18 +--- .../FollowEveryone/FollowEveryonePlugin.php | 21 ----- .../User_followeveryone_prefs.php | 0 .../GNUsocialPhoto/GNUsocialPhotoPlugin.php | 20 ----- .../GNUsocialPhoto/{ => actions}/newphoto.php | 0 .../{ => actions}/showphoto.php | 0 .../GNUsocialPhoto/{ => classes}/Photo.php | 0 .../{newphotoform.php => forms/newphoto.php} | 0 .../GNUsocialPhotos/GNUsocialPhotosPlugin.php | 35 +------- .../{photonav.php => gnusocialphotonav.php} | 0 .../{tempphoto.php => gnusocialphototemp.php} | 0 .../GNUsocialProfileExtensionsPlugin.php | 25 +----- .../GNUsocialVideo/GNUsocialVideoPlugin.php | 23 ----- .../{ => actions}/showvideo.php | 0 .../GNUsocialVideo/{ => classes}/Video.php | 0 .../{videoform.php => forms/video.php} | 0 .../GroupFavorited/GroupFavoritedPlugin.php | 21 ----- .../groupfavorited.php} | 0 .../GroupPrivateMessagePlugin.php | 34 ------- .../{ => actions}/groupinbox.php | 0 .../{ => actions}/newgroupmessage.php | 0 .../{ => actions}/showgroupmessage.php | 0 .../{ => classes}/Group_message.php | 0 .../{ => classes}/Group_message_profile.php | 0 .../{ => classes}/Group_privacy_settings.php | 0 .../groupmessage.php} | 0 .../{ => lib}/groupmessagecommand.php | 0 .../{ => lib}/groupmessagelist.php | 0 .../{ => lib}/groupmessagelistitem.php | 0 plugins/Imap/ImapPlugin.php | 22 ----- plugins/Imap/{ => lib}/imapmailhandler.php | 0 plugins/Imap/{ => lib}/imapmanager.php | 0 plugins/Irc/IrcPlugin.php | 23 ++--- .../Irc/{ => classes}/Irc_waiting_message.php | 0 .../channelresponsechannel.php} | 0 .../Irc/{Fake_Irc.php => lib/fake_irc.php} | 0 plugins/Irc/{ => lib}/ircmanager.php | 0 .../LdapAuthenticationPlugin.php | 2 + .../LdapAuthorizationPlugin.php | 2 + plugins/LdapCommon/LdapCommon.php | 3 + plugins/LinkPreview/LinkPreviewPlugin.php | 22 ----- .../oembedproxy.php} | 0 plugins/Mapstraction/MapstractionPlugin.php | 23 ----- plugins/Mapstraction/{ => actions}/allmap.php | 0 plugins/Mapstraction/{ => actions}/map.php | 0 .../Mapstraction/{ => actions}/usermap.php | 0 plugins/Minify/MinifyPlugin.php | 12 --- plugins/Minify/{ => actions}/minify.php | 0 plugins/ModLog/ModLogPlugin.php | 22 ----- plugins/ModLog/{ => classes}/ModLog.php | 0 plugins/ModPlus/ModPlusPlugin.php | 22 ----- .../remoteprofile.php} | 0 plugins/Msn/MsnPlugin.php | 8 +- .../Msn/{ => classes}/msn_waiting_message.php | 0 plugins/Msn/{ => lib}/msnmanager.php | 0 plugins/NoticeTitle/NoticeTitlePlugin.php | 21 ----- .../{ => classes}/Notice_title.php | 0 plugins/OMB/OMBPlugin.php | 34 ------- plugins/OMB/lib/omb.php | 1 - ...mboauthstore.php => omboauthdatastore.php} | 0 plugins/OStatus/OStatusPlugin.php | 32 ------- .../salmonaction.php => actions/salmon.php} | 0 .../{lib/xrdaction.php => actions/xrd.php} | 0 plugins/OfflineBackup/OfflineBackupPlugin.php | 16 ---- .../{ => actions}/offlinebackup.php | 0 .../{ => lib}/offlinebackupqueuehandler.php | 0 plugins/OpenID/OpenIDPlugin.php | 20 +---- .../OpenID/{ => actions}/finishaddopenid.php | 0 .../{ => actions}/finishopenidlogin.php | 0 .../OpenID/{ => actions}/openidadminpanel.php | 0 plugins/OpenID/{ => actions}/openidlogin.php | 0 plugins/OpenID/{ => actions}/openidserver.php | 0 .../OpenID/{ => actions}/openidsettings.php | 0 plugins/OpenID/{ => actions}/openidtrust.php | 0 plugins/OpenID/{ => classes}/User_openid.php | 0 .../{ => classes}/User_openid_prefs.php | 0 .../{ => classes}/User_openid_trustroot.php | 0 plugins/OpenX/OpenXPlugin.php | 14 --- .../OpenX/{ => actions}/openxadminpanel.php | 0 plugins/Poll/PollPlugin.php | 34 ------- plugins/Poll/{ => actions}/newpoll.php | 0 plugins/Poll/{ => actions}/pollsettings.php | 0 plugins/Poll/{ => actions}/respondpoll.php | 0 plugins/Poll/{ => actions}/showpoll.php | 0 plugins/Poll/{ => classes}/Poll.php | 0 plugins/Poll/{ => classes}/Poll_response.php | 0 .../Poll/{ => classes}/User_poll_prefs.php | 0 .../{newpollform.php => forms/newpoll.php} | 0 .../pollresponse.php} | 0 .../pollresult.php} | 0 plugins/QnA/QnAPlugin.php | 42 --------- .../qnanewanswer.php} | 0 .../qnanewquestion.php} | 0 .../qnareviseanswer.php} | 0 .../qnashowanswer.php} | 0 .../qnashowquestion.php} | 0 .../qnavoteform.php => forms/qnavote.php} | 0 plugins/RSSCloud/RSSCloudPlugin.php | 32 ------- .../loggingaggregator.php} | 0 .../rsscloudrequestnotify.php} | 0 .../{ => classes}/RSSCloudSubscription.php | 0 .../rsscloudnotifier.php} | 0 .../rsscloudqueuehandler.php} | 0 plugins/Realtime/RealtimePlugin.php | 18 ---- .../Realtime/{ => actions}/closechannel.php | 0 .../{ => actions}/keepalivechannel.php | 0 .../{ => classes}/Realtime_channel.php | 0 .../{ => scripts}/cleanupchannels.php | 0 .../RegisterThrottlePlugin.php | 21 ----- .../{ => classes}/Registration_ip.php | 0 .../RequireValidatedEmailPlugin.php | 14 --- .../{ => actions}/confirmfirstemail.php | 0 .../{ => scripts}/registerbyemail.php | 0 plugins/Sample/SamplePlugin.php | 35 -------- plugins/Sample/{ => actions}/hello.php | 0 .../{ => classes}/User_greeting_count.php | 0 plugins/SearchSub/SearchSubPlugin.php | 33 ------- .../searchsub.php} | 0 .../searchsubs.php} | 0 .../searchunsub.php} | 0 plugins/SearchSub/{ => classes}/SearchSub.php | 0 .../searchsub.php} | 0 .../searchunsub.php} | 0 plugins/SearchSub/{ => lib}/searchsubmenu.php | 0 .../{ => lib}/searchsubtrackcommand.php | 0 .../{ => lib}/searchsubtrackingcommand.php | 0 .../{ => lib}/searchsubtrackoffcommand.php | 0 .../{ => lib}/searchsubuntrackcommand.php | 0 .../SiteNoticeInSidebarPlugin.php | 14 --- .../{ => lib}/sitenoticesection.php | 0 plugins/Sitemap/SitemapPlugin.php | 31 ------- .../Sitemap/{ => actions}/noticesitemap.php | 0 .../sitemap.php} | 0 .../{ => actions}/sitemapadminpanel.php | 0 .../Sitemap/{ => actions}/sitemapindex.php | 0 plugins/Sitemap/{ => actions}/usersitemap.php | 0 .../{ => classes}/Sitemap_notice_count.php | 0 .../{ => classes}/Sitemap_user_count.php | 0 .../SlicedFavorites/SlicedFavoritesPlugin.php | 21 ----- .../favoritedslice.php} | 0 plugins/SphinxSearch/SphinxSearchPlugin.php | 4 +- plugins/SubMirror/SubMirrorPlugin.php | 26 ------ .../addmirrorform.php => forms/addmirror.php} | 0 .../addtwitter.php} | 0 .../editmirror.php} | 0 plugins/TagSub/TagSubPlugin.php | 29 ------ .../{tagsubaction.php => actions/tagsub.php} | 0 .../tagsubs.php} | 0 .../tagunsub.php} | 0 plugins/TagSub/{ => classes}/TagSub.php | 0 .../{tagsubform.php => forms/tagsub.php} | 0 .../{tagunsubform.php => forms/tagunsub.php} | 0 plugins/TagSub/{ => lib}/tagsubmenu.php | 0 plugins/TwitterBridge/TwitterBridgePlugin.php | 40 --------- .../{ => actions}/twitteradminpanel.php | 0 .../{ => actions}/twitterauthorization.php | 0 .../{ => actions}/twitterlogin.php | 0 .../{ => actions}/twittersettings.php | 0 .../{ => classes}/Notice_to_status.php | 0 .../{ => classes}/Twitter_synch_status.php | 0 .../daemons/twitterstatusfetcher.php | 2 +- .../{ => lib}/jsonstreamreader.php | 0 .../{ => lib}/tweetinqueuehandler.php | 0 .../TwitterBridge/{ => lib}/twitterimport.php | 0 .../{ => lib}/twitteroauthclient.php | 0 .../{ => lib}/twitterqueuehandler.php | 0 .../TwitterBridge/lib/twittersitestream.php | 88 +++++++++++++++++++ .../{ => lib}/twitterstreamreader.php | 0 .../TwitterBridge/lib/twitteruserstream.php | 59 +++++++++++++ plugins/TwitterBridge/scripts/streamtest.php | 4 +- plugins/UserFlag/UserFlagPlugin.php | 29 ------ .../{ => actions}/adminprofileflag.php | 0 plugins/UserFlag/{ => actions}/clearflag.php | 0 .../UserFlag/{ => actions}/flagprofile.php | 0 .../{ => classes}/User_flag_profile.php | 0 .../clearflag.php} | 0 .../flagprofile.php} | 0 plugins/Xmpp/XmppPlugin.php | 11 +-- .../{Queued_XMPP.php => lib/queued_xmpp.php} | 0 .../sharing_xmpp.php} | 0 plugins/Xmpp/{ => lib}/xmppmanager.php | 0 plugins/YammerImport/YammerImportPlugin.php | 40 --------- .../yammerapikey.php} | 0 .../yammerauthinit.php} | 0 .../yammerauthverify.php} | 0 .../yammerprogress.php} | 0 282 files changed, 227 insertions(+), 1423 deletions(-) rename plugins/AccountManager/{AccountManagementControlDocumentAction.php => actions/accountmanagementcontroldocument.php} (100%) rename plugins/AccountManager/{AccountManagementSessionStatusAction.php => actions/accountmanagementsessionstatus.php} (100%) rename plugins/Activity/{ => lib}/followlistitem.php (100%) rename plugins/Activity/{ => lib}/joinlistitem.php (100%) rename plugins/Activity/{ => lib}/leavelistitem.php (100%) rename plugins/Activity/{ => lib}/systemlistitem.php (100%) rename plugins/Activity/{ => lib}/unfollowlistitem.php (100%) rename plugins/ActivitySpam/{ => actions}/spam.php (100%) rename plugins/ActivitySpam/{ => actions}/train.php (100%) rename plugins/ActivitySpam/{Spam_score.php => classes/spam_score.php} (100%) rename plugins/ActivitySpam/{trainhamform.php => forms/trainham.php} (100%) rename plugins/ActivitySpam/{trainspamform.php => forms/trainspam.php} (100%) rename plugins/ActivitySpam/{ => lib}/spamfilter.php (100%) rename plugins/ActivitySpam/{ => lib}/spamnoticestream.php (100%) rename plugins/Adsense/{ => actions}/adsenseadminpanel.php (100%) rename plugins/Aim/{ => classes}/Fake_Aim.php (100%) rename plugins/Aim/{ => lib}/aimmanager.php (100%) rename plugins/AnonymousFave/{ => actions}/anondisfavor.php (100%) rename plugins/AnonymousFave/{ => actions}/anonfavor.php (100%) rename plugins/AnonymousFave/{ => classes}/Fave_tally.php (100%) rename plugins/AnonymousFave/{anondisfavorform.php => forms/anondisfavor.php} (99%) rename plugins/AnonymousFave/{anonfavorform.php => forms/anonfavor.php} (99%) rename plugins/Autocomplete/{ => actions}/autocomplete.php (100%) rename plugins/BitlyUrl/{bitlyadminpanelaction.php => actions/bitlyadminpanel.php} (100%) rename plugins/Blacklist/{ => actions}/blacklistadminpanel.php (100%) rename plugins/Blacklist/{ => classes}/Homepage_blacklist.php (100%) rename plugins/Blacklist/{ => classes}/Nickname_blacklist.php (100%) rename plugins/Blog/{ => actions}/newblogentry.php (100%) rename plugins/Blog/{ => actions}/showblogentry.php (100%) rename plugins/Blog/{ => classes}/Blog_entry.php (100%) rename plugins/Blog/{blogentryform.php => forms/blogentry.php} (100%) rename plugins/Blog/{ => lib}/blogentrylistitem.php (100%) rename plugins/Bookmark/{ => actions}/apitimelinebookmarks.php (99%) rename plugins/Bookmark/{ => actions}/bookmarkforurl.php (100%) rename plugins/Bookmark/{ => actions}/bookmarkpopup.php (100%) rename plugins/Bookmark/{ => actions}/bookmarks.php (99%) rename plugins/Bookmark/{ => actions}/bookmarksrss.php (99%) rename plugins/Bookmark/{ => actions}/importdelicious.php (100%) rename plugins/Bookmark/{ => actions}/newbookmark.php (100%) rename plugins/Bookmark/{ => actions}/noticebyurl.php (100%) rename plugins/Bookmark/{ => actions}/showbookmark.php (100%) rename plugins/Bookmark/{ => classes}/Bookmark.php (100%) rename plugins/Bookmark/{bookmarkform.php => forms/bookmark.php} (100%) rename plugins/Bookmark/{initialbookmarkform.php => forms/initialbookmark.php} (100%) rename plugins/Bookmark/{ => lib}/bookmarklistitem.php (100%) rename plugins/Bookmark/{ => lib}/bookmarksnoticestream.php (100%) rename plugins/Bookmark/{ => lib}/deliciousbackupimporter.php (100%) rename plugins/Bookmark/{ => lib}/deliciousbookmarkimporter.php (100%) rename plugins/Bookmark/{ => scripts}/importbookmarks.php (100%) rename plugins/CasAuthentication/{ => actions}/caslogin.php (100%) rename plugins/ClientSideShorten/{ => actions}/shorten.php (100%) rename plugins/DomainStatusNetwork/{lib/globalapiaction.php => actions/globalapi.php} (100%) rename plugins/DomainWhitelist/{lib/whitelistinviteform.php => forms/whitelistinvite.php} (100%) rename plugins/EmailRegistration/{ => actions}/emailregister.php (100%) rename plugins/EmailRegistration/{confirmregistrationform.php => forms/confirmregistration.php} (100%) rename plugins/EmailRegistration/{emailregistrationform.php => forms/emailregistration.php} (100%) rename plugins/EmailSummary/{ => classes}/Email_summary_status.php (100%) rename plugins/EmailSummary/{ => lib}/siteemailsummaryhandler.php (100%) rename plugins/EmailSummary/{ => lib}/useremailsummaryhandler.php (100%) rename plugins/EmailSummary/{ => scripts}/sendemailsummary.php (100%) rename plugins/Event/{ => actions}/cancelrsvp.php (100%) rename plugins/Event/{ => actions}/newevent.php (100%) rename plugins/Event/{ => actions}/newrsvp.php (100%) rename plugins/Event/{ => actions}/showevent.php (100%) rename plugins/Event/{ => actions}/showrsvp.php (100%) rename plugins/Event/{ => actions}/timelist.php (100%) rename plugins/Event/{ => classes}/Happening.php (100%) rename plugins/Event/{ => classes}/RSVP.php (100%) rename plugins/Event/{cancelrsvpform.php => forms/cancelrsvp.php} (100%) rename plugins/Event/{eventform.php => forms/event.php} (100%) rename plugins/Event/{rsvpform.php => forms/rsvp.php} (100%) rename plugins/Event/{ => lib}/eventlistitem.php (100%) rename plugins/Event/{ => lib}/eventtimelist.php (100%) rename plugins/Event/{ => lib}/rsvplistitem.php (100%) rename plugins/FollowEveryone/{ => classes}/User_followeveryone_prefs.php (100%) rename plugins/GNUsocialPhoto/{ => actions}/newphoto.php (100%) rename plugins/GNUsocialPhoto/{ => actions}/showphoto.php (100%) rename plugins/GNUsocialPhoto/{ => classes}/Photo.php (100%) rename plugins/GNUsocialPhoto/{newphotoform.php => forms/newphoto.php} (100%) rename plugins/GNUsocialPhotos/lib/{photonav.php => gnusocialphotonav.php} (100%) rename plugins/GNUsocialPhotos/lib/{tempphoto.php => gnusocialphototemp.php} (100%) rename plugins/GNUsocialVideo/{ => actions}/showvideo.php (100%) rename plugins/GNUsocialVideo/{ => classes}/Video.php (100%) rename plugins/GNUsocialVideo/{videoform.php => forms/video.php} (100%) rename plugins/GroupFavorited/{groupfavoritedaction.php => actions/groupfavorited.php} (100%) rename plugins/GroupPrivateMessage/{ => actions}/groupinbox.php (100%) rename plugins/GroupPrivateMessage/{ => actions}/newgroupmessage.php (100%) rename plugins/GroupPrivateMessage/{ => actions}/showgroupmessage.php (100%) rename plugins/GroupPrivateMessage/{ => classes}/Group_message.php (100%) rename plugins/GroupPrivateMessage/{ => classes}/Group_message_profile.php (100%) rename plugins/GroupPrivateMessage/{ => classes}/Group_privacy_settings.php (100%) rename plugins/GroupPrivateMessage/{groupmessageform.php => forms/groupmessage.php} (100%) rename plugins/GroupPrivateMessage/{ => lib}/groupmessagecommand.php (100%) rename plugins/GroupPrivateMessage/{ => lib}/groupmessagelist.php (100%) rename plugins/GroupPrivateMessage/{ => lib}/groupmessagelistitem.php (100%) rename plugins/Imap/{ => lib}/imapmailhandler.php (100%) rename plugins/Imap/{ => lib}/imapmanager.php (100%) rename plugins/Irc/{ => classes}/Irc_waiting_message.php (100%) rename plugins/Irc/{ChannelResponseChannel.php => lib/channelresponsechannel.php} (100%) rename plugins/Irc/{Fake_Irc.php => lib/fake_irc.php} (100%) rename plugins/Irc/{ => lib}/ircmanager.php (100%) rename plugins/LinkPreview/{oembedproxyaction.php => actions/oembedproxy.php} (100%) rename plugins/Mapstraction/{ => actions}/allmap.php (100%) rename plugins/Mapstraction/{ => actions}/map.php (100%) rename plugins/Mapstraction/{ => actions}/usermap.php (100%) rename plugins/Minify/{ => actions}/minify.php (100%) rename plugins/ModLog/{ => classes}/ModLog.php (100%) rename plugins/ModPlus/{remoteprofileaction.php => actions/remoteprofile.php} (100%) rename plugins/Msn/{ => classes}/msn_waiting_message.php (100%) rename plugins/Msn/{ => lib}/msnmanager.php (100%) rename plugins/NoticeTitle/{ => classes}/Notice_title.php (100%) rename plugins/OMB/lib/{omboauthstore.php => omboauthdatastore.php} (100%) rename plugins/OStatus/{lib/salmonaction.php => actions/salmon.php} (100%) rename plugins/OStatus/{lib/xrdaction.php => actions/xrd.php} (100%) rename plugins/OfflineBackup/{ => actions}/offlinebackup.php (100%) rename plugins/OfflineBackup/{ => lib}/offlinebackupqueuehandler.php (100%) rename plugins/OpenID/{ => actions}/finishaddopenid.php (100%) rename plugins/OpenID/{ => actions}/finishopenidlogin.php (100%) rename plugins/OpenID/{ => actions}/openidadminpanel.php (100%) rename plugins/OpenID/{ => actions}/openidlogin.php (100%) rename plugins/OpenID/{ => actions}/openidserver.php (100%) rename plugins/OpenID/{ => actions}/openidsettings.php (100%) rename plugins/OpenID/{ => actions}/openidtrust.php (100%) rename plugins/OpenID/{ => classes}/User_openid.php (100%) rename plugins/OpenID/{ => classes}/User_openid_prefs.php (100%) rename plugins/OpenID/{ => classes}/User_openid_trustroot.php (100%) rename plugins/OpenX/{ => actions}/openxadminpanel.php (100%) rename plugins/Poll/{ => actions}/newpoll.php (100%) rename plugins/Poll/{ => actions}/pollsettings.php (100%) rename plugins/Poll/{ => actions}/respondpoll.php (100%) rename plugins/Poll/{ => actions}/showpoll.php (100%) rename plugins/Poll/{ => classes}/Poll.php (100%) rename plugins/Poll/{ => classes}/Poll_response.php (100%) rename plugins/Poll/{ => classes}/User_poll_prefs.php (100%) rename plugins/Poll/{newpollform.php => forms/newpoll.php} (100%) rename plugins/Poll/{pollresponseform.php => forms/pollresponse.php} (100%) rename plugins/Poll/{pollresultform.php => forms/pollresult.php} (100%) rename plugins/QnA/{lib/qnanewanswerform.php => forms/qnanewanswer.php} (100%) rename plugins/QnA/{lib/qnanewquestionform.php => forms/qnanewquestion.php} (100%) rename plugins/QnA/{lib/qnareviseanswerform.php => forms/qnareviseanswer.php} (100%) rename plugins/QnA/{lib/qnashowanswerform.php => forms/qnashowanswer.php} (100%) rename plugins/QnA/{lib/qnashowquestionform.php => forms/qnashowquestion.php} (100%) rename plugins/QnA/{lib/qnavoteform.php => forms/qnavote.php} (100%) rename plugins/RSSCloud/{LoggingAggregator.php => actions/loggingaggregator.php} (100%) rename plugins/RSSCloud/{RSSCloudRequestNotify.php => actions/rsscloudrequestnotify.php} (100%) rename plugins/RSSCloud/{ => classes}/RSSCloudSubscription.php (100%) rename plugins/RSSCloud/{RSSCloudNotifier.php => lib/rsscloudnotifier.php} (100%) rename plugins/RSSCloud/{RSSCloudQueueHandler.php => lib/rsscloudqueuehandler.php} (100%) rename plugins/Realtime/{ => actions}/closechannel.php (100%) rename plugins/Realtime/{ => actions}/keepalivechannel.php (100%) rename plugins/Realtime/{ => classes}/Realtime_channel.php (100%) rename plugins/Realtime/{ => scripts}/cleanupchannels.php (100%) rename plugins/RegisterThrottle/{ => classes}/Registration_ip.php (100%) rename plugins/RequireValidatedEmail/{ => actions}/confirmfirstemail.php (100%) rename plugins/RequireValidatedEmail/{ => scripts}/registerbyemail.php (100%) rename plugins/Sample/{ => actions}/hello.php (100%) rename plugins/Sample/{ => classes}/User_greeting_count.php (100%) rename plugins/SearchSub/{searchsubaction.php => actions/searchsub.php} (100%) rename plugins/SearchSub/{searchsubsaction.php => actions/searchsubs.php} (100%) rename plugins/SearchSub/{searchunsubaction.php => actions/searchunsub.php} (100%) rename plugins/SearchSub/{ => classes}/SearchSub.php (100%) rename plugins/SearchSub/{searchsubform.php => forms/searchsub.php} (100%) rename plugins/SearchSub/{searchunsubform.php => forms/searchunsub.php} (100%) rename plugins/SearchSub/{ => lib}/searchsubmenu.php (100%) rename plugins/SearchSub/{ => lib}/searchsubtrackcommand.php (100%) rename plugins/SearchSub/{ => lib}/searchsubtrackingcommand.php (100%) rename plugins/SearchSub/{ => lib}/searchsubtrackoffcommand.php (100%) rename plugins/SearchSub/{ => lib}/searchsubuntrackcommand.php (100%) rename plugins/SiteNoticeInSidebar/{ => lib}/sitenoticesection.php (100%) rename plugins/Sitemap/{ => actions}/noticesitemap.php (100%) rename plugins/Sitemap/{sitemapaction.php => actions/sitemap.php} (100%) rename plugins/Sitemap/{ => actions}/sitemapadminpanel.php (100%) rename plugins/Sitemap/{ => actions}/sitemapindex.php (100%) rename plugins/Sitemap/{ => actions}/usersitemap.php (100%) rename plugins/Sitemap/{ => classes}/Sitemap_notice_count.php (100%) rename plugins/Sitemap/{ => classes}/Sitemap_user_count.php (100%) rename plugins/SlicedFavorites/{favoritedsliceaction.php => actions/favoritedslice.php} (100%) rename plugins/SubMirror/{lib/addmirrorform.php => forms/addmirror.php} (100%) rename plugins/SubMirror/{lib/addtwittermirrorform.php => forms/addtwitter.php} (100%) rename plugins/SubMirror/{lib/editmirrorform.php => forms/editmirror.php} (100%) rename plugins/TagSub/{tagsubaction.php => actions/tagsub.php} (100%) rename plugins/TagSub/{tagsubsaction.php => actions/tagsubs.php} (100%) rename plugins/TagSub/{tagunsubaction.php => actions/tagunsub.php} (100%) rename plugins/TagSub/{ => classes}/TagSub.php (100%) rename plugins/TagSub/{tagsubform.php => forms/tagsub.php} (100%) rename plugins/TagSub/{tagunsubform.php => forms/tagunsub.php} (100%) rename plugins/TagSub/{ => lib}/tagsubmenu.php (100%) rename plugins/TwitterBridge/{ => actions}/twitteradminpanel.php (100%) rename plugins/TwitterBridge/{ => actions}/twitterauthorization.php (100%) rename plugins/TwitterBridge/{ => actions}/twitterlogin.php (100%) rename plugins/TwitterBridge/{ => actions}/twittersettings.php (100%) rename plugins/TwitterBridge/{ => classes}/Notice_to_status.php (100%) rename plugins/TwitterBridge/{ => classes}/Twitter_synch_status.php (100%) rename plugins/TwitterBridge/{ => lib}/jsonstreamreader.php (100%) rename plugins/TwitterBridge/{ => lib}/tweetinqueuehandler.php (100%) rename plugins/TwitterBridge/{ => lib}/twitterimport.php (100%) rename plugins/TwitterBridge/{ => lib}/twitteroauthclient.php (100%) rename plugins/TwitterBridge/{ => lib}/twitterqueuehandler.php (100%) create mode 100644 plugins/TwitterBridge/lib/twittersitestream.php rename plugins/TwitterBridge/{ => lib}/twitterstreamreader.php (100%) create mode 100644 plugins/TwitterBridge/lib/twitteruserstream.php rename plugins/UserFlag/{ => actions}/adminprofileflag.php (100%) rename plugins/UserFlag/{ => actions}/clearflag.php (100%) rename plugins/UserFlag/{ => actions}/flagprofile.php (100%) rename plugins/UserFlag/{ => classes}/User_flag_profile.php (100%) rename plugins/UserFlag/{clearflagform.php => forms/clearflag.php} (100%) rename plugins/UserFlag/{flagprofileform.php => forms/flagprofile.php} (100%) rename plugins/Xmpp/{Queued_XMPP.php => lib/queued_xmpp.php} (100%) rename plugins/Xmpp/{Sharing_XMPP.php => lib/sharing_xmpp.php} (100%) rename plugins/Xmpp/{ => lib}/xmppmanager.php (100%) rename plugins/YammerImport/{lib/yammerapikeyform.php => forms/yammerapikey.php} (100%) rename plugins/YammerImport/{lib/yammerauthinitform.php => forms/yammerauthinit.php} (100%) rename plugins/YammerImport/{lib/yammerauthverifyform.php => forms/yammerauthverify.php} (100%) rename plugins/YammerImport/{lib/yammerprogressform.php => forms/yammerprogress.php} (100%) diff --git a/lib/plugin.php b/lib/plugin.php index a5424e06ca..f97a07fe5a 100644 --- a/lib/plugin.php +++ b/lib/plugin.php @@ -79,6 +79,49 @@ class Plugin return true; } + /** + * Load related modules when needed + * + * Most non-trivial plugins will require extra modules to do their work. Typically + * these include data classes, action classes, widget classes, or external libraries. + * + * This method receives a class name and loads the PHP file related to that class. By + * tradition, action classes typically have files named for the action, all lower-case. + * Data classes are in files with the data class name, initial letter capitalized. + * + * Note that this method will be called for *all* overloaded classes, not just ones + * in this plugin! So, make sure to return true by default to let other plugins, and + * the core code, get a chance. + * + * @param string $cls Name of the class to be loaded + * + * @return boolean hook value; true means continue processing, false means stop. + */ + public function onAutoload($cls) { + $cls = basename($cls); + $basedir = INSTALLDIR . '/plugins/' . mb_substr(get_called_class(), 0, -6); + $file = null; + + if (preg_match('/^(\w+)(Action|Form)$/', $cls, $type)) { + $type = array_map('strtolower', $type); + $file = "$basedir/{$type[2]}s/{$type[1]}.php"; + } else { + $file = "$basedir/classes/{$cls}.php"; + + if (!file_exists($file)) { + $type = strtolower($cls); + $file = "$basedir/lib/{$type}.php"; + } + } + + if (!is_null($file) && file_exists($file)) { + require_once($file); + return false; + } + + return true; + } + /** * Checks if this plugin has localization that needs to be set up. * Gettext localizations can be called via the _m() helper function. diff --git a/plugins/AccountManager/AccountManagerPlugin.php b/plugins/AccountManager/AccountManagerPlugin.php index 3b399af8c8..a4ddc747ca 100644 --- a/plugins/AccountManager/AccountManagerPlugin.php +++ b/plugins/AccountManager/AccountManagerPlugin.php @@ -40,19 +40,6 @@ class AccountManagerPlugin extends Plugin parent::__construct(); } - function onAutoload($cls) - { - switch ($cls) - { - case 'AccountManagementControlDocumentAction': - require_once(INSTALLDIR.'/plugins/AccountManager/AccountManagementControlDocumentAction.php'); - return false; - case 'AccountManagementSessionStatusAction': - require_once(INSTALLDIR.'/plugins/AccountManager/AccountManagementSessionStatusAction.php'); - return false; - } - } - /** * Hook for RouterInitialized event. * diff --git a/plugins/AccountManager/AccountManagementControlDocumentAction.php b/plugins/AccountManager/actions/accountmanagementcontroldocument.php similarity index 100% rename from plugins/AccountManager/AccountManagementControlDocumentAction.php rename to plugins/AccountManager/actions/accountmanagementcontroldocument.php diff --git a/plugins/AccountManager/AccountManagementSessionStatusAction.php b/plugins/AccountManager/actions/accountmanagementsessionstatus.php similarity index 100% rename from plugins/AccountManager/AccountManagementSessionStatusAction.php rename to plugins/AccountManager/actions/accountmanagementsessionstatus.php diff --git a/plugins/Activity/ActivityPlugin.php b/plugins/Activity/ActivityPlugin.php index ff95360281..bffd7a3a10 100644 --- a/plugins/Activity/ActivityPlugin.php +++ b/plugins/Activity/ActivityPlugin.php @@ -57,24 +57,6 @@ class ActivityPlugin extends Plugin public $StartLike = false; public $StopLike = false; - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'JoinListItem': - case 'LeaveListItem': - case 'FollowListItem': - case 'UnfollowListItem': - case 'SystemListItem': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } - function onEndSubscribe($subscriber, $other) { // Only do this if config is enabled diff --git a/plugins/Activity/followlistitem.php b/plugins/Activity/lib/followlistitem.php similarity index 100% rename from plugins/Activity/followlistitem.php rename to plugins/Activity/lib/followlistitem.php diff --git a/plugins/Activity/joinlistitem.php b/plugins/Activity/lib/joinlistitem.php similarity index 100% rename from plugins/Activity/joinlistitem.php rename to plugins/Activity/lib/joinlistitem.php diff --git a/plugins/Activity/leavelistitem.php b/plugins/Activity/lib/leavelistitem.php similarity index 100% rename from plugins/Activity/leavelistitem.php rename to plugins/Activity/lib/leavelistitem.php diff --git a/plugins/Activity/systemlistitem.php b/plugins/Activity/lib/systemlistitem.php similarity index 100% rename from plugins/Activity/systemlistitem.php rename to plugins/Activity/lib/systemlistitem.php diff --git a/plugins/Activity/unfollowlistitem.php b/plugins/Activity/lib/unfollowlistitem.php similarity index 100% rename from plugins/Activity/unfollowlistitem.php rename to plugins/Activity/lib/unfollowlistitem.php diff --git a/plugins/ActivitySpam/ActivitySpamPlugin.php b/plugins/ActivitySpam/ActivitySpamPlugin.php index 975fc6885c..c33097fd81 100644 --- a/plugins/ActivitySpam/ActivitySpamPlugin.php +++ b/plugins/ActivitySpam/ActivitySpamPlugin.php @@ -92,38 +92,6 @@ class ActivitySpamPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'TrainAction': - case 'SpamAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'Spam_score': - include_once $dir . '/'.$cls.'.php'; - return false; - case 'SpamFilter': - case 'SpamNoticeStream': - case 'TrainSpamForm': - case 'TrainHamForm': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } - /** * When a notice is saved, check its spam score * diff --git a/plugins/ActivitySpam/spam.php b/plugins/ActivitySpam/actions/spam.php similarity index 100% rename from plugins/ActivitySpam/spam.php rename to plugins/ActivitySpam/actions/spam.php diff --git a/plugins/ActivitySpam/train.php b/plugins/ActivitySpam/actions/train.php similarity index 100% rename from plugins/ActivitySpam/train.php rename to plugins/ActivitySpam/actions/train.php diff --git a/plugins/ActivitySpam/Spam_score.php b/plugins/ActivitySpam/classes/spam_score.php similarity index 100% rename from plugins/ActivitySpam/Spam_score.php rename to plugins/ActivitySpam/classes/spam_score.php diff --git a/plugins/ActivitySpam/trainhamform.php b/plugins/ActivitySpam/forms/trainham.php similarity index 100% rename from plugins/ActivitySpam/trainhamform.php rename to plugins/ActivitySpam/forms/trainham.php diff --git a/plugins/ActivitySpam/trainspamform.php b/plugins/ActivitySpam/forms/trainspam.php similarity index 100% rename from plugins/ActivitySpam/trainspamform.php rename to plugins/ActivitySpam/forms/trainspam.php diff --git a/plugins/ActivitySpam/spamfilter.php b/plugins/ActivitySpam/lib/spamfilter.php similarity index 100% rename from plugins/ActivitySpam/spamfilter.php rename to plugins/ActivitySpam/lib/spamfilter.php diff --git a/plugins/ActivitySpam/spamnoticestream.php b/plugins/ActivitySpam/lib/spamnoticestream.php similarity index 100% rename from plugins/ActivitySpam/spamnoticestream.php rename to plugins/ActivitySpam/lib/spamnoticestream.php diff --git a/plugins/Adsense/AdsensePlugin.php b/plugins/Adsense/AdsensePlugin.php index fa8afb1807..78637b446e 100644 --- a/plugins/Adsense/AdsensePlugin.php +++ b/plugins/Adsense/AdsensePlugin.php @@ -174,20 +174,6 @@ class AdsensePlugin extends UAPPlugin return true; } - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'AdsenseadminpanelAction': - require_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - default: - return true; - } - } - function onEndAdminPanelNav($menu) { if (AdminPanelAction::canAdmin('adsense')) { // TRANS: Menu item title/tooltip diff --git a/plugins/Adsense/adsenseadminpanel.php b/plugins/Adsense/actions/adsenseadminpanel.php similarity index 100% rename from plugins/Adsense/adsenseadminpanel.php rename to plugins/Adsense/actions/adsenseadminpanel.php diff --git a/plugins/Aim/AimPlugin.php b/plugins/Aim/AimPlugin.php index ffb9345877..f244728205 100644 --- a/plugins/Aim/AimPlugin.php +++ b/plugins/Aim/AimPlugin.php @@ -96,15 +96,9 @@ class AimPlugin extends ImPlugin case 'Aim': require_once(INSTALLDIR.'/plugins/Aim/extlib/phptoclib/aimclassw.php'); return false; - case 'AimManager': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - case 'Fake_Aim': - include_once $dir . '/'. $cls .'.php'; - return false; - default: - return true; } + + return parent::onAutoload($cls); } function onStartImDaemonIoManagers(&$classes) diff --git a/plugins/Aim/Fake_Aim.php b/plugins/Aim/classes/Fake_Aim.php similarity index 100% rename from plugins/Aim/Fake_Aim.php rename to plugins/Aim/classes/Fake_Aim.php diff --git a/plugins/Aim/aimmanager.php b/plugins/Aim/lib/aimmanager.php similarity index 100% rename from plugins/Aim/aimmanager.php rename to plugins/Aim/lib/aimmanager.php diff --git a/plugins/AnonymousFave/AnonymousFavePlugin.php b/plugins/AnonymousFave/AnonymousFavePlugin.php index e0b2a17d1f..67fe851d0f 100644 --- a/plugins/AnonymousFave/AnonymousFavePlugin.php +++ b/plugins/AnonymousFave/AnonymousFavePlugin.php @@ -100,31 +100,6 @@ class AnonymousFavePlugin extends Plugin $action->inlineScript('SN.U.NoticeFavor();'); } - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) { - case 'Fave_tally': - include_once $dir . '/' . $cls . '.php'; - return false; - case 'AnonFavorAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'AnonDisFavorAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'AnonFavorForm': - include_once $dir . '/anonfavorform.php'; - return false; - case 'AnonDisFavorForm': - include_once $dir . '/anondisfavorform.php'; - return false; - default: - return true; - } - } - function onStartInitializeRouter($m) { $m->connect('main/anonfavor', array('action' => 'AnonFavor')); diff --git a/plugins/AnonymousFave/anondisfavor.php b/plugins/AnonymousFave/actions/anondisfavor.php similarity index 100% rename from plugins/AnonymousFave/anondisfavor.php rename to plugins/AnonymousFave/actions/anondisfavor.php diff --git a/plugins/AnonymousFave/anonfavor.php b/plugins/AnonymousFave/actions/anonfavor.php similarity index 100% rename from plugins/AnonymousFave/anonfavor.php rename to plugins/AnonymousFave/actions/anonfavor.php diff --git a/plugins/AnonymousFave/Fave_tally.php b/plugins/AnonymousFave/classes/Fave_tally.php similarity index 100% rename from plugins/AnonymousFave/Fave_tally.php rename to plugins/AnonymousFave/classes/Fave_tally.php diff --git a/plugins/AnonymousFave/anondisfavorform.php b/plugins/AnonymousFave/forms/anondisfavor.php similarity index 99% rename from plugins/AnonymousFave/anondisfavorform.php rename to plugins/AnonymousFave/forms/anondisfavor.php index 38e2903db1..3d715f0807 100644 --- a/plugins/AnonymousFave/anondisfavorform.php +++ b/plugins/AnonymousFave/forms/anondisfavor.php @@ -67,3 +67,4 @@ class AnonDisfavorForm extends DisFavorForm return common_local_url('AnonDisFavor'); } } + diff --git a/plugins/AnonymousFave/anonfavorform.php b/plugins/AnonymousFave/forms/anonfavor.php similarity index 99% rename from plugins/AnonymousFave/anonfavorform.php rename to plugins/AnonymousFave/forms/anonfavor.php index a68fdaf2b3..491165aa1c 100644 --- a/plugins/AnonymousFave/anonfavorform.php +++ b/plugins/AnonymousFave/forms/anonfavor.php @@ -67,3 +67,4 @@ class AnonFavorForm extends FavorForm return common_local_url('AnonFavor'); } } + diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php index 39b933afd9..450a22ad62 100644 --- a/plugins/Autocomplete/AutocompletePlugin.php +++ b/plugins/Autocomplete/AutocompletePlugin.php @@ -39,16 +39,6 @@ class AutocompletePlugin extends Plugin parent::__construct(); } - function onAutoload($cls) - { - switch ($cls) - { - case 'AutocompleteAction': - require_once(INSTALLDIR.'/plugins/Autocomplete/autocomplete.php'); - return false; - } - } - function onEndShowScripts($action){ if (common_logged_in()) { $action->element('span', array('id' => 'autocomplete-api', diff --git a/plugins/Autocomplete/autocomplete.php b/plugins/Autocomplete/actions/autocomplete.php similarity index 100% rename from plugins/Autocomplete/autocomplete.php rename to plugins/Autocomplete/actions/autocomplete.php diff --git a/plugins/BitlyUrl/BitlyUrlPlugin.php b/plugins/BitlyUrl/BitlyUrlPlugin.php index 5efd573896..8b2fc6551f 100644 --- a/plugins/BitlyUrl/BitlyUrlPlugin.php +++ b/plugins/BitlyUrl/BitlyUrlPlugin.php @@ -205,27 +205,6 @@ class BitlyUrlPlugin extends UrlShortenerPlugin return true; } - /** - * Automatically load the actions and libraries used by the plugin - * - * @param Class $cls the class - * - * @return boolean hook return - * - */ - function onAutoload($cls) - { - $base = dirname(__FILE__); - $lower = strtolower($cls); - switch ($lower) { - case 'bitlyadminpanelaction': - require_once "$base/$lower.php"; - return false; - default: - return true; - } - } - /** * Internal hook point to check the default global credentials so * the admin form knows if we have a fallback or not. diff --git a/plugins/BitlyUrl/bitlyadminpanelaction.php b/plugins/BitlyUrl/actions/bitlyadminpanel.php similarity index 100% rename from plugins/BitlyUrl/bitlyadminpanelaction.php rename to plugins/BitlyUrl/actions/bitlyadminpanel.php diff --git a/plugins/Blacklist/BlacklistPlugin.php b/plugins/Blacklist/BlacklistPlugin.php index 5f31be63d4..2a99e65f11 100644 --- a/plugins/Blacklist/BlacklistPlugin.php +++ b/plugins/Blacklist/BlacklistPlugin.php @@ -284,30 +284,6 @@ class BlacklistPlugin extends Plugin return true; } - /** - * Auto-load our classes if called - * - * @param string $cls Class to load - * - * @return boolean hook return - */ - function onAutoload($cls) - { - switch (strtolower($cls)) - { - case 'nickname_blacklist': - case 'homepage_blacklist': - include_once INSTALLDIR.'/plugins/Blacklist/'.ucfirst($cls).'.php'; - return false; - case 'blacklistadminpanelaction': - $base = strtolower(mb_substr($cls, 0, -6)); - include_once INSTALLDIR.'/plugins/Blacklist/'.$base.'.php'; - return false; - default: - return true; - } - } - /** * Plugin version data * diff --git a/plugins/Blacklist/blacklistadminpanel.php b/plugins/Blacklist/actions/blacklistadminpanel.php similarity index 100% rename from plugins/Blacklist/blacklistadminpanel.php rename to plugins/Blacklist/actions/blacklistadminpanel.php diff --git a/plugins/Blacklist/Homepage_blacklist.php b/plugins/Blacklist/classes/Homepage_blacklist.php similarity index 100% rename from plugins/Blacklist/Homepage_blacklist.php rename to plugins/Blacklist/classes/Homepage_blacklist.php diff --git a/plugins/Blacklist/Nickname_blacklist.php b/plugins/Blacklist/classes/Nickname_blacklist.php similarity index 100% rename from plugins/Blacklist/Nickname_blacklist.php rename to plugins/Blacklist/classes/Nickname_blacklist.php diff --git a/plugins/Blog/BlogPlugin.php b/plugins/Blog/BlogPlugin.php index eb1f5833c4..7fa23461d6 100644 --- a/plugins/Blog/BlogPlugin.php +++ b/plugins/Blog/BlogPlugin.php @@ -67,35 +67,6 @@ class BlogPlugin extends MicroAppPlugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'NewblogentryAction': - case 'ShowblogentryAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'BlogEntryForm': - case 'BlogEntryListItem': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - case 'Blog_entry': - include_once $dir . '/'.$cls.'.php'; - return false; - default: - return true; - } - } - /** * Map URLs to actions * diff --git a/plugins/Blog/newblogentry.php b/plugins/Blog/actions/newblogentry.php similarity index 100% rename from plugins/Blog/newblogentry.php rename to plugins/Blog/actions/newblogentry.php diff --git a/plugins/Blog/showblogentry.php b/plugins/Blog/actions/showblogentry.php similarity index 100% rename from plugins/Blog/showblogentry.php rename to plugins/Blog/actions/showblogentry.php diff --git a/plugins/Blog/Blog_entry.php b/plugins/Blog/classes/Blog_entry.php similarity index 100% rename from plugins/Blog/Blog_entry.php rename to plugins/Blog/classes/Blog_entry.php diff --git a/plugins/Blog/blogentryform.php b/plugins/Blog/forms/blogentry.php similarity index 100% rename from plugins/Blog/blogentryform.php rename to plugins/Blog/forms/blogentry.php diff --git a/plugins/Blog/blogentrylistitem.php b/plugins/Blog/lib/blogentrylistitem.php similarity index 100% rename from plugins/Blog/blogentrylistitem.php rename to plugins/Blog/lib/blogentrylistitem.php diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index c8408cf971..6dacdb085e 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -135,44 +135,6 @@ class BookmarkPlugin extends MicroAppPlugin $action->script($this->path('js/bookmark.js')); return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'BookmarksAction': - case 'BookmarksrssAction': - case 'ApiTimelineBookmarksAction': - case 'ShowbookmarkAction': - case 'NewbookmarkAction': - case 'BookmarkpopupAction': - case 'NoticebyurlAction': - case 'BookmarkforurlAction': - case 'ImportdeliciousAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'Bookmark': - include_once $dir.'/'.$cls.'.php'; - return false; - case 'BookmarkListItem': - case 'BookmarkForm': - case 'InitialBookmarkForm': - case 'DeliciousBackupImporter': - case 'DeliciousBookmarkImporter': - include_once $dir.'/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } /** * Map URLs to actions diff --git a/plugins/Bookmark/apitimelinebookmarks.php b/plugins/Bookmark/actions/apitimelinebookmarks.php similarity index 99% rename from plugins/Bookmark/apitimelinebookmarks.php rename to plugins/Bookmark/actions/apitimelinebookmarks.php index 1753462350..34dbfa75d3 100644 --- a/plugins/Bookmark/apitimelinebookmarks.php +++ b/plugins/Bookmark/actions/apitimelinebookmarks.php @@ -35,7 +35,6 @@ if (!defined('STATUSNET')) { } require_once INSTALLDIR.'/lib/apibareauth.php'; -require_once 'bookmarksnoticestream.php'; /** * Returns the 20 most recent favorite notices for the authenticating user or user diff --git a/plugins/Bookmark/bookmarkforurl.php b/plugins/Bookmark/actions/bookmarkforurl.php similarity index 100% rename from plugins/Bookmark/bookmarkforurl.php rename to plugins/Bookmark/actions/bookmarkforurl.php diff --git a/plugins/Bookmark/bookmarkpopup.php b/plugins/Bookmark/actions/bookmarkpopup.php similarity index 100% rename from plugins/Bookmark/bookmarkpopup.php rename to plugins/Bookmark/actions/bookmarkpopup.php diff --git a/plugins/Bookmark/bookmarks.php b/plugins/Bookmark/actions/bookmarks.php similarity index 99% rename from plugins/Bookmark/bookmarks.php rename to plugins/Bookmark/actions/bookmarks.php index 8c786d6fb0..fce1185cb5 100644 --- a/plugins/Bookmark/bookmarks.php +++ b/plugins/Bookmark/actions/bookmarks.php @@ -31,8 +31,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once 'bookmarksnoticestream.php'; - /** * List currently logged-in user's bookmakrs * diff --git a/plugins/Bookmark/bookmarksrss.php b/plugins/Bookmark/actions/bookmarksrss.php similarity index 99% rename from plugins/Bookmark/bookmarksrss.php rename to plugins/Bookmark/actions/bookmarksrss.php index a52a0b7f43..c48ab90934 100644 --- a/plugins/Bookmark/bookmarksrss.php +++ b/plugins/Bookmark/actions/bookmarksrss.php @@ -33,7 +33,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { } require_once INSTALLDIR.'/lib/rssaction.php'; -require_once 'bookmarksnoticestream.php'; /** * RSS feed for user bookmarks action class. diff --git a/plugins/Bookmark/importdelicious.php b/plugins/Bookmark/actions/importdelicious.php similarity index 100% rename from plugins/Bookmark/importdelicious.php rename to plugins/Bookmark/actions/importdelicious.php diff --git a/plugins/Bookmark/newbookmark.php b/plugins/Bookmark/actions/newbookmark.php similarity index 100% rename from plugins/Bookmark/newbookmark.php rename to plugins/Bookmark/actions/newbookmark.php diff --git a/plugins/Bookmark/noticebyurl.php b/plugins/Bookmark/actions/noticebyurl.php similarity index 100% rename from plugins/Bookmark/noticebyurl.php rename to plugins/Bookmark/actions/noticebyurl.php diff --git a/plugins/Bookmark/showbookmark.php b/plugins/Bookmark/actions/showbookmark.php similarity index 100% rename from plugins/Bookmark/showbookmark.php rename to plugins/Bookmark/actions/showbookmark.php diff --git a/plugins/Bookmark/Bookmark.php b/plugins/Bookmark/classes/Bookmark.php similarity index 100% rename from plugins/Bookmark/Bookmark.php rename to plugins/Bookmark/classes/Bookmark.php diff --git a/plugins/Bookmark/bookmarkform.php b/plugins/Bookmark/forms/bookmark.php similarity index 100% rename from plugins/Bookmark/bookmarkform.php rename to plugins/Bookmark/forms/bookmark.php diff --git a/plugins/Bookmark/initialbookmarkform.php b/plugins/Bookmark/forms/initialbookmark.php similarity index 100% rename from plugins/Bookmark/initialbookmarkform.php rename to plugins/Bookmark/forms/initialbookmark.php diff --git a/plugins/Bookmark/bookmarklistitem.php b/plugins/Bookmark/lib/bookmarklistitem.php similarity index 100% rename from plugins/Bookmark/bookmarklistitem.php rename to plugins/Bookmark/lib/bookmarklistitem.php diff --git a/plugins/Bookmark/bookmarksnoticestream.php b/plugins/Bookmark/lib/bookmarksnoticestream.php similarity index 100% rename from plugins/Bookmark/bookmarksnoticestream.php rename to plugins/Bookmark/lib/bookmarksnoticestream.php diff --git a/plugins/Bookmark/deliciousbackupimporter.php b/plugins/Bookmark/lib/deliciousbackupimporter.php similarity index 100% rename from plugins/Bookmark/deliciousbackupimporter.php rename to plugins/Bookmark/lib/deliciousbackupimporter.php diff --git a/plugins/Bookmark/deliciousbookmarkimporter.php b/plugins/Bookmark/lib/deliciousbookmarkimporter.php similarity index 100% rename from plugins/Bookmark/deliciousbookmarkimporter.php rename to plugins/Bookmark/lib/deliciousbookmarkimporter.php diff --git a/plugins/Bookmark/importbookmarks.php b/plugins/Bookmark/scripts/importbookmarks.php similarity index 100% rename from plugins/Bookmark/importbookmarks.php rename to plugins/Bookmark/scripts/importbookmarks.php diff --git a/plugins/CasAuthentication/CasAuthenticationPlugin.php b/plugins/CasAuthentication/CasAuthenticationPlugin.php index ecc642b856..0efbb7519b 100644 --- a/plugins/CasAuthentication/CasAuthenticationPlugin.php +++ b/plugins/CasAuthentication/CasAuthenticationPlugin.php @@ -54,10 +54,10 @@ class CasAuthenticationPlugin extends AuthenticationPlugin case 'phpCAS': require_once(INSTALLDIR.'/plugins/CasAuthentication/extlib/CAS.php'); return false; - case 'CasloginAction': - require_once(INSTALLDIR.'/plugins/CasAuthentication/' . strtolower(mb_substr($cls, 0, -6)) . '.php'); - return false; } + + // if it's not our exception, try standard places + return parent::onAutoload($cls); } function onArgsInitialize(&$args) diff --git a/plugins/CasAuthentication/caslogin.php b/plugins/CasAuthentication/actions/caslogin.php similarity index 100% rename from plugins/CasAuthentication/caslogin.php rename to plugins/CasAuthentication/actions/caslogin.php diff --git a/plugins/ClientSideShorten/ClientSideShortenPlugin.php b/plugins/ClientSideShorten/ClientSideShortenPlugin.php index cc10929231..ba4f05fc20 100644 --- a/plugins/ClientSideShorten/ClientSideShortenPlugin.php +++ b/plugins/ClientSideShorten/ClientSideShortenPlugin.php @@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once(INSTALLDIR.'/plugins/ClientSideShorten/shorten.php'); - class ClientSideShortenPlugin extends Plugin { function __construct() @@ -40,16 +38,6 @@ class ClientSideShortenPlugin extends Plugin parent::__construct(); } - function onAutoload($cls) - { - switch ($cls) - { - case 'ShortenAction': - require_once(INSTALLDIR.'/plugins/ClientSideShorten/shorten.php'); - return false; - } - } - function onEndShowScripts($action){ if (common_logged_in()) { $user = common_current_user(); diff --git a/plugins/ClientSideShorten/shorten.php b/plugins/ClientSideShorten/actions/shorten.php similarity index 100% rename from plugins/ClientSideShorten/shorten.php rename to plugins/ClientSideShorten/actions/shorten.php diff --git a/plugins/Directory/DirectoryPlugin.php b/plugins/Directory/DirectoryPlugin.php index 5979bb0e80..511b7eb561 100644 --- a/plugins/Directory/DirectoryPlugin.php +++ b/plugins/Directory/DirectoryPlugin.php @@ -68,41 +68,6 @@ class DirectoryPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, - * false means stop. - */ - function onAutoload($cls) - { - // common_debug("class = $cls"); - - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'UserdirectoryAction': - case 'GroupdirectoryAction': - include_once $dir - . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'AlphaNav': - include_once $dir - . '/lib/' . strtolower($cls) . '.php'; - return false; - case 'SortableSubscriptionList': - case 'SortableGroupList': - include_once $dir - . '/lib/' . strtolower($cls) . '.php'; - return false; - default: - return true; - } - } - /** * Map URLs to actions * diff --git a/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php b/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php index 3364c8ae5c..732a85f373 100644 --- a/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php +++ b/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php @@ -91,27 +91,6 @@ class DomainStatusNetworkPlugin extends Plugin } } - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'GlobalregisterAction': - case 'GloballoginAction': - case 'GlobalrecoverAction': - include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'DomainStatusNetworkInstaller': - case 'GlobalApiAction': - case 'FreeEmail': - include_once $dir . '/lib/' . strtolower($cls) . '.php'; - return false; - default: - return true; - } - } - static function toDomain($raw) { $parts = explode('@', $raw); diff --git a/plugins/DomainStatusNetwork/lib/globalapiaction.php b/plugins/DomainStatusNetwork/actions/globalapi.php similarity index 100% rename from plugins/DomainStatusNetwork/lib/globalapiaction.php rename to plugins/DomainStatusNetwork/actions/globalapi.php diff --git a/plugins/DomainWhitelist/DomainWhitelistPlugin.php b/plugins/DomainWhitelist/DomainWhitelistPlugin.php index da49338fe7..9aa67ab845 100644 --- a/plugins/DomainWhitelist/DomainWhitelistPlugin.php +++ b/plugins/DomainWhitelist/DomainWhitelistPlugin.php @@ -48,32 +48,6 @@ if (!defined('STATUSNET')) { */ class DomainWhitelistPlugin extends Plugin { - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false - * means stop. - */ - function onAutoload($cls) { - $base = dirname(__FILE__); - $lower = strtolower($cls); - - $files = array("$base/classes/$cls.php", - "$base/lib/$lower.php"); - if (substr($lower, -6) == 'action') { - $files[] = "$base/actions/" . substr($lower, 0, -6) . ".php"; - } - foreach ($files as $file) { - if (file_exists($file)) { - include_once $file; - return false; - } - } - return true; - } - /** * Get the path to the plugin's installation directory. Used * to link in js files and whatnot. diff --git a/plugins/DomainWhitelist/lib/whitelistinviteform.php b/plugins/DomainWhitelist/forms/whitelistinvite.php similarity index 100% rename from plugins/DomainWhitelist/lib/whitelistinviteform.php rename to plugins/DomainWhitelist/forms/whitelistinvite.php diff --git a/plugins/EmailRegistration/EmailRegistrationPlugin.php b/plugins/EmailRegistration/EmailRegistrationPlugin.php index 2f1116ba0c..14af35ec11 100644 --- a/plugins/EmailRegistration/EmailRegistrationPlugin.php +++ b/plugins/EmailRegistration/EmailRegistrationPlugin.php @@ -49,24 +49,6 @@ class EmailRegistrationPlugin extends Plugin { const CONFIRMTYPE = 'register'; - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'EmailregisterAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'EmailRegistrationForm': - case 'ConfirmRegistrationForm': - include_once $dir . '/' . strtolower($cls) . '.php'; - return false; - default: - return true; - } - } - function onArgsInitialize(&$args) { if (array_key_exists('action', $args) && $args['action'] == 'register') { diff --git a/plugins/EmailRegistration/emailregister.php b/plugins/EmailRegistration/actions/emailregister.php similarity index 100% rename from plugins/EmailRegistration/emailregister.php rename to plugins/EmailRegistration/actions/emailregister.php diff --git a/plugins/EmailRegistration/confirmregistrationform.php b/plugins/EmailRegistration/forms/confirmregistration.php similarity index 100% rename from plugins/EmailRegistration/confirmregistrationform.php rename to plugins/EmailRegistration/forms/confirmregistration.php diff --git a/plugins/EmailRegistration/emailregistrationform.php b/plugins/EmailRegistration/forms/emailregistration.php similarity index 100% rename from plugins/EmailRegistration/emailregistrationform.php rename to plugins/EmailRegistration/forms/emailregistration.php diff --git a/plugins/EmailReminder/EmailReminderPlugin.php b/plugins/EmailReminder/EmailReminderPlugin.php index 4e144af521..e55f134a94 100644 --- a/plugins/EmailReminder/EmailReminderPlugin.php +++ b/plugins/EmailReminder/EmailReminderPlugin.php @@ -61,32 +61,6 @@ class EmailReminderPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false - * means stop. - */ - function onAutoload($cls) { - $base = dirname(__FILE__); - $lower = strtolower($cls); - - $files = array("$base/classes/$cls.php", - "$base/lib/$lower.php"); - if (substr($lower, -6) == 'action') { - $files[] = "$base/actions/" . substr($lower, 0, -6) . ".php"; - } - foreach ($files as $file) { - if (file_exists($file)) { - include_once $file; - return false; - } - } - return true; - } - /** * Register our queue handlers * diff --git a/plugins/EmailSummary/EmailSummaryPlugin.php b/plugins/EmailSummary/EmailSummaryPlugin.php index f99a10bc02..0ba80e1e36 100644 --- a/plugins/EmailSummary/EmailSummaryPlugin.php +++ b/plugins/EmailSummary/EmailSummaryPlugin.php @@ -59,32 +59,6 @@ class EmailSummaryPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - * - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'SiteEmailSummaryHandler': - case 'UserEmailSummaryHandler': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - case 'Email_summary_status': - include_once $dir . '/'.$cls.'.php'; - return false; - default: - return true; - } - } - /** * Version info for this plugin * diff --git a/plugins/EmailSummary/Email_summary_status.php b/plugins/EmailSummary/classes/Email_summary_status.php similarity index 100% rename from plugins/EmailSummary/Email_summary_status.php rename to plugins/EmailSummary/classes/Email_summary_status.php diff --git a/plugins/EmailSummary/siteemailsummaryhandler.php b/plugins/EmailSummary/lib/siteemailsummaryhandler.php similarity index 100% rename from plugins/EmailSummary/siteemailsummaryhandler.php rename to plugins/EmailSummary/lib/siteemailsummaryhandler.php diff --git a/plugins/EmailSummary/useremailsummaryhandler.php b/plugins/EmailSummary/lib/useremailsummaryhandler.php similarity index 100% rename from plugins/EmailSummary/useremailsummaryhandler.php rename to plugins/EmailSummary/lib/useremailsummaryhandler.php diff --git a/plugins/EmailSummary/sendemailsummary.php b/plugins/EmailSummary/scripts/sendemailsummary.php similarity index 100% rename from plugins/EmailSummary/sendemailsummary.php rename to plugins/EmailSummary/scripts/sendemailsummary.php diff --git a/plugins/Event/EventPlugin.php b/plugins/Event/EventPlugin.php index 7676a25ac0..2a8a078c74 100644 --- a/plugins/Event/EventPlugin.php +++ b/plugins/Event/EventPlugin.php @@ -64,44 +64,6 @@ class EventPlugin extends MicroappPlugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'NeweventAction': - case 'NewrsvpAction': - case 'CancelrsvpAction': - case 'ShoweventAction': - case 'ShowrsvpAction': - case 'TimelistAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'EventListItem': - case 'RSVPListItem': - case 'EventForm': - case 'RSVPForm': - case 'CancelRSVPForm': - case 'EventTimeList': - include_once $dir . '/'.strtolower($cls).'.php'; - break; - case 'Happening': - case 'RSVP': - include_once $dir . '/'.$cls.'.php'; - return false; - default: - return true; - } - } - /** * Map URLs to actions * diff --git a/plugins/Event/cancelrsvp.php b/plugins/Event/actions/cancelrsvp.php similarity index 100% rename from plugins/Event/cancelrsvp.php rename to plugins/Event/actions/cancelrsvp.php diff --git a/plugins/Event/newevent.php b/plugins/Event/actions/newevent.php similarity index 100% rename from plugins/Event/newevent.php rename to plugins/Event/actions/newevent.php diff --git a/plugins/Event/newrsvp.php b/plugins/Event/actions/newrsvp.php similarity index 100% rename from plugins/Event/newrsvp.php rename to plugins/Event/actions/newrsvp.php diff --git a/plugins/Event/showevent.php b/plugins/Event/actions/showevent.php similarity index 100% rename from plugins/Event/showevent.php rename to plugins/Event/actions/showevent.php diff --git a/plugins/Event/showrsvp.php b/plugins/Event/actions/showrsvp.php similarity index 100% rename from plugins/Event/showrsvp.php rename to plugins/Event/actions/showrsvp.php diff --git a/plugins/Event/timelist.php b/plugins/Event/actions/timelist.php similarity index 100% rename from plugins/Event/timelist.php rename to plugins/Event/actions/timelist.php diff --git a/plugins/Event/Happening.php b/plugins/Event/classes/Happening.php similarity index 100% rename from plugins/Event/Happening.php rename to plugins/Event/classes/Happening.php diff --git a/plugins/Event/RSVP.php b/plugins/Event/classes/RSVP.php similarity index 100% rename from plugins/Event/RSVP.php rename to plugins/Event/classes/RSVP.php diff --git a/plugins/Event/cancelrsvpform.php b/plugins/Event/forms/cancelrsvp.php similarity index 100% rename from plugins/Event/cancelrsvpform.php rename to plugins/Event/forms/cancelrsvp.php diff --git a/plugins/Event/eventform.php b/plugins/Event/forms/event.php similarity index 100% rename from plugins/Event/eventform.php rename to plugins/Event/forms/event.php diff --git a/plugins/Event/rsvpform.php b/plugins/Event/forms/rsvp.php similarity index 100% rename from plugins/Event/rsvpform.php rename to plugins/Event/forms/rsvp.php diff --git a/plugins/Event/eventlistitem.php b/plugins/Event/lib/eventlistitem.php similarity index 100% rename from plugins/Event/eventlistitem.php rename to plugins/Event/lib/eventlistitem.php diff --git a/plugins/Event/eventtimelist.php b/plugins/Event/lib/eventtimelist.php similarity index 100% rename from plugins/Event/eventtimelist.php rename to plugins/Event/lib/eventtimelist.php diff --git a/plugins/Event/rsvplistitem.php b/plugins/Event/lib/rsvplistitem.php similarity index 100% rename from plugins/Event/rsvplistitem.php rename to plugins/Event/lib/rsvplistitem.php diff --git a/plugins/ExtendedProfile/ExtendedProfilePlugin.php b/plugins/ExtendedProfile/ExtendedProfilePlugin.php index 8436275b78..578825aa34 100644 --- a/plugins/ExtendedProfile/ExtendedProfilePlugin.php +++ b/plugins/ExtendedProfile/ExtendedProfilePlugin.php @@ -43,42 +43,6 @@ class ExtendedProfilePlugin extends Plugin return true; } - /** - * Autoloader - * - * Loads our classes if they're requested. - * - * @param string $cls Class requested - * - * @return boolean hook return - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch (strtolower($cls)) - { - case 'profiledetailaction': - case 'profiledetailsettingsaction': - case 'userautocompleteaction': - include_once $dir . '/actions/' - . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - break; // Safety first! - case 'extendedprofile': - case 'extendedprofilewidget': - include_once $dir . '/lib/' . strtolower($cls) . '.php'; - return false; - break; - case 'profile_detail': - include_once $dir . '/classes/' . ucfirst($cls) . '.php'; - return false; - break; - default: - return true; - } - } - /** * Add paths to the router table * diff --git a/plugins/FacebookBridge/FacebookBridgePlugin.php b/plugins/FacebookBridge/FacebookBridgePlugin.php index 07a149785c..3bace7341b 100644 --- a/plugins/FacebookBridge/FacebookBridgePlugin.php +++ b/plugins/FacebookBridge/FacebookBridgePlugin.php @@ -109,23 +109,9 @@ class FacebookBridgePlugin extends Plugin include_once $dir . '/extlib/base_facebook.php'; include_once $dir . '/extlib/facebook.php'; return false; - case 'FacebookloginAction': - case 'FacebookfinishloginAction': - case 'FacebookadminpanelAction': - case 'FacebooksettingsAction': - case 'FacebookdeauthorizeAction': - include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'Facebookclient': - case 'FacebookQueueHandler': - include_once $dir . '/lib/' . strtolower($cls) . '.php'; - return false; - case 'Notice_to_item': - include_once $dir . '/classes/' . $cls . '.php'; - return false; - default: - return true; } + + return parent::onAutoload($cls); } /** diff --git a/plugins/FollowEveryone/FollowEveryonePlugin.php b/plugins/FollowEveryone/FollowEveryonePlugin.php index 0bea8d9aa4..167b431533 100644 --- a/plugins/FollowEveryone/FollowEveryonePlugin.php +++ b/plugins/FollowEveryone/FollowEveryonePlugin.php @@ -119,27 +119,6 @@ class FollowEveryonePlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'User_followeveryone_prefs': - include_once $dir . '/'.$cls.'.php'; - return false; - default: - return true; - } - } - /** * Show a checkbox on the profile form to ask whether to follow everyone * diff --git a/plugins/FollowEveryone/User_followeveryone_prefs.php b/plugins/FollowEveryone/classes/User_followeveryone_prefs.php similarity index 100% rename from plugins/FollowEveryone/User_followeveryone_prefs.php rename to plugins/FollowEveryone/classes/User_followeveryone_prefs.php diff --git a/plugins/GNUsocialPhoto/GNUsocialPhotoPlugin.php b/plugins/GNUsocialPhoto/GNUsocialPhotoPlugin.php index 27a3285558..cb6ee97e89 100644 --- a/plugins/GNUsocialPhoto/GNUsocialPhotoPlugin.php +++ b/plugins/GNUsocialPhoto/GNUsocialPhotoPlugin.php @@ -42,26 +42,6 @@ class GNUsocialPhotoPlugin extends MicroAppPlugin return true; } - function onAutoload($cls) - { - $dir = dirname(__FILE__); - switch($cls) - { - case 'Photo': - include_once $dir . '/Photo.php'; - break; - case 'NewPhotoForm': - include_once $dir . '/newphotoform.php'; - break; - case 'NewphotoAction': - include_once $dir . '/newphoto.php'; - break; - default: - break; - } - return true; - } - function onRouterInitialized($m) { $m->connect('main/photo/new', array('action' => 'newphoto')); diff --git a/plugins/GNUsocialPhoto/newphoto.php b/plugins/GNUsocialPhoto/actions/newphoto.php similarity index 100% rename from plugins/GNUsocialPhoto/newphoto.php rename to plugins/GNUsocialPhoto/actions/newphoto.php diff --git a/plugins/GNUsocialPhoto/showphoto.php b/plugins/GNUsocialPhoto/actions/showphoto.php similarity index 100% rename from plugins/GNUsocialPhoto/showphoto.php rename to plugins/GNUsocialPhoto/actions/showphoto.php diff --git a/plugins/GNUsocialPhoto/Photo.php b/plugins/GNUsocialPhoto/classes/Photo.php similarity index 100% rename from plugins/GNUsocialPhoto/Photo.php rename to plugins/GNUsocialPhoto/classes/Photo.php diff --git a/plugins/GNUsocialPhoto/newphotoform.php b/plugins/GNUsocialPhoto/forms/newphoto.php similarity index 100% rename from plugins/GNUsocialPhoto/newphotoform.php rename to plugins/GNUsocialPhoto/forms/newphoto.php diff --git a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php index 3a7e882236..2351551927 100644 --- a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php +++ b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php @@ -33,41 +33,10 @@ if (!defined('STATUSNET')) { exit(1); } +include_once $dir . '/lib/photolib.php'; + class GNUsocialPhotosPlugin extends Plugin { - - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - include_once $dir . '/lib/tempphoto.php'; - include_once $dir . '/lib/photonav.php'; - switch ($cls) - { - case 'PhotosAction': - include_once $dir . '/lib/photolib.php'; - include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - break; - case 'PhotouploadAction': - include_once $dir . '/lib/photolib.php'; - include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - break; - case 'PhotoAction': - include_once $dir . '/lib/photolib.php'; - include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - break; - case 'EditphotoAction': - include_once $dir . '/lib/photolib.php'; - include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - break; - default: - break; - } - include_once $dir . '/classes/gnusocialphoto.php'; - include_once $dir . '/classes/gnusocialphotoalbum.php'; - return true; - } - function onCheckSchema() { $schema = Schema::get(); diff --git a/plugins/GNUsocialPhotos/lib/photonav.php b/plugins/GNUsocialPhotos/lib/gnusocialphotonav.php similarity index 100% rename from plugins/GNUsocialPhotos/lib/photonav.php rename to plugins/GNUsocialPhotos/lib/gnusocialphotonav.php diff --git a/plugins/GNUsocialPhotos/lib/tempphoto.php b/plugins/GNUsocialPhotos/lib/gnusocialphototemp.php similarity index 100% rename from plugins/GNUsocialPhotos/lib/tempphoto.php rename to plugins/GNUsocialPhotos/lib/gnusocialphototemp.php diff --git a/plugins/GNUsocialProfileExtensions/GNUsocialProfileExtensionsPlugin.php b/plugins/GNUsocialProfileExtensions/GNUsocialProfileExtensionsPlugin.php index e6c961f865..bfdcf3e42d 100644 --- a/plugins/GNUsocialProfileExtensions/GNUsocialProfileExtensionsPlugin.php +++ b/plugins/GNUsocialProfileExtensions/GNUsocialProfileExtensionsPlugin.php @@ -30,32 +30,11 @@ if (!defined('STATUSNET')) { exit(1); } +include_once $dir . '/lib/profiletools.php'; + class GNUsocialProfileExtensionsPlugin extends Plugin { - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'BioAction': - case 'NewresponseAction': - include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - break; - case 'ProfilefieldsAdminPanelAction': - include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -16)) . '.php'; - break; - default: - break; - } - include_once $dir . '/classes/GNUsocialProfileExtensionField.php'; - include_once $dir . '/classes/GNUsocialProfileExtensionResponse.php'; - include_once $dir . '/lib/profiletools.php'; - include_once $dir . '/lib/noticetree.php'; - return true; - } - function onCheckSchema() { $schema = Schema::get(); diff --git a/plugins/GNUsocialVideo/GNUsocialVideoPlugin.php b/plugins/GNUsocialVideo/GNUsocialVideoPlugin.php index 296b451223..7d1b98a63f 100644 --- a/plugins/GNUsocialVideo/GNUsocialVideoPlugin.php +++ b/plugins/GNUsocialVideo/GNUsocialVideoPlugin.php @@ -42,29 +42,6 @@ class GNUsocialVideoPlugin extends MicroAppPlugin return true; } - function onAutoload($cls) - { - $dir = dirname(__FILE__); - switch($cls) - { - case 'PostvideoAction': - include_once $dir . '/actions/postvideo.php'; - break; - case 'Video': - include_once $dir . '/Video.php'; - break; - case 'VideoForm': - include_once $dir . '/videoform.php'; - break; - case 'ShowvideoAction': - include_once $dir . '/showvideo.php'; - break; - default: - break; - } - return true; - } - function onRouterInitialized($m) { $m->connect('main/postvideo', array('action' => 'postvideo')); diff --git a/plugins/GNUsocialVideo/showvideo.php b/plugins/GNUsocialVideo/actions/showvideo.php similarity index 100% rename from plugins/GNUsocialVideo/showvideo.php rename to plugins/GNUsocialVideo/actions/showvideo.php diff --git a/plugins/GNUsocialVideo/Video.php b/plugins/GNUsocialVideo/classes/Video.php similarity index 100% rename from plugins/GNUsocialVideo/Video.php rename to plugins/GNUsocialVideo/classes/Video.php diff --git a/plugins/GNUsocialVideo/videoform.php b/plugins/GNUsocialVideo/forms/video.php similarity index 100% rename from plugins/GNUsocialVideo/videoform.php rename to plugins/GNUsocialVideo/forms/video.php diff --git a/plugins/GroupFavorited/GroupFavoritedPlugin.php b/plugins/GroupFavorited/GroupFavoritedPlugin.php index 27ce289c2e..ee541f2dc0 100644 --- a/plugins/GroupFavorited/GroupFavoritedPlugin.php +++ b/plugins/GroupFavorited/GroupFavoritedPlugin.php @@ -41,27 +41,6 @@ class GroupFavoritedPlugin extends Plugin return true; } - /** - * Automatically load the actions and libraries used by the plugin - * - * @param Class $cls the class - * - * @return boolean hook return - * - */ - function onAutoload($cls) - { - $base = dirname(__FILE__); - $lower = strtolower($cls); - switch ($lower) { - case 'groupfavoritedaction': - require_once "$base/$lower.php"; - return false; - default: - return true; - } - } - function onEndGroupGroupNav(GroupNav $nav) { $action_name = $nav->action->trimmed('action'); diff --git a/plugins/GroupFavorited/groupfavoritedaction.php b/plugins/GroupFavorited/actions/groupfavorited.php similarity index 100% rename from plugins/GroupFavorited/groupfavoritedaction.php rename to plugins/GroupFavorited/actions/groupfavorited.php diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index 467f384f4d..1cbf3c31f1 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -67,40 +67,6 @@ class GroupPrivateMessagePlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'GroupinboxAction': - case 'ShowgroupmessageAction': - case 'NewgroupmessageAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'Group_privacy_settings': - case 'Group_message': - case 'Group_message_profile': - include_once $dir . '/'.$cls.'.php'; - return false; - case 'GroupMessageCommand': - case 'GroupMessageList': - case 'GroupMessageListItem': - case 'GroupMessageForm': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } - /** * Map URLs to actions * diff --git a/plugins/GroupPrivateMessage/groupinbox.php b/plugins/GroupPrivateMessage/actions/groupinbox.php similarity index 100% rename from plugins/GroupPrivateMessage/groupinbox.php rename to plugins/GroupPrivateMessage/actions/groupinbox.php diff --git a/plugins/GroupPrivateMessage/newgroupmessage.php b/plugins/GroupPrivateMessage/actions/newgroupmessage.php similarity index 100% rename from plugins/GroupPrivateMessage/newgroupmessage.php rename to plugins/GroupPrivateMessage/actions/newgroupmessage.php diff --git a/plugins/GroupPrivateMessage/showgroupmessage.php b/plugins/GroupPrivateMessage/actions/showgroupmessage.php similarity index 100% rename from plugins/GroupPrivateMessage/showgroupmessage.php rename to plugins/GroupPrivateMessage/actions/showgroupmessage.php diff --git a/plugins/GroupPrivateMessage/Group_message.php b/plugins/GroupPrivateMessage/classes/Group_message.php similarity index 100% rename from plugins/GroupPrivateMessage/Group_message.php rename to plugins/GroupPrivateMessage/classes/Group_message.php diff --git a/plugins/GroupPrivateMessage/Group_message_profile.php b/plugins/GroupPrivateMessage/classes/Group_message_profile.php similarity index 100% rename from plugins/GroupPrivateMessage/Group_message_profile.php rename to plugins/GroupPrivateMessage/classes/Group_message_profile.php diff --git a/plugins/GroupPrivateMessage/Group_privacy_settings.php b/plugins/GroupPrivateMessage/classes/Group_privacy_settings.php similarity index 100% rename from plugins/GroupPrivateMessage/Group_privacy_settings.php rename to plugins/GroupPrivateMessage/classes/Group_privacy_settings.php diff --git a/plugins/GroupPrivateMessage/groupmessageform.php b/plugins/GroupPrivateMessage/forms/groupmessage.php similarity index 100% rename from plugins/GroupPrivateMessage/groupmessageform.php rename to plugins/GroupPrivateMessage/forms/groupmessage.php diff --git a/plugins/GroupPrivateMessage/groupmessagecommand.php b/plugins/GroupPrivateMessage/lib/groupmessagecommand.php similarity index 100% rename from plugins/GroupPrivateMessage/groupmessagecommand.php rename to plugins/GroupPrivateMessage/lib/groupmessagecommand.php diff --git a/plugins/GroupPrivateMessage/groupmessagelist.php b/plugins/GroupPrivateMessage/lib/groupmessagelist.php similarity index 100% rename from plugins/GroupPrivateMessage/groupmessagelist.php rename to plugins/GroupPrivateMessage/lib/groupmessagelist.php diff --git a/plugins/GroupPrivateMessage/groupmessagelistitem.php b/plugins/GroupPrivateMessage/lib/groupmessagelistitem.php similarity index 100% rename from plugins/GroupPrivateMessage/groupmessagelistitem.php rename to plugins/GroupPrivateMessage/lib/groupmessagelistitem.php diff --git a/plugins/Imap/ImapPlugin.php b/plugins/Imap/ImapPlugin.php index dbaa904c6e..1d23e384a7 100644 --- a/plugins/Imap/ImapPlugin.php +++ b/plugins/Imap/ImapPlugin.php @@ -71,28 +71,6 @@ class ImapPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'ImapManager': - case 'IMAPMailHandler': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } - function onStartQueueDaemonIoManagers(&$classes) { $classes[] = new ImapManager($this); diff --git a/plugins/Imap/imapmailhandler.php b/plugins/Imap/lib/imapmailhandler.php similarity index 100% rename from plugins/Imap/imapmailhandler.php rename to plugins/Imap/lib/imapmailhandler.php diff --git a/plugins/Imap/imapmanager.php b/plugins/Imap/lib/imapmanager.php similarity index 100% rename from plugins/Imap/imapmanager.php rename to plugins/Imap/lib/imapmanager.php diff --git a/plugins/Irc/IrcPlugin.php b/plugins/Irc/IrcPlugin.php index aeefded4b0..18d1a0afe1 100644 --- a/plugins/Irc/IrcPlugin.php +++ b/plugins/Irc/IrcPlugin.php @@ -120,24 +120,13 @@ class IrcPlugin extends ImPlugin { * @return boolean hook value; true means continue processing, false means stop. */ public function onAutoload($cls) { - $dir = dirname(__FILE__); - - switch ($cls) { - case 'IrcManager': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - case 'Fake_Irc': - case 'Irc_waiting_message': - case 'ChannelResponseChannel': - include_once $dir . '/'. $cls .'.php'; - return false; - default: - if (substr($cls, 0, 7) == 'Phergie') { - include_once str_replace('_', DIRECTORY_SEPARATOR, $cls) . '.php'; - return false; - } - return true; + // in the beginning of this file, we have added an include path + if (substr($cls, 0, 7) == 'Phergie') { + include_once str_replace('_', DIRECTORY_SEPARATOR, $cls) . '.php'; + return false; } + + return parent::onAutoload($cls); } /* diff --git a/plugins/Irc/Irc_waiting_message.php b/plugins/Irc/classes/Irc_waiting_message.php similarity index 100% rename from plugins/Irc/Irc_waiting_message.php rename to plugins/Irc/classes/Irc_waiting_message.php diff --git a/plugins/Irc/ChannelResponseChannel.php b/plugins/Irc/lib/channelresponsechannel.php similarity index 100% rename from plugins/Irc/ChannelResponseChannel.php rename to plugins/Irc/lib/channelresponsechannel.php diff --git a/plugins/Irc/Fake_Irc.php b/plugins/Irc/lib/fake_irc.php similarity index 100% rename from plugins/Irc/Fake_Irc.php rename to plugins/Irc/lib/fake_irc.php diff --git a/plugins/Irc/ircmanager.php b/plugins/Irc/lib/ircmanager.php similarity index 100% rename from plugins/Irc/ircmanager.php rename to plugins/Irc/lib/ircmanager.php diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php index 38ea6e6592..76df45369c 100644 --- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php +++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php @@ -54,6 +54,8 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin require_once(INSTALLDIR.'/plugins/LdapCommon/LdapCommon.php'); return false; } + + return parent::onAutoload($cls); } function onEndShowPageNotice($action) diff --git a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php index 1049c5610a..6c8f1253c5 100644 --- a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php +++ b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php @@ -56,6 +56,8 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin require_once(INSTALLDIR.'/plugins/LdapCommon/LdapCommon.php'); return false; } + + return parent::onAutoload($cls); } //---interface implementation---// diff --git a/plugins/LdapCommon/LdapCommon.php b/plugins/LdapCommon/LdapCommon.php index afc61abf72..ef31313b8f 100644 --- a/plugins/LdapCommon/LdapCommon.php +++ b/plugins/LdapCommon/LdapCommon.php @@ -75,6 +75,7 @@ class LdapCommon function onAutoload($cls) { + // we've added an extra include-path in the beginning of this file switch ($cls) { case 'MemcacheSchemaCache': @@ -93,6 +94,8 @@ class LdapCommon require_once 'Net/LDAP2/Entry.php'; return false; } + + return parent::onAutoload($cls); } function get_ldap_config(){ diff --git a/plugins/LinkPreview/LinkPreviewPlugin.php b/plugins/LinkPreview/LinkPreviewPlugin.php index 09b3a2af64..652afdbdf9 100644 --- a/plugins/LinkPreview/LinkPreviewPlugin.php +++ b/plugins/LinkPreview/LinkPreviewPlugin.php @@ -68,28 +68,6 @@ class LinkPreviewPlugin extends Plugin return true; } - /** - * Autoloader - * - * Loads our classes if they're requested. - * - * @param string $cls Class requested - * - * @return boolean hook return - */ - function onAutoload($cls) - { - $lower = strtolower($cls); - switch ($lower) - { - case 'oembedproxyaction': - require_once dirname(__FILE__) . '/' . $lower . '.php'; - return false; - default: - return true; - } - } - /** * Hook for RouterInitialized event. * diff --git a/plugins/LinkPreview/oembedproxyaction.php b/plugins/LinkPreview/actions/oembedproxy.php similarity index 100% rename from plugins/LinkPreview/oembedproxyaction.php rename to plugins/LinkPreview/actions/oembedproxy.php diff --git a/plugins/Mapstraction/MapstractionPlugin.php b/plugins/Mapstraction/MapstractionPlugin.php index f51b607309..9883650206 100644 --- a/plugins/Mapstraction/MapstractionPlugin.php +++ b/plugins/Mapstraction/MapstractionPlugin.php @@ -74,29 +74,6 @@ class MapstractionPlugin extends Plugin return true; } - /** - * Hook for autoloading classes - * - * This makes sure our classes get autoloaded from our directory - * - * @param string $cls name of class being used - * - * @return boolean event handler return - */ - function onAutoload($cls) - { - switch ($cls) - { - case 'AllmapAction': - case 'UsermapAction': - case 'MapAction': - include_once INSTALLDIR.'/plugins/Mapstraction/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - default: - return true; - } - } - /** * Hook for adding extra JavaScript * diff --git a/plugins/Mapstraction/allmap.php b/plugins/Mapstraction/actions/allmap.php similarity index 100% rename from plugins/Mapstraction/allmap.php rename to plugins/Mapstraction/actions/allmap.php diff --git a/plugins/Mapstraction/map.php b/plugins/Mapstraction/actions/map.php similarity index 100% rename from plugins/Mapstraction/map.php rename to plugins/Mapstraction/actions/map.php diff --git a/plugins/Mapstraction/usermap.php b/plugins/Mapstraction/actions/usermap.php similarity index 100% rename from plugins/Mapstraction/usermap.php rename to plugins/Mapstraction/actions/usermap.php diff --git a/plugins/Minify/MinifyPlugin.php b/plugins/Minify/MinifyPlugin.php index 4041b228ae..9a1f4110d1 100644 --- a/plugins/Minify/MinifyPlugin.php +++ b/plugins/Minify/MinifyPlugin.php @@ -58,18 +58,6 @@ class MinifyPlugin extends Plugin return true; } - function onAutoload($cls) - { - switch ($cls) - { - case 'MinifyAction': - require_once(INSTALLDIR.'/plugins/Minify/' . strtolower(mb_substr($cls, 0, -6)) . '.php'); - return false; - default: - return true; - } - } - function onLoginAction($action, &$login) { switch ($action) diff --git a/plugins/Minify/minify.php b/plugins/Minify/actions/minify.php similarity index 100% rename from plugins/Minify/minify.php rename to plugins/Minify/actions/minify.php diff --git a/plugins/ModLog/ModLogPlugin.php b/plugins/ModLog/ModLogPlugin.php index 48229232f2..89f71fe866 100644 --- a/plugins/ModLog/ModLogPlugin.php +++ b/plugins/ModLog/ModLogPlugin.php @@ -71,28 +71,6 @@ class ModLogPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'ModLog': - include_once $dir . '/'.$cls.'.php'; - return false; - default: - return true; - } - } - function onEndGrantRole($profile, $role) { $modlog = new ModLog(); diff --git a/plugins/ModLog/ModLog.php b/plugins/ModLog/classes/ModLog.php similarity index 100% rename from plugins/ModLog/ModLog.php rename to plugins/ModLog/classes/ModLog.php diff --git a/plugins/ModPlus/ModPlusPlugin.php b/plugins/ModPlus/ModPlusPlugin.php index c8c88c9d7a..d66ec6054a 100644 --- a/plugins/ModPlus/ModPlusPlugin.php +++ b/plugins/ModPlus/ModPlusPlugin.php @@ -62,28 +62,6 @@ class ModPlusPlugin extends Plugin return true; } - /** - * Autoloader - * - * Loads our classes if they're requested. - * - * @param string $cls Class requested - * - * @return boolean hook return - */ - function onAutoload($cls) - { - switch ($cls) - { - case 'RemoteprofileAction': - case 'RemoteProfileAction': - require_once dirname(__FILE__) . '/remoteprofileaction.php'; - return false; - default: - return true; - } - } - /** * Add ModPlus-related paths to the router table * diff --git a/plugins/ModPlus/remoteprofileaction.php b/plugins/ModPlus/actions/remoteprofile.php similarity index 100% rename from plugins/ModPlus/remoteprofileaction.php rename to plugins/ModPlus/actions/remoteprofile.php diff --git a/plugins/Msn/MsnPlugin.php b/plugins/Msn/MsnPlugin.php index 38602668b9..91c67f5f79 100644 --- a/plugins/Msn/MsnPlugin.php +++ b/plugins/Msn/MsnPlugin.php @@ -105,13 +105,9 @@ class MsnPlugin extends ImPlugin { case 'MSN': require_once(INSTALLDIR.'/plugins/Msn/extlib/phpmsnclass/msn.class.php'); return false; - case 'MsnManager': - case 'Msn_waiting_message': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - default: - return true; } + + return parent::onAutoload($cls); } /* diff --git a/plugins/Msn/msn_waiting_message.php b/plugins/Msn/classes/msn_waiting_message.php similarity index 100% rename from plugins/Msn/msn_waiting_message.php rename to plugins/Msn/classes/msn_waiting_message.php diff --git a/plugins/Msn/msnmanager.php b/plugins/Msn/lib/msnmanager.php similarity index 100% rename from plugins/Msn/msnmanager.php rename to plugins/Msn/lib/msnmanager.php diff --git a/plugins/NoticeTitle/NoticeTitlePlugin.php b/plugins/NoticeTitle/NoticeTitlePlugin.php index d73da51d58..c97acfe7b2 100644 --- a/plugins/NoticeTitle/NoticeTitlePlugin.php +++ b/plugins/NoticeTitle/NoticeTitlePlugin.php @@ -75,27 +75,6 @@ class NoticeTitlePlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'Notice_title': - include_once $dir . '/'.$cls.'.php'; - return false; - default: - return true; - } - } - /** * Provide plugin version information. * diff --git a/plugins/NoticeTitle/Notice_title.php b/plugins/NoticeTitle/classes/Notice_title.php similarity index 100% rename from plugins/NoticeTitle/Notice_title.php rename to plugins/NoticeTitle/classes/Notice_title.php diff --git a/plugins/OMB/OMBPlugin.php b/plugins/OMB/OMBPlugin.php index fe4510f4a7..e2552e8e08 100644 --- a/plugins/OMB/OMBPlugin.php +++ b/plugins/OMB/OMBPlugin.php @@ -54,40 +54,6 @@ if (!defined('STATUSNET')) { */ class OMBPlugin extends Plugin { - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'Requesttokenaction': - case 'Accesstokenaction': - case 'Userauthorizationaction': - case 'Postnoticeaction': - case 'Updateprofileaction': - case 'Finishremotesubscribeaction': - case 'Remotesubscribeaction': - case 'XrdsAction': - include_once $dir . '/action/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - break; - case 'OmbQueueHandler': - case 'ProfileQueueHandler': - include_once $dir . '/lib/' . strtolower($cls) . '.php'; - return false; - case 'OMBOAuthDataStore': - include_once $dir . '/lib/omboauthstore.php'; - default: - return true; - } - } /** * Map URLs to actions diff --git a/plugins/OMB/lib/omb.php b/plugins/OMB/lib/omb.php index a2c3d7c45e..4731440a31 100644 --- a/plugins/OMB/lib/omb.php +++ b/plugins/OMB/lib/omb.php @@ -21,7 +21,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } $dir = dirname(__FILE__); -require_once $dir . '/omboauthstore.php'; require_once $dir . '/../extlib/libomb/constants.php'; require_once $dir . '/../extlib/libomb/service_consumer.php'; require_once $dir . '/../extlib/libomb/notice.php'; diff --git a/plugins/OMB/lib/omboauthstore.php b/plugins/OMB/lib/omboauthdatastore.php similarity index 100% rename from plugins/OMB/lib/omboauthstore.php rename to plugins/OMB/lib/omboauthdatastore.php diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 567989c11e..bcb8a3098c 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -200,38 +200,6 @@ class OStatusPlugin extends Plugin return true; } - /** - * Automatically load the actions and libraries used by the plugin - * - * @param Class $cls the class - * - * @return boolean hook return - * - */ - function onAutoload($cls) - { - $base = dirname(__FILE__); - $lower = strtolower($cls); - $map = array('activityverb' => 'activity', - 'activityobject' => 'activity', - 'activityutils' => 'activity'); - if (isset($map[$lower])) { - $lower = $map[$lower]; - } - $files = array("$base/classes/$cls.php", - "$base/lib/$lower.php"); - if (substr($lower, -6) == 'action') { - $files[] = "$base/actions/" . substr($lower, 0, -6) . ".php"; - } - foreach ($files as $file) { - if (file_exists($file)) { - include_once $file; - return false; - } - } - return true; - } - /** * Add in an OStatus subscribe button */ diff --git a/plugins/OStatus/lib/salmonaction.php b/plugins/OStatus/actions/salmon.php similarity index 100% rename from plugins/OStatus/lib/salmonaction.php rename to plugins/OStatus/actions/salmon.php diff --git a/plugins/OStatus/lib/xrdaction.php b/plugins/OStatus/actions/xrd.php similarity index 100% rename from plugins/OStatus/lib/xrdaction.php rename to plugins/OStatus/actions/xrd.php diff --git a/plugins/OfflineBackup/OfflineBackupPlugin.php b/plugins/OfflineBackup/OfflineBackupPlugin.php index a7bede2875..1dd636930e 100644 --- a/plugins/OfflineBackup/OfflineBackupPlugin.php +++ b/plugins/OfflineBackup/OfflineBackupPlugin.php @@ -49,22 +49,6 @@ if (!defined('STATUSNET')) { class OfflineBackupPlugin extends Plugin { - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'OfflinebackupAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'OfflineBackupQueueHandler': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } function onRouterInitialized($m) { diff --git a/plugins/OfflineBackup/offlinebackup.php b/plugins/OfflineBackup/actions/offlinebackup.php similarity index 100% rename from plugins/OfflineBackup/offlinebackup.php rename to plugins/OfflineBackup/actions/offlinebackup.php diff --git a/plugins/OfflineBackup/offlinebackupqueuehandler.php b/plugins/OfflineBackup/lib/offlinebackupqueuehandler.php similarity index 100% rename from plugins/OfflineBackup/offlinebackupqueuehandler.php rename to plugins/OfflineBackup/lib/offlinebackupqueuehandler.php diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php index f233118739..f4a9e061a1 100644 --- a/plugins/OpenID/OpenIDPlugin.php +++ b/plugins/OpenID/OpenIDPlugin.php @@ -350,30 +350,14 @@ class OpenIDPlugin extends Plugin { switch ($cls) { - case 'OpenidloginAction': - case 'FinishopenidloginAction': - case 'FinishaddopenidAction': - case 'XrdsAction': - case 'PublicxrdsAction': - case 'OpenidsettingsAction': - case 'OpenidserverAction': - case 'OpenidtrustAction': - case 'OpenidadminpanelAction': - require_once dirname(__FILE__) . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'User_openid': - case 'User_openid_prefs': - case 'User_openid_trustroot': - require_once dirname(__FILE__) . '/' . $cls . '.php'; - return false; case 'Auth_OpenID_TeamsExtension': case 'Auth_OpenID_TeamsRequest': case 'Auth_OpenID_TeamsResponse': require_once dirname(__FILE__) . '/extlib/teams-extension.php'; return false; - default: - return true; } + + return parent::onAutoload($cls); } /** diff --git a/plugins/OpenID/finishaddopenid.php b/plugins/OpenID/actions/finishaddopenid.php similarity index 100% rename from plugins/OpenID/finishaddopenid.php rename to plugins/OpenID/actions/finishaddopenid.php diff --git a/plugins/OpenID/finishopenidlogin.php b/plugins/OpenID/actions/finishopenidlogin.php similarity index 100% rename from plugins/OpenID/finishopenidlogin.php rename to plugins/OpenID/actions/finishopenidlogin.php diff --git a/plugins/OpenID/openidadminpanel.php b/plugins/OpenID/actions/openidadminpanel.php similarity index 100% rename from plugins/OpenID/openidadminpanel.php rename to plugins/OpenID/actions/openidadminpanel.php diff --git a/plugins/OpenID/openidlogin.php b/plugins/OpenID/actions/openidlogin.php similarity index 100% rename from plugins/OpenID/openidlogin.php rename to plugins/OpenID/actions/openidlogin.php diff --git a/plugins/OpenID/openidserver.php b/plugins/OpenID/actions/openidserver.php similarity index 100% rename from plugins/OpenID/openidserver.php rename to plugins/OpenID/actions/openidserver.php diff --git a/plugins/OpenID/openidsettings.php b/plugins/OpenID/actions/openidsettings.php similarity index 100% rename from plugins/OpenID/openidsettings.php rename to plugins/OpenID/actions/openidsettings.php diff --git a/plugins/OpenID/openidtrust.php b/plugins/OpenID/actions/openidtrust.php similarity index 100% rename from plugins/OpenID/openidtrust.php rename to plugins/OpenID/actions/openidtrust.php diff --git a/plugins/OpenID/User_openid.php b/plugins/OpenID/classes/User_openid.php similarity index 100% rename from plugins/OpenID/User_openid.php rename to plugins/OpenID/classes/User_openid.php diff --git a/plugins/OpenID/User_openid_prefs.php b/plugins/OpenID/classes/User_openid_prefs.php similarity index 100% rename from plugins/OpenID/User_openid_prefs.php rename to plugins/OpenID/classes/User_openid_prefs.php diff --git a/plugins/OpenID/User_openid_trustroot.php b/plugins/OpenID/classes/User_openid_trustroot.php similarity index 100% rename from plugins/OpenID/User_openid_trustroot.php rename to plugins/OpenID/classes/User_openid_trustroot.php diff --git a/plugins/OpenX/OpenXPlugin.php b/plugins/OpenX/OpenXPlugin.php index d288363b21..7285cf1ca8 100644 --- a/plugins/OpenX/OpenXPlugin.php +++ b/plugins/OpenX/OpenXPlugin.php @@ -181,20 +181,6 @@ ENDOFSCRIPT; return true; } - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'OpenxadminpanelAction': - require_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - default: - return true; - } - } - function onEndAdminPanelNav($menu) { if (AdminPanelAction::canAdmin('openx')) { // TRANS: Menu item title. diff --git a/plugins/OpenX/openxadminpanel.php b/plugins/OpenX/actions/openxadminpanel.php similarity index 100% rename from plugins/OpenX/openxadminpanel.php rename to plugins/OpenX/actions/openxadminpanel.php diff --git a/plugins/Poll/PollPlugin.php b/plugins/Poll/PollPlugin.php index d09d827bd1..a6292032c5 100644 --- a/plugins/Poll/PollPlugin.php +++ b/plugins/Poll/PollPlugin.php @@ -81,40 +81,6 @@ class PollPlugin extends MicroAppPlugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'ShowpollAction': - case 'NewpollAction': - case 'RespondpollAction': - case 'PollsettingsAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'Poll': - case 'Poll_response': - case 'User_poll_prefs': - include_once $dir.'/'.$cls.'.php'; - return false; - case 'NewPollForm': - case 'PollResponseForm': - case 'PollResultForm': - include_once $dir.'/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } - /** * Map URLs to actions * diff --git a/plugins/Poll/newpoll.php b/plugins/Poll/actions/newpoll.php similarity index 100% rename from plugins/Poll/newpoll.php rename to plugins/Poll/actions/newpoll.php diff --git a/plugins/Poll/pollsettings.php b/plugins/Poll/actions/pollsettings.php similarity index 100% rename from plugins/Poll/pollsettings.php rename to plugins/Poll/actions/pollsettings.php diff --git a/plugins/Poll/respondpoll.php b/plugins/Poll/actions/respondpoll.php similarity index 100% rename from plugins/Poll/respondpoll.php rename to plugins/Poll/actions/respondpoll.php diff --git a/plugins/Poll/showpoll.php b/plugins/Poll/actions/showpoll.php similarity index 100% rename from plugins/Poll/showpoll.php rename to plugins/Poll/actions/showpoll.php diff --git a/plugins/Poll/Poll.php b/plugins/Poll/classes/Poll.php similarity index 100% rename from plugins/Poll/Poll.php rename to plugins/Poll/classes/Poll.php diff --git a/plugins/Poll/Poll_response.php b/plugins/Poll/classes/Poll_response.php similarity index 100% rename from plugins/Poll/Poll_response.php rename to plugins/Poll/classes/Poll_response.php diff --git a/plugins/Poll/User_poll_prefs.php b/plugins/Poll/classes/User_poll_prefs.php similarity index 100% rename from plugins/Poll/User_poll_prefs.php rename to plugins/Poll/classes/User_poll_prefs.php diff --git a/plugins/Poll/newpollform.php b/plugins/Poll/forms/newpoll.php similarity index 100% rename from plugins/Poll/newpollform.php rename to plugins/Poll/forms/newpoll.php diff --git a/plugins/Poll/pollresponseform.php b/plugins/Poll/forms/pollresponse.php similarity index 100% rename from plugins/Poll/pollresponseform.php rename to plugins/Poll/forms/pollresponse.php diff --git a/plugins/Poll/pollresultform.php b/plugins/Poll/forms/pollresult.php similarity index 100% rename from plugins/Poll/pollresultform.php rename to plugins/Poll/forms/pollresult.php diff --git a/plugins/QnA/QnAPlugin.php b/plugins/QnA/QnAPlugin.php index ce93536388..37cfcb9be3 100644 --- a/plugins/QnA/QnAPlugin.php +++ b/plugins/QnA/QnAPlugin.php @@ -65,48 +65,6 @@ class QnAPlugin extends MicroAppPlugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'QnanewquestionAction': - case 'QnanewanswerAction': - case 'QnashowquestionAction': - case 'QnaclosequestionAction': - case 'QnashowanswerAction': - case 'QnareviseanswerAction': - case 'QnavoteAction': - include_once $dir . '/actions/' - . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'QnanewquestionForm': - case 'QnashowquestionForm': - case 'QnanewanswerForm': - case 'QnashowanswerForm': - case 'QnareviseanswerForm': - case 'QnavoteForm': - include_once $dir . '/lib/' . strtolower($cls).'.php'; - break; - case 'QnA_Question': - case 'QnA_Answer': - case 'QnA_Vote': - include_once $dir . '/classes/' . $cls.'.php'; - return false; - break; - default: - return true; - } - } - /** * Map URLs to actions * diff --git a/plugins/QnA/lib/qnanewanswerform.php b/plugins/QnA/forms/qnanewanswer.php similarity index 100% rename from plugins/QnA/lib/qnanewanswerform.php rename to plugins/QnA/forms/qnanewanswer.php diff --git a/plugins/QnA/lib/qnanewquestionform.php b/plugins/QnA/forms/qnanewquestion.php similarity index 100% rename from plugins/QnA/lib/qnanewquestionform.php rename to plugins/QnA/forms/qnanewquestion.php diff --git a/plugins/QnA/lib/qnareviseanswerform.php b/plugins/QnA/forms/qnareviseanswer.php similarity index 100% rename from plugins/QnA/lib/qnareviseanswerform.php rename to plugins/QnA/forms/qnareviseanswer.php diff --git a/plugins/QnA/lib/qnashowanswerform.php b/plugins/QnA/forms/qnashowanswer.php similarity index 100% rename from plugins/QnA/lib/qnashowanswerform.php rename to plugins/QnA/forms/qnashowanswer.php diff --git a/plugins/QnA/lib/qnashowquestionform.php b/plugins/QnA/forms/qnashowquestion.php similarity index 100% rename from plugins/QnA/lib/qnashowquestionform.php rename to plugins/QnA/forms/qnashowquestion.php diff --git a/plugins/QnA/lib/qnavoteform.php b/plugins/QnA/forms/qnavote.php similarity index 100% rename from plugins/QnA/lib/qnavoteform.php rename to plugins/QnA/forms/qnavote.php diff --git a/plugins/RSSCloud/RSSCloudPlugin.php b/plugins/RSSCloud/RSSCloudPlugin.php index 144e0ca57d..823094f269 100644 --- a/plugins/RSSCloud/RSSCloudPlugin.php +++ b/plugins/RSSCloud/RSSCloudPlugin.php @@ -115,38 +115,6 @@ class RSSCloudPlugin extends Plugin return true; } - /** - * Automatically load the actions and libraries used by - * the RSSCloud plugin - * - * @param Class $cls the class - * - * @return boolean hook return - * - */ - function onAutoload($cls) - { - switch ($cls) - { - case 'RSSCloudSubscription': - include_once INSTALLDIR . '/plugins/RSSCloud/RSSCloudSubscription.php'; - return false; - case 'RSSCloudNotifier': - include_once INSTALLDIR . '/plugins/RSSCloud/RSSCloudNotifier.php'; - return false; - case 'RSSCloudQueueHandler': - include_once INSTALLDIR . '/plugins/RSSCloud/RSSCloudQueueHandler.php'; - return false; - case 'RSSCloudRequestNotifyAction': - case 'LoggingAggregatorAction': - include_once INSTALLDIR . '/plugins/RSSCloud/' . - mb_substr($cls, 0, -6) . '.php'; - return false; - default: - return true; - } - } - /** * Add a element to the RSS feed (after the rss * element is started). diff --git a/plugins/RSSCloud/LoggingAggregator.php b/plugins/RSSCloud/actions/loggingaggregator.php similarity index 100% rename from plugins/RSSCloud/LoggingAggregator.php rename to plugins/RSSCloud/actions/loggingaggregator.php diff --git a/plugins/RSSCloud/RSSCloudRequestNotify.php b/plugins/RSSCloud/actions/rsscloudrequestnotify.php similarity index 100% rename from plugins/RSSCloud/RSSCloudRequestNotify.php rename to plugins/RSSCloud/actions/rsscloudrequestnotify.php diff --git a/plugins/RSSCloud/RSSCloudSubscription.php b/plugins/RSSCloud/classes/RSSCloudSubscription.php similarity index 100% rename from plugins/RSSCloud/RSSCloudSubscription.php rename to plugins/RSSCloud/classes/RSSCloudSubscription.php diff --git a/plugins/RSSCloud/RSSCloudNotifier.php b/plugins/RSSCloud/lib/rsscloudnotifier.php similarity index 100% rename from plugins/RSSCloud/RSSCloudNotifier.php rename to plugins/RSSCloud/lib/rsscloudnotifier.php diff --git a/plugins/RSSCloud/RSSCloudQueueHandler.php b/plugins/RSSCloud/lib/rsscloudqueuehandler.php similarity index 100% rename from plugins/RSSCloud/RSSCloudQueueHandler.php rename to plugins/RSSCloud/lib/rsscloudqueuehandler.php diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index aec53d48f3..42a254ab0c 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -66,24 +66,6 @@ class RealtimePlugin extends Plugin return true; } - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'KeepalivechannelAction': - case 'ClosechannelAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'Realtime_channel': - include_once $dir.'/'.$cls.'.php'; - return false; - default: - return true; - } - } - /** * Hook for RouterInitialized event. * diff --git a/plugins/Realtime/closechannel.php b/plugins/Realtime/actions/closechannel.php similarity index 100% rename from plugins/Realtime/closechannel.php rename to plugins/Realtime/actions/closechannel.php diff --git a/plugins/Realtime/keepalivechannel.php b/plugins/Realtime/actions/keepalivechannel.php similarity index 100% rename from plugins/Realtime/keepalivechannel.php rename to plugins/Realtime/actions/keepalivechannel.php diff --git a/plugins/Realtime/Realtime_channel.php b/plugins/Realtime/classes/Realtime_channel.php similarity index 100% rename from plugins/Realtime/Realtime_channel.php rename to plugins/Realtime/classes/Realtime_channel.php diff --git a/plugins/Realtime/cleanupchannels.php b/plugins/Realtime/scripts/cleanupchannels.php similarity index 100% rename from plugins/Realtime/cleanupchannels.php rename to plugins/Realtime/scripts/cleanupchannels.php diff --git a/plugins/RegisterThrottle/RegisterThrottlePlugin.php b/plugins/RegisterThrottle/RegisterThrottlePlugin.php index d6ab7fc0f4..be986fa2b8 100644 --- a/plugins/RegisterThrottle/RegisterThrottlePlugin.php +++ b/plugins/RegisterThrottle/RegisterThrottlePlugin.php @@ -83,27 +83,6 @@ class RegisterThrottlePlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'Registration_ip': - include_once $dir . '/'.$cls.'.php'; - return false; - default: - return true; - } - } - /** * Called when someone tries to register. * diff --git a/plugins/RegisterThrottle/Registration_ip.php b/plugins/RegisterThrottle/classes/Registration_ip.php similarity index 100% rename from plugins/RegisterThrottle/Registration_ip.php rename to plugins/RegisterThrottle/classes/Registration_ip.php diff --git a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php index 0a79796ebf..8ad41fe05d 100644 --- a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php +++ b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php @@ -80,20 +80,6 @@ class RequireValidatedEmailPlugin extends Plugin */ public $disallowLogin = false; - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'ConfirmfirstemailAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - default: - return true; - } - } - function onRouterInitialized($m) { $m->connect('main/confirmfirst/:code', diff --git a/plugins/RequireValidatedEmail/confirmfirstemail.php b/plugins/RequireValidatedEmail/actions/confirmfirstemail.php similarity index 100% rename from plugins/RequireValidatedEmail/confirmfirstemail.php rename to plugins/RequireValidatedEmail/actions/confirmfirstemail.php diff --git a/plugins/RequireValidatedEmail/registerbyemail.php b/plugins/RequireValidatedEmail/scripts/registerbyemail.php similarity index 100% rename from plugins/RequireValidatedEmail/registerbyemail.php rename to plugins/RequireValidatedEmail/scripts/registerbyemail.php diff --git a/plugins/Sample/SamplePlugin.php b/plugins/Sample/SamplePlugin.php index f2d333bbcb..9365410613 100644 --- a/plugins/Sample/SamplePlugin.php +++ b/plugins/Sample/SamplePlugin.php @@ -174,41 +174,6 @@ class SamplePlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * Most non-trivial plugins will require extra modules to do their work. Typically - * these include data classes, action classes, widget classes, or external libraries. - * - * This method receives a class name and loads the PHP file related to that class. By - * tradition, action classes typically have files named for the action, all lower-case. - * Data classes are in files with the data class name, initial letter capitalized. - * - * Note that this method will be called for *all* overloaded classes, not just ones - * in this plugin! So, make sure to return true by default to let other plugins, and - * the core code, get a chance. - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'HelloAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'User_greeting_count': - include_once $dir . '/'.$cls.'.php'; - return false; - default: - return true; - } - } - /** * Map URLs to actions * diff --git a/plugins/Sample/hello.php b/plugins/Sample/actions/hello.php similarity index 100% rename from plugins/Sample/hello.php rename to plugins/Sample/actions/hello.php diff --git a/plugins/Sample/User_greeting_count.php b/plugins/Sample/classes/User_greeting_count.php similarity index 100% rename from plugins/Sample/User_greeting_count.php rename to plugins/Sample/classes/User_greeting_count.php diff --git a/plugins/SearchSub/SearchSubPlugin.php b/plugins/SearchSub/SearchSubPlugin.php index 858474240e..ba25bf1b2b 100644 --- a/plugins/SearchSub/SearchSubPlugin.php +++ b/plugins/SearchSub/SearchSubPlugin.php @@ -60,39 +60,6 @@ class SearchSubPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'SearchSub': - include_once $dir.'/'.$cls.'.php'; - return false; - case 'SearchsubAction': - case 'SearchunsubAction': - case 'SearchsubsAction': - case 'SearchSubForm': - case 'SearchSubMenu': - case 'SearchUnsubForm': - case 'SearchSubTrackCommand': - case 'SearchSubTrackOffCommand': - case 'SearchSubTrackingCommand': - case 'SearchSubUntrackCommand': - include_once $dir.'/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } - /** * Map URLs to actions * diff --git a/plugins/SearchSub/searchsubaction.php b/plugins/SearchSub/actions/searchsub.php similarity index 100% rename from plugins/SearchSub/searchsubaction.php rename to plugins/SearchSub/actions/searchsub.php diff --git a/plugins/SearchSub/searchsubsaction.php b/plugins/SearchSub/actions/searchsubs.php similarity index 100% rename from plugins/SearchSub/searchsubsaction.php rename to plugins/SearchSub/actions/searchsubs.php diff --git a/plugins/SearchSub/searchunsubaction.php b/plugins/SearchSub/actions/searchunsub.php similarity index 100% rename from plugins/SearchSub/searchunsubaction.php rename to plugins/SearchSub/actions/searchunsub.php diff --git a/plugins/SearchSub/SearchSub.php b/plugins/SearchSub/classes/SearchSub.php similarity index 100% rename from plugins/SearchSub/SearchSub.php rename to plugins/SearchSub/classes/SearchSub.php diff --git a/plugins/SearchSub/searchsubform.php b/plugins/SearchSub/forms/searchsub.php similarity index 100% rename from plugins/SearchSub/searchsubform.php rename to plugins/SearchSub/forms/searchsub.php diff --git a/plugins/SearchSub/searchunsubform.php b/plugins/SearchSub/forms/searchunsub.php similarity index 100% rename from plugins/SearchSub/searchunsubform.php rename to plugins/SearchSub/forms/searchunsub.php diff --git a/plugins/SearchSub/searchsubmenu.php b/plugins/SearchSub/lib/searchsubmenu.php similarity index 100% rename from plugins/SearchSub/searchsubmenu.php rename to plugins/SearchSub/lib/searchsubmenu.php diff --git a/plugins/SearchSub/searchsubtrackcommand.php b/plugins/SearchSub/lib/searchsubtrackcommand.php similarity index 100% rename from plugins/SearchSub/searchsubtrackcommand.php rename to plugins/SearchSub/lib/searchsubtrackcommand.php diff --git a/plugins/SearchSub/searchsubtrackingcommand.php b/plugins/SearchSub/lib/searchsubtrackingcommand.php similarity index 100% rename from plugins/SearchSub/searchsubtrackingcommand.php rename to plugins/SearchSub/lib/searchsubtrackingcommand.php diff --git a/plugins/SearchSub/searchsubtrackoffcommand.php b/plugins/SearchSub/lib/searchsubtrackoffcommand.php similarity index 100% rename from plugins/SearchSub/searchsubtrackoffcommand.php rename to plugins/SearchSub/lib/searchsubtrackoffcommand.php diff --git a/plugins/SearchSub/searchsubuntrackcommand.php b/plugins/SearchSub/lib/searchsubuntrackcommand.php similarity index 100% rename from plugins/SearchSub/searchsubuntrackcommand.php rename to plugins/SearchSub/lib/searchsubuntrackcommand.php diff --git a/plugins/SiteNoticeInSidebar/SiteNoticeInSidebarPlugin.php b/plugins/SiteNoticeInSidebar/SiteNoticeInSidebarPlugin.php index 4e6aade2a5..b487d86720 100644 --- a/plugins/SiteNoticeInSidebar/SiteNoticeInSidebarPlugin.php +++ b/plugins/SiteNoticeInSidebar/SiteNoticeInSidebarPlugin.php @@ -75,18 +75,4 @@ class SiteNoticeInSidebarPlugin extends Plugin $action->element('style', null, '#site_notice { width: 100% }'); return true; } - - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'SiteNoticeSection': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } } diff --git a/plugins/SiteNoticeInSidebar/sitenoticesection.php b/plugins/SiteNoticeInSidebar/lib/sitenoticesection.php similarity index 100% rename from plugins/SiteNoticeInSidebar/sitenoticesection.php rename to plugins/SiteNoticeInSidebar/lib/sitenoticesection.php diff --git a/plugins/Sitemap/SitemapPlugin.php b/plugins/Sitemap/SitemapPlugin.php index ae90134db9..d65aba1222 100644 --- a/plugins/Sitemap/SitemapPlugin.php +++ b/plugins/Sitemap/SitemapPlugin.php @@ -49,37 +49,6 @@ class SitemapPlugin extends Plugin const USERS_PER_MAP = 50000; const NOTICES_PER_MAP = 50000; - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'Sitemap_user_count': - case 'Sitemap_notice_count': - require_once $dir . '/' . $cls . '.php'; - return false; - case 'SitemapindexAction': - case 'NoticesitemapAction': - case 'UsersitemapAction': - case 'SitemapadminpanelAction': - require_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'SitemapAction': - require_once $dir . '/' . strtolower($cls) . '.php'; - return false; - default: - return true; - } - } - /** * Add sitemap-related information at the end of robots.txt * diff --git a/plugins/Sitemap/noticesitemap.php b/plugins/Sitemap/actions/noticesitemap.php similarity index 100% rename from plugins/Sitemap/noticesitemap.php rename to plugins/Sitemap/actions/noticesitemap.php diff --git a/plugins/Sitemap/sitemapaction.php b/plugins/Sitemap/actions/sitemap.php similarity index 100% rename from plugins/Sitemap/sitemapaction.php rename to plugins/Sitemap/actions/sitemap.php diff --git a/plugins/Sitemap/sitemapadminpanel.php b/plugins/Sitemap/actions/sitemapadminpanel.php similarity index 100% rename from plugins/Sitemap/sitemapadminpanel.php rename to plugins/Sitemap/actions/sitemapadminpanel.php diff --git a/plugins/Sitemap/sitemapindex.php b/plugins/Sitemap/actions/sitemapindex.php similarity index 100% rename from plugins/Sitemap/sitemapindex.php rename to plugins/Sitemap/actions/sitemapindex.php diff --git a/plugins/Sitemap/usersitemap.php b/plugins/Sitemap/actions/usersitemap.php similarity index 100% rename from plugins/Sitemap/usersitemap.php rename to plugins/Sitemap/actions/usersitemap.php diff --git a/plugins/Sitemap/Sitemap_notice_count.php b/plugins/Sitemap/classes/Sitemap_notice_count.php similarity index 100% rename from plugins/Sitemap/Sitemap_notice_count.php rename to plugins/Sitemap/classes/Sitemap_notice_count.php diff --git a/plugins/Sitemap/Sitemap_user_count.php b/plugins/Sitemap/classes/Sitemap_user_count.php similarity index 100% rename from plugins/Sitemap/Sitemap_user_count.php rename to plugins/Sitemap/classes/Sitemap_user_count.php diff --git a/plugins/SlicedFavorites/SlicedFavoritesPlugin.php b/plugins/SlicedFavorites/SlicedFavoritesPlugin.php index d2407484da..2a87a64745 100644 --- a/plugins/SlicedFavorites/SlicedFavoritesPlugin.php +++ b/plugins/SlicedFavorites/SlicedFavoritesPlugin.php @@ -77,27 +77,6 @@ class SlicedFavoritesPlugin extends Plugin return true; } - /** - * Automatically load the actions and libraries used by the plugin - * - * @param Class $cls the class - * - * @return boolean hook return - * - */ - function onAutoload($cls) - { - $base = dirname(__FILE__); - $lower = strtolower($cls); - switch ($lower) { - case 'favoritedsliceaction': - require_once "$base/$lower.php"; - return false; - default: - return true; - } - } - function onSlicedFavoritesGetSettings($slice, &$data) { if (isset($this->slices[$slice])) { diff --git a/plugins/SlicedFavorites/favoritedsliceaction.php b/plugins/SlicedFavorites/actions/favoritedslice.php similarity index 100% rename from plugins/SlicedFavorites/favoritedsliceaction.php rename to plugins/SlicedFavorites/actions/favoritedslice.php diff --git a/plugins/SphinxSearch/SphinxSearchPlugin.php b/plugins/SphinxSearch/SphinxSearchPlugin.php index ad34a7cc15..7abfb04e9d 100644 --- a/plugins/SphinxSearch/SphinxSearchPlugin.php +++ b/plugins/SphinxSearch/SphinxSearchPlugin.php @@ -66,9 +66,9 @@ class SphinxSearchPlugin extends Plugin include_once INSTALLDIR . '/plugins/SphinxSearch/' . strtolower($cls) . '.php'; return false; - default: - return true; } + + return parent::onAutoload($cls); } /** diff --git a/plugins/SubMirror/SubMirrorPlugin.php b/plugins/SubMirror/SubMirrorPlugin.php index 427153ab22..7eb30d4d9d 100644 --- a/plugins/SubMirror/SubMirrorPlugin.php +++ b/plugins/SubMirror/SubMirrorPlugin.php @@ -45,32 +45,6 @@ class SubMirrorPlugin extends Plugin return true; } - /** - * Automatically load the actions and libraries used by the plugin - * - * @param Class $cls the class - * - * @return boolean hook return - * - */ - function onAutoload($cls) - { - $base = dirname(__FILE__); - $lower = strtolower($cls); - $files = array("$base/lib/$lower.php", - "$base/classes/$cls.php"); - if (substr($lower, -6) == 'action') { - $files[] = "$base/actions/" . substr($lower, 0, -6) . ".php"; - } - foreach ($files as $file) { - if (file_exists($file)) { - include_once $file; - return false; - } - } - return true; - } - function handle($notice) { // Is anybody mirroring? diff --git a/plugins/SubMirror/lib/addmirrorform.php b/plugins/SubMirror/forms/addmirror.php similarity index 100% rename from plugins/SubMirror/lib/addmirrorform.php rename to plugins/SubMirror/forms/addmirror.php diff --git a/plugins/SubMirror/lib/addtwittermirrorform.php b/plugins/SubMirror/forms/addtwitter.php similarity index 100% rename from plugins/SubMirror/lib/addtwittermirrorform.php rename to plugins/SubMirror/forms/addtwitter.php diff --git a/plugins/SubMirror/lib/editmirrorform.php b/plugins/SubMirror/forms/editmirror.php similarity index 100% rename from plugins/SubMirror/lib/editmirrorform.php rename to plugins/SubMirror/forms/editmirror.php diff --git a/plugins/TagSub/TagSubPlugin.php b/plugins/TagSub/TagSubPlugin.php index b84b208006..1c493de0cd 100644 --- a/plugins/TagSub/TagSubPlugin.php +++ b/plugins/TagSub/TagSubPlugin.php @@ -60,35 +60,6 @@ class TagSubPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'TagSub': - include_once $dir.'/'.$cls.'.php'; - return false; - case 'TagsubAction': - case 'TagunsubAction': - case 'TagsubsAction': - case 'TagSubForm': - case 'TagSubMenu': - case 'TagUnsubForm': - include_once $dir.'/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } - /** * Map URLs to actions * diff --git a/plugins/TagSub/tagsubaction.php b/plugins/TagSub/actions/tagsub.php similarity index 100% rename from plugins/TagSub/tagsubaction.php rename to plugins/TagSub/actions/tagsub.php diff --git a/plugins/TagSub/tagsubsaction.php b/plugins/TagSub/actions/tagsubs.php similarity index 100% rename from plugins/TagSub/tagsubsaction.php rename to plugins/TagSub/actions/tagsubs.php diff --git a/plugins/TagSub/tagunsubaction.php b/plugins/TagSub/actions/tagunsub.php similarity index 100% rename from plugins/TagSub/tagunsubaction.php rename to plugins/TagSub/actions/tagunsub.php diff --git a/plugins/TagSub/TagSub.php b/plugins/TagSub/classes/TagSub.php similarity index 100% rename from plugins/TagSub/TagSub.php rename to plugins/TagSub/classes/TagSub.php diff --git a/plugins/TagSub/tagsubform.php b/plugins/TagSub/forms/tagsub.php similarity index 100% rename from plugins/TagSub/tagsubform.php rename to plugins/TagSub/forms/tagsub.php diff --git a/plugins/TagSub/tagunsubform.php b/plugins/TagSub/forms/tagunsub.php similarity index 100% rename from plugins/TagSub/tagunsubform.php rename to plugins/TagSub/forms/tagunsub.php diff --git a/plugins/TagSub/tagsubmenu.php b/plugins/TagSub/lib/tagsubmenu.php similarity index 100% rename from plugins/TagSub/tagsubmenu.php rename to plugins/TagSub/lib/tagsubmenu.php diff --git a/plugins/TwitterBridge/TwitterBridgePlugin.php b/plugins/TwitterBridge/TwitterBridgePlugin.php index 1e0f328ad9..f11234b5e1 100644 --- a/plugins/TwitterBridge/TwitterBridgePlugin.php +++ b/plugins/TwitterBridge/TwitterBridgePlugin.php @@ -183,46 +183,6 @@ class TwitterBridgePlugin extends Plugin return true; } - /** - * Automatically load the actions and libraries used by the Twitter bridge - * - * @param Class $cls the class - * - * @return boolean hook return - * - */ - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) { - case 'TwittersettingsAction': - case 'TwitterauthorizationAction': - case 'TwitterloginAction': - case 'TwitteradminpanelAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'TwitterOAuthClient': - case 'TwitterQueueHandler': - case 'TweetInQueueHandler': - case 'TwitterImport': - case 'JsonStreamReader': - case 'TwitterStreamReader': - include_once $dir . '/' . strtolower($cls) . '.php'; - return false; - case 'TwitterSiteStream': - case 'TwitterUserStream': - include_once $dir . '/twitterstreamreader.php'; - return false; - case 'Notice_to_status': - case 'Twitter_synch_status': - include_once $dir . '/' . $cls . '.php'; - return false; - default: - return true; - } - } - /** * Add a Twitter queue item for each notice * diff --git a/plugins/TwitterBridge/twitteradminpanel.php b/plugins/TwitterBridge/actions/twitteradminpanel.php similarity index 100% rename from plugins/TwitterBridge/twitteradminpanel.php rename to plugins/TwitterBridge/actions/twitteradminpanel.php diff --git a/plugins/TwitterBridge/twitterauthorization.php b/plugins/TwitterBridge/actions/twitterauthorization.php similarity index 100% rename from plugins/TwitterBridge/twitterauthorization.php rename to plugins/TwitterBridge/actions/twitterauthorization.php diff --git a/plugins/TwitterBridge/twitterlogin.php b/plugins/TwitterBridge/actions/twitterlogin.php similarity index 100% rename from plugins/TwitterBridge/twitterlogin.php rename to plugins/TwitterBridge/actions/twitterlogin.php diff --git a/plugins/TwitterBridge/twittersettings.php b/plugins/TwitterBridge/actions/twittersettings.php similarity index 100% rename from plugins/TwitterBridge/twittersettings.php rename to plugins/TwitterBridge/actions/twittersettings.php diff --git a/plugins/TwitterBridge/Notice_to_status.php b/plugins/TwitterBridge/classes/Notice_to_status.php similarity index 100% rename from plugins/TwitterBridge/Notice_to_status.php rename to plugins/TwitterBridge/classes/Notice_to_status.php diff --git a/plugins/TwitterBridge/Twitter_synch_status.php b/plugins/TwitterBridge/classes/Twitter_synch_status.php similarity index 100% rename from plugins/TwitterBridge/Twitter_synch_status.php rename to plugins/TwitterBridge/classes/Twitter_synch_status.php diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php index 47a44597be..6599058fd4 100755 --- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php +++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php @@ -40,7 +40,7 @@ require_once INSTALLDIR . '/scripts/commandline.inc'; require_once INSTALLDIR . '/lib/common.php'; require_once INSTALLDIR . '/lib/daemon.php'; require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php'; -require_once INSTALLDIR . '/plugins/TwitterBridge/twitteroauthclient.php'; +require_once INSTALLDIR . '/plugins/TwitterBridge/lib/twitteroauthclient.php'; /** * Fetch statuses from Twitter diff --git a/plugins/TwitterBridge/jsonstreamreader.php b/plugins/TwitterBridge/lib/jsonstreamreader.php similarity index 100% rename from plugins/TwitterBridge/jsonstreamreader.php rename to plugins/TwitterBridge/lib/jsonstreamreader.php diff --git a/plugins/TwitterBridge/tweetinqueuehandler.php b/plugins/TwitterBridge/lib/tweetinqueuehandler.php similarity index 100% rename from plugins/TwitterBridge/tweetinqueuehandler.php rename to plugins/TwitterBridge/lib/tweetinqueuehandler.php diff --git a/plugins/TwitterBridge/twitterimport.php b/plugins/TwitterBridge/lib/twitterimport.php similarity index 100% rename from plugins/TwitterBridge/twitterimport.php rename to plugins/TwitterBridge/lib/twitterimport.php diff --git a/plugins/TwitterBridge/twitteroauthclient.php b/plugins/TwitterBridge/lib/twitteroauthclient.php similarity index 100% rename from plugins/TwitterBridge/twitteroauthclient.php rename to plugins/TwitterBridge/lib/twitteroauthclient.php diff --git a/plugins/TwitterBridge/twitterqueuehandler.php b/plugins/TwitterBridge/lib/twitterqueuehandler.php similarity index 100% rename from plugins/TwitterBridge/twitterqueuehandler.php rename to plugins/TwitterBridge/lib/twitterqueuehandler.php diff --git a/plugins/TwitterBridge/lib/twittersitestream.php b/plugins/TwitterBridge/lib/twittersitestream.php new file mode 100644 index 0000000000..2f11f0adfc --- /dev/null +++ b/plugins/TwitterBridge/lib/twittersitestream.php @@ -0,0 +1,88 @@ +. + * + * @category Plugin + * @package StatusNet + * @author Brion Vibber + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +/** + * Multiuser stream listener for Twitter Site Streams API + * http://dev.twitter.com/pages/site_streams + * + * The site streams API allows listening to updates for multiple users. + * Pass in the user IDs to listen to in via followUser() -- note they + * must each have a valid OAuth token for the application ID we're + * connecting as. + * + * You'll need to be connecting with the auth keys for the user who + * owns the application registration. + * + * The user each message is destined for will be passed to event handlers + * in $context['for_user_id']. + */ +class TwitterSiteStream extends TwitterStreamReader +{ + protected $userIds; + + public function __construct(TwitterOAuthClient $auth, $baseUrl='https://sitestream.twitter.com') + { + parent::__construct($auth, $baseUrl); + } + + public function connect($method='2b/site.json') + { + $params = array(); + if ($this->userIds) { + $params['follow'] = implode(',', $this->userIds); + } + return parent::connect($method, $params); + } + + /** + * Set the users whose home streams should be pulled. + * They all must have valid oauth tokens for this application. + * + * Must be called before connect(). + * + * @param array $userIds + */ + function followUsers($userIds) + { + $this->userIds = $userIds; + } + + /** + * Each message in the site stream tells us which user ID it should be + * routed to; we'll need that to let the caller know what to do. + * + * @param array $data + */ + function routeMessage(stdClass $data) + { + $context = array( + 'source' => 'sitestream', + 'for_user' => $data->for_user + ); + parent::handleMessage($data->message, $context); + } +} diff --git a/plugins/TwitterBridge/twitterstreamreader.php b/plugins/TwitterBridge/lib/twitterstreamreader.php similarity index 100% rename from plugins/TwitterBridge/twitterstreamreader.php rename to plugins/TwitterBridge/lib/twitterstreamreader.php diff --git a/plugins/TwitterBridge/lib/twitteruserstream.php b/plugins/TwitterBridge/lib/twitteruserstream.php new file mode 100644 index 0000000000..ad4094d3d5 --- /dev/null +++ b/plugins/TwitterBridge/lib/twitteruserstream.php @@ -0,0 +1,59 @@ +. + * + * @category Plugin + * @package StatusNet + * @author Brion Vibber + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +/** + * Stream listener for Twitter User Streams API + * http://dev.twitter.com/pages/user_streams + * + * This will pull the home stream and additional events just for the user + * we've authenticated as. + */ +class TwitterUserStream extends TwitterStreamReader +{ + public function __construct(TwitterOAuthClient $auth, $baseUrl='https://userstream.twitter.com') + { + parent::__construct($auth, $baseUrl); + } + + public function connect($method='2/user.json') + { + return parent::connect($method); + } + + /** + * Each message in the user stream is just ready to go. + * + * @param array $data + */ + function routeMessage(stdClass $data) + { + $context = array( + 'source' => 'userstream' + ); + parent::handleMessage($data, $context); + } +} diff --git a/plugins/TwitterBridge/scripts/streamtest.php b/plugins/TwitterBridge/scripts/streamtest.php index e0c48efe57..800d8c1e1c 100644 --- a/plugins/TwitterBridge/scripts/streamtest.php +++ b/plugins/TwitterBridge/scripts/streamtest.php @@ -44,8 +44,8 @@ data as it comes. ENDOFHELP; require_once INSTALLDIR.'/scripts/commandline.inc'; -require_once dirname(dirname(__FILE__)) . '/jsonstreamreader.php'; -require_once dirname(dirname(__FILE__)) . '/twitterstreamreader.php'; +require_once dirname(dirname(__FILE__)) . '/lib/jsonstreamreader.php'; +require_once dirname(dirname(__FILE__)) . '/lib/twitterstreamreader.php'; if (have_option('n')) { $nickname = get_option_value('n'); diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php index 1d8cccd54d..22955a2ebc 100644 --- a/plugins/UserFlag/UserFlagPlugin.php +++ b/plugins/UserFlag/UserFlagPlugin.php @@ -79,35 +79,6 @@ class UserFlagPlugin extends Plugin return true; } - /** - * Auto-load our classes if called - * - * @param string $cls Class to load - * - * @return boolean hook return - */ - function onAutoload($cls) - { - switch (strtolower($cls)) - { - case 'flagprofileaction': - case 'adminprofileflagaction': - case 'clearflagaction': - include_once INSTALLDIR.'/plugins/UserFlag/' . - strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'flagprofileform': - case 'clearflagform': - include_once INSTALLDIR.'/plugins/UserFlag/' . strtolower($cls . '.php'); - return false; - case 'user_flag_profile': - include_once INSTALLDIR.'/plugins/UserFlag/'.ucfirst(strtolower($cls)).'.php'; - return false; - default: - return true; - } - } - /** * Add a 'flag' button to profile page * diff --git a/plugins/UserFlag/adminprofileflag.php b/plugins/UserFlag/actions/adminprofileflag.php similarity index 100% rename from plugins/UserFlag/adminprofileflag.php rename to plugins/UserFlag/actions/adminprofileflag.php diff --git a/plugins/UserFlag/clearflag.php b/plugins/UserFlag/actions/clearflag.php similarity index 100% rename from plugins/UserFlag/clearflag.php rename to plugins/UserFlag/actions/clearflag.php diff --git a/plugins/UserFlag/flagprofile.php b/plugins/UserFlag/actions/flagprofile.php similarity index 100% rename from plugins/UserFlag/flagprofile.php rename to plugins/UserFlag/actions/flagprofile.php diff --git a/plugins/UserFlag/User_flag_profile.php b/plugins/UserFlag/classes/User_flag_profile.php similarity index 100% rename from plugins/UserFlag/User_flag_profile.php rename to plugins/UserFlag/classes/User_flag_profile.php diff --git a/plugins/UserFlag/clearflagform.php b/plugins/UserFlag/forms/clearflag.php similarity index 100% rename from plugins/UserFlag/clearflagform.php rename to plugins/UserFlag/forms/clearflag.php diff --git a/plugins/UserFlag/flagprofileform.php b/plugins/UserFlag/forms/flagprofile.php similarity index 100% rename from plugins/UserFlag/flagprofileform.php rename to plugins/UserFlag/forms/flagprofile.php diff --git a/plugins/Xmpp/XmppPlugin.php b/plugins/Xmpp/XmppPlugin.php index f56d33f0a3..61b2998656 100644 --- a/plugins/Xmpp/XmppPlugin.php +++ b/plugins/Xmpp/XmppPlugin.php @@ -296,16 +296,9 @@ class XmppPlugin extends ImPlugin case 'XMPPHP_XMPP': require_once $dir . '/extlib/XMPPHP/XMPP.php'; return false; - case 'Sharing_XMPP': - case 'Queued_XMPP': - require_once $dir . '/'.$cls.'.php'; - return false; - case 'XmppManager': - require_once $dir . '/'.strtolower($cls).'.php'; - return false; - default: - return true; } + + return parent::onAutoload($cls); } function onStartImDaemonIoManagers(&$classes) diff --git a/plugins/Xmpp/Queued_XMPP.php b/plugins/Xmpp/lib/queued_xmpp.php similarity index 100% rename from plugins/Xmpp/Queued_XMPP.php rename to plugins/Xmpp/lib/queued_xmpp.php diff --git a/plugins/Xmpp/Sharing_XMPP.php b/plugins/Xmpp/lib/sharing_xmpp.php similarity index 100% rename from plugins/Xmpp/Sharing_XMPP.php rename to plugins/Xmpp/lib/sharing_xmpp.php diff --git a/plugins/Xmpp/xmppmanager.php b/plugins/Xmpp/lib/xmppmanager.php similarity index 100% rename from plugins/Xmpp/xmppmanager.php rename to plugins/Xmpp/lib/xmppmanager.php diff --git a/plugins/YammerImport/YammerImportPlugin.php b/plugins/YammerImport/YammerImportPlugin.php index b93eb3ba4a..9d6c5ad41e 100644 --- a/plugins/YammerImport/YammerImportPlugin.php +++ b/plugins/YammerImport/YammerImportPlugin.php @@ -105,44 +105,4 @@ class YammerImportPlugin extends Plugin return true; } - - /** - * Automatically load the actions and libraries used by the plugin - * - * @param Class $cls the class - * - * @return boolean hook return - * - */ - function onAutoload($cls) - { - $base = dirname(__FILE__); - $lower = strtolower($cls); - switch ($lower) { - case 'sn_yammerclient': - case 'yammerimporter': - case 'yammerrunner': - case 'yammerapikeyform': - case 'yammerauthinitform': - case 'yammerauthverifyform': - case 'yammerprogressform': - case 'yammerqueuehandler': - require_once "$base/lib/$lower.php"; - return false; - case 'yammeradminpanelaction': - $crop = substr($lower, 0, strlen($lower) - strlen('action')); - require_once "$base/actions/$crop.php"; - return false; - case 'yammer_state': - case 'yammer_notice_stub': - case 'yammer_common': - case 'yammer_user': - case 'yammer_group': - case 'yammer_notice': - require_once "$base/classes/$cls.php"; - return false; - default: - return true; - } - } } diff --git a/plugins/YammerImport/lib/yammerapikeyform.php b/plugins/YammerImport/forms/yammerapikey.php similarity index 100% rename from plugins/YammerImport/lib/yammerapikeyform.php rename to plugins/YammerImport/forms/yammerapikey.php diff --git a/plugins/YammerImport/lib/yammerauthinitform.php b/plugins/YammerImport/forms/yammerauthinit.php similarity index 100% rename from plugins/YammerImport/lib/yammerauthinitform.php rename to plugins/YammerImport/forms/yammerauthinit.php diff --git a/plugins/YammerImport/lib/yammerauthverifyform.php b/plugins/YammerImport/forms/yammerauthverify.php similarity index 100% rename from plugins/YammerImport/lib/yammerauthverifyform.php rename to plugins/YammerImport/forms/yammerauthverify.php diff --git a/plugins/YammerImport/lib/yammerprogressform.php b/plugins/YammerImport/forms/yammerprogress.php similarity index 100% rename from plugins/YammerImport/lib/yammerprogressform.php rename to plugins/YammerImport/forms/yammerprogress.php