当前位置: 首页>>代码示例>>PHP>>正文


PHP Loader::getExtensionKey方法代码示例

本文整理汇总了PHP中HDNET\Autoloader\Loader::getExtensionKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::getExtensionKey方法的具体用法?PHP Loader::getExtensionKey怎么用?PHP Loader::getExtensionKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HDNET\Autoloader\Loader的用法示例。


在下文中一共展示了Loader::getExtensionKey方法的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 $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');
     foreach ($slotClasses as $slot) {
         $slotClass = ClassNamingUtility::getFqnByPath($autoLoader->getVendorName(), $autoLoader->getExtensionKey(), 'Slots/' . $slot);
         if (!$autoLoader->isInstantiableClass($slotClass)) {
             continue;
         }
         $methods = ReflectionUtility::getPublicMethods($slotClass);
         foreach ($methods as $methodReflection) {
             /** @var MethodReflection $methodReflection */
             $tagConfiguration = ReflectionUtility::getTagConfiguration($methodReflection, ['signalClass', 'signalName', 'signalPriority']);
             foreach ($tagConfiguration['signalClass'] as $key => $signalClass) {
                 if (!isset($tagConfiguration['signalName'][$key])) {
                     continue;
                 }
                 $priority = isset($tagConfiguration['signalPriority'][$key]) ? $tagConfiguration['signalPriority'][$key] : 0;
                 $priority = MathUtility::forceIntegerInRange($priority, 0, 100);
                 $slots[$priority][] = ['signalClassName' => trim($signalClass, '\\'), 'signalName' => $tagConfiguration['signalName'][$key], 'slotClassNameOrObject' => $slotClass, 'slotMethodName' => $methodReflection->getName()];
             }
         }
     }
     $slots = $this->flattenSlotsByPriority($slots);
     return $slots;
 }
开发者ID:phogl,项目名称:autoloader,代码行数:37,代码来源:Slots.php

示例2: 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;
 }
开发者ID:phogl,项目名称:autoloader,代码行数:39,代码来源:LanguageOverride.php

示例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)
 {
     $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;
 }
开发者ID:jousch,项目名称:autoloader,代码行数:35,代码来源:Slots.php

示例4: 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)
 {
     $icons = [];
     if (!class_exists('TYPO3\\CMS\\Core\\Imaging\\IconRegistry')) {
         return $icons;
     }
     $iconFolder = 'Resources/Public/Icon/';
     $folder = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . $iconFolder;
     $extensionPath = ExtensionManagementUtility::extPath($loader->getExtensionKey());
     $files = GeneralUtility::getAllFilesAndFoldersInPath([], $folder, '', false, true);
     if (!sizeof($files)) {
         return $icons;
     }
     foreach ($files as $path) {
         $provider = 'TYPO3\\CMS\\Core\\Imaging\\IconProvider\\BitmapIconProvider';
         if (substr(strtolower($path), -3) === 'svg') {
             $provider = 'TYPO3\\CMS\\Core\\Imaging\\IconProvider\\SvgIconProvider';
         }
         $relativePath = str_replace($extensionPath, '', $path);
         $iconPath = str_replace($iconFolder, '', $relativePath);
         $pathElements = PathUtility::pathinfo(strtolower(str_replace('/', '-', $iconPath)));
         $icons[] = ['provider' => $provider, 'path' => 'EXT:' . $loader->getExtensionKey() . '/' . $relativePath, 'identifier' => str_replace('_', '-', $loader->getExtensionKey()) . '-' . $pathElements['filename']];
     }
     return $icons;
 }
开发者ID:Calius,项目名称:autoloader,代码行数:35,代码来源:Icon.php

示例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 $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');
     foreach ($files as $hookFile) {
         $hookClass = ClassNamingUtility::getFqnByPath($loader->getVendorName(), $loader->getExtensionKey(), '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;
 }
开发者ID:c2po,项目名称:autoloader,代码行数:37,代码来源:Hooks.php

示例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)
 {
     // We don't have to prepare anything if the extension has no smart objects
     if (!$this->extensionHasSmartObjects($loader->getExtensionKey())) {
         return [];
     }
     return $this->generateTypoScriptSetup($loader->getExtensionKey());
 }
