Пример #1
0
 /**
  * Check for an alias for the given path
  * @param string $path
  * @return string
  */
 public function getAliasForPath($path)
 {
     if (!$this->configurationProvider) {
         return NULL;
     }
     return $this->configurationProvider->getSetting('aliases.' . $path);
 }
Пример #2
0
 /**
  * Tries to read the configuration from TypoScript
  *
  * @param string $path
  * @return ConfigurationInterface Returns the Configuration object or NULL if no matching configuration was found
  */
 public function createFromTypoScriptForPath($path)
 {
     $configurationData = $this->configurationProvider->getSetting('virtualObjects.' . $path);
     if (!isset($configurationData['mapping.'])) {
         return NULL;
     }
     $mapping = $configurationData['mapping.'];
     if (!isset($mapping['properties.'])) {
         return NULL;
     }
     $mergedConfigurationData = array('identifier' => $mapping['identifier'], 'tableName' => $mapping['tableName'], 'properties' => $mapping['properties.']);
     if (isset($mapping['skipUnknownProperties'])) {
         $mergedConfigurationData['skipUnknownProperties'] = $mapping['skipUnknownProperties'];
     }
     return $this->_createWithConfigurationData($mergedConfigurationData);
 }
Пример #3
0
 /**
  * @param string $uri
  * @return string
  */
 private function removePathPrefixes($uri)
 {
     $pathPrefix = getenv('TYPO3_REST_REQUEST_BASE_PATH');
     if ($pathPrefix === false) {
         $pathPrefix = $this->configurationProvider->getSetting('absRefPrefix');
     }
     return $this->removePathPrefix($uri, $pathPrefix);
 }
Пример #4
0
 /**
  * Check for an alias for the given path
  *
  * @param string $path
  * @return string
  * @deprecated
  */
 public function getAliasForPath($path)
 {
     \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
     if (!$this->configurationProvider) {
         return NULL;
     }
     return $this->configurationProvider->getSetting('aliases.' . $path);
 }
 /**
  * @test
  */
 public function getSettingDefaultTest()
 {
     $this->assertEquals('defaultValue', $this->fixture->getSetting('paths.NO.path', 'defaultValue'));
 }