X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSitemap%2FSitemapPlugin.php;h=a1fe90b4b42e4313769735217e423b68b98f33e9;hb=d15fb62d3ca761370a1d3c3d93b559345247a51f;hp=29b822acd54be6014597c32908d8c75c5505e04d;hpb=7f2f333528fac83086568fc47b0b6dbcf6892038;p=quix0rs-gnu-social.git diff --git a/plugins/Sitemap/SitemapPlugin.php b/plugins/Sitemap/SitemapPlugin.php index 29b822acd5..a1fe90b4b4 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 * @@ -99,11 +68,11 @@ class SitemapPlugin extends Plugin /** * Map URLs to actions * - * @param Net_URL_Mapper $m path-to-action mapper + * @param URLMapper $m path-to-action mapper * * @return boolean hook value; true means continue processing, false means stop. */ - function onRouterInitialized($m) + public function onRouterInitialized(URLMapper $m) { $m->connect('sitemapindex.xml', array('action' => 'sitemapindex')); @@ -180,22 +149,8 @@ class SitemapPlugin extends Plugin { $schema = Schema::get(); - $schema->ensureTable('sitemap_user_count', - array(new ColumnDef('registration_date', 'date', null, - true, 'PRI'), - new ColumnDef('user_count', 'integer'), - new ColumnDef('created', 'datetime', - null, false), - new ColumnDef('modified', 'timestamp'))); - - $schema->ensureTable('sitemap_notice_count', - array(new ColumnDef('notice_date', 'date', null, - true, 'PRI'), - new ColumnDef('notice_count', 'integer'), - new ColumnDef('created', 'datetime', - null, false), - new ColumnDef('modified', 'timestamp'))); - + $schema->ensureTable('sitemap_user_count', Sitemap_user_count::schemaDef()); + $schema->ensureTable('sitemap_notice_count', Sitemap_notice_count::schemaDef()); return true; } @@ -219,12 +174,12 @@ class SitemapPlugin extends Plugin * * @return boolean hook value */ - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $url = 'http://status.net/wiki/Plugin:Sitemap'; $versions[] = array('name' => 'Sitemap', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Evan Prodromou', 'homepage' => $url, 'rawdescription' =>