/** * Setup * * @return void * @author Bastian Waidelich <*****@*****.**> */ public function setUp() { $this->unixStylePath = \F3\FLOW3\Utility\Files::getUnixStylePath(__DIR__); $this->unixStylePathAndFilename = \F3\FLOW3\Utility\Files::getUnixStylePath(__FILE__); \vfsStreamWrapper::register(); \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('testDirectory')); }
/** * Defines various path constants used by FLOW3 and if no root path or web root was * specified by an environment variable, exits with a respective error message. * * @return void */ public static function defineConstants() { define('FLOW3_SAPITYPE', PHP_SAPI === 'cli' ? 'CLI' : 'Web'); define('FLOW3_PATH_FLOW3', str_replace('//', '/', str_replace('\\', '/', realpath(__DIR__ . '/../../') . '/'))); if (isset($_SERVER['FLOW3_ROOTPATH'])) { $rootPath = str_replace('//', '/', str_replace('\\', '/', realpath($_SERVER['FLOW3_ROOTPATH']))) . '/'; $testPath = str_replace('//', '/', str_replace('\\', '/', realpath($rootPath . 'Packages/Framework/FLOW3'))) . '/'; if ($testPath !== FLOW3_PATH_FLOW3) { exit('FLOW3: Invalid root path. (Error #1248964375)' . PHP_EOL . '"' . $rootPath . 'Packages/Framework/FLOW3' . '" does not lead to' . PHP_EOL . '"' . FLOW3_PATH_FLOW3 . '"' . PHP_EOL); } define('FLOW3_PATH_ROOT', $rootPath); unset($rootPath); unset($testPath); } if (FLOW3_SAPITYPE === 'cli') { if (!defined('FLOW3_PATH_ROOT')) { exit('FLOW3: No root path defined in environment variable FLOW3_ROOTPATH (Error #1248964376)' . PHP_EOL); } if (!isset($_SERVER['FLOW3_WEBPATH']) || !is_dir($_SERVER['FLOW3_WEBPATH'])) { exit('FLOW3: No web path defined in environment variable FLOW3_WEBPATH or directory does not exist (Error #1249046843)' . PHP_EOL); } define('FLOW3_PATH_WEB', \F3\FLOW3\Utility\Files::getUnixStylePath(realpath($_SERVER['FLOW3_WEBPATH'])) . '/'); } else { if (!defined('FLOW3_PATH_ROOT')) { define('FLOW3_PATH_ROOT', \F3\FLOW3\Utility\Files::getUnixStylePath(realpath(dirname($_SERVER['SCRIPT_FILENAME']) . '/../')) . '/'); } define('FLOW3_PATH_WEB', \F3\FLOW3\Utility\Files::getUnixStylePath(realpath(dirname($_SERVER['SCRIPT_FILENAME']))) . '/'); } define('FLOW3_PATH_CONFIGURATION', FLOW3_PATH_ROOT . 'Configuration/'); define('FLOW3_PATH_DATA', FLOW3_PATH_ROOT . 'Data/'); define('FLOW3_PATH_PACKAGES', FLOW3_PATH_ROOT . 'Packages/'); }
/** * Processes @templateRoot, @subpackage, @controller, and @format placeholders inside $pattern. * This method is used to generate "fallback chains" for file system locations where a certain Partial can reside. * * If $bubbleControllerAndSubpackage is FALSE and $formatIsOptional is FALSE, then the resulting array will only have one element * with all the above placeholders replaced. * * If you set $bubbleControllerAndSubpackage to TRUE, then you will get an array with potentially many elements: * The first element of the array is like above. The second element has the @controller part set to "" (the empty string) * The third element now has the @controller part again stripped off, and has the last subpackage part stripped off as well. * This continues until both @subpackage and @controller are empty. * * Example for $bubbleControllerAndSubpackage is TRUE, we have the F3\MyPackage\MySubPackage\Controller\MyController as Controller Object Name and the current format is "html" * If pattern is @templateRoot/@subpackage/@controller/@action.@format, then the resulting array is: * - Resources/Private/Templates/MySubPackage/My/@action.html * - Resources/Private/Templates/MySubPackage/@action.html * - Resources/Private/Templates/@action.html * * If you set $formatIsOptional to TRUE, then for any of the above arrays, every element will be duplicated - once with @format * replaced by the current request format, and once with .@format stripped off. * * @param string $pattern Pattern to be resolved * @param boolean $bubbleControllerAndSubpackage if TRUE, then we successively split off parts from @controller and @subpackage until both are empty. * @param boolean $formatIsOptional if TRUE, then half of the resulting strings will have .@format stripped off, and the other half will have it. * @return array unix style path * @author Sebastian Kurfürst <*****@*****.**> * @author Robert Lemke <*****@*****.**> */ protected function expandGenericPathPattern($pattern, $bubbleControllerAndSubpackage, $formatIsOptional) { $pattern = str_replace('@templateRoot', $this->getTemplateRootPath(), $pattern); $pattern = str_replace('@partialRoot', $this->getPartialRootPath(), $pattern); $pattern = str_replace('@layoutRoot', $this->getLayoutRootPath(), $pattern); $subPackageKey = $this->controllerContext->getRequest()->getControllerSubpackageKey(); $controllerName = $this->controllerContext->getRequest()->getControllerName(); $subpackageParts = $subPackageKey !== '' ? explode(\F3\Fluid\Fluid::NAMESPACE_SEPARATOR, $subPackageKey) : array(); $results = array(); if ($controllerName !== NULL) { $i = -1; } else { $i = 0; } do { $temporaryPattern = $pattern; if ($i < 0) { $temporaryPattern = str_replace('@controller', $controllerName, $temporaryPattern); } else { $temporaryPattern = str_replace('//', '/', str_replace('@controller', '', $temporaryPattern)); } $temporaryPattern = str_replace('@subpackage', implode('/', $i < 0 ? $subpackageParts : array_slice($subpackageParts, $i)), $temporaryPattern); $results[] = \F3\FLOW3\Utility\Files::getUnixStylePath(str_replace('@format', $this->controllerContext->getRequest()->getFormat(), $temporaryPattern)); if ($formatIsOptional) { $results[] = \F3\FLOW3\Utility\Files::getUnixStylePath(str_replace('.@format', '', $temporaryPattern)); } } while ($i++ < count($subpackageParts) && $bubbleControllerAndSubpackage); return $results; }
/** * Creates FLOW3's temporary directory - or at least asserts that it exists and is * writable. * * @param string $temporaryDirectoryBase Full path to the base for the temporary directory * @return string The full path to the temporary directory * @throws \F3\FLOW3\Utility\Exception if the temporary directory could not be created or is not writable * @author Robert Lemke <*****@*****.**> * @author Bastian Waidelich <*****@*****.**> */ protected function createTemporaryDirectory($temporaryDirectoryBase) { $temporaryDirectoryBase = \F3\FLOW3\Utility\Files::getUnixStylePath($temporaryDirectoryBase); if (substr($temporaryDirectoryBase, -1, 1) !== '/') { $temporaryDirectoryBase .= '/'; } $maximumPathLength = $this->getMaximumPathLength(); if (strlen($temporaryDirectoryBase) > $maximumPathLength - 230) { $this->systemLogger->log('The path to your temporary directory is ' . strlen($temporaryDirectoryBase) . ' characters long. The maximum path length of your system is only ' . $maximumPathLength . '. Please consider setting the temporaryDirectoryBase option to a shorter path.', LOG_WARNING); } $processUser = extension_loaded('posix') ? posix_getpwuid(posix_geteuid()) : array('name' => 'default'); $pathHash = substr(md5(FLOW3_PATH_WEB . $this->getSAPIName() . $processUser['name'] . $this->context), 0, 12); $temporaryDirectory = $temporaryDirectoryBase . $pathHash . '/'; if (!is_dir($temporaryDirectory)) { try { \F3\FLOW3\Utility\Files::createDirectoryRecursively($temporaryDirectory); } catch (\F3\FLOW3\Error\Exception $exception) { } } if (!is_writable($temporaryDirectory)) { throw new \F3\FLOW3\Utility\Exception('The temporary directory "' . $temporaryDirectory . '" could not be created or is not writable for the current user "' . $processUser['name'] . '". Please make this directory writable or define another temporary directory by setting the respective system environment variable (eg. TMPDIR) or defining it in the FLOW3 settings.', 1216287176); } return $temporaryDirectory; }
/** * Scans all directories in the packages directories for available packages. * For each package a \F3\FLOW3\Package\ object is created and returned as * an array. * * @return void * @author Robert Lemke <*****@*****.**> */ protected function scanAvailablePackages() { $this->packages = array('FLOW3' => $this->objectFactory->create('F3\\FLOW3\\Package\\Package', 'FLOW3', FLOW3_PATH_FLOW3)); foreach (new \DirectoryIterator(FLOW3_PATH_PACKAGES) as $parentFileInfo) { $parentFilename = $parentFileInfo->getFilename(); if ($parentFilename[0] === '.' || !$parentFileInfo->isDir()) { continue; } foreach (new \DirectoryIterator($parentFileInfo->getPathname()) as $childFileInfo) { $childFilename = $childFileInfo->getFilename(); if ($childFilename[0] !== '.' && $childFilename !== 'FLOW3') { $packagePath = \F3\FLOW3\Utility\Files::getUnixStylePath($childFileInfo->getPathName()) . '/'; if (isset($this->packages[$childFilename])) { throw new \F3\FLOW3\Package\Exception\DuplicatePackageException('Detected a duplicate package, remove either "' . $this->packages[$childFilename]->getPackagePath() . '" or "' . $packagePath . '".', 1253716811); } $this->packages[$childFilename] = $this->objectFactory->create('F3\\FLOW3\\Package\\Package', $childFilename, $packagePath); } } } foreach (array_keys($this->packages) as $upperCamelCasedPackageKey) { $this->packageKeys[strtolower($upperCamelCasedPackageKey)] = $upperCamelCasedPackageKey; } }
/** * Reads all test files from base directory and subdirecotries * * @param array $testcaseFilenames array to store found testcases * @param object $testsDirectoryIterator RecursiveDirectoryIterator object * @return array Filenames of all found testcase files * @author Ronny Unger <*****@*****.**> */ protected function readDirectories(array $testcaseFilenames, $testsDirectoryIterator) { while ($testsDirectoryIterator->valid()) { if ($testsDirectoryIterator->hasChildren() && $testsDirectoryIterator->getFilename() != '.svn') { $testcaseFilenames = $this->readDirectories($testcaseFilenames, $testsDirectoryIterator->getChildren()); } if (!$testsDirectoryIterator->isDir()) { $pathAndFilename = \F3\FLOW3\Utility\Files::getUnixStylePath($testsDirectoryIterator->getPathname()); if (preg_match('/\\/' . str_replace('\\', '\\/', $this->testcaseClassName) . '\\.php/', $pathAndFilename) === 1) { $testcaseFilenames[] = $pathAndFilename; } } $testsDirectoryIterator->next(); } return $testcaseFilenames; }
/** * @test * @dataProvider pathsWithProtocol * @author Karsten Dambekalns <*****@*****.**> */ public function getUnixStylePathWorksForPathWithProtocol($path, $expected) { $this->assertEquals($expected, \F3\FLOW3\Utility\Files::getUnixStylePath($path)); }
$rootPath = str_replace('//', '/', str_replace('\\', '/', realpath($_SERVER['FLOW3_ROOTPATH']))) . '/'; $testPath = str_replace('//', '/', str_replace('\\', '/', realpath($rootPath . 'Packages/Framework/FLOW3'))) . '/'; if ($testPath !== FLOW3_PATH_FLOW3) { exit('FLOW3: Invalid root path. (Error #1248964375)' . PHP_EOL . '"' . $rootPath . 'Packages/Framework/FLOW3' . '" does not lead to' . PHP_EOL . '"' . FLOW3_PATH_FLOW3 . '"' . PHP_EOL); } define('FLOW3_PATH_ROOT', $rootPath); unset($rootPath); unset($testPath); } if (!defined('FLOW3_PATH_ROOT')) { exit('FLOW3: No root path defined in environment variable FLOW3_ROOTPATH (Error #1248964376)' . PHP_EOL); } if (!isset($_SERVER['FLOW3_WEBPATH']) || !is_dir($_SERVER['FLOW3_WEBPATH'])) { exit('FLOW3: No web path defined in environment variable FLOW3_WEBPATH or directory does not exist (Error #1249046843)' . PHP_EOL); } define('FLOW3_PATH_WEB', \F3\FLOW3\Utility\Files::getUnixStylePath(realpath($_SERVER['FLOW3_WEBPATH'])) . '/'); define('FLOW3_PATH_CONFIGURATION', FLOW3_PATH_ROOT . 'Configuration/'); define('FLOW3_PATH_DATA', FLOW3_PATH_ROOT . 'Data/'); define('FLOW3_PATH_PACKAGES', FLOW3_PATH_ROOT . 'Packages/'); echo "\nFLOW3 1.0.0 alpha 7 class names migration script.\n\nThis script scans PHP, YAML and XML files of all installed packages for\noccurrences of class and interface names which have been changed for\nFLOW3 1.0.0 alpha 7 and replaces them by the new names.\n\n"; $classNameReplacementMap = array('F3\\FLOW3\\AOP\\Exception\\CircularPointcutReference' => 'F3\\FLOW3\\AOP\\Exception\\CircularPointcutReferenceException', 'F3\\FLOW3\\AOP\\Exception\\InvalidArgument' => 'F3\\FLOW3\\AOP\\Exception\\InvalidArgumentException', 'F3\\FLOW3\\AOP\\Exception\\InvalidConstructorSignature' => 'F3\\FLOW3\\AOP\\Exception\\InvalidConstructorSignatureException', 'F3\\FLOW3\\AOP\\Exception\\InvalidPointcutExpression' => 'F3\\FLOW3\\AOP\\Exception\\InvalidPointcutExpressionException', 'F3\\FLOW3\\AOP\\Exception\\InvalidTargetClass' => 'F3\\FLOW3\\AOP\\Exception\\InvalidTargetClassException', 'F3\\FLOW3\\AOP\\Exception\\UnknowClass' => 'F3\\FLOW3\\AOP\\Exception\\UnknowClassException', 'F3\\FLOW3\\AOP\\Exception\\UnknownPointcut' => 'F3\\FLOW3\\AOP\\Exception\\UnknownPointcutException', 'F3\\FLOW3\\Cache\\Controller\\ManagerController' => 'F3\\FLOW3\\Cache\\Controller\\CacheManagerController', 'F3\\FLOW3\\Cache\\Exception\\ClassAlreadyLoaded' => 'F3\\FLOW3\\Cache\\Exception\\ClassAlreadyLoadedException', 'F3\\FLOW3\\Cache\\Exception\\DuplicateIdentifier' => 'F3\\FLOW3\\Cache\\Exception\\DuplicateIdentifierException', 'F3\\FLOW3\\Cache\\Exception\\InvalidBackend' => 'F3\\FLOW3\\Cache\\Exception\\InvalidBackendException', 'F3\\FLOW3\\Cache\\Exception\\InvalidCache' => 'F3\\FLOW3\\Cache\\Exception\\InvalidCacheException', 'F3\\FLOW3\\Cache\\Exception\\InvalidData' => 'F3\\FLOW3\\Cache\\Exception\\InvalidDataException', 'F3\\FLOW3\\Cache\\Exception\\NoSuchCache' => 'F3\\FLOW3\\Cache\\Exception\\NoSuchCacheException', 'F3\\FLOW3\\Cache\\Factory' => 'F3\\FLOW3\\Cache\\CacheFactory', 'F3\\FLOW3\\Cache\\Manager' => 'F3\\FLOW3\\Cache\\CacheManager', 'F3\\FLOW3\\Configuration\\Exception\\ContainerIsLocked' => 'F3\\FLOW3\\Configuration\\Exception\\ContainerIsLockedException', 'F3\\FLOW3\\Configuration\\Exception\\InvalidConfigurationType' => 'F3\\FLOW3\\Configuration\\Exception\\InvalidConfigurationTypeException', 'F3\\FLOW3\\Configuration\\Exception\\NoSuchFile' => 'F3\\FLOW3\\Configuration\\Exception\\NoSuchFileException', 'F3\\FLOW3\\Configuration\\Exception\\NoSuchOption' => 'F3\\FLOW3\\Configuration\\Exception\\NoSuchOptionException', 'F3\\FLOW3\\Configuration\\Exception\\ParseError' => 'F3\\FLOW3\\Configuration\\Exception\\ParseErrorException', 'F3\\FLOW3\\Configuration\\Source\\YAMLSource' => 'F3\\FLOW3\\Configuration\\Source\\YamlSource', 'F3\\FLOW3\\Configuration\\Manager' => 'F3\\FLOW3\\Configuration\\ConfigurationManager', 'F3\\FLOW3\\Locale\\Exception\\InvalidLocaleIdentifier' => 'F3\\FLOW3\\Locale\\Exception\\InvalidLocaleIdentifierException', 'F3\\FLOW3\\Log\\Exception\\CouldNotOpenResource' => 'F3\\FLOW3\\Log\\Exception\\CouldNotOpenResourceException', 'F3\\FLOW3\\Log\\Exception\\InvalidBackend' => 'F3\\FLOW3\\Log\\Exception\\InvalidBackendException', 'F3\\FLOW3\\Log\\Exception\\NoSuchBackend' => 'F3\\FLOW3\\Log\\Exception\\NoSuchBackendException', 'F3\\FLOW3\\MVC\\Controller\\ControllerContext' => 'F3\\FLOW3\\MVC\\Controller\\Context', 'F3\\FLOW3\\MVC\\Controller\\ControllerInterface' => 'F3\\FLOW3\\MVC\\Controller\\ControllerInterface', 'F3\\FLOW3\\MVC\\Controller\\Exception\\InactivePackage' => 'F3\\FLOW3\\MVC\\Controller\\Exception\\InactivePackageException', 'F3\\FLOW3\\MVC\\Controller\\Exception\\InvalidController' => 'F3\\FLOW3\\MVC\\Controller\\Exception\\InvalidControllerException', 'F3\\FLOW3\\MVC\\Controller\\Exception\\InvalidPackage' => 'F3\\FLOW3\\MVC\\Controller\\Exception\\InvalidPackageException', 'F3\\FLOW3\\MVC\\Exception\\InfiniteLoop' => 'F3\\FLOW3\\MVC\\Exception\\InfiniteLoopException', 'F3\\FLOW3\\MVC\\Exception\\InvalidActionName' => 'F3\\FLOW3\\MVC\\Exception\\InvalidActionNameException', 'F3\\FLOW3\\MVC\\Exception\\InvalidArgumentName' => 'F3\\FLOW3\\MVC\\Exception\\InvalidArgumentNameException', 'F3\\FLOW3\\MVC\\Exception\\InvalidArgumentType' => 'F3\\FLOW3\\MVC\\Exception\\InvalidArgumentTypeException', 'F3\\FLOW3\\MVC\\Exception\\InvalidArgumentValue' => 'F3\\FLOW3\\MVC\\Exception\\InvalidArgumentValueException', 'F3\\FLOW3\\MVC\\Exception\\InvalidController' => 'F3\\FLOW3\\MVC\\Exception\\InvalidControllerException', 'F3\\FLOW3\\MVC\\Exception\\InvalidControllerName' => 'F3\\FLOW3\\MVC\\Exception\\InvalidControllerNameException', 'F3\\FLOW3\\MVC\\Exception\\InvalidFormat' => 'F3\\FLOW3\\MVC\\Exception\\InvalidFormatException', 'F3\\FLOW3\\MVC\\Exception\\InvalidMarker' => 'F3\\FLOW3\\MVC\\Exception\\InvalidMarkerException', 'F3\\FLOW3\\MVC\\Exception\\InvalidOrMissingRequestHash' => 'F3\\FLOW3\\MVC\\Exception\\InvalidOrMissingRequestHashException', 'F3\\FLOW3\\MVC\\Exception\\InvalidPackageKey' => 'F3\\FLOW3\\MVC\\Exception\\InvalidPackageKeyException', 'F3\\FLOW3\\MVC\\Exception\\InvalidPart' => 'F3\\FLOW3\\MVC\\Exception\\InvalidPartException', 'F3\\FLOW3\\MVC\\Exception\\InvalidRequestMethod' => 'F3\\FLOW3\\MVC\\Exception\\InvalidRequestMethodException', 'F3\\FLOW3\\MVC\\Exception\\InvalidRequestType' => 'F3\\FLOW3\\MVC\\Exception\\InvalidRequestTypeException', 'F3\\FLOW3\\MVC\\Exception\\InvalidRoutePartHandler' => 'F3\\FLOW3\\MVC\\Exception\\InvalidRoutePartHandlerException', 'F3\\FLOW3\\MVC\\Exception\\InvalidTemplateResource' => 'F3\\FLOW3\\MVC\\Exception\\InvalidTemplateResourceException', 'F3\\FLOW3\\MVC\\Exception\\InvalidUriPattern' => 'F3\\FLOW3\\MVC\\Exception\\InvalidUriPatternException', 'F3\\FLOW3\\MVC\\Exception\\NoSuchAction' => 'F3\\FLOW3\\MVC\\Exception\\NoSuchActionException', 'F3\\FLOW3\\MVC\\Exception\\NoSuchArgument' => 'F3\\FLOW3\\MVC\\Exception\\NoSuchArgumentException', 'F3\\FLOW3\\MVC\\Exception\\NoSuchController' => 'F3\\FLOW3\\MVC\\Exception\\NoSuchControllerException', 'F3\\FLOW3\\MVC\\Exception\\StopAction' => 'F3\\FLOW3\\MVC\\Exception\\StopActionException', 'F3\\FLOW3\\MVC\\Exception\\UnsupportedRequestType' => 'F3\\FLOW3\\MVC\\Exception\\UnsupportedRequestTypeException', 'F3\\FLOW3\\Object\\Builder' => 'F3\\FLOW3\\Object\\ObjectBuilder', 'F3\\FLOW3\\Object\\Exception\\CannotBuildObject' => 'F3\\FLOW3\\Object\\Exception\\CannotBuildObjectException', 'F3\\FLOW3\\Object\\Exception\\CannotReconstituteObject' => 'F3\\FLOW3\\Object\\Exception\\CannotReconstituteObjectException', 'F3\\FLOW3\\Object\\Exception\\InvalidClass' => 'F3\\FLOW3\\Object\\Exception\\InvalidClassException', 'F3\\FLOW3\\Object\\Exception\\InvalidObject' => 'F3\\FLOW3\\Object\\Exception\\InvalidObjectException', 'F3\\FLOW3\\Object\\Exception\\InvalidObjectConfiguration' => 'F3\\FLOW3\\Object\\Exception\\InvalidObjectConfigurationException', 'F3\\FLOW3\\Object\\Exception\\InvalidObjectName' => 'F3\\FLOW3\\Object\\Exception\\InvalidObjectNameException', 'F3\\FLOW3\\Object\\Exception\\ObjectAlreadyRegistered' => 'F3\\FLOW3\\Object\\Exception\\ObjectAlreadyRegisteredException', 'F3\\FLOW3\\Object\\Exception\\UnknownClass' => 'F3\\FLOW3\\Object\\Exception\\UnknownClassException', 'F3\\FLOW3\\Object\\Exception\\UnknownInterface' => 'F3\\FLOW3\\Object\\Exception\\UnknownInterfaceException', 'F3\\FLOW3\\Object\\Exception\\UnknownObject' => 'F3\\FLOW3\\Object\\Exception\\UnknownObjectException', 'F3\\FLOW3\\Object\\Exception\\UnresolvedDependencies' => 'F3\\FLOW3\\Object\\Exception\\UnresolvedDependenciesException', 'F3\\FLOW3\\Object\\Exception\\WrongScope' => 'F3\\FLOW3\\Object\\Exception\\WrongScopeException', 'F3\\FLOW3\\Object\\Factory' => 'F3\\FLOW3\\Object\\ObjectFactory', 'F3\\FLOW3\\Object\\FactoryInterface' => 'F3\\FLOW3\\Object\\ObjectFactoryInterface', 'F3\\FLOW3\\Object\\Manager' => 'F3\\FLOW3\\Object\\ObjectManager', 'F3\\FLOW3\\Object\\ManagerInterface' => 'F3\\FLOW3\\Object\\ObjectManagerInterface', 'F3\\FLOW3\\Object\\RegistryInterface' => 'F3\\FLOW3\\Object\\RegistryInterface', 'F3\\FLOW3\\Object\\SessionRegistry' => 'F3\\FLOW3\\Object\\SessionRegistry', 'F3\\FLOW3\\Object\\TransientRegistry' => 'F3\\FLOW3\\Object\\TransientRegistry', 'F3\\FLOW3\\Package\\Controller\\ManagerController' => 'F3\\FLOW3\\Package\\Controller\\PackageManagerController', 'F3\\FLOW3\\Package\\Exception\\DuplicatePackage' => 'F3\\FLOW3\\Package\\Exception\\DuplicatePackageException', 'F3\\FLOW3\\Package\\Exception\\InvalidPackageKey' => 'F3\\FLOW3\\Package\\Exception\\InvalidPackageKeyException', 'F3\\FLOW3\\Package\\Exception\\InvalidPackagePath' => 'F3\\FLOW3\\Package\\Exception\\InvalidPackagePathException', 'F3\\FLOW3\\Package\\Exception\\InvalidPackageState' => 'F3\\FLOW3\\Package\\Exception\\InvalidPackageStateException', 'F3\\FLOW3\\Package\\Exception\\PackageKeyAlreadyExists' => 'F3\\FLOW3\\Package\\Exception\\PackageKeyAlreadyExistsException', 'F3\\FLOW3\\Package\\Exception\\ProtectedPackageKey' => 'F3\\FLOW3\\Package\\Exception\\ProtectedPackageKeyException', 'F3\\FLOW3\\Package\\Exception\\UnknownPackage' => 'F3\\FLOW3\\Package\\Exception\\UnknownPackageException', 'F3\\FLOW3\\Package\\Manager' => 'F3\\FLOW3\\Package\\PackageManager', 'F3\\FLOW3\\Package\\ManagerInterface' => 'F3\\FLOW3\\Package\\PackageManagerInterface', 'F3\\FLOW3\\Persistence\\Aspect\\DirtyMonitoring' => 'F3\\FLOW3\\Persistence\\Aspect\\DirtyMonitoringAspect', 'F3\\FLOW3\\Persistence\\Exception\\IllegalObjectType' => 'F3\\FLOW3\\Persistence\\Exception\\IllegalObjectTypeException', 'F3\\FLOW3\\Persistence\\Exception\\MissingBackend' => 'F3\\FLOW3\\Persistence\\Exception\\MissingBackendException', 'F3\\FLOW3\\Persistence\\Exception\\TooDirty' => 'F3\\FLOW3\\Persistence\\Exception\\TooDirtyException', 'F3\\FLOW3\\Persistence\\Exception\\UnexpectedType' => 'F3\\FLOW3\\Persistence\\Exception\\UnexpectedTypeException', 'F3\\FLOW3\\Persistence\\Exception\\UnknownObject' => 'F3\\FLOW3\\Persistence\\Exception\\UnknownObjectException', 'F3\\FLOW3\\Persistence\\Manager' => 'F3\\FLOW3\\Persistence\\PersistenceManager', 'F3\\FLOW3\\Persistence\\ManagerInterface' => 'F3\\FLOW3\\Persistence\\PersistenceManagerInterface', 'F3\\FLOW3\\Property\\Exception\\FormatNotSupported' => 'F3\\FLOW3\\Property\\Exception\\FormatNotSupportedException', 'F3\\FLOW3\\Property\\Exception\\InvalidDataType' => 'F3\\FLOW3\\Property\\Exception\\InvalidDataTypeException', 'F3\\FLOW3\\Property\\Exception\\InvalidFormat' => 'F3\\FLOW3\\Property\\Exception\\InvalidFormatException', 'F3\\FLOW3\\Property\\Exception\\InvalidProperty' => 'F3\\FLOW3\\Property\\Exception\\InvalidPropertyException', 'F3\\FLOW3\\Property\\Exception\\InvalidSource' => 'F3\\FLOW3\\Property\\Exception\\InvalidSourceException', 'F3\\FLOW3\\Property\\Exception\\InvalidTarget' => 'F3\\FLOW3\\Property\\Exception\\InvalidTargetException', 'F3\\FLOW3\\Property\\Exception\\TargetNotFound' => 'F3\\FLOW3\\Property\\Exception\\TargetNotFoundException', 'F3\\FLOW3\\Reflection\\Exception\\InvalidPropertyType' => 'F3\\FLOW3\\Reflection\\Exception\\InvalidPropertyTypeException', 'F3\\FLOW3\\Reflection\\Exception\\UnknownClass' => 'F3\\FLOW3\\Reflection\\Exception\\UnknownClassException', 'F3\\FLOW3\\Reflection\\Service' => 'F3\\FLOW3\\Reflection\\ReflectionService', 'F3\\FLOW3\\Security\\Authentication\\ManagerInterface' => 'F3\\FLOW3\\Security\\Authentication\\AuthenticationManagerInterface', 'F3\\FLOW3\\Security\\Authentication\\Provider\\UsernamePasswordCR' => 'F3\\FLOW3\\Security\\Authentication\\Provider\\PersistedUsernamePasswordProvider', 'F3\\FLOW3\\Security\\Authentication\\ProviderInterface' => 'F3\\FLOW3\\Security\\Authentication\\AuthenticationProviderInterface', 'F3\\FLOW3\\Security\\Authentication\\ProviderManager' => 'F3\\FLOW3\\Security\\Authentication\\AuthenticationProviderManager', 'F3\\FLOW3\\Security\\Authentication\\ProviderResolver' => 'F3\\FLOW3\\Security\\Authentication\\AuthenticationProviderResolver', 'F3\\FLOW3\\Security\\Authorization\\Voter\\ACL' => 'F3\\FLOW3\\Security\\Authorization\\Voter\\AclVoter', 'F3\\FLOW3\\Security\\Channel\\HTTPSInterceptor' => 'F3\\FLOW3\\Security\\Channel\\HttpsInterceptor', 'F3\\FLOW3\\Security\\Channel\\RequestHashService' => 'F3\\FLOW3\\Security\\Channel\\RequestHashService', 'F3\\FLOW3\\Security\\Cryptography\\OpenSSLRSAKey' => 'F3\\FLOW3\\Security\\Cryptography\\OpenSslRsaKey', 'F3\\FLOW3\\Security\\Cryptography\\RSAWalletServiceInterface' => 'F3\\FLOW3\\Security\\Cryptography\\RsaWalletServiceInterface', 'F3\\FLOW3\\Security\\Cryptography\\RSAWalletServicePHP' => 'F3\\FLOW3\\Security\\Cryptography\\RsaWalletServicePhp', 'F3\\FLOW3\\Security\\Exception\\AccessDenied' => 'F3\\FLOW3\\Security\\Exception\\AccessDeniedException', 'F3\\FLOW3\\Security\\Exception\\AuthenticationRequired' => 'F3\\FLOW3\\Security\\Exception\\AuthenticationRequiredException', 'F3\\FLOW3\\Security\\Exception\\CircularResourceDefinitionDetected' => 'F3\\FLOW3\\Security\\Exception\\CircularResourceDefinitionDetectedException', 'F3\\FLOW3\\Security\\Exception\\DecryptionNotAllowed' => 'F3\\FLOW3\\Security\\Exception\\DecryptionNotAllowedException', 'F3\\FLOW3\\Security\\Exception\\InvalidArgumentForHashGeneration' => 'F3\\FLOW3\\Security\\Exception\\InvalidArgumentForHashGenerationException', 'F3\\FLOW3\\Security\\Exception\\InvalidArgumentForRequestHashGeneration' => 'F3\\FLOW3\\Security\\Exception\\InvalidArgumentForRequestHashGenerationException', 'F3\\FLOW3\\Security\\Exception\\InvalidAuthenticationProvider' => 'F3\\FLOW3\\Security\\Exception\\InvalidAuthenticationProviderException', 'F3\\FLOW3\\Security\\Exception\\InvalidAuthenticationStatus' => 'F3\\FLOW3\\Security\\Exception\\InvalidAuthenticationStatusException', 'F3\\FLOW3\\Security\\Exception\\InvalidKeyPairID' => 'F3\\FLOW3\\Security\\Exception\\InvalidKeyPairIdException', 'F3\\FLOW3\\Security\\Exception\\MissingConfiguration' => 'F3\\FLOW3\\Security\\Exception\\MissingConfigurationException', 'F3\\FLOW3\\Security\\Exception\\NoAuthenticationProviderFound' => 'F3\\FLOW3\\Security\\Exception\\NoAuthenticationProviderFoundException', 'F3\\FLOW3\\Security\\Exception\\NoContextAvailable' => 'F3\\FLOW3\\Security\\Exception\\NoContextAvailableException', 'F3\\FLOW3\\Security\\Exception\\NoEntryInPolicy' => 'F3\\FLOW3\\Security\\Exception\\NoEntryInPolicyException', 'F3\\FLOW3\\Security\\Exception\\NoEntryPointFound' => 'F3\\FLOW3\\Security\\Exception\\NoEntryPointFoundException', 'F3\\FLOW3\\Security\\Exception\\NoInterceptorFound' => 'F3\\FLOW3\\Security\\Exception\\NoInterceptorFoundException', 'F3\\FLOW3\\Security\\Exception\\NoRequestPatternFound' => 'F3\\FLOW3\\Security\\Exception\\NoRequestPatternFoundException', 'F3\\FLOW3\\Security\\Exception\\OperationNotPermitted' => 'F3\\FLOW3\\Security\\Exception\\OperationNotPermittedException', 'F3\\FLOW3\\Security\\Exception\\RequestTypeNotSupported' => 'F3\\FLOW3\\Security\\Exception\\RequestTypeNotSupportedException', 'F3\\FLOW3\\Security\\Exception\\SyntacticallyWrongRequestHash' => 'F3\\FLOW3\\Security\\Exception\\SyntacticallyWrongRequestHashException', 'F3\\FLOW3\\Security\\Exception\\UnsupportedAuthenticationToken' => 'F3\\FLOW3\\Security\\Exception\\UnsupportedAuthenticationTokenException', 'F3\\FLOW3\\Security\\Exception\\VoterNotFound' => 'F3\\FLOW3\\Security\\Exception\\VoterNotFoundException', 'F3\\FLOW3\\Session\\Exception\\DataNotSerializeable' => 'F3\\FLOW3\\Session\\Exception\\DataNotSerializeableException', 'F3\\FLOW3\\Session\\Exception\\SessionAutostartIsEnabled' => 'F3\\FLOW3\\Session\\Exception\\SessionAutostartIsEnabledException', 'F3\\FLOW3\\Session\\Exception\\SessionNotStarted' => 'F3\\FLOW3\\Session\\Exception\\SessionNotStartedException', 'F3\\FLOW3\\Session\\PHPSession' => 'F3\\FLOW3\\Session\\PhpSession', 'F3\\FLOW3\\SignalSlot\\Exception\\InvalidSlot' => 'F3\\FLOW3\\SignalSlot\\Exception\\InvalidSlotException', 'F3\\FLOW3\\Validation\\Exception\\InvalidSubject' => 'F3\\FLOW3\\Validation\\Exception\\InvalidSubjectException', 'F3\\FLOW3\\Validation\\Exception\\InvalidValidationConfiguration' => 'F3\\FLOW3\\Validation\\Exception\\InvalidValidationConfigurationException', 'F3\\FLOW3\\Validation\\Exception\\InvalidValidationOptions' => 'F3\\FLOW3\\Validation\\Exception\\InvalidValidationOptionsException', 'F3\\FLOW3\\Validation\\Exception\\NoSuchFilter' => 'F3\\FLOW3\\Validation\\Exception\\NoSuchFilterException', 'F3\\FLOW3\\Validation\\Exception\\NoSuchValidator' => 'F3\\FLOW3\\Validation\\Exception\\NoSuchValidatorException', 'F3\\FLOW3\\Validation\\Validator\\UUIDValidator' => 'F3\\FLOW3\\Validation\\Validator\\UuidValidator', 'F3\\FLOW3\\Private\\AOP\\AOPProxyClassTemplate' => 'F3\\FLOW3\\Private\\AOP\\AopProxyClassTemplate', 'F3\\Fluid\\View\\Exception\\InvalidTemplateResource' => 'F3\\Fluid\\View\\Exception\\InvalidTemplateResourceException', 'F3\\Testing\\Controller\\CLIController' => 'F3\\Testing\\Controller\\CliController', 'F3\\TYPO3CR\\Storage\\Backend\\PDO' => 'F3\\TYPO3CR\\Storage\\Backend\\Pdo', 'F3\\TYPO3CR\\Storage\\Search\\PDO' => 'F3\\TYPO3CR\\Storage\\Search\\Pdo', 'F3\\YAML\\YAML' => 'F3\\YAML\\Yaml'); $phpFiles = \F3\FLOW3\Utility\Files::readDirectoryRecursively(FLOW3_PATH_PACKAGES, '.php', TRUE); $yamlFiles = \F3\FLOW3\Utility\Files::readDirectoryRecursively(FLOW3_PATH_PACKAGES, '.yaml', TRUE); $xmlFiles = \F3\FLOW3\Utility\Files::readDirectoryRecursively(FLOW3_PATH_PACKAGES, '.xml', TRUE); $configurationFiles = \F3\FLOW3\Utility\Files::readDirectoryRecursively(FLOW3_PATH_CONFIGURATION, '.yaml', TRUE); $allPathsAndFilenames = array_merge($phpFiles, $yamlFiles, $xmlFiles, $configurationFiles); foreach ($allPathsAndFilenames as $pathAndFilename) { $pathInfo = pathinfo($pathAndFilename); if (!isset($pathInfo['filename'])) { continue; }
/** * Adds the specified directory to the list of directories to be monitored. * All files in these directories will be monitored too. * * @param string $path Absolute path of the directory to monitor * @return void * @author Robert Lemke <*****@*****.**> * @api */ public function monitorDirectory($path) { if (!is_string($path)) { throw new \InvalidArgumentException('String expected, ' . gettype($path), ' given.', 1231171810); } $path = rtrim(\F3\FLOW3\Utility\Files::getUnixStylePath($path), '/'); if (array_search($path, $this->monitoredDirectories) === FALSE) { $this->monitoredDirectories[] = $path; } }
/** * FIXME do we test something like this? * @test * @author Christopher Hlubek <*****@*****.**> */ public function getLocalPackagesPathReturnsPathToLocalPackagesDirectory() { $this->markTestSkipped('needs proper rework using vfs'); $packagesPath = $this->packageManager->getLocalPackagesPath(); $this->assertEquals(\F3\FLOW3\Utility\Files::getUnixStylePath(realpath(FLOW3_PATH_PACKAGES . '../Packages/Application/') . '/'), $packagesPath); }