[ticket/13740] Move default data settings out of constructors

PHPBB3-13740
This commit is contained in:
Mate Bartus 2015-07-25 14:44:39 +02:00
parent e8e9193690
commit 0befa9f109
3 changed files with 251 additions and 263 deletions

View file

@ -33,21 +33,7 @@ class database
/**
* @var array
*/
protected $supported_dbms;
/**
* Constructor
*
* @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem interface
* @param string $phpbb_root_path Path to phpBB's root
*/
public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
{
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
// DBMS supported by phpBB
$this->supported_dbms = array(
protected $supported_dbms = array(
// Note: php 5.5 alpha 2 deprecated mysql.
// Keep mysqli before mysql in this list.
'mysqli' => array(
@ -132,6 +118,17 @@ class database
'2.0.x' => false,
),
);
/**
* Constructor
*
* @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem interface
* @param string $phpbb_root_path Path to phpBB's root
*/
public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
{
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
}
/**

View file

@ -16,9 +16,91 @@ namespace phpbb\install\module\install_data\task;
class add_bots extends \phpbb\install\task_base
{
/**
* A list of the web-crawlers/bots we recognise by default
*
* Candidates but not included:
* 'Accoona [Bot]' 'Accoona-AI-Agent/'
* 'ASPseek [Crawler]' 'ASPseek/'
* 'Boitho [Crawler]' 'boitho.com-dc/'
* 'Bunnybot [Bot]' 'powered by www.buncat.de'
* 'Cosmix [Bot]' 'cfetch/'
* 'Crawler Search [Crawler]' '.Crawler-Search.de'
* 'Findexa [Crawler]' 'Findexa Crawler ('
* 'GBSpider [Spider]' 'GBSpider v'
* 'genie [Bot]' 'genieBot ('
* 'Hogsearch [Bot]' 'oegp v. 1.3.0'
* 'Insuranco [Bot]' 'InsurancoBot'
* 'IRLbot [Bot]' 'http://irl.cs.tamu.edu/crawler'
* 'ISC Systems [Bot]' 'ISC Systems iRc Search'
* 'Jyxobot [Bot]' 'Jyxobot/'
* 'Kraehe [Metasuche]' '-DIE-KRAEHE- META-SEARCH-ENGINE/'
* 'LinkWalker' 'LinkWalker'
* 'MMSBot [Bot]' 'http://www.mmsweb.at/bot.html'
* 'Naver [Bot]' 'nhnbot@naver.com)'
* 'NetResearchServer' 'NetResearchServer/'
* 'Nimble [Crawler]' 'NimbleCrawler'
* 'Ocelli [Bot]' 'Ocelli/'
* 'Onsearch [Bot]' 'onCHECK-Robot'
* 'Orange [Spider]' 'OrangeSpider'
* 'Sproose [Bot]' 'http://www.sproose.com/bot'
* 'Susie [Sync]' '!Susie (http://www.sync2it.com/susie)'
* 'Tbot [Bot]' 'Tbot/'
* 'Thumbshots [Capture]' 'thumbshots-de-Bot'
* 'Vagabondo [Crawler]' 'http://webagent.wise-guys.nl/'
* 'Walhello [Bot]' 'appie 1.1 (www.walhello.com)'
* 'WissenOnline [Bot]' 'WissenOnline-Bot'
* 'WWWeasel [Bot]' 'WWWeasel Robot v'
* 'Xaldon [Spider]' 'Xaldon WebSpider'
*
* @var array
*/
protected $bot_list;
protected $bot_list = array(
'AdsBot [Google]' => array('AdsBot-Google', ''),
'Alexa [Bot]' => array('ia_archiver', ''),
'Alta Vista [Bot]' => array('Scooter/', ''),
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
'Baidu [Spider]' => array('Baiduspider', ''),
'Bing [Bot]' => array('bingbot/', ''),
'Exabot [Bot]' => array('Exabot', ''),
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
'Francis [Bot]' => array('http://www.neomo.de/', ''),
'Gigabot [Bot]' => array('Gigabot/', ''),
'Google Adsense [Bot]' => array('Mediapartners-Google', ''),
'Google Desktop' => array('Google Desktop', ''),
'Google Feedfetcher' => array('Feedfetcher-Google', ''),
'Google [Bot]' => array('Googlebot', ''),
'Heise IT-Markt [Crawler]' => array('heise-IT-Markt-Crawler', ''),
'Heritrix [Crawler]' => array('heritrix/1.', ''),
'IBM Research [Bot]' => array('ibm.com/cs/crawler', ''),
'ICCrawler - ICjobs' => array('ICCrawler - ICjobs', ''),
'ichiro [Crawler]' => array('ichiro/', ''),
'Majestic-12 [Bot]' => array('MJ12bot/', ''),
'Metager [Bot]' => array('MetagerBot/', ''),
'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''),
'MSN [Bot]' => array('msnbot/', ''),
'MSNbot Media' => array('msnbot-media/', ''),
'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''),
'Online link [Validator]' => array('online link validator', ''),
'psbot [Picsearch]' => array('psbot/0', ''),
'Sensis [Crawler]' => array('Sensis Web Crawler', ''),
'SEO Crawler' => array('SEO search Crawler/', ''),
'Seoma [Crawler]' => array('Seoma [SEO Crawler]', ''),
'SEOSearch [Crawler]' => array('SEOsearch/', ''),
'Snappy [Bot]' => array('Snappy/1.1 ( http://www.urltrends.com/ )', ''),
'Steeler [Crawler]' => array('http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', ''),
'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''),
'TurnitinBot [Bot]' => array('TurnitinBot/', ''),
'Voyager [Bot]' => array('voyager/', ''),
'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''),
'W3C [Linkcheck]' => array('W3C-checklink/', ''),
'W3C [Validator]' => array('W3C_Validator', ''),
'YaCy [Bot]' => array('yacybot', ''),
'Yahoo MMCrawler [Bot]' => array('Yahoo-MMCrawler/', ''),
'Yahoo Slurp [Bot]' => array('Yahoo! DE Slurp', ''),
'Yahoo [Bot]' => array('Yahoo! Slurp', ''),
'YahooSeeker [Bot]' => array('YahooSeeker/', ''),
);
/**
* @var \phpbb\db\driver\driver_interface
@ -75,91 +157,6 @@ class add_bots extends \phpbb\install\task_base
$this->language = $language;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
/**
* A list of the web-crawlers/bots we recognise by default
*
* Candidates but not included:
* 'Accoona [Bot]' 'Accoona-AI-Agent/'
* 'ASPseek [Crawler]' 'ASPseek/'
* 'Boitho [Crawler]' 'boitho.com-dc/'
* 'Bunnybot [Bot]' 'powered by www.buncat.de'
* 'Cosmix [Bot]' 'cfetch/'
* 'Crawler Search [Crawler]' '.Crawler-Search.de'
* 'Findexa [Crawler]' 'Findexa Crawler ('
* 'GBSpider [Spider]' 'GBSpider v'
* 'genie [Bot]' 'genieBot ('
* 'Hogsearch [Bot]' 'oegp v. 1.3.0'
* 'Insuranco [Bot]' 'InsurancoBot'
* 'IRLbot [Bot]' 'http://irl.cs.tamu.edu/crawler'
* 'ISC Systems [Bot]' 'ISC Systems iRc Search'
* 'Jyxobot [Bot]' 'Jyxobot/'
* 'Kraehe [Metasuche]' '-DIE-KRAEHE- META-SEARCH-ENGINE/'
* 'LinkWalker' 'LinkWalker'
* 'MMSBot [Bot]' 'http://www.mmsweb.at/bot.html'
* 'Naver [Bot]' 'nhnbot@naver.com)'
* 'NetResearchServer' 'NetResearchServer/'
* 'Nimble [Crawler]' 'NimbleCrawler'
* 'Ocelli [Bot]' 'Ocelli/'
* 'Onsearch [Bot]' 'onCHECK-Robot'
* 'Orange [Spider]' 'OrangeSpider'
* 'Sproose [Bot]' 'http://www.sproose.com/bot'
* 'Susie [Sync]' '!Susie (http://www.sync2it.com/susie)'
* 'Tbot [Bot]' 'Tbot/'
* 'Thumbshots [Capture]' 'thumbshots-de-Bot'
* 'Vagabondo [Crawler]' 'http://webagent.wise-guys.nl/'
* 'Walhello [Bot]' 'appie 1.1 (www.walhello.com)'
* 'WissenOnline [Bot]' 'WissenOnline-Bot'
* 'WWWeasel [Bot]' 'WWWeasel Robot v'
* 'Xaldon [Spider]' 'Xaldon WebSpider'
*/
$this->bot_list = array(
'AdsBot [Google]' => array('AdsBot-Google', ''),
'Alexa [Bot]' => array('ia_archiver', ''),
'Alta Vista [Bot]' => array('Scooter/', ''),
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
'Baidu [Spider]' => array('Baiduspider', ''),
'Bing [Bot]' => array('bingbot/', ''),
'Exabot [Bot]' => array('Exabot', ''),
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
'Francis [Bot]' => array('http://www.neomo.de/', ''),
'Gigabot [Bot]' => array('Gigabot/', ''),
'Google Adsense [Bot]' => array('Mediapartners-Google', ''),
'Google Desktop' => array('Google Desktop', ''),
'Google Feedfetcher' => array('Feedfetcher-Google', ''),
'Google [Bot]' => array('Googlebot', ''),
'Heise IT-Markt [Crawler]' => array('heise-IT-Markt-Crawler', ''),
'Heritrix [Crawler]' => array('heritrix/1.', ''),
'IBM Research [Bot]' => array('ibm.com/cs/crawler', ''),
'ICCrawler - ICjobs' => array('ICCrawler - ICjobs', ''),
'ichiro [Crawler]' => array('ichiro/', ''),
'Majestic-12 [Bot]' => array('MJ12bot/', ''),
'Metager [Bot]' => array('MetagerBot/', ''),
'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''),
'MSN [Bot]' => array('msnbot/', ''),
'MSNbot Media' => array('msnbot-media/', ''),
'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''),
'Online link [Validator]' => array('online link validator', ''),
'psbot [Picsearch]' => array('psbot/0', ''),
'Sensis [Crawler]' => array('Sensis Web Crawler', ''),
'SEO Crawler' => array('SEO search Crawler/', ''),
'Seoma [Crawler]' => array('Seoma [SEO Crawler]', ''),
'SEOSearch [Crawler]' => array('SEOsearch/', ''),
'Snappy [Bot]' => array('Snappy/1.1 ( http://www.urltrends.com/ )', ''),
'Steeler [Crawler]' => array('http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', ''),
'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''),
'TurnitinBot [Bot]' => array('TurnitinBot/', ''),
'Voyager [Bot]' => array('voyager/', ''),
'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''),
'W3C [Linkcheck]' => array('W3C-checklink/', ''),
'W3C [Validator]' => array('W3C_Validator', ''),
'YaCy [Bot]' => array('yacybot', ''),
'Yahoo MMCrawler [Bot]' => array('Yahoo-MMCrawler/', ''),
'Yahoo Slurp [Bot]' => array('Yahoo! DE Slurp', ''),
'Yahoo [Bot]' => array('Yahoo! Slurp', ''),
'YahooSeeker [Bot]' => array('YahooSeeker/', ''),
);
}
/**

View file

@ -41,35 +41,7 @@ class add_modules extends \phpbb\install\task_base
*
* @var array
*/
protected $module_categories;
/**
* @var array
*/
protected $module_categories_basenames;
/**
* @var array
*/
protected $module_extras;
/**
* Constructor
*
* @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
* @param \phpbb\install\helper\container_factory $container Installer's DI container
*/
public function __construct(\phpbb\install\helper\iohandler\iohandler_interface $iohandler,
\phpbb\install\helper\container_factory $container)
{
$this->db = $container->get('dbal.conn');
$this->extension_manager = $container->get('ext.manager');
$this->iohandler = $iohandler;
$this->module_manager = $container->get('module.manager');
parent::__construct(true);
$this->module_categories = array(
protected $module_categories = array(
'acp' => array(
'ACP_CAT_GENERAL' => array(
'ACP_QUICK_ACCESS',
@ -131,11 +103,17 @@ class add_modules extends \phpbb\install\task_base
),
);
$this->module_categories_basenames = array(
/**
* @var array
*/
protected $module_categories_basenames = array(
'UCP_PM' => 'ucp_pm',
);
$this->module_extras = array(
/**
* @var array
*/
protected $module_extras = array(
'acp' => array(
'ACP_QUICK_ACCESS' => array(
'ACP_MANAGE_USERS',
@ -154,6 +132,22 @@ class add_modules extends \phpbb\install\task_base
),
),
);
/**
* Constructor
*
* @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
* @param \phpbb\install\helper\container_factory $container Installer's DI container
*/
public function __construct(\phpbb\install\helper\iohandler\iohandler_interface $iohandler,
\phpbb\install\helper\container_factory $container)
{
$this->db = $container->get('dbal.conn');
$this->extension_manager = $container->get('ext.manager');
$this->iohandler = $iohandler;
$this->module_manager = $container->get('module.manager');
parent::__construct(true);
}
/**