Convert remaining Authorize.net test to use guzzle
[civicrm-core.git] / CRM / Extension / Container / Default.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * @package CRM
14 * @copyright CiviCRM LLC https://civicrm.org/licensing
15 */
16
17 /**
18 * The default container is just a basic container which can be configured via
19 * the web UI.
20 */
21 class CRM_Extension_Container_Default extends CRM_Extension_Container_Basic {
22
23 /**
24 * @inheritDoc
25 *
26 * @return array
27 */
28 public function checkRequirements() {
29 $errors = array();
30
31 // In current configuration, we don't construct the default container
32 // unless baseDir is set, so this error condition is more theoretical.
33 if (empty($this->baseDir) || !is_dir($this->baseDir)) {
34 $civicrmDestination = urlencode(CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1'));
35 $url = CRM_Utils_System::url('civicrm/admin/setting/path', "reset=1&civicrmDestination=${civicrmDestination}");
36 $errors[] = array(
37 'title' => ts('Invalid Base Directory'),
38 'message' => ts('The extensions directory is not properly set. Please go to the <a href="%1">path setting page</a> and correct it.<br/>',
39 array(
40 1 => $url,
41 )
42 ),
43 );
44 }
45 if (empty($this->baseUrl)) {
46 $civicrmDestination = urlencode(CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1'));
47 $url = CRM_Utils_System::url('civicrm/admin/setting/url', "reset=1&civicrmDestination=${civicrmDestination}");
48 $errors[] = array(
49 'title' => ts('Invalid Base URL'),
50 'message' => ts('The extensions URL is not properly set. Please go to the <a href="%1">URL setting page</a> and correct it.<br/>',
51 array(
52 1 => $url,
53 )
54 ),
55 );
56 }
57
58 return $errors;
59 }
60
61 }