本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::deprecationLog方法的具体用法?PHP GeneralUtility::deprecationLog怎么用?PHP GeneralUtility::deprecationLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::deprecationLog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct()
{
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
GeneralUtility::deprecationLog('PageTreeNavigationController is deprecated in favor of new pagetrees');
$GLOBALS['SOBE'] = $this;
$this->init();
}
示例2: __construct
/**
* constructor just init's the temp-file-name
*
* @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8
*/
public function __construct()
{
GeneralUtility::deprecationLog(self::class . ' is deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8');
// The file name is prefixed with "z" since the concatenator orders files per name
$this->cssTcaFile = PATH_site . SpriteManager::$tempPath . 'zextensions.css';
$this->styleSheetData = '/* Auto-Generated via ' . get_class($this) . ' */' . LF;
}
示例3: render
/**
* Render the supplied DateTime object as a formatted date.
*
* @param mixed $date \DateTime object or a string that is accepted by DateTime constructor
* @param string $format Format String which is taken to format the Date/Time
* @param bool $currentDate if true, the current date is used
* @param bool $strftime if true, the strftime is used instead of date()
* @return string Formatted date
* @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
*/
public function render($date = null, $format = '%Y-%m-%d', $currentDate = false, $strftime = true)
{
GeneralUtility::deprecationLog('The ViewHelper "format.date" of EXT:news is deprecated! Use the one of the core!');
if ($currentDate) {
if ($strftime) {
return strftime($format, $GLOBALS['EXEC_TIME']);
} else {
return date($format, $GLOBALS['EXEC_TIME']);
}
}
if ($date === null) {
$date = $this->renderChildren();
if ($date === null) {
return '';
}
}
if (!$date instanceof \DateTime) {
try {
$date = new \DateTime($date);
} catch (\Exception $exception) {
throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('"' . $date . '" could not be parsed by DateTime constructor.', 1241722579);
}
}
if ($strftime) {
$formattedDate = strftime($format, $date->format('U'));
} else {
$formattedDate = date($format, $date->format('U'));
}
return $formattedDate;
}
示例4: render
/**
* Renders a record list as known from the TYPO3 list module
* Note: This feature is experimental!
*
* @param string $tableName name of the database table
* @param array $fieldList list of fields to be displayed. If empty, only the title column (configured in $TCA[$tableName]['ctrl']['title']) is shown
* @param int $storagePid by default, records are fetched from the storage PID configured in persistence.storagePid. With this argument, the storage PID can be overwritten
* @param int $levels corresponds to the level selector of the TYPO3 list module. By default only records from the current storagePid are fetched
* @param string $filter corresponds to the "Search String" textbox of the TYPO3 list module. If not empty, only records matching the string will be fetched
* @param int $recordsPerPage amount of records to be displayed at once. Defaults to $TCA[$tableName]['interface']['maxSingleDBListItems'] or (if that's not set) to 100
* @param string $sortField table field to sort the results by
* @param bool $sortDescending if TRUE records will be sorted in descending order
* @param bool $readOnly if TRUE, the edit icons won't be shown. Otherwise edit icons will be shown, if the current BE user has edit rights for the specified table!
* @param bool $enableClickMenu enables context menu
* @param string $clickTitleMode one of "edit", "show" (only pages, tt_content), "info
* @param bool $alternateBackgroundColors Deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
* @return string the rendered record list
* @see \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList
*/
public function render($tableName, array $fieldList = array(), $storagePid = NULL, $levels = 0, $filter = '', $recordsPerPage = 0, $sortField = '', $sortDescending = FALSE, $readOnly = FALSE, $enableClickMenu = TRUE, $clickTitleMode = NULL, $alternateBackgroundColors = FALSE)
{
if ($alternateBackgroundColors) {
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('The option alternateBackgroundColors has no effect anymore and can be removed without problems. The parameter will be removed in TYPO3 CMS 8.');
}
$pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1));
/** @var $dblist \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList */
$dblist = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class);
$dblist->backPath = $GLOBALS['BACK_PATH'];
$dblist->pageRow = $pageinfo;
if ($readOnly === FALSE) {
$dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
}
$dblist->showClipboard = FALSE;
$dblist->disableSingleTableView = TRUE;
$dblist->clickTitleMode = $clickTitleMode;
$dblist->clickMenuEnabled = $enableClickMenu;
if ($storagePid === NULL) {
$frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$storagePid = $frameworkConfiguration['persistence']['storagePid'];
}
$dblist->start($storagePid, $tableName, (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pointer'), $filter, $levels, $recordsPerPage);
$dblist->allFields = TRUE;
$dblist->dontShowClipControlPanels = TRUE;
$dblist->displayFields = FALSE;
$dblist->setFields = array($tableName => $fieldList);
$dblist->noControlPanels = TRUE;
$dblist->sortField = $sortField;
$dblist->sortRev = $sortDescending;
$dblist->script = $_SERVER['REQUEST_URI'];
$dblist->generateList();
return $dblist->HTMLcode;
}
示例5: __construct
/**
* Constructor
*/
public function __construct()
{
GeneralUtility::deprecationLog('PageTreeNavigationController is deprecated in favor of new pagetrees');
$GLOBALS['SOBE'] = $this;
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
示例6: __construct
/**
* @param mixed $value
*/
public function __construct($value = null)
{
if (isset(static::$legacyValueMap[$value])) {
GeneralUtility::deprecationLog('Using ' . $value . ' for resolving conflicts in file names is deprecated. Make use of the enumeration "\\TYPO3\\CMS\\Core\\Resource\\DuplicationBehavior" instead.');
$value = static::$legacyValueMap[$value];
}
parent::__construct($value);
}
示例7: renderStatic
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
GeneralUtility::deprecationLog(sprintf('Deprecated TypoLinkViewHelper from VHS was used. Please use %s instead.', FluidTypolinkViewHelper::class));
if (null === $arguments['configuration']['additionalAttributes']) {
$arguments['configuration']['additionalAttributes'] = [];
}
return FluidTypolinkViewHelper::renderStatic($arguments['configuration'], $renderChildrenClosure, $renderingContext);
}
示例8: __construct
/**
* Constructor of a Generic component in Vidi.
*
* @param array $configuration
* @param array $legacyParameterConfiguration
*/
public function __construct($configuration = array(), $legacyParameterConfiguration = array())
{
if (is_string($configuration)) {
$configuration = $legacyParameterConfiguration;
GeneralUtility::deprecationLog('ColumnRendererAbstract: first parameter must now be an array. Please edit me in ' . get_class($this));
}
$this->configuration = $configuration;
}
示例9: render
/**
* Render content with htmlspecialchars
*
* @return string Formatted date
* @deprecated Use Tx_Fluid_ViewHelpers_Format_HtmlspecialcharsViewHelper instead
*/
public function render()
{
if (class_exists('Tx_Fluid_ViewHelpers_Format_HtmlspecialcharsViewHelper')) {
$message = 'EXT:news: Since TYPO3 4.6.0, a native ViewHelper for htmlspecialchars() ' . 'is available, use f:format.htmlspecialchars instead of n:format.hsc';
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog($message);
}
return htmlspecialchars($this->renderChildren());
}
示例10: __construct
/**
* Constructs the Statement instance
*
* @param string|\TYPO3\CMS\Core\Database\PreparedStatement $statement The statement as sql string or TYPO3\CMS\Core\Database\PreparedStatement
* @param array $boundVariables An array of variables to bind to the statement, only to be used with preparedStatement
*/
public function __construct($statement, array $boundVariables = array())
{
// @deprecated since 6.2, using $boundVariables without preparedStatement will be removed in two versions
if (!empty($boundVariables) && !$statement instanceof \TYPO3\CMS\Core\Database\PreparedStatement) {
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('Using boundVariables' . ' in Extbase\'s custom statement without using preparedStatement is' . ' deprecated since TYPO3 6.2 and will be removed in two versions.');
}
$this->statement = $statement;
$this->boundVariables = $boundVariables;
}
示例11: render
/**
* Render context sensitive help (CSH) for the given table
*
* @param string $table Table name ('_MOD_'+module name). If not set, the current module name will be used
* @param string $field Field name (CSH locallang main key)
* @param bool $iconOnly Deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
* @param string $styleAttributes Deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
* @return string the rendered CSH icon
*/
public function render($table = NULL, $field = '', $iconOnly = FALSE, $styleAttributes = '')
{
if ($iconOnly) {
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('The option iconOnly has no effect anymore and can be removed without problems. The parameter will be removed in TYPO3 CMS 8.');
}
if ($styleAttributes) {
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('The option styleAttributes has no effect anymore and can be removed without problems. The parameter will be removed in TYPO3 CMS 8.');
}
return static::renderStatic(array('table' => $table, 'field' => $field), $this->buildRenderChildrenClosure(), $this->renderingContext);
}
示例12: processData
/**
* Run migration dynamically a second time on *every* request.
* This can not be cached and is slow.
*
* @return void
*/
public function processData()
{
/** @var \TYPO3\CMS\Core\Migrations\TcaMigration $tcaMigration */
$tcaMigration = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Migrations\TcaMigration::class);
$GLOBALS['TCA'] = $tcaMigration->migrate($GLOBALS['TCA']);
$messages = $tcaMigration->getMessages();
if (!empty($messages)) {
$context = 'ext:compatibility6 did an automatic migration of TCA during boostrap. This costs performance on every' . ' call. It also means some old extensions register TCA in ext_tables.php and not in Configuration/TCA.' . ' Please adapt TCA accordingly until this message is not thrown anymore and unload extension compatibility6' . ' as soon as possible';
array_unshift($messages, $context);
GeneralUtility::deprecationLog(implode(LF, $messages));
}
}
示例13: addData
/**
* Fetch available system languages and resolve iso code if necessary.
*
* @param array $result
* @return array
* @throws \UnexpectedValueException
*/
public function addData(array $result)
{
$database = $this->getDatabase();
$languageService = $this->getLanguageService();
$pageTs = $result['pageTsConfig'];
$defaultLanguageLabel = $languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:defaultLanguage');
if (isset($pageTs['mod.']['SHARED.']['defaultLanguageLabel'])) {
$defaultLanguageLabel = $pageTs['mod.']['SHARED.']['defaultLanguageLabel'] . ' (' . $languageService->sL($defaultLanguageLabel) . ')';
}
$defaultLanguageFlag = 'empty-empty';
if (isset($pageTs['mod.']['SHARED.']['defaultLanguageFlag'])) {
$defaultLanguageFlag = 'flags-' . $pageTs['mod.']['SHARED.']['defaultLanguageFlag'];
}
$languageRows = [-1 => ['uid' => -1, 'title' => $languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:multipleLanguages'), 'iso' => 'DEF', 'flagIconIdentifier' => 'flags-multiple'], 0 => ['uid' => 0, 'title' => $defaultLanguageLabel, 'iso' => 'DEF', 'flagIconIdentifier' => $defaultLanguageFlag]];
$dbRows = $database->exec_SELECTgetRows('uid,title,language_isocode,static_lang_isocode,flag', 'sys_language', 'pid=0 AND hidden=0');
if ($dbRows === null) {
throw new \UnexpectedValueException('Database query error ' . $database->sql_error(), 1438170741);
}
$isStaticInfoTablesLoaded = ExtensionManagementUtility::isLoaded('static_info_tables');
foreach ($dbRows as $dbRow) {
$uid = $dbRow['uid'];
$languageRows[$uid] = ['uid' => $uid, 'title' => $dbRow['title'], 'flagIconIdentifier' => 'flags-' . $dbRow['flag']];
if (!empty($dbRow['language_isocode'])) {
$languageRows[$uid]['iso'] = $dbRow['language_isocode'];
} elseif ($isStaticInfoTablesLoaded && !empty($dbRow['static_lang_isocode'])) {
GeneralUtility::deprecationLog('Usage of the field "static_lang_isocode" is discouraged, and will stop working with CMS 8. Use the built-in' . ' language field "language_isocode" in your sys_language records.');
$lg_iso_2 = BackendUtility::getRecord('static_languages', $dbRow['static_lang_isocode'], 'lg_iso_2');
if ($lg_iso_2['lg_iso_2']) {
$languageRows[$uid]['iso'] = $lg_iso_2['lg_iso_2'];
}
} else {
// No iso code could be found. This is currently possible in the system but discouraged.
// So, code within FormEngine has to be suited to work with an empty iso code. However,
// it may impact certain multi language scenarios, so we add a flash message hinting for
// incomplete configuration here.
// It might be possible to convert this to a non-catchable exception later if
// it iso code is enforced on a different layer of the system (tca required + migration wizard).
// @todo: This could be relaxed again if flex form language handling is extracted,
// @todo: since the rest of the FormEngine code does not rely on iso code?
$message = sprintf($languageService->sL('LLL:EXT:lang/locallang_core.xlf:error.missingLanguageIsocode'), $dbRow['title'], $uid);
/** @var FlashMessage $flashMessage */
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $message, '', FlashMessage::ERROR);
/** @var $flashMessageService FlashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
$languageRows[$uid]['iso'] = '';
}
}
$result['systemLanguageRows'] = $languageRows;
return $result;
}
示例14: render
/**
* Converts all HTML entities to their applicable characters as needed
* using PHPs html_entity_decode() function.
*
* @param string $value string to format
* @param bool $keepQuotes if TRUE, single and double quotes won't be replaced
* @return string the altered string
* @see http://www.php.net/html_entity_decode
*/
public function render($value = null, $keepQuotes = false)
{
if (class_exists('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\HtmlentitiesDecodeViewHelper')) {
$message = 'EXT:news: Since TYPO3 4.6.0, a native ViewHelper for html_entity_decode() ' . 'is available, use f:format.htmlentitiesDecode instead of n:format.htmlEntityDecode';
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog($message);
}
if ($value === null) {
$value = $this->renderChildren();
}
if (!is_string($value)) {
return $value;
}
$flags = $keepQuotes ? ENT_NOQUOTES : ENT_COMPAT;
return html_entity_decode($value, $flags);
}
示例15: getCustomContent
/**
* Hook to add custom content
*
* @return array with additional content sections
* @deprecated Since 4.7; will be removed together with the call in indexAction and the fluid partial in 6.1
*/
protected function getCustomContent()
{
$sections = array();
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['about/index.php']['addSection'])) {
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('Hook about/index.php addSection is deprecated and will be removed in TYPO3 6.1, use fluid overrides instead.');
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['about/index.php']['addSection'] as $classRef) {
/** @var $hookObject \TYPO3\CMS\About\CustomSectionsInterface */
$hookObject = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
if (!$hookObject instanceof \TYPO3\CMS\About\CustomSectionsInterface) {
throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\About\\CustomSectionsInterface', 1298121573);
}
$hookObject->addSection($sections);
}
}
return $sections;
}