mirror of
https://github.com/silverstripe/silverstripe-environmentcheck
synced 2024-10-22 17:05:40 +02:00
29 lines
578 B
PHP
29 lines
578 B
PHP
<?php
|
|
|
|
/**
|
|
* Check that the given class exists.
|
|
*/
|
|
class HasClassCheck implements EnvironmentCheck {
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $className;
|
|
|
|
/**
|
|
* @param string $className The name of the class to look for.
|
|
*/
|
|
function __construct($className) {
|
|
$this->className = $className;
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*
|
|
* @return array
|
|
*/
|
|
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');
|
|
}
|
|
}
|