use wcf\action\AJAXInvokeAction;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
use wcf\util\JSON;
/**
throw new SystemException("class name cannot be empty.");
}
- if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\worker\IWorker')) {
+ if (!is_subclass_of($this->className, 'wcf\system\worker\IWorker')) {
throw new SystemException("'".$this->className."' does not implement 'wcf\system\worker\IWorker'");
}
}
use wcf\system\exception\UserInputException;
use wcf\system\exception\ValidateActionException;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
use wcf\util\JSON;
use wcf\util\StringUtil;
*/
protected function invoke() {
// check for interface and inheritance of SingletonFactory
- if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\IAJAXInvokeAction')) {
+ if (!is_subclass_of($this->className, 'wcf\system\IAJAXInvokeAction')) {
throw new SystemException("'".$this->className."' does not implement 'wcf\system\IAJAXInvokeAction'");
}
- else if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\SingletonFactory')) {
+ else if (!is_subclass_of($this->className, 'wcf\system\SingletonFactory')) {
throw new SystemException("'".$this->className."' does not extend 'wcf\system\SingletonFactory'");
}
use wcf\system\exception\SystemException;
use wcf\system\WCF;
use wcf\util\ArrayUtil;
-use wcf\util\ClassUtil;
use wcf\util\StringUtil;
/**
* @see \wcf\action\IAction::execute()
*/
protected function invoke() {
- if (!ClassUtil::isInstanceOf($this->className, 'wcf\data\IDatabaseObjectAction')) {
+ if (!is_subclass_of($this->className, 'wcf\data\IDatabaseObjectAction')) {
throw new SystemException("'".$this->className."' does not implement 'wcf\data\IDatabaseObjectAction'");
}
if (!empty($this->interfaceName)) {
- if (!ClassUtil::isInstanceOf($this->className, $this->interfaceName)) {
+ if (!is_subclass_of($this->className, $this->interfaceName)) {
throw new SystemException("'".$this->className."' does not implement '".$this->interfaceName."'");
}
}
use wcf\system\request\RequestHandler;
use wcf\system\WCF;
use wcf\util\ArrayUtil;
-use wcf\util\ClassUtil;
use wcf\util\JSON;
use wcf\util\StringUtil;
* Resets cache of database object.
*/
protected function resetCache() {
- if (ClassUtil::isInstanceOf($this->className, 'wcf\data\IEditableCachedObject')) {
+ if (is_subclass_of($this->className, 'wcf\data\IEditableCachedObject')) {
call_user_func(array($this->className, 'resetCache'));
}
}
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
/**
* Abstract class for a list of database objects.
if (!empty($this->decoratorClassName)) {
// validate decorator class name
- if (!ClassUtil::isInstanceOf($this->decoratorClassName, 'wcf\data\DatabaseObjectDecorator')) {
+ if (!is_subclass_of($this->decoratorClassName, 'wcf\data\DatabaseObjectDecorator')) {
throw new SystemException("'".$this->decoratorClassName."' should extend 'wcf\data\DatabaseObjectDecorator'");
}
$objectClassName = $this->objectClassName ?: $this->className;
$baseClassName = call_user_func(array($this->decoratorClassName, 'getBaseClass'));
- if ($objectClassName != $baseClassName && !ClassUtil::isInstanceOf($baseClassName, $objectClassName)) {
+ if ($objectClassName != $baseClassName && !is_subclass_of($baseClassName, $objectClassName)) {
throw new SystemException("'".$this->decoratorClassName."' can't decorate objects of class '".$objectClassName."'");
}
}
<?php
namespace wcf\data;
use wcf\system\exception\SystemException;
-use wcf\util\ClassUtil;
/**
* Abstract class for all processible data holder classes.
if (!class_exists($this->className)) {
throw new SystemException("Unable to find class '".$this->className."'");
}
- if (!ClassUtil::isInstanceOf($this->className, static::$processorInterface)) {
+ if (!is_subclass_of($this->className, static::$processorInterface)) {
throw new SystemException("'".$this->className."' does not implement '".static::$processorInterface."'");
}
- if (ClassUtil::isInstanceOf($this->className, 'wcf\system\SingletonFactory')) {
+ if (is_subclass_of($this->className, 'wcf\system\SingletonFactory')) {
$this->processor = call_user_func(array($this->className, 'getInstance'));
}
else {
- if (!ClassUtil::isInstanceOf($this->className, 'wcf\data\IDatabaseObjectProcessor')) {
+ if (!is_subclass_of($this->className, 'wcf\data\IDatabaseObjectProcessor')) {
throw new SystemException("'".$this->className."' does not implement 'wcf\data\IDatabaseObjectProcessor'");
}
use wcf\data\TDatabaseObjectOptions;
use wcf\data\TDatabaseObjectPermissions;
use wcf\system\exception\SystemException;
-use wcf\util\ClassUtil;
/**
* Represents an object type.
if (!class_exists($this->className)) {
throw new SystemException("Unable to find class '".$this->className."'");
}
- if (($definitionInterface = ObjectTypeCache::getInstance()->getDefinition($this->definitionID)->interfaceName) && !ClassUtil::isInstanceOf($this->className, $definitionInterface)) {
+ if (($definitionInterface = ObjectTypeCache::getInstance()->getDefinition($this->definitionID)->interfaceName) && !is_subclass_of($this->className, $definitionInterface)) {
throw new SystemException("'".$this->className."' does not implement '".$definitionInterface."'");
}
- if (ClassUtil::isInstanceOf($this->className, 'wcf\system\SingletonFactory')) {
+ if (is_subclass_of($this->className, 'wcf\system\SingletonFactory')) {
$this->processor = call_user_func(array($this->className, 'getInstance'));
}
else {
use wcf\data\TDatabaseObjectPermissions;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
/**
* Represents a sitemap entry.
throw new SystemException("Unable to find class '".$this->className."' for sitemap '".$this->sitemapName."'");
}
- if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\sitemap\ISitemapProvider')) {
+ if (!is_subclass_of($this->className, 'wcf\system\sitemap\ISitemapProvider')) {
throw new SystemException("'".$this->className."' does not implement 'wcf\system\sitemap\ISitemapProvider'");
}
use wcf\data\DatabaseObjectDecorator;
use wcf\system\cache\builder\UserOptionCacheBuilder;
use wcf\system\exception\SystemException;
-use wcf\util\ClassUtil;
use wcf\util\StringUtil;
/**
}
// validate interface
- if (!ClassUtil::isInstanceOf($this->outputClass, 'wcf\system\option\user\IUserOptionOutput')) {
+ if (!is_subclass_of($this->outputClass, 'wcf\system\option\user\IUserOptionOutput')) {
throw new SystemException("'".$this->outputClass."' does not implement 'wcf\system\option\user\IUserOptionOutput'");
}
use wcf\data\TDatabaseObjectOptions;
use wcf\data\TDatabaseObjectPermissions;
use wcf\system\exception\SystemException;
-use wcf\util\ClassUtil;
/**
* Represents an user profile menu item.
throw new SystemException("Unable to find class '".$this->className."'");
}
- if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\SingletonFactory')) {
+ if (!is_subclass_of($this->className, 'wcf\system\SingletonFactory')) {
throw new SystemException("'".$this->className."' does not extend 'wcf\system\SingletonFactory'");
}
- if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\menu\user\profile\content\IUserProfileMenuContent')) {
+ if (!is_subclass_of($this->className, 'wcf\system\menu\user\profile\content\IUserProfileMenuContent')) {
throw new SystemException("'".$this->className."' does not implement 'wcf\system\menu\user\profile\content\IUserProfileMenuContent'");
}
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
/**
* Provides default implementations for a multiple link page.
throw new SystemException('DatabaseObjectList class name not specified.');
}
- if (!ClassUtil::isInstanceOf($this->objectListClassName, 'wcf\data\DatabaseObjectList')) {
+ if (!is_subclass_of($this->objectListClassName, 'wcf\data\DatabaseObjectList')) {
throw new SystemException("'".$this->objectListClassName."' does not extend 'wcf\data\DatabaseObjectList'");
}
use wcf\system\style\StyleHandler;
use wcf\system\template\TemplateEngine;
use wcf\system\user\storage\UserStorageHandler;
-use wcf\util\ClassUtil;
use wcf\util\FileUtil;
use wcf\util\StringUtil;
use wcf\util\UserUtil;
self::$autoloadDirectories[$abbreviation] = $packageDir . 'lib/';
$className = $abbreviation.'\system\\'.strtoupper($abbreviation).'Core';
- if (class_exists($className) && ClassUtil::isInstanceOf($className, 'wcf\system\application\IApplication')) {
+ if (class_exists($className) && is_subclass_of($className, 'wcf\system\application\IApplication')) {
// include config file
$configPath = $packageDir . PackageInstallationDispatcher::CONFIG_FILE;
if (file_exists($configPath)) {
}
if (class_exists($objectName)) {
- if (!(ClassUtil::isInstanceOf($objectName, 'wcf\system\SingletonFactory'))) {
+ if (!(is_subclass_of($objectName, 'wcf\system\SingletonFactory'))) {
throw new SystemException("class '".$objectName."' does not implement the interface 'SingletonFactory'");
}
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
use wcf\util\StringUtil;
/**
if (!class_exists($className)) {
throw new SystemException("unable to find class '".$className."'");
}
- if (!ClassUtil::isInstanceOf($className, 'wcf\system\option\user\group\IUserGroupOptionType')) {
+ if (!is_subclass_of($className, 'wcf\system\option\user\group\IUserGroupOptionType')) {
throw new SystemException("'".$className."' does not implement 'wcf\system\option\user\group\IUserGroupOptionType'");
}
use phpline\internal\Log;
use wcf\system\CLIWCF;
use wcf\system\Regex;
-use wcf\util\ClassUtil;
use wcf\util\CLIUtil;
use wcf\util\DirectoryUtil;
use wcf\util\StringUtil;
if (!$reflection->isInstantiable()) {
$invalid = true;
}
- else if (!ClassUtil::isInstanceOf($class, 'wcf\system\worker\IWorker')) {
+ else if (!is_subclass_of($class, 'wcf\system\worker\IWorker')) {
$invalid = true;
}
}
$reflection = new \ReflectionClass($class);
if (!$reflection->isInstantiable()) continue;
- if (!ClassUtil::isInstanceOf($class, 'wcf\system\worker\IWorker')) {
+ if (!is_subclass_of($class, 'wcf\system\worker\IWorker')) {
Log::info('Invalid worker file: ', $worker);
continue;
}
use wcf\system\exception\SystemException;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
/**
* Handles clipboard-related actions.
$actionClassName = $actionObject->actionClassName;
if (!isset($actions[$actionClassName])) {
// validate class
- if (!ClassUtil::isInstanceOf($actionClassName, 'wcf\system\clipboard\action\IClipboardAction')) {
+ if (!is_subclass_of($actionClassName, 'wcf\system\clipboard\action\IClipboardAction')) {
throw new SystemException("'".$actionClassName."' does not implement 'wcf\system\clipboard\action\IClipboardAction'");
}
use wcf\system\exception\SystemException;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
/**
* Provides functions to execute cronjobs.
}
// verify class signature
- if (!(ClassUtil::isInstanceOf($className, 'wcf\system\cronjob\ICronjob'))) {
+ if (!(is_subclass_of($className, 'wcf\system\cronjob\ICronjob'))) {
throw new SystemException("'".$className."' does not implement 'wcf\system\cronjob\ICronjob'");
}
use wcf\system\exception\SystemException;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
/**
* Handles dashboard boxes.
);
foreach ($boxIDs as $boxID) {
$className = $this->boxCache[$boxID]->className;
- if (!ClassUtil::isInstanceOf($className, 'wcf\system\dashboard\box\IDashboardBox')) {
+ if (!is_subclass_of($className, 'wcf\system\dashboard\box\IDashboardBox')) {
throw new SystemException("'".$className."' does not implement 'wcf\system\dashboard\box\IDashboardBox'");
}
use wcf\system\event\IEventListener as ILegacyEventListener;
use wcf\system\exception\SystemException;
use wcf\system\SingletonFactory;
-use wcf\util\ClassUtil;
/**
* EventHandler executes all registered actions for a specific event.
if (!class_exists($eventListener->listenerClassName)) {
throw new SystemException("Unable to find class '".$eventListener->listenerClassName."'");
}
- if (!ClassUtil::isInstanceOf($eventListener->listenerClassName, 'wcf\system\event\listener\IParameterizedEventListener')) {
+ if (!is_subclass_of($eventListener->listenerClassName, 'wcf\system\event\listener\IParameterizedEventListener')) {
// legacy event listeners
- if (!ClassUtil::isInstanceOf($eventListener->listenerClassName, 'wcf\system\event\IEventListener')) {
+ if (!is_subclass_of($eventListener->listenerClassName, 'wcf\system\event\IEventListener')) {
throw new SystemException("'".$eventListener->listenerClassName."' does not implement 'wcf\system\event\listener\IParameterizedEventListener'");
}
}
if (!class_exists($eventListener->listenerClassName)) {
throw new SystemException("Unable to find class '".$eventListener->listenerClassName."'");
}
- if (!ClassUtil::isInstanceOf($eventListener->listenerClassName, 'wcf\system\event\listener\IParameterizedEventListener')) {
+ if (!is_subclass_of($eventListener->listenerClassName, 'wcf\system\event\listener\IParameterizedEventListener')) {
// legacy event listeners
- if (!ClassUtil::isInstanceOf($eventListener->listenerClassName, 'wcf\system\event\IEventListener')) {
+ if (!is_subclass_of($eventListener->listenerClassName, 'wcf\system\event\IEventListener')) {
throw new SystemException("'".$eventListener->listenerClassName."' does not implement 'wcf\system\event\listener\IParameterizedEventListener'");
}
}
use wcf\system\SingletonFactory;
use wcf\system\WCF;
use wcf\util\ArrayUtil;
-use wcf\util\ClassUtil;
use wcf\util\MessageUtil;
use wcf\util\StringUtil;
$this->container = new $containerClassName($parameters['objectID']);
if (!empty($containerDecoratorClassName)) {
- if (!ClassUtil::isInstanceOf($containerDecoratorClassName, 'wcf\data\DatabaseObjectDecorator')) {
+ if (!is_subclass_of($containerDecoratorClassName, 'wcf\data\DatabaseObjectDecorator')) {
throw new SystemException("'".$containerDecoratorClassName."' does not extend 'wcf\data\DatabaseObjectDecorator'");
}
}
// update visit time (messages shouldn't occur as new upon next visit)
- if (ClassUtil::isInstanceOf($containerActionClassName, 'wcf\data\IVisitableObjectAction')) {
+ if (is_subclass_of($containerActionClassName, 'wcf\data\IVisitableObjectAction')) {
$containerAction = new $containerActionClassName(array(($this->container instanceof DatabaseObjectDecorator ? $this->container->getDecoratedObject() : $this->container)), 'markAsRead');
$containerAction->executeAction();
}
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
/**
* Default implementation for moderation queue handlers.
* @see \wcf\system\moderation\queue\IModerationQueueHandler::identifyOrphans()
*/
public function identifyOrphans(array $queues) {
- if (empty($this->className) || !class_exists($this->className) || !ClassUtil::isInstanceOf($this->className, 'wcf\data\DatabaseObject')) {
+ if (empty($this->className) || !class_exists($this->className) || !is_subclass_of($this->className, 'wcf\data\DatabaseObject')) {
throw new SystemException("DatabaseObject class name '" . $this->className . "' is missing or invalid");
}
use wcf\system\exception\SystemException;
use wcf\system\exception\UserInputException;
use wcf\system\language\I18nHandler;
-use wcf\util\ClassUtil;
use wcf\util\StringUtil;
/**
return null;
}
- if (!ClassUtil::isInstanceOf($className, 'wcf\system\option\IOptionType')) {
+ if (!is_subclass_of($className, 'wcf\system\option\IOptionType')) {
throw new SystemException("'".$className."' does not implement 'wcf\system\option\IOptionType'");
}
use wcf\system\exception\SystemException;
use wcf\system\exception\UserInputException;
use wcf\system\option\OptionHandler;
-use wcf\util\ClassUtil;
use wcf\system\WCF;
/**
if (!class_exists($className)) {
return null;
}
- if (!ClassUtil::isInstanceOf($className, 'wcf\system\option\user\group\IUserGroupOptionType')) {
+ if (!is_subclass_of($className, 'wcf\system\option\user\group\IUserGroupOptionType')) {
throw new SystemException("'".$className."' does not implement 'wcf\system\option\user\group\IUserGroupOptionType'");
}
use wcf\system\exception\UserInputException;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
use wcf\util\StringUtil;
/**
// validates against object type's class
$className = $this->cache[$objectType]->className;
- if (!ClassUtil::isInstanceOf($className, 'wcf\system\poll\IPollHandler')) {
+ if (!is_subclass_of($className, 'wcf\system\poll\IPollHandler')) {
throw new SystemException("'".$className."' does not implement 'wcf\system\poll\IPollHandler'");
}
- else if (!ClassUtil::isInstanceOf($className, 'wcf\system\SingletonFactory')) {
+ else if (!is_subclass_of($className, 'wcf\system\SingletonFactory')) {
throw new SystemException("'".$className."' does not extend 'wcf\system\SingletonFactory'");
}
use wcf\system\cache\builder\ACPSearchProviderCacheBuilder;
use wcf\system\exception\SystemException;
use wcf\system\SingletonFactory;
-use wcf\util\ClassUtil;
/**
* Handles ACP Search.
foreach ($this->cache as $acpSearchProvider) {
$className = $acpSearchProvider->className;
- if (!ClassUtil::isInstanceOf($className, 'wcf\system\search\acp\IACPSearchResultProvider')) {
+ if (!is_subclass_of($className, 'wcf\system\search\acp\IACPSearchResultProvider')) {
throw new SystemException("'".$className."' does not implement 'wcf\system\search\acp\IACPSearchResultProvider'");
}
<?php
namespace wcf\system\search\acp;
use wcf\system\exception\SystemException;
-use wcf\util\ClassUtil;
/**
* Abstract implementation of a ACP search result provider with nested categories.
*/
protected function loadCategories() {
// validate list class name
- if (empty($this->listClassName) || !ClassUtil::isInstanceOf($this->listClassName, 'wcf\data\DatabaseObjectList')) {
+ if (empty($this->listClassName) || !is_subclass_of($this->listClassName, 'wcf\data\DatabaseObjectList')) {
throw new SystemException("Given class '".$this->listClassName."' is empty or invalid");
}
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
use wcf\system\SingletonFactory;
-use wcf\util\ClassUtil;
/**
* Gets the user authentication instance.
// call loadInstance event
EventHandler::getInstance()->fireAction($this, 'init');
- if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\user\authentication\IUserAuthentication')) {
+ if (!is_subclass_of($this->className, 'wcf\system\user\authentication\IUserAuthentication')) {
throw new SystemException("'" . $this->className . "' does not implement 'wcf\system\user\authentication\IUserAuthentication'");
}
use wcf\system\request\LinkHandler;
use wcf\system\search\SearchIndexManager;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
/**
* Abstract implementation of rebuild data worker.
throw new SystemException('DatabaseObjectList class name not specified.');
}
- if (!ClassUtil::isInstanceOf($this->objectListClassName, 'wcf\data\DatabaseObjectList')) {
+ if (!is_subclass_of($this->objectListClassName, 'wcf\data\DatabaseObjectList')) {
throw new SystemException("'".$this->objectListClassName."' does not extend 'wcf\data\DatabaseObjectList'");
}
* @param string $className
* @param string $targetClass
* @return boolean
+ *
+ * @deprecated use is_subclass_of() instead
*/
public static function isInstanceOf($className, $targetClass) {
// validate parameters