开发者ID:Calius,项目名称:autoloader,代码行数:18,代码来源:ExtensionTypoScriptSetup.php

示例7: 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)
 {
     $scripts = [];
     $folder = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Resources/Private/Php/eID/';
     $files = FileUtility::getBaseFilesInDir($folder, 'php');
     foreach ($files as $eIdFile) {
         $scripts[] = ['name' => $eIdFile, 'path' => 'EXT:' . $loader->getExtensionKey() . '/Resources/Private/Php/eID/' . $eIdFile . '.php'];
     }
     return $scripts;
 }
开发者ID:phogl,项目名称:autoloader,代码行数:20,代码来源:ExtensionId.php

示例8: 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');
     $info = [];
     foreach ($serviceClasses as $service) {
         $serviceClass = ClassNamingUtility::getFqnByPath($autoLoader->getVendorName(), $autoLoader->getExtensionKey(), 'Service/Soap/' . $service);
         $info[lcfirst($service)] = $serviceClass;
     }
     return $info;
 }
开发者ID:c2po,项目名称:autoloader,代码行数:21,代码来源:SoapServer.php

示例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;
 }
开发者ID:jousch,项目名称:autoloader,代码行数:22,代码来源:SoapServer.php

示例10: 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);
     foreach ($converterClasses as $converterClass) {
         $converterClass = ClassNamingUtility::getFqnByPath($autoLoader->getVendorName(), $autoLoader->getExtensionKey(), 'Property/TypeConverter/' . $converterClass);
         if ($autoLoader->isInstantiableClass($converterClass)) {
             $classes[] = $converterClass;
         }
     }
     return $classes;
 }
开发者ID:c2po,项目名称:autoloader,代码行数:23,代码来源:TypeConverter.php

示例11: 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');
     foreach ($alternativeClasses as $aic) {
         $aicClass = ClassNamingUtility::getFqnByPath($loader->getVendorName(), $loader->getExtensionKey(), 'AlternativeImplementations/' . $aic);
         if (!$loader->isInstantiableClass($aicClass)) {
             continue;
         }
         $classNames[] = ['originalName' => ReflectionUtility::getParentClassName($aicClass), 'alternativeClassName' => $aicClass];
     }
     return $classNames;
 }
开发者ID:c2po,项目名称:autoloader,代码行数:24,代码来源:AlternativeImplementations.php

示例12: 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;
 }
开发者ID:jousch,项目名称:autoloader,代码行数:24,代码来源:TypeConverter.php

示例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 $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;
 }
开发者ID:jousch,项目名称:autoloader,代码行数:25,代码来源:AlternativeImplementations.php

示例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)
 {
     if ($type !== LoaderInterface::EXT_TABLES) {
         return [];
     }
     $modelInformation = $this->findTableAndModelInformationForExtension($loader->getExtensionKey());
     $loaderInformation = [];
     foreach ($modelInformation as $information) {
         $table = $information['table'];
         $path = $this->checkCshValues($loader->getExtensionKey(), $information['table'], $information['properties']);
         if ($path !== null) {
             $loaderInformation[$table] = $path;
         }
     }
     return $loaderInformation;
 }
开发者ID:phogl,项目名称:autoloader,代码行数:26,代码来源:ContextSensitiveHelps.php

示例15: loadExtensionTables

 /**
  * Run the loading process for the ext_tables.php file
  *
  * @param Loader $loader
  * @param array  $loaderInformation
  *
  * @return NULL
  */
 public function loadExtensionTables(Loader $loader, array $loaderInformation)
 {
     foreach ($loaderInformation as $tsConfig) {
         ExtensionManagementUtility::addStaticFile($loader->getExtensionKey(), $tsConfig['path'], $tsConfig['title']);
     }
     return null;
 }
开发者ID:phogl,项目名称:autoloader,代码行数:15,代码来源:StaticTyposcript.php


注:本文中的HDNET\Autoloader\Loader::getExtensionKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。