+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* system.
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2016
*/
class CRM_Extension_Browser {
/**
* An URL for public extensions repository.
+ *
+ * Note: This default is now handled through setting/*.php.
+ *
+ * @deprecated
*/
const DEFAULT_EXTENSIONS_REPOSITORY = 'https://civicrm.org/extdir/ver={ver}|cms={uf}';
*/
const CACHE_JSON_FILE = 'extensions.json';
+ // timeout for when the connection or the server is slow
+ const CHECK_TIMEOUT = 5;
+
/**
* @param string $repoUrl
* URL of the remote repository.
return $exts[$key];
}
else {
- // throw new CRM_Extension_Exception("Unknown remote extension: $key");
return NULL;
}
}
*/
private function grabRemoteJson() {
- ini_set('default_socket_timeout', CRM_Utils_VersionCheck::CHECK_TIMEOUT);
+ ini_set('default_socket_timeout', self::CHECK_TIMEOUT);
set_error_handler(array('CRM_Extension_Browser', 'downloadError'));
if (!ini_get('allow_url_fopen')) {