本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::camelCaseToLowerCaseUnderscored方法的具体用法?PHP GeneralUtility::camelCaseToLowerCaseUnderscored怎么用?PHP GeneralUtility::camelCaseToLowerCaseUnderscored使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::camelCaseToLowerCaseUnderscored方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main function, returning the HTML content
*
* @return string HTML
*/
function main()
{
$content = '';
$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$this->installTool = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility');
$databaseUpdateUtility = $this->objectManager->get('SJBR\\StaticInfoTables\\Utility\\DatabaseUpdateUtility');
// Clear the class cache
$classCacheManager = $this->objectManager->get('SJBR\\StaticInfoTables\\Cache\\ClassCacheManager');
$classCacheManager->reBuild();
// Process the database updates of this base extension (we want to re-process these updates every time the update script is invoked)
$extensionSitePath = ExtensionManagementUtility::extPath(GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName));
$content .= '<p>' . nl2br(LocalizationUtility::translate('updateTables', $this->extensionName)) . '</p>';
$this->importStaticSqlFile($extensionSitePath);
// Get the extensions which want to extend static_info_tables
$loadedExtensions = array_unique(ExtensionManagementUtility::getLoadedExtensionListArray());
foreach ($loadedExtensions as $extensionKey) {
$extensionInfoFile = ExtensionManagementUtility::extPath($extensionKey) . 'Configuration/DomainModelExtension/StaticInfoTables.txt';
if (file_exists($extensionInfoFile)) {
// We need to reprocess the database structure update sql statements (ext_tables)
$this->processDatabaseUpdates($extensionKey);
// Now we process the static data updates (ext_tables_static+adt)
// Note: The Install Tool Utility does not handle sql update statements
$databaseUpdateUtility->doUpdate($extensionKey);
$content .= '<p>' . nl2br(LocalizationUtility::translate('updateLanguageLabels', $this->extensionName)) . ' ' . $extensionKey . '</p>';
}
}
if (!$content) {
// Nothing to do
$content .= '<p>' . nl2br(LocalizationUtility::translate('nothingToDo', $this->extensionName)) . '</p>';
}
// Notice for old language packs
$content .= '<p>' . nl2br(LocalizationUtility::translate('update.oldLanguagePacks', $this->extensionName)) . '</p>';
return $content;
}
示例2: getQueue
/**
* @param string $queueName
* @return QueueInterface
* @throws JobQueueException
*/
public function getQueue($queueName)
{
if (!isset($this->queues[$queueName])) {
$settings = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['jobqueue'];
$className = $this->extensionConfiguration->get('defaultQueue');
$options = [];
if (isset($settings[$queueName])) {
$className = isset($settings[$queueName]['className']) ? $settings[$queueName]['className'] : null;
$options = isset($settings[$queueName]['options']) ? (array) $settings[$queueName]['options'] : [];
}
if (empty($options)) {
$options = isset($settings[$className]['options']) ? (array) $settings[$className]['options'] : [];
}
if (!isset($options['timeout'])) {
$defaultTimeout = (int) $this->extensionConfiguration->get('defaultTimeout');
$options['timeout'] = $defaultTimeout > 0 ? $defaultTimeout : null;
}
if (empty($className)) {
throw new JobQueueException('No jobqueue class name configuration found.', 1448488276);
}
$classNameParts = ClassNamingUtility::explode($className);
ExtensionManagementUtility::isLoaded(GeneralUtility::camelCaseToLowerCaseUnderscored($classNameParts['extensionName']), true);
$queue = $this->objectManager->get($className, $queueName, $options);
if (!$queue instanceof QueueInterface) {
throw new JobQueueException("Queue '{$queueName}' is not a queue.", 1446318455);
}
$this->queues[$queueName] = $queue;
}
return $this->queues[$queueName];
}
示例3: prepareLoader
/**
* Get all the complex data for the loader.
* This return value will be cached and stored in the database
* There is no file monitoring for this cache
*
* @param Loader $autoLoader
* @param int $type
*
* @return array
*/
public function prepareLoader(Loader $autoLoader, $type)
{
$languageOverride = [];
if ($type === LoaderInterface::EXT_TABLES) {
return $languageOverride;
}
$languageOverridePath = ExtensionManagementUtility::extPath($autoLoader->getExtensionKey()) . 'Resources/Private/Language/Overrides/';
if (!is_dir($languageOverridePath)) {
return $languageOverride;
}
$files = GeneralUtility::getAllFilesAndFoldersInPath([], $languageOverridePath, 'xlf,php,xml', false, 99);
foreach ($files as $file) {
$file = str_replace($languageOverridePath, '', $file);
$parts = GeneralUtility::trimExplode('/', $file, true);
$extension = GeneralUtility::camelCaseToLowerCaseUnderscored($parts[0]);
unset($parts[0]);
$parts = array_values($parts);
// language
$language = 'default';
$fileParts = GeneralUtility::trimExplode('.', PathUtility::basename($file), true);
if (strlen($fileParts[0]) === 2) {
$language = $fileParts[0];
unset($fileParts[0]);
$parts[sizeof($parts) - 1] = implode('.', $fileParts);
}
$languageOverride[] = ['language' => $language, 'original' => 'EXT:' . $extension . '/' . implode('/', $parts), 'override' => 'EXT:' . $autoLoader->getExtensionKey() . '/Resources/Private/Language/Overrides/' . $file];
}
return $languageOverride;
}
示例4: evaluateCondition
/**
* This method decides if the condition is TRUE or FALSE. It can be overriden in extending viewhelpers
* to adjust functionality.
*
* @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper, allows for
* flexiblity in overriding this method.
* @return bool
*/
protected static function evaluateCondition($arguments = null)
{
$extensionName = $arguments['extensionName'];
$extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($extensionName);
$isLoaded = ExtensionManagementUtility::isLoaded($extensionKey);
return true === $isLoaded;
}
示例5: findTranslationSubKeyByExceptionClassName
/**
* Find the translation subkey based on the class name of the exception
*/
protected function findTranslationSubKeyByExceptionClassName()
{
preg_match("/_([^_]*)Exception\$/", get_class($this), $subKey);
if (!empty($subKey[1])) {
$this->subKey = \TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($subKey[1]);
}
}
示例6: resolvePath
/**
* Resolves path e.g. EXT:media/Resources/Public/foo.png or ../../foo and returns an absolute path to the given resource.
*
* @param string $resource
* @return string
*/
public static function resolvePath($resource)
{
$resource = self::canonicalPath($resource);
if (!is_file(PATH_site . $resource)) {
$resource = 'EXT:' . GeneralUtility::camelCaseToLowerCaseUnderscored(self::$extensionName) . '/Resources/Public/' . $resource;
}
return GeneralUtility::getFileAbsFileName($resource);
}
示例7: isReservedTYPO3Word
/**
*
* @param string $word
*
* @return bool
*/
public static function isReservedTYPO3Word($word)
{
if (in_array(\TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($word), self::$reservedTYPO3ColumnNames)) {
return true;
} else {
return false;
}
}
示例8: getExtensionKeyFromSettings
/**
* @return string
*/
protected function getExtensionKeyFromSettings()
{
$extensionKey = $this->configuration['extensionKey'];
if (FALSE !== strpos($extensionKey, '.')) {
$extensionKey = array_pop(explode('.', $extensionKey));
}
return GeneralUtility::camelCaseToLowerCaseUnderscored($extensionKey);
}
示例9: getExtensionKeyByModel
/**
* Get the extension key by the given model name
*
* @param string|object $modelClassName
*
* @return string
*/
public static function getExtensionKeyByModel($modelClassName)
{
if (is_object($modelClassName)) {
$modelClassName = get_class($modelClassName);
}
$matches = self::explodeObjectModelName($modelClassName);
return GeneralUtility::camelCaseToLowerCaseUnderscored($matches['extensionName']);
}
示例10: __construct
/**
* CacheUtility constructor.
*/
public function __construct()
{
parent::__construct();
$this->_extKey = GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName);
$this->_request = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Mvc\\Request');
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$this->_configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
}
示例11: render
/**
* Render
*
* Renders a valid CSS class/id name
*
* @return string
*/
public function render()
{
$name = $this->renderChildren();
$name = trim($name);
$name = \TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($name);
$name = strtolower($name);
$name = str_replace(array(' ', '_'), '-', $name);
return $name;
}
示例12: flexformSelection
/**
* @param $params
* @param $ref
*/
public function flexformSelection(&$params, &$ref)
{
$providers = self::getProviders();
$params['items'] = array();
foreach ($providers as $provider) {
$extensionName = self::getExtensionNameByClassName($provider);
$params['items'][] = array($provider, $provider, 'EXT:' . GeneralUtility::camelCaseToLowerCaseUnderscored($extensionName) . '/ext_icon.gif');
}
}
示例13: initializeAction
/**
* Initializes the controller before invoking an action method.
*
* Override this method to solve tasks which all actions have in
* common.
*
* @return void
*/
protected function initializeAction()
{
parent::initializeAction();
$this->dateTime = new \DateTime('now', new \DateTimeZone('Europe/Berlin'));
$this->extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName)]);
$this->controllerSettings = $this->settings['controllers'][$this->request->getControllerName()];
$this->actionSettings = $this->controllerSettings['actions'][$this->request->getControllerActionName()];
$this->currentPageUid = $GLOBALS['TSFE']->id;
}
示例14: render
/**
* Render method
*
* @return string
*/
public function render()
{
$extensionName = $this->arguments['extensionName'];
$extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($extensionName);
$isLoaded = ExtensionManagementUtility::isLoaded($extensionKey);
if (TRUE === $isLoaded) {
return $this->renderThenChild();
} else {
return $this->renderElseChild();
}
}
示例15: getVendorNameAndExtensionKey
/**
* @param string $qualifiedExtensionName
* @return array
*/
public static function getVendorNameAndExtensionKey($qualifiedExtensionName)
{
if (TRUE === self::hasVendorName($qualifiedExtensionName)) {
list($vendorName, $extensionKey) = GeneralUtility::trimExplode('.', $qualifiedExtensionName);
} else {
$vendorName = NULL;
$extensionKey = $qualifiedExtensionName;
}
$extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($extensionKey);
return array($vendorName, $extensionKey);
}