TYPO3 CMS  TYPO3_6-2
GlobalObjectDeprecationDecorator.php
Go to the documentation of this file.
1 <?php
3 
18 
26 
30  protected $className;
31 
36 
41  public function __construct($className, $deprecationMessage = NULL) {
42  $this->className = $className;
43  $this->deprecationMessage = $deprecationMessage ?: 'Usage of $GLOBALS[\'typo3CacheManager\'] and $GLOBALS[\'typo3CacheFactory\'] are deprecated since 6.2 will be removed in two versions. Use \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\'' . $this->className . '\') or dependency injection to access the singletons.';
44  }
45 
54  public function __call($methodName, $arguments) {
55  GeneralUtility::deprecationLog($this->deprecationMessage);
56  $decoratedObject = GeneralUtility::makeInstance($this->className);
57  return call_user_func_array(array($decoratedObject, $methodName), $arguments);
58  }
59 }