本文整理汇总了PHP中HDNET\Autoloader\Loader::getVendorName方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::getVendorName方法的具体用法?PHP Loader::getVendorName怎么用?PHP Loader::getVendorName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HDNET\Autoloader\Loader
的用法示例。
在下文中一共展示了Loader::getVendorName方法的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)
{
$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;
}
示例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)
{
$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;
}
示例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;
}
示例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 $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;
}
示例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)
{
$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;
}
示例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 $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;
}
示例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)
{
$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;
}
示例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)
{
$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;
}
示例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 $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;
}
示例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 $loader
* @param int $type
*
* @return array
*/
public function prepareLoader(Loader $loader, $type)
{
$return = [];
if ($type === LoaderInterface::EXT_TABLES) {
return $return;
}
$xClassesPath = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Classes/Xclass/';
$xClasses = FileUtility::getBaseFilesRecursivelyInDir($xClassesPath, 'php');
foreach ($xClasses as $xClass) {
$className = ClassNamingUtility::getFqnByPath($loader->getVendorName(), $loader->getExtensionKey(), 'Xclass/' . $xClass);
if (!$loader->isInstantiableClass($className)) {
continue;
}
$return[] = ['source' => ReflectionUtility::getParentClassName($className), 'target' => $className];
}
return $return;
}
示例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 = [];
$commandPath = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Classes/Command/';
$controllers = FileUtility::getBaseFilesInDir($commandPath, 'php');
foreach ($controllers as $controller) {
if ($controller === 'AbstractCommandController') {
continue;
}
$className = ClassNamingUtility::getFqnByPath($loader->getVendorName(), $loader->getExtensionKey(), 'Command/' . $controller);
if (!$loader->isInstantiableClass($className)) {
continue;
}
$classNames[] = $className;
}
return $classNames;
}
示例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 $loader
* @param int $type
*
* @return array
*/
public function prepareLoader(Loader $loader, $type)
{
$classNames = [];
$commandPath = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Classes/Command/';
$controllers = FileUtility::getBaseFilesInDir($commandPath, 'php');
foreach ($controllers as $controller) {
if ($controller === 'AbstractCommandController') {
continue;
}
$className = $loader->getVendorName() . '\\' . ucfirst(GeneralUtility::underscoredToUpperCamelCase($loader->getExtensionKey())) . '\\Command\\' . $controller;
if (!$loader->isInstantiableClass($className)) {
continue;
}
$classNames[] = $className;
}
return $classNames;
}
示例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)
{
$servicePath = ExtensionManagementUtility::extPath($autoLoader->getExtensionKey()) . 'Classes/Service/Json/';
$serviceClasses = FileUtility::getBaseFilesRecursivelyInDir($servicePath, 'php');
$info = [];
foreach ($serviceClasses as $service) {
$serviceClass = ClassNamingUtility::getFqnByPath($autoLoader->getVendorName(), $autoLoader->getExtensionKey(), 'Service/Json/' . $service);
$legacyServiceName = lcfirst($service);
if (array_key_exists($legacyServiceName, $info)) {
trigger_error('Service "' . $service . '" already defined in: ' . $info[$legacyServiceName] . '!"', E_USER_NOTICE);
}
$info[$legacyServiceName] = $serviceClass;
$serviceName = $autoLoader->getExtensionKey() . '/' . $service;
$info[$serviceName] = $serviceClass;
}
return $info;
}
示例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)
{
$configuration = [];
$modelPath = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Classes/Domain/Model/';
if (!is_dir($modelPath)) {
return $configuration;
}
$models = FileUtility::getBaseFilesInDir($modelPath, 'php');
foreach ($models as $model) {
$className = $loader->getVendorName() . '\\' . ucfirst(GeneralUtility::underscoredToUpperCamelCase($loader->getExtensionKey())) . '\\Domain\\Model\\' . $model;
if (SmartObjectManager::isSmartObjectClass($className)) {
$configuration[] = $className;
}
}
// already add for the following processes
$this->addClassesToSmartRegister($configuration);
return $configuration;
}
示例15: 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)
{
$return = [];
if ($type === LoaderInterface::EXT_TABLES) {
return $return;
}
$xClassesPath = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Classes/Xclass/';
$xClasses = FileUtility::getBaseFilesRecursivelyInDir($xClassesPath, 'php');
$extKey = GeneralUtility::underscoredToUpperCamelCase($loader->getExtensionKey());
foreach ($xClasses as $xClass) {
$xclassName = $loader->getVendorName() . '\\' . $extKey . '\\Xclass\\' . str_replace('/', '\\', $xClass);
if (!$loader->isInstantiableClass($xclassName)) {
continue;
}
$return[] = ['source' => ReflectionUtility::getParentClassName($xclassName), 'target' => $xclassName];
}
return $return;
}