Merge pull request #7950 from JKingsnorth/CRM-18196
[civicrm-core.git] / CRM / Extension / Browser.php
index 9abbd7a12c3c24e460f06a48fec67821a349c640..3a58366433b32bde57dcbd3ff8518900e30f80d7 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -30,7 +30,7 @@
  * system.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
  */
 class CRM_Extension_Browser {
 
@@ -53,6 +53,9 @@ class CRM_Extension_Browser {
    */
   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.
@@ -230,7 +233,7 @@ class CRM_Extension_Browser {
    */
   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')) {