本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::underscoredToUpperCamelCase方法的具体用法?PHP GeneralUtility::underscoredToUpperCamelCase怎么用?PHP GeneralUtility::underscoredToUpperCamelCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::underscoredToUpperCamelCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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 $loader
* @param int $type
*
* @return array
*/
public function prepareLoader(Loader $loader, $type)
{
$pluginInformation = [];
$controllerPath = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Classes/Controller/';
$controllers = FileUtility::getBaseFilesRecursivelyInDir($controllerPath, 'php');
$extKey = GeneralUtility::underscoredToUpperCamelCase($loader->getExtensionKey());
foreach ($controllers as $controller) {
$controllerName = $loader->getVendorName() . '\\' . $extKey . '\\Controller\\' . str_replace('/', '\\', $controller);
if (!$loader->isInstantiableClass($controllerName)) {
continue;
}
$controllerKey = str_replace('/', '\\', $controller);
$controllerKey = str_replace('Controller', '', $controllerKey);
$methods = ReflectionUtility::getPublicMethods($controllerName);
foreach ($methods as $method) {
/** @var $method \TYPO3\CMS\Extbase\Reflection\MethodReflection */
if ($method->isTaggedWith('plugin')) {
$pluginKeys = GeneralUtility::trimExplode(' ', implode(' ', $method->getTagValues('plugin')), true);
$actionName = str_replace('Action', '', $method->getName());
foreach ($pluginKeys as $pluginKey) {
$pluginInformation = $this->addPluginInformation($pluginInformation, $pluginKey, $controllerKey, $actionName, $method->isTaggedWith('noCache'));
}
}
}
}
return $pluginInformation;
}
示例2: flexFormAutoLoader
/**
* Call this function at the end of your ext_tables.php to autoregister the flexforms
* of the extension to the given plugins.
*
* @return void
*/
public static function flexFormAutoLoader()
{
global $TCA, $_EXTKEY;
$_extConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['nn_address']);
$FlexFormPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/FlexForms/';
$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY);
$FlexForms = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($FlexFormPath, 'xml');
foreach ($FlexForms as $FlexForm) {
if (preg_match("/^Model_(.*)\$/", $FlexForm)) {
continue;
}
$fileKey = str_replace('.xml', '', $FlexForm);
$pluginSignature = strtolower($extensionName . '_' . $fileKey);
#$TCA['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'layout,select_key,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'select_key,recursive';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
$fileFlexForm = 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/' . $fileKey . '.xml';
// Any flexform dir in extension config set?
if ($_extConfig['flexFormPlugin'] != '') {
if (is_dir(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($_extConfig['flexFormPlugin']))) {
// modify the relative path
$path = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($_extConfig['flexFormPlugin']);
$path = preg_match('/^(.*)\\/$/', $path) ? $path : $path . '/';
$fileFlexForm = 'FILE:' . $path . $fileKey . '.xml';
}
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, $fileFlexForm);
}
}
示例3: addPluginFlexform
/**
* A utility method which calls ExtensionManagementUtility::addPiFlexFormValue
*
* This method performs the necessary string manipulations which are necessary
* for extbase based extensions.
*
* @param string $extensionKey Mostly $_EXTKEY
* @param string $pluginName Same value which is passed into
* Tx_Extbase_Utility_Extension::registerPlugin() as a
* second value
* @param string $flexformFile Last part of the flexform file
* without leading slash
*
* @return void
*
* @api
*/
public static function addPluginFlexform($extensionKey, $pluginName, $flexformFile)
{
$extensionName = GeneralUtility::underscoredToUpperCamelCase($extensionKey);
$pluginSignature = strtolower($extensionName . '_' . $pluginName);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, self::getFlexformFileReference($extensionKey, $flexformFile));
}
示例4: create
/**
* Returns a package instance.
*
* @param string $packagesBasePath the base install path of packages,
* @param string $packagePath path to package, relative to base path
* @param string $packageKey key / name of the package
* @param string $classesPath path to the classes directory, relative to the package path
* @param string $manifestPath path to the package's Composer manifest, relative to package path, defaults to same path
* @return \TYPO3\Flow\Package\PackageInterface
* @throws \TYPO3\Flow\Package\Exception\CorruptPackageException
*/
public function create($packagesBasePath, $packagePath, $packageKey, $classesPath, $manifestPath = '')
{
$packagePath = Files::getNormalizedPath(Files::concatenatePaths(array($packagesBasePath, $packagePath)));
$packageClassPathAndFilename = Files::concatenatePaths(array($packagePath, 'Classes/' . str_replace('.', '/', $packageKey) . '/Package.php'));
$alternativeClassPathAndFilename = Files::concatenatePaths(array($packagePath, 'Classes/Package.php'));
$packageClassPathAndFilename = @file_exists($alternativeClassPathAndFilename) ? $alternativeClassPathAndFilename : $packageClassPathAndFilename;
if (@file_exists($packageClassPathAndFilename)) {
require_once $packageClassPathAndFilename;
if (substr($packagePath, 0, strlen(PATH_typo3)) === PATH_typo3 && strpos($packageKey, '.') === FALSE) {
//TODO Remove this exception once the systextension are renamed to proper Flow naming scheme packages
$packageClassName = 'TYPO3\\CMS\\' . \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($packageKey) . '\\Package';
} else {
$packageClassName = str_replace('.', '\\', $packageKey) . '\\Package';
}
if (!class_exists($packageClassName, FALSE)) {
throw new \TYPO3\Flow\Package\Exception\CorruptPackageException(sprintf('The package "%s" does not contain a valid package class. Check if the file "%s" really contains a class called "%s".', $packageKey, $packageClassPathAndFilename, $packageClassName), 1327587092);
}
} else {
$emConfPath = Files::concatenatePaths(array($packagePath, 'ext_emconf.php'));
$packageClassName = @file_exists($emConfPath) ? 'TYPO3\\CMS\\Core\\Package\\Package' : 'TYPO3\\Flow\\Package\\Package';
}
/** @var $package \TYPO3\Flow\Package\PackageInterface */
$package = new $packageClassName($this->packageManager, $packageKey, $packagePath, $classesPath, $manifestPath);
return $package;
}
示例5: 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)
{
$slots = [];
$slotPath = ExtensionManagementUtility::extPath($autoLoader->getExtensionKey()) . 'Classes/Slots/';
$slotClasses = FileUtility::getBaseFilesInDir($slotPath, 'php');
$extKey = GeneralUtility::underscoredToUpperCamelCase($autoLoader->getExtensionKey());
foreach ($slotClasses as $slot) {
$slotClass = $autoLoader->getVendorName() . '\\' . $extKey . '\\Slots\\' . $slot;
if (!$autoLoader->isInstantiableClass($slotClass)) {
continue;
}
$methods = ReflectionUtility::getPublicMethods($slotClass);
foreach ($methods as $methodReflection) {
/** @var MethodReflection $methodReflection */
$tagConfiguration = ReflectionUtility::getTagConfiguration($methodReflection, ['signalClass', 'signalName']);
foreach ($tagConfiguration['signalClass'] as $key => $signalClass) {
if (!isset($tagConfiguration['signalName'][$key])) {
continue;
}
$slots[] = ['signalClassName' => trim($signalClass, '\\'), 'signalName' => $tagConfiguration['signalName'][$key], 'slotClassNameOrObject' => $slotClass, 'slotMethodName' => $methodReflection->getName()];
}
}
}
return $slots;
}
示例6: 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 $loader
* @param int $type
*
* @return array
*/
public function prepareLoader(Loader $loader, $type)
{
$hooks = [];
$folder = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Classes/Hooks/';
$files = FileUtility::getBaseFilesInDir($folder, 'php');
$extKey = GeneralUtility::underscoredToUpperCamelCase($loader->getExtensionKey());
foreach ($files as $hookFile) {
$hookClass = $loader->getVendorName() . '\\' . $extKey . '\\Hooks\\' . $hookFile;
if (!$loader->isInstantiableClass($hookClass)) {
continue;
}
$classReflection = ReflectionUtility::createReflectionClass($hookClass);
// add class hook
$tagConfiguration = ReflectionUtility::getTagConfiguration($classReflection, ['hook']);
if (sizeof($tagConfiguration['hook'])) {
$hooks[] = ['locations' => $tagConfiguration['hook'], 'configuration' => $hookClass];
}
// add method hooks
foreach ($classReflection->getMethods(MethodReflection::IS_PUBLIC) as $methodReflection) {
/** @var $methodReflection \TYPO3\CMS\Extbase\Reflection\MethodReflection */
$tagConfiguration = ReflectionUtility::getTagConfiguration($methodReflection, ['hook']);
if (sizeof($tagConfiguration['hook'])) {
$hooks[] = ['locations' => $tagConfiguration['hook'], 'configuration' => $hookClass . '->' . $methodReflection->getName()];
}
}
}
return $hooks;
}
示例7: render
/**
* Is {outer.{inner}} a datetime?
*
* @param object $obj
* @param string $prop Property
* @return bool
*/
public function render($obj, $prop)
{
$mixed = NULL;
if (is_object($obj) && method_exists($obj, 'get' . GeneralUtility::underscoredToUpperCamelCase($prop))) {
$mixed = $obj->{'get' . GeneralUtility::underscoredToUpperCamelCase($prop)}();
}
return method_exists($mixed, 'getTimestamp');
}
示例8: render
/**
* Solution for {outer.{inner}} problem with variables in fluid
*
* @param object $obj
* @param string $prop
* @return string
*/
public function render($obj, $prop)
{
if (is_object($obj) && method_exists($obj, 'get' . GeneralUtility::underscoredToUpperCamelCase($prop))) {
return $obj->{'get' . GeneralUtility::underscoredToUpperCamelCase($prop)}();
} elseif (is_array($obj)) {
if (array_key_exists($prop, $obj)) {
return $obj[$prop];
}
}
return NULL;
}
示例9: 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)
{
$servicePath = ExtensionManagementUtility::extPath($autoLoader->getExtensionKey()) . 'Classes/Service/Soap/';
$serviceClasses = FileUtility::getBaseFilesRecursivelyInDir($servicePath, 'php');
$extKey = GeneralUtility::underscoredToUpperCamelCase($autoLoader->getExtensionKey());
$info = [];
foreach ($serviceClasses as $service) {
$serviceClass = $autoLoader->getVendorName() . '\\' . $extKey . '\\Service\\Soap\\' . $service;
$info[lcfirst($service)] = $serviceClass;
}
return $info;
}
示例10: setOriginalResource
/**
* @param \TYPO3\CMS\Core\Resource\FileReference $originalResource
*/
public function setOriginalResource(\TYPO3\CMS\Core\Resource\FileReference $originalResource)
{
$this->originalResource = $originalResource;
# Absorb properties from original resource, because otherwise we'll get an empty sys_file_reference row.
$originalResourceProperties = $originalResource->getReferenceProperties();
foreach ($originalResourceProperties as $propertyName => $propertyValue) {
$setter = 'set' . GeneralUtility::underscoredToUpperCamelCase($propertyName);
if (method_exists($this, $setter)) {
$this->{$setter}($propertyValue);
}
}
}
示例11: indexAction
/**
* Render the content Element via ExtBase
*/
public function indexAction()
{
$extensionKey = $this->settings['extensionKey'];
$vendorName = $this->settings['vendorName'];
$name = $this->settings['contentElement'];
$data = $this->configurationManager->getContentObject()->data;
$camelCaseExtKey = GeneralUtility::underscoredToUpperCamelCase($extensionKey);
$targetObject = $vendorName . '\\' . $camelCaseExtKey . '\\Domain\\Model\\Content\\' . $name;
$model = ModelUtility::getModel($targetObject, $data);
$view = $this->createStandaloneView();
$view->assignMultiple(['data' => $data, 'object' => $model, 'settings' => $this->settings]);
return $view->render();
}
示例12: getRecurranceSubtype
public function getRecurranceSubtype($config)
{
$type = trim($config['row']['recurrance_type']);
if (empty($type)) {
return;
}
$className = 'Tx_CzSimpleCal_Recurrance_Type_' . \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($type);
$callback = array($className, 'getSubtypes');
if (!class_exists($className) || !is_callable($callback)) {
return;
}
$config['items'] = call_user_func($callback);
}
示例13: 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)
{
$classes = [];
$converterPath = ExtensionManagementUtility::extPath($autoLoader->getExtensionKey()) . 'Classes/Property/TypeConverter/';
$converterClasses = FileUtility::getBaseFilesRecursivelyInDir($converterPath, 'php', true);
$extKey = GeneralUtility::underscoredToUpperCamelCase($autoLoader->getExtensionKey());
foreach ($converterClasses as $converterClass) {
$converterClass = $autoLoader->getVendorName() . '\\' . $extKey . '\\Property\\TypeConverter\\' . str_replace('/', '\\', $converterClass);
if ($autoLoader->isInstantiableClass($converterClass)) {
$classes[] = $converterClass;
}
}
return $classes;
}
示例14: 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 $loader
* @param int $type
*
* @return array
*/
public function prepareLoader(Loader $loader, $type)
{
$classNames = [];
$alternativeImpPath = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Classes/AlternativeImplementations/';
$alternativeClasses = FileUtility::getBaseFilesInDir($alternativeImpPath, 'php');
$extKey = GeneralUtility::underscoredToUpperCamelCase($loader->getExtensionKey());
foreach ($alternativeClasses as $aic) {
$aicClass = $loader->getVendorName() . '\\' . $extKey . '\\AlternativeImplementations\\' . $aic;
if (!$loader->isInstantiableClass($aicClass)) {
continue;
}
$classNames[] = ['originalName' => ReflectionUtility::getParentClassName($aicClass), 'alternativeClassName' => $aicClass];
}
return $classNames;
}
示例15: registerPlugin
/**
* @param $pluginName
* @param $pluginTitle
* @param null $flexFormClass
*/
protected static function registerPlugin($pluginName, $pluginTitle, $flexFormClass = null)
{
ExtensionUtility::registerPlugin('BERGWERK.' . self::$_extKey, $pluginName, $pluginTitle);
if (empty($flexFormClass)) {
return;
}
/** @var FlexForm $flexFormInstance */
$flexFormInstance = new $flexFormClass();
if (!$flexFormInstance instanceof FlexForm) {
return;
}
$flexForm = $flexFormInstance->render();
$pluginSignature = strtolower(GeneralUtility::underscoredToUpperCamelCase(self::$_extKey)) . '_' . strtolower($pluginName);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, $flexForm);
}