diff --git a/composer.json b/composer.json index 28b407ed5a9272f983bc205762267f701644807c..f6c0141296ece6156ef125a588293494ffca175a 100644 --- a/composer.json +++ b/composer.json @@ -54,8 +54,8 @@ "symfony/event-dispatcher": "~2.6.0", "pear/pear_exception": "~1.0.0", "piwik/referrer-spam-blacklist": "~1.0", - "tecnickcom/tcpdf": "~6.0", - "piwik/searchengine-and-social-definitions": "dev-master" + "piwik/searchengine-and-social-list": "~1.0", + "tecnickcom/tcpdf": "~6.0" }, "require-dev": { "aws/aws-sdk-php": "2.7.1", @@ -91,20 +91,8 @@ "reference": "master" } } - }, - { - "type": "package", - "package": { - "name": "piwik/searchengine-and-social-definitions", - "type": "library", - "version": "master", - "source": { - "type": "git", - "url": "https://github.com/sgiehl/searchengine-and-social-definitions", - "reference": "master" - } - } - } ], + } + ], "scripts": { "pre-update-cmd": [ "Piwik\\Composer\\ScriptHandler::cleanXhprof" diff --git a/composer.lock b/composer.lock index 1a5ba52b51fc487f1d7028717527ed5d704da2fa..2a53020e147a5a3ff1bd452a51a6984baab18788 100644 --- a/composer.lock +++ b/composer.lock @@ -959,15 +959,26 @@ "time": "2015-10-07 10:17:59" }, { - "name": "piwik/searchengine-and-social-definitions", - "version": "master", + "name": "piwik/searchengine-and-social-list", + "version": "1.0", "source": { "type": "git", - "url": "https://github.com/sgiehl/searchengine-and-social-definitions", - "reference": "master" + "url": "https://github.com/piwik/searchengine-and-social-list.git", + "reference": "e2b97a1cd9ed2dde735de49f8ef9afc26b3df80b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/piwik/searchengine-and-social-list/zipball/e2b97a1cd9ed2dde735de49f8ef9afc26b3df80b", + "reference": "e2b97a1cd9ed2dde735de49f8ef9afc26b3df80b", + "shasum": "" }, "type": "library", - "time": "2015-10-31 15:36:36" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Public Domain" + ], + "description": "Search engine and social network definitions used by Piwik", + "time": "2015-11-06 21:32:51" }, { "name": "psr/log", @@ -2656,7 +2667,6 @@ "minimum-stability": "stable", "stability-flags": { "php-di/php-di": 10, - "piwik/searchengine-and-social-definitions": 20, "facebook/xhprof": 20 }, "prefer-stable": false, diff --git a/plugins/Referrers/SearchEngine.php b/plugins/Referrers/SearchEngine.php index df48d9663a4b9f4fe047f1f34888cef89a82b761..41542e1548ac67cb5c2cceafa6dd8929860ed4cf 100644 --- a/plugins/Referrers/SearchEngine.php +++ b/plugins/Referrers/SearchEngine.php @@ -23,7 +23,7 @@ class SearchEngine extends Singleton const OPTION_STORAGE_NAME = 'SearchEngineDefinitions'; /** @var string location of definition file (relative to PIWIK_INCLUDE_PATH) */ - const DEFINITION_FILE = '/vendor/piwik/searchengine-and-social-definitions/SearchEngines.yml'; + const DEFINITION_FILE = '/vendor/piwik/searchengine-and-social-list/SearchEngines.yml'; protected $definitionList = null; diff --git a/plugins/Referrers/Social.php b/plugins/Referrers/Social.php index f554dc75d0e9fc47d9d2ca006d4e91872c21db07..71badc3357a3e7b7eba58ef0e2b3a481929819cc 100644 --- a/plugins/Referrers/Social.php +++ b/plugins/Referrers/Social.php @@ -22,7 +22,7 @@ class Social extends Singleton const OPTION_STORAGE_NAME = 'SocialDefinitions'; /** @var string location of definition file (relative to PIWIK_INCLUDE_PATH) */ - const DEFINITION_FILE = '/vendor/piwik/searchengine-and-social-definitions/Socials.yml'; + const DEFINITION_FILE = '/vendor/piwik/searchengine-and-social-list/Socials.yml'; protected $definitionList = null; diff --git a/plugins/Referrers/Tasks.php b/plugins/Referrers/Tasks.php index 8dd3f96e5a2c4152db156293acf70c54fc6e8790..da9cad13217708441b8bd5da73eac8ead9bc440f 100644 --- a/plugins/Referrers/Tasks.php +++ b/plugins/Referrers/Tasks.php @@ -23,26 +23,32 @@ class Tasks extends \Piwik\Plugin\Tasks /** * Update the search engine definitions * - * @see https://github.com/piwik/searchengine-and-social-definitions + * @see https://github.com/piwik/searchengine-and-social-list */ public function updateSearchEngines() { - $url = 'https://raw.githubusercontent.com/piwik/searchengine-and-social-definitions/master/SearchEngines.yml'; + $url = 'https://raw.githubusercontent.com/piwik/searchengine-and-social-list/master/SearchEngines.yml'; $list = Http::sendHttpRequest($url, 30); $searchEngines = SearchEngine::getInstance()->loadYmlData($list); + if (count($searchEngines) < 200) { + return; + } Option::set(SearchEngine::OPTION_STORAGE_NAME, base64_encode(serialize($searchEngines))); } /** * Update the social definitions * - * @see https://github.com/piwik/searchengine-and-social-definitions + * @see https://github.com/piwik/searchengine-and-social-list */ public function updateSocials() { - $url = 'https://raw.githubusercontent.com/piwik/searchengine-and-social-definitions/master/Socials.yml'; + $url = 'https://raw.githubusercontent.com/piwik/searchengine-and-social-list/master/Socials.yml'; $list = Http::sendHttpRequest($url, 30); $socials = Social::getInstance()->loadYmlData($list); + if (count($socials) < 50) { + return; + } Option::set(Social::OPTION_STORAGE_NAME, base64_encode(serialize($socials))); } } \ No newline at end of file