Convert remaining Authorize.net test to use guzzle
[civicrm-core.git] / CRM / Extension / Container / Default.php
CommitLineData
70d331a6 1<?php
4faa436b
SB
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
4faa436b 5 | |
bc77d7c0
TO
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 |
4faa436b
SB
9 +--------------------------------------------------------------------+
10 */
11
12/**
13 * @package CRM
ca5cec67 14 * @copyright CiviCRM LLC https://civicrm.org/licensing
4faa436b 15 */
70d331a6
TO
16
17/**
78612209
TO
18 * The default container is just a basic container which can be configured via
19 * the web UI.
70d331a6
TO
20 */
21class CRM_Extension_Container_Default extends CRM_Extension_Container_Basic {
22
23 /**
e7c15cb6 24 * @inheritDoc
4faa436b
SB
25 *
26 * @return array
70d331a6
TO
27 */
28 public function checkRequirements() {
29 $errors = array();
30
78612209
TO
31 // In current configuration, we don't construct the default container
32 // unless baseDir is set, so this error condition is more theoretical.
70d331a6
TO
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 )
78612209 42 ),
70d331a6
TO
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 )
78612209 54 ),
70d331a6
TO
55 );
56 }
57
58 return $errors;
59 }
96025800 60
78612209 61}