Esempio n. 1
0
 /**
  * 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');
     foreach ($controllers as $controller) {
         $controllerName = ClassNamingUtility::getFqnByPath($loader->getVendorName(), $loader->getExtensionKey(), 'Controller/' . $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;
 }
Esempio n. 2
0
 /**
  * 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;
 }
Esempio n. 3
0
 /**
  * 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;
 }
Esempio n. 4
0
 /**
  * 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;
 }
Esempio n. 5
0
 /**
  * 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;
 }
Esempio n. 6
0
 /**
  * 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;
 }
Esempio n. 7
0
 /**
  * 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;
 }
Esempio n. 8
0
 /**
  * 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::getBaseFilesRecursivelyInDir($modelPath, 'php');
     foreach ($models as $model) {
         $className = ClassNamingUtility::getFqnByPath($loader->getVendorName(), $loader->getExtensionKey(), 'Domain/Model/' . $model);
         if (SmartObjectManager::isSmartObjectClass($className)) {
             $configuration[] = $className;
         }
     }
     // already add for the following processes
     $this->addClassesToSmartRegister($configuration);
     return $configuration;
 }
Esempio n. 9
0
 /**
  * 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;
 }