コード例 #1
0
 /**
  * Writes a message to the deprecation log.
  *
  * @param string $msg Message (in English).
  * @return void
  */
 public static function deprecationLog($msg)
 {
     if (!$GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) {
         return;
     }
     // Legacy values (no strict comparison, $log can be boolean, string or int)
     $log = $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'];
     if ($log === TRUE || $log == '1') {
         $log = array('file');
     } else {
         $log = self::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'], TRUE);
     }
     $date = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ': ');
     if (in_array('file', $log) !== FALSE) {
         // In case lock is acquired before autoloader was defined:
         if (class_exists('TYPO3\\CMS\\Core\\Locking\\Locker') === FALSE) {
             require_once ExtensionManagementUtility::extPath('core') . 'Classes/Locking/Locker.php';
         }
         // Write a longer message to the deprecation log
         $destination = self::getDeprecationLogFileName();
         $file = @fopen($destination, 'a');
         if ($file) {
             @fwrite($file, $date . $msg . LF);
             @fclose($file);
             self::fixPermissions($destination);
         }
     }
     if (in_array('devlog', $log) !== FALSE) {
         // Copy message also to the developer log
         self::devLog($msg, 'Core', self::SYSLOG_SEVERITY_WARNING);
     }
     // Do not use console in login screen
     if (in_array('console', $log) !== FALSE && isset($GLOBALS['BE_USER']->user['uid'])) {
         \TYPO3\CMS\Core\Utility\DebugUtility::debug($msg, $date, 'Deprecation Log');
     }
 }
コード例 #2
0
 /**
  * Adds a module path to $GLOBALS['TBE_MODULES'] for used with the module dispatcher, mod.php
  * Used only for modules that are not placed in the main/sub menu hierarchy by the traditional mechanism of addModule()
  * Examples for this is context menu functionality (like import/export) which runs as an independent module through mod.php
  * FOR USE IN ext_tables.php FILES
  * Example:  \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath('xMOD_tximpexp', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'app/');
  *
  * @param string $name The name of the module, refer to conf.php of the module.
  * @param string $path The absolute path to the module directory inside of which "index.php" and "conf.php" is found.
  * @return void
  */
 public static function addModulePath($name, $path)
 {
     if (substr($path, 0, 4) === 'EXT:') {
         list($extensionKey, $relativePath) = explode('/', substr($path, 4), 2);
         $path = ExtensionManagementUtility::extPath($extensionKey) . $relativePath;
     }
     $GLOBALS['TBE_MODULES']['_PATHS'][$name] = $path;
 }