Compare commits

...

3 Commits

Author SHA1 Message Date
Guy Sartorelli
4d551af50c
Merge 1280a1a58fc8360faa349921d1c5efd4cfb0f97b into 9cd1ae9a3bc49b388fdf167aeee95e4965df9926 2024-09-23 22:33:17 +00:00
Guy Sartorelli
1280a1a58f
ENH Update config to reflect changes in CLI interaction 2024-09-24 10:33:11 +12:00
Guy Sartorelli
9cd1ae9a3b
API Use new names for renamed classes (#113) 2024-09-23 14:38:51 +12:00
6 changed files with 13 additions and 81 deletions

View File

@ -73,7 +73,7 @@ SilverStripe\EnvironmentCheck\EnvironmentCheckSuite:
* `HasClassCheck`: Check that the given class exists. * `HasClassCheck`: Check that the given class exists.
This can be used to check that PHP modules or features are installed. This can be used to check that PHP modules or features are installed.
* `FileWriteableCheck`: Check that the given file is writeable. * `FileWriteableCheck`: Check that the given file is writeable.
* `FileAccessibilityAndValidationCheck`: Check that a given file is accessible and optionally matches a given format. * `FileAccessibilityAndValidationCheck`: Check that a given file is accessible and optionally matches a given format.
* `FileAgeCheck`: Checks for the maximum age of one or more files or folders. * `FileAgeCheck`: Checks for the maximum age of one or more files or folders.
Useful for files which should be frequently auto-generated, Useful for files which should be frequently auto-generated,
like static caches, as well as for backup files and folders. like static caches, as well as for backup files and folders.

View File

@ -1,70 +0,0 @@
<?php
//
//use SilverStripe\EnvironmentCheck\EnvironmentCheckSuite;
//
//// These power dev/health, which can be used by load balancers and other such systems
//EnvironmentCheckSuite::register('health', 'DatabaseCheck');
//
//// These power dev/check, which is used for diagnostics and for deployment
//EnvironmentCheckSuite::register('check', 'DatabaseCheck("Member")', "Is the database accessible?");
//EnvironmentCheckSuite::register('check', 'URLCheck("")', "Is the homepage accessible?");
//
//EnvironmentCheckSuite::register(
// 'check',
// 'HasFunctionCheck("curl_init")',
// "Does PHP have CURL support?"
//);
//
//EnvironmentCheckSuite::register(
// 'check',
// 'HasFunctionCheck("imagecreatetruecolor")',
// "Does PHP have GD2 support?"
//);
//
//EnvironmentCheckSuite::register(
// 'check',
// 'HasFunctionCheck("xml_set_object")',
// "Does PHP have XML support?"
//);
//
//EnvironmentCheckSuite::register(
// 'check',
// 'HasFunctionCheck("token_get_all")',
// "Does PHP have tokenizer support?"
//);
//
//EnvironmentCheckSuite::register(
// 'check',
// 'HasFunctionCheck("iconv")',
// "Does PHP have iconv support?"
//);
//
//EnvironmentCheckSuite::register(
// 'check',
// 'HasFunctionCheck("hash")',
// "Does PHP have hash support?"
//);
//
//EnvironmentCheckSuite::register(
// 'check',
// 'HasFunctionCheck("session_start")',
// "Does PHP have session support?"
//);
//
//EnvironmentCheckSuite::register(
// 'check',
// 'HasClassCheck("DOMDocument")',
// "Does PHP have DOMDocument support?"
//);
//
//EnvironmentCheckSuite::register(
// 'check',
// 'FileWriteableCheck("assets")',
// "Is assets/ writeable?"
//);
//
//EnvironmentCheckSuite::register(
// 'check',
// 'FileWriteableCheck("' . TEMP_FOLDER . '")',
// "Is the temp folder writeable?"
//);

View File

@ -4,14 +4,12 @@ Name: environmentcheckroutes
SilverStripe\Control\Director: SilverStripe\Control\Director:
rules: rules:
'health/check': 'Silverstripe\EnvironmentCheck\Controllers\DevHealthController' 'health/check': 'Silverstripe\EnvironmentCheck\Controllers\DevHealthController'
'dev/check/$Suite': 'Silverstripe\EnvironmentCheck\Controllers\DevCheckController'
SilverStripe\Dev\DevelopmentAdmin: SilverStripe\Dev\DevelopmentAdmin:
registered_controllers: controllers:
check: check:
controller: Silverstripe\EnvironmentCheck\Controllers\DevCheckController class: Silverstripe\EnvironmentCheck\Controllers\DevCheckController
links: description: 'Run registered environment checks and display their status'
check: 'Run registered environment checks and display their status'
--- ---
Name: environmentcheckroutes-dev_urls-confirmation-exceptions Name: environmentcheckroutes-dev_urls-confirmation-exceptions

View File

@ -4,7 +4,7 @@ namespace SilverStripe\EnvironmentCheck\Checks;
use SilverStripe\Control\Director; use SilverStripe\Control\Director;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
use SilverStripe\ORM\ValidationResult; use SilverStripe\Core\Validation\ValidationResult;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\Config\Configurable;
use SilverStripe\EnvironmentCheck\Traits\Fetcher; use SilverStripe\EnvironmentCheck\Traits\Fetcher;

View File

@ -14,6 +14,10 @@ use SilverStripe\EnvironmentCheck\EnvironmentChecker;
*/ */
class DevCheckController extends Controller class DevCheckController extends Controller
{ {
private static $url_handlers = [
'$Suite' => 'index',
];
/** /**
* @var array * @var array
*/ */

View File

@ -3,16 +3,16 @@
namespace SilverStripe\EnvironmentCheck; namespace SilverStripe\EnvironmentCheck;
use InvalidArgumentException; use InvalidArgumentException;
use SilverStripe\ORM\ArrayList; use SilverStripe\Model\List\ArrayList;
use SilverStripe\View\ArrayData; use SilverStripe\Model\ArrayData;
use SilverStripe\View\ViewableData; use SilverStripe\Model\ModelData;
/** /**
* A single set of results from running an EnvironmentCheckSuite * A single set of results from running an EnvironmentCheckSuite
* *
* @package environmentcheck * @package environmentcheck
*/ */
class EnvironmentCheckSuiteResult extends ViewableData class EnvironmentCheckSuiteResult extends ModelData
{ {
/** /**
* @var ArrayList * @var ArrayList