mirror of
https://github.com/silverstripe/silverstripe-environmentcheck
synced 2024-10-22 17:05:40 +02:00
18 lines
559 B
PHP
18 lines
559 B
PHP
<?php
|
|
/**
|
|
* Check that the given class exists.
|
|
* This can be used to check that PHP modules or features are installed.
|
|
* @param $className The name of the class to look for.
|
|
*/
|
|
class HasClassCheck implements EnvironmentCheck {
|
|
protected $className;
|
|
|
|
function __construct($className) {
|
|
$this->className = $className;
|
|
}
|
|
|
|
function check() {
|
|
if(class_exists($this->className)) return array(EnvironmentCheck::OK, 'Class ' . $this->className.' exists');
|
|
else return array(EnvironmentCheck::ERROR, 'Class ' . $this->className.' doesn\'t exist');
|
|
}
|
|
} |