X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSitemap%2FSitemapPlugin.php;h=3d83629bb2dc1acfa59b6f2d1e61bcaf6d6d752d;hb=660e8c6efcee8278aee23f378cb9eab426837ec7;hp=29b822acd54be6014597c32908d8c75c5505e04d;hpb=f79aec36feaa4760201a7e88d5b31513a3c458ba;p=quix0rs-gnu-social.git diff --git a/plugins/Sitemap/SitemapPlugin.php b/plugins/Sitemap/SitemapPlugin.php index 29b822acd5..3d83629bb2 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; } @@ -224,7 +179,7 @@ class SitemapPlugin extends Plugin $url = 'http://status.net/wiki/Plugin:Sitemap'; $versions[] = array('name' => 'Sitemap', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Evan Prodromou', 'homepage' => $url, 'rawdescription' =>