Task #5658 ยป migrateclassnames.php

Robert Lemke, 2010-01-15 15:53

 
1
<?php
2
declare(ENCODING = 'utf-8');
3

    
4
/*                                                                        *
5
 * This script belongs to the FLOW3 package "FLOW3".                      *
6
 *                                                                        *
7
 * It is free software; you can redistribute it and/or modify it under    *
8
 * the terms of the GNU Lesser General Public License as published by the *
9
 * Free Software Foundation, either version 3 of the License, or (at your *
10
 * option) any later version.                                             *
11
 *                                                                        *
12
 * This script is distributed in the hope that it will be useful, but     *
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
14
 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
15
 * General Public License for more details.                               *
16
 *                                                                        *
17
 * You should have received a copy of the GNU Lesser General Public       *
18
 * License along with the script.                                         *
19
 * If not, see http://www.gnu.org/licenses/lgpl.html                      *
20
 *                                                                        *
21
 * The TYPO3 project - inspiring people to share!                         *
22
 *                                                                        */
23

    
24
require (__DIR__ . '/../Classes/Utility/Files.php');
25

    
26
define('FLOW3_SAPITYPE', (PHP_SAPI === 'cli' ? 'CLI' : 'Web'));
27
define('FLOW3_PATH_FLOW3', str_replace('//', '/', str_replace('\\', '/', (realpath(__DIR__ . '/../') . '/'))));
28
define('FLOW3_PATH_ROOT', realpath(FLOW3_PATH_FLOW3 . '/../../../') . '/');
29
define('FLOW3_PATH_PACKAGES', FLOW3_PATH_ROOT . 'Packages/');
30
define('FLOW3_PATH_CONFIGURATION', FLOW3_PATH_ROOT . 'Configuration/');
31

    
32
if (FLOW3_SAPITYPE !== 'CLI') exit ('This script can only be executed from the command line.');
33

    
34
$classNameReplacementMap = array(
35
	'F3\FLOW3\AOP\Exception\CircularPointcutReference' => 'F3\FLOW3\AOP\Exception\CircularPointcutReferenceException',
36
	'F3\FLOW3\AOP\Exception\InvalidArgument' => 'F3\FLOW3\AOP\Exception\InvalidArgumentException',
37
	'F3\FLOW3\AOP\Exception\InvalidConstructorSignature' => 'F3\FLOW3\AOP\Exception\InvalidConstructorSignatureException',
38
	'F3\FLOW3\AOP\Exception\InvalidPointcutExpression' => 'F3\FLOW3\AOP\Exception\InvalidPointcutExpressionException',
39
	'F3\FLOW3\AOP\Exception\InvalidTargetClass' => 'F3\FLOW3\AOP\Exception\InvalidTargetClassException',
40
	'F3\FLOW3\AOP\Exception\UnknowClass' => 'F3\FLOW3\AOP\Exception\UnknowClassException',
41
	'F3\FLOW3\AOP\Exception\UnknownPointcut' => 'F3\FLOW3\AOP\Exception\UnknownPointcutException',
42
	
43
	'F3\FLOW3\Cache\Controller\ManagerController' => 'F3\FLOW3\Cache\Controller\CacheManagerController',
44
	'F3\FLOW3\Cache\Exception\ClassAlreadyLoaded' => 'F3\FLOW3\Cache\Exception\ClassAlreadyLoadedException',
45
	'F3\FLOW3\Cache\Exception\DuplicateIdentifier' => 'F3\FLOW3\Cache\Exception\DuplicateIdentifierException',
46
	'F3\FLOW3\Cache\Exception\InvalidBackend' => 'F3\FLOW3\Cache\Exception\InvalidBackendException',
47
	'F3\FLOW3\Cache\Exception\InvalidCache' => 'F3\FLOW3\Cache\Exception\InvalidCacheException',
48
	'F3\FLOW3\Cache\Exception\InvalidData' => 'F3\FLOW3\Cache\Exception\InvalidDataException',
49
	'F3\FLOW3\Cache\Exception\NoSuchCache' => 'F3\FLOW3\Cache\Exception\NoSuchCacheException',
50
	'F3\FLOW3\Cache\Factory' => 'F3\FLOW3\Cache\CacheFactory',
51
	'F3\FLOW3\Cache\Manager' => 'F3\FLOW3\Cache\CacheManager',
52
	
53
	'F3\FLOW3\Configuration\Exception\ContainerIsLocked' => 'F3\FLOW3\Configuration\Exception\ContainerIsLockedException',
54
	'F3\FLOW3\Configuration\Exception\InvalidConfigurationType' => 'F3\FLOW3\Configuration\Exception\InvalidConfigurationTypeException',
55
	'F3\FLOW3\Configuration\Exception\NoSuchFile' => 'F3\FLOW3\Configuration\Exception\NoSuchFileException',
56
	'F3\FLOW3\Configuration\Exception\NoSuchOption' => 'F3\FLOW3\Configuration\Exception\NoSuchOptionException',
57
	'F3\FLOW3\Configuration\Exception\ParseError' => 'F3\FLOW3\Configuration\Exception\ParseErrorException',
58
	'F3\FLOW3\Configuration\Source\YAMLSource' => 'F3\FLOW3\Configuration\Source\YamlSource',
59
	'F3\FLOW3\Configuration\Manager' => 'F3\FLOW3\Configuration\ConfigurationManager',
60

    
61
	'F3\FLOW3\Locale\Exception\InvalidLocaleIdentifier' => 'F3\FLOW3\Locale\Exception\InvalidLocaleIdentifierException',
62
	'F3\FLOW3\Log\Exception\CouldNotOpenResource' => 'F3\FLOW3\Log\Exception\CouldNotOpenResourceException',
63
	'F3\FLOW3\Log\Exception\InvalidBackend' => 'F3\FLOW3\Log\Exception\InvalidBackendException',
64
	'F3\FLOW3\Log\Exception\NoSuchBackend' => 'F3\FLOW3\Log\Exception\NoSuchBackendException',
65
	'F3\FLOW3\MVC\Controller\ControllerContext' => 'F3\FLOW3\MVC\Controller\Context',
66
	'F3\FLOW3\MVC\Controller\ControllerInterface' => 'F3\FLOW3\MVC\Controller\ControllerInterface',
67
	'F3\FLOW3\MVC\Controller\Exception\InactivePackage' => 'F3\FLOW3\MVC\Controller\Exception\InactivePackageException',
68
	'F3\FLOW3\MVC\Controller\Exception\InvalidController' => 'F3\FLOW3\MVC\Controller\Exception\InvalidControllerException',
69
	'F3\FLOW3\MVC\Controller\Exception\InvalidPackage' => 'F3\FLOW3\MVC\Controller\Exception\InvalidPackageException',
70
	'F3\FLOW3\MVC\Exception\InfiniteLoop' => 'F3\FLOW3\MVC\Exception\InfiniteLoopException',
71
	'F3\FLOW3\MVC\Exception\InvalidActionName' => 'F3\FLOW3\MVC\Exception\InvalidActionNameException',
72
	'F3\FLOW3\MVC\Exception\InvalidArgumentName' => 'F3\FLOW3\MVC\Exception\InvalidArgumentNameException',
73
	'F3\FLOW3\MVC\Exception\InvalidArgumentType' => 'F3\FLOW3\MVC\Exception\InvalidArgumentTypeException',
74
	'F3\FLOW3\MVC\Exception\InvalidArgumentValue' => 'F3\FLOW3\MVC\Exception\InvalidArgumentValueException',
75
	'F3\FLOW3\MVC\Exception\InvalidController' => 'F3\FLOW3\MVC\Exception\InvalidControllerException',
76
	'F3\FLOW3\MVC\Exception\InvalidControllerName' => 'F3\FLOW3\MVC\Exception\InvalidControllerNameException',
77
	'F3\FLOW3\MVC\Exception\InvalidFormat' => 'F3\FLOW3\MVC\Exception\InvalidFormatException',
78
	'F3\FLOW3\MVC\Exception\InvalidMarker' => 'F3\FLOW3\MVC\Exception\InvalidMarkerException',
79
	'F3\FLOW3\MVC\Exception\InvalidOrMissingRequestHash' => 'F3\FLOW3\MVC\Exception\InvalidOrMissingRequestHashException',
80
	'F3\FLOW3\MVC\Exception\InvalidPackageKey' => 'F3\FLOW3\MVC\Exception\InvalidPackageKeyException',
81
	'F3\FLOW3\MVC\Exception\InvalidPart' => 'F3\FLOW3\MVC\Exception\InvalidPartException',
82
	'F3\FLOW3\MVC\Exception\InvalidRequestMethod' => 'F3\FLOW3\MVC\Exception\InvalidRequestMethodException',
83
	'F3\FLOW3\MVC\Exception\InvalidRequestType' => 'F3\FLOW3\MVC\Exception\InvalidRequestTypeException',
84
	'F3\FLOW3\MVC\Exception\InvalidRoutePartHandler' => 'F3\FLOW3\MVC\Exception\InvalidRoutePartHandlerException',
85
	'F3\FLOW3\MVC\Exception\InvalidTemplateResource' => 'F3\FLOW3\MVC\Exception\InvalidTemplateResourceException',
86
	'F3\FLOW3\MVC\Exception\InvalidUriPattern' => 'F3\FLOW3\MVC\Exception\InvalidUriPatternException',
87
	'F3\FLOW3\MVC\Exception\NoSuchAction' => 'F3\FLOW3\MVC\Exception\NoSuchActionException',
88
	'F3\FLOW3\MVC\Exception\NoSuchArgument' => 'F3\FLOW3\MVC\Exception\NoSuchArgumentException',
89
	'F3\FLOW3\MVC\Exception\NoSuchController' => 'F3\FLOW3\MVC\Exception\NoSuchControllerException',
90
	'F3\FLOW3\MVC\Exception\StopAction' => 'F3\FLOW3\MVC\Exception\StopActionException',
91
	'F3\FLOW3\MVC\Exception\UnsupportedRequestType' => 'F3\FLOW3\MVC\Exception\UnsupportedRequestTypeException',
92

    
93
	'F3\FLOW3\Object\Builder' => 'F3\FLOW3\Object\ObjectBuilder',
94
	'F3\FLOW3\Object\Exception\CannotBuildObject' => 'F3\FLOW3\Object\Exception\CannotBuildObjectException',
95
	'F3\FLOW3\Object\Exception\CannotReconstituteObject' => 'F3\FLOW3\Object\Exception\CannotReconstituteObjectException',
96
	'F3\FLOW3\Object\Exception\InvalidClass' => 'F3\FLOW3\Object\Exception\InvalidClassException',
97
	'F3\FLOW3\Object\Exception\InvalidObject' => 'F3\FLOW3\Object\Exception\InvalidObjectException',
98
	'F3\FLOW3\Object\Exception\InvalidObjectConfiguration' => 'F3\FLOW3\Object\Exception\InvalidObjectConfigurationException',
99
	'F3\FLOW3\Object\Exception\InvalidObjectName' => 'F3\FLOW3\Object\Exception\InvalidObjectNameException',
100
	'F3\FLOW3\Object\Exception\ObjectAlreadyRegistered' => 'F3\FLOW3\Object\Exception\ObjectAlreadyRegisteredException',
101
	'F3\FLOW3\Object\Exception\UnknownClass' => 'F3\FLOW3\Object\Exception\UnknownClassException',
102
	'F3\FLOW3\Object\Exception\UnknownInterface' => 'F3\FLOW3\Object\Exception\UnknownInterfaceException',
103
	'F3\FLOW3\Object\Exception\UnknownObject' => 'F3\FLOW3\Object\Exception\UnknownObjectException',
104
	'F3\FLOW3\Object\Exception\UnresolvedDependencies' => 'F3\FLOW3\Object\Exception\UnresolvedDependenciesException',
105
	'F3\FLOW3\Object\Exception\WrongScope' => 'F3\FLOW3\Object\Exception\WrongScopeException',
106
	'F3\FLOW3\Object\Factory' => 'F3\FLOW3\Object\ObjectFactory',
107
	'F3\FLOW3\Object\FactoryInterface' => 'F3\FLOW3\Object\ObjectFactoryInterface',
108
	'F3\FLOW3\Object\Manager' => 'F3\FLOW3\Object\ObjectManager',
109
	'F3\FLOW3\Object\ManagerInterface' => 'F3\FLOW3\Object\ObjectManagerInterface',
110
	'F3\FLOW3\Object\RegistryInterface' => 'F3\FLOW3\Object\RegistryInterface',
111
	'F3\FLOW3\Object\SessionRegistry' => 'F3\FLOW3\Object\SessionRegistry',
112
	'F3\FLOW3\Object\TransientRegistry' => 'F3\FLOW3\Object\TransientRegistry',
113

    
114
	'F3\FLOW3\Package\Controller\ManagerController' => 'F3\FLOW3\Package\Controller\PackageManagerController',
115
	'F3\FLOW3\Package\Exception\DuplicatePackage' => 'F3\FLOW3\Package\Exception\DuplicatePackageException',
116
	'F3\FLOW3\Package\Exception\InvalidPackageKey' => 'F3\FLOW3\Package\Exception\InvalidPackageKeyException',
117
	'F3\FLOW3\Package\Exception\InvalidPackagePath' => 'F3\FLOW3\Package\Exception\InvalidPackagePathException',
118
	'F3\FLOW3\Package\Exception\InvalidPackageState' => 'F3\FLOW3\Package\Exception\InvalidPackageStateException',
119
	'F3\FLOW3\Package\Exception\PackageKeyAlreadyExists' => 'F3\FLOW3\Package\Exception\PackageKeyAlreadyExistsException',
120
	'F3\FLOW3\Package\Exception\ProtectedPackageKey' => 'F3\FLOW3\Package\Exception\ProtectedPackageKeyException',
121
	'F3\FLOW3\Package\Exception\UnknownPackage' => 'F3\FLOW3\Package\Exception\UnknownPackageException',
122
	'F3\FLOW3\Package\Manager' => 'F3\FLOW3\Package\PackageManager',
123
	'F3\FLOW3\Package\ManagerInterface' => 'F3\FLOW3\Package\PackageManagerInterface',
124

    
125
	'F3\FLOW3\Persistence\Aspect\DirtyMonitoring' => 'F3\FLOW3\Persistence\Aspect\DirtyMonitoringAspect',
126
	'F3\FLOW3\Persistence\Exception\IllegalObjectType' => 'F3\FLOW3\Persistence\Exception\IllegalObjectTypeException',
127
	'F3\FLOW3\Persistence\Exception\MissingBackend' => 'F3\FLOW3\Persistence\Exception\MissingBackendException',
128
	'F3\FLOW3\Persistence\Exception\TooDirty' => 'F3\FLOW3\Persistence\Exception\TooDirtyException',
129
	'F3\FLOW3\Persistence\Exception\UnexpectedType' => 'F3\FLOW3\Persistence\Exception\UnexpectedTypeException',
130
	'F3\FLOW3\Persistence\Exception\UnknownObject' => 'F3\FLOW3\Persistence\Exception\UnknownObjectException',
131
	'F3\FLOW3\Persistence\Manager' => 'F3\FLOW3\Persistence\PersistenceManager',
132
	'F3\FLOW3\Persistence\ManagerInterface' => 'F3\FLOW3\Persistence\PersistenceManagerInterface',
133

    
134
	'F3\FLOW3\Property\Exception\FormatNotSupported' => 'F3\FLOW3\Property\Exception\FormatNotSupportedException',
135
	'F3\FLOW3\Property\Exception\InvalidDataType' => 'F3\FLOW3\Property\Exception\InvalidDataTypeException',
136
	'F3\FLOW3\Property\Exception\InvalidFormat' => 'F3\FLOW3\Property\Exception\InvalidFormatException',
137
	'F3\FLOW3\Property\Exception\InvalidProperty' => 'F3\FLOW3\Property\Exception\InvalidPropertyException',
138
	'F3\FLOW3\Property\Exception\InvalidSource' => 'F3\FLOW3\Property\Exception\InvalidSourceException',
139
	'F3\FLOW3\Property\Exception\InvalidTarget' => 'F3\FLOW3\Property\Exception\InvalidTargetException',
140
	'F3\FLOW3\Property\Exception\TargetNotFound' => 'F3\FLOW3\Property\Exception\TargetNotFoundException',
141

    
142
	'F3\FLOW3\Reflection\Exception\InvalidPropertyType' => 'F3\FLOW3\Reflection\Exception\InvalidPropertyTypeException',
143
	'F3\FLOW3\Reflection\Exception\UnknownClass' => 'F3\FLOW3\Reflection\Exception\UnknownClassException',
144
	'F3\FLOW3\Reflection\Service' => 'F3\FLOW3\Reflection\ReflectionService',
145

    
146
	'F3\FLOW3\Security\Authentication\ManagerInterface' => 'F3\FLOW3\Security\Authentication\AuthenticationManagerInterface',
147
	'F3\FLOW3\Security\Authentication\Provider\UsernamePasswordCR' => 'F3\FLOW3\Security\Authentication\Provider\PersistedUsernamePasswordProvider',
148
	'F3\FLOW3\Security\Authentication\ProviderInterface' => 'F3\FLOW3\Security\Authentication\AuthenticationProviderInterface',
149
	'F3\FLOW3\Security\Authentication\ProviderManager' => 'F3\FLOW3\Security\Authentication\AuthenticationProviderManager',
150
	'F3\FLOW3\Security\Authentication\ProviderResolver' => 'F3\FLOW3\Security\Authentication\AuthenticationProviderResolver',
151
	'F3\FLOW3\Security\Authorization\Voter\ACL' => 'F3\FLOW3\Security\Authorization\Voter\AclVoter',
152
	'F3\FLOW3\Security\Channel\HTTPSInterceptor' => 'F3\FLOW3\Security\Channel\HttpsInterceptor',
153
	'F3\FLOW3\Security\Channel\RequestHashService' => 'F3\FLOW3\Security\Channel\RequestHashService',
154
	'F3\FLOW3\Security\Cryptography\OpenSSLRSAKey' => 'F3\FLOW3\Security\Cryptography\OpenSslRsaKey',
155
	'F3\FLOW3\Security\Cryptography\RSAWalletServiceInterface' => 'F3\FLOW3\Security\Cryptography\RsaWalletServiceInterface',
156
	'F3\FLOW3\Security\Cryptography\RSAWalletServicePHP' => 'F3\FLOW3\Security\Cryptography\RsaWalletServicePhp',
157
	'F3\FLOW3\Security\Exception\AccessDenied' => 'F3\FLOW3\Security\Exception\AccessDeniedException',
158
	'F3\FLOW3\Security\Exception\AuthenticationRequired' => 'F3\FLOW3\Security\Exception\AuthenticationRequiredException',
159
	'F3\FLOW3\Security\Exception\CircularResourceDefinitionDetected' => 'F3\FLOW3\Security\Exception\CircularResourceDefinitionDetectedException',
160
	'F3\FLOW3\Security\Exception\DecryptionNotAllowed' => 'F3\FLOW3\Security\Exception\DecryptionNotAllowedException',
161
	'F3\FLOW3\Security\Exception\InvalidArgumentForHashGeneration' => 'F3\FLOW3\Security\Exception\InvalidArgumentForHashGenerationException',
162
	'F3\FLOW3\Security\Exception\InvalidArgumentForRequestHashGeneration' => 'F3\FLOW3\Security\Exception\InvalidArgumentForRequestHashGenerationException',
163
	'F3\FLOW3\Security\Exception\InvalidAuthenticationProvider' => 'F3\FLOW3\Security\Exception\InvalidAuthenticationProviderException',
164
	'F3\FLOW3\Security\Exception\InvalidAuthenticationStatus' => 'F3\FLOW3\Security\Exception\InvalidAuthenticationStatusException',
165
	'F3\FLOW3\Security\Exception\InvalidKeyPairID' => 'F3\FLOW3\Security\Exception\InvalidKeyPairIdException',
166
	'F3\FLOW3\Security\Exception\MissingConfiguration' => 'F3\FLOW3\Security\Exception\MissingConfigurationException',
167
	'F3\FLOW3\Security\Exception\NoAuthenticationProviderFound' => 'F3\FLOW3\Security\Exception\NoAuthenticationProviderFoundException',
168
	'F3\FLOW3\Security\Exception\NoContextAvailable' => 'F3\FLOW3\Security\Exception\NoContextAvailableException',
169
	'F3\FLOW3\Security\Exception\NoEntryInPolicy' => 'F3\FLOW3\Security\Exception\NoEntryInPolicyException',
170
	'F3\FLOW3\Security\Exception\NoEntryPointFound' => 'F3\FLOW3\Security\Exception\NoEntryPointFoundException',
171
	'F3\FLOW3\Security\Exception\NoInterceptorFound' => 'F3\FLOW3\Security\Exception\NoInterceptorFoundException',
172
	'F3\FLOW3\Security\Exception\NoRequestPatternFound' => 'F3\FLOW3\Security\Exception\NoRequestPatternFoundException',
173
	'F3\FLOW3\Security\Exception\OperationNotPermitted' => 'F3\FLOW3\Security\Exception\OperationNotPermittedException',
174
	'F3\FLOW3\Security\Exception\RequestTypeNotSupported' => 'F3\FLOW3\Security\Exception\RequestTypeNotSupportedException',
175
	'F3\FLOW3\Security\Exception\SyntacticallyWrongRequestHash' => 'F3\FLOW3\Security\Exception\SyntacticallyWrongRequestHashException',
176
	'F3\FLOW3\Security\Exception\UnsupportedAuthenticationToken' => 'F3\FLOW3\Security\Exception\UnsupportedAuthenticationTokenException',
177
	'F3\FLOW3\Security\Exception\VoterNotFound' => 'F3\FLOW3\Security\Exception\VoterNotFoundException',
178

    
179
	'F3\FLOW3\Session\Exception\DataNotSerializeable' => 'F3\FLOW3\Session\Exception\DataNotSerializeableException',
180
	'F3\FLOW3\Session\Exception\SessionAutostartIsEnabled' => 'F3\FLOW3\Session\Exception\SessionAutostartIsEnabledException',
181
	'F3\FLOW3\Session\Exception\SessionNotStarted' => 'F3\FLOW3\Session\Exception\SessionNotStartedException',
182
	'F3\FLOW3\Session\PHPSession' => 'F3\FLOW3\Session\PhpSession',
183

    
184
	'F3\FLOW3\SignalSlot\Exception\InvalidSlot' => 'F3\FLOW3\SignalSlot\Exception\InvalidSlotException',
185

    
186
	'F3\FLOW3\Validation\Exception\InvalidSubject' => 'F3\FLOW3\Validation\Exception\InvalidSubjectException',
187
	'F3\FLOW3\Validation\Exception\InvalidValidationConfiguration' => 'F3\FLOW3\Validation\Exception\InvalidValidationConfigurationException',
188
	'F3\FLOW3\Validation\Exception\InvalidValidationOptions' => 'F3\FLOW3\Validation\Exception\InvalidValidationOptionsException',
189
	'F3\FLOW3\Validation\Exception\NoSuchFilter' => 'F3\FLOW3\Validation\Exception\NoSuchFilterException',
190
	'F3\FLOW3\Validation\Exception\NoSuchValidator' => 'F3\FLOW3\Validation\Exception\NoSuchValidatorException',
191
	'F3\FLOW3\Validation\Validator\UUIDValidator' => 'F3\FLOW3\Validation\Validator\UuidValidator',
192
	'F3\FLOW3\Private\AOP\AOPProxyClassTemplate' => 'F3\FLOW3\Private\AOP\AopProxyClassTemplate',
193

    
194
	'F3\Fluid\View\Exception\InvalidTemplateResource' => 'F3\Fluid\View\Exception\InvalidTemplateResourceException',
195

    
196
	'F3\Testing\Controller\CLIController' => 'F3\Testing\Controller\CliController',
197
	'F3\TYPO3CR\Storage\Backend\PDO' => 'F3\TYPO3CR\Storage\Backend\Pdo',
198
	'F3\TYPO3CR\Storage\Search\PDO' => 'F3\TYPO3CR\Storage\Search\Pdo',
199

    
200
	'F3\YAML\YAML' => 'F3\YAML\Yaml',
201
);
202

    
203

    
204

    
205
$phpFiles = \F3\FLOW3\Utility\Files::readDirectoryRecursively(__DIR__ . '/../../../../', '.php', TRUE);
206
$yamlFiles = \F3\FLOW3\Utility\Files::readDirectoryRecursively(__DIR__ . '/../../../../', '.yaml', TRUE);
207
$xmlFiles = \F3\FLOW3\Utility\Files::readDirectoryRecursively(__DIR__ . '/../../../../', '.xml', TRUE);
208

    
209
$allPathsAndFilenames = array_merge($phpFiles, $yamlFiles, $xmlFiles);
210
unset($allPathsAndFilenames[(array_search(realpath(__FILE__), $allPathsAndFilenames))]);
211

    
212
foreach ($allPathsAndFilenames as $pathAndFilename) {
213
	echo '> ' . $pathAndFilename . chr(10);
214
	$pathInfo = pathinfo($pathAndFilename);
215
	if (!isset($pathInfo['filename'])) continue;
216

    
217
	$pathSegments = explode('/', (substr($pathAndFilename, strlen(FLOW3_PATH_PACKAGES))));
218
	if (isset($pathSegments[2]) && $pathSegments[2] === 'Resources') continue;
219

    
220
	$file = file_get_contents($pathAndFilename);
221
	$fileBackup = $file;
222
	$newPathAndFilename = $pathAndFilename;
223

    
224
	foreach ($classNameReplacementMap as $oldClassName => $newClassName) {
225
		$file = preg_replace('/([^a-zA-Z])' . str_replace('\\', '\\\\', $oldClassName) . '([^a-zA-Z])/', '$1' . $newClassName . '$2', $file);
226
	}
227
	
228
	if ($pathInfo['extension'] == 'php') {
229
		if (count($pathSegments) > 1) {
230
			list(, $packageKey) = $pathSegments;
231
			
232
			if ($pathSegments[2] == 'Classes') {
233
				$oldFullyQualifiedClassName = substr('F3\\' . $packageKey. '\\' . implode('\\', array_slice($pathSegments, 3)), 0, -4);
234
				if (isset($classNameReplacementMap[$oldFullyQualifiedClassName])) {
235
					$oldClassName = implode('', array_slice(explode('\\', $oldFullyQualifiedClassName), -1, 1));
236
					$newClassName = implode('', array_slice(explode('\\', $classNameReplacementMap[$oldFullyQualifiedClassName]), -1, 1));
237
					$file = preg_replace('/([class|interface]) ' . $oldClassName . ' /', '$1 ' . $newClassName . ' ', $file);
238
					$newPathAndFilename = $pathInfo['dirname'] . '/' . $newClassName . '.php';
239
				}
240
			} elseif ($pathSegments[2] == 'Tests') {
241
				$oldFullyQualifiedTestcaseClassName = substr('F3\\' . $packageKey. '\\' . implode('\\', array_slice($pathSegments, 4)), 0, -4);
242
				$fullyQualifiedTestSubjectClassName = substr($oldFullyQualifiedTestcaseClassName, 0, -4);
243
				if (isset($classNameReplacementMap[$fullyQualifiedTestSubjectClassName])) {
244
					$oldTestcaseClassName = implode('', array_slice(explode('\\', $oldFullyQualifiedTestcaseClassName), -1, 1));
245
					$newTestcaseClassName = implode('', array_slice(explode('\\', $classNameReplacementMap[$fullyQualifiedTestSubjectClassName] . 'Test'), -1, 1));
246
					$file = preg_replace('/(class )' . $oldTestcaseClassName . ' /', 'class ' . $newTestcaseClassName . ' ', $file);
247
					$newPathAndFilename = $pathInfo['dirname'] . '/' . $newTestcaseClassName . '.php';
248
				}
249
			}
250
		}
251
	}
252
	
253
	if ($file !== $fileBackup) {
254
		file_put_contents($pathAndFilename, $file);
255
		if ($newPathAndFilename !== $pathAndFilename) {
256
			system('svn mv ' . escapeshellarg($pathAndFilename) . ' ' . escapeshellarg($newPathAndFilename) . chr(10));
257
		}
258
	}
259

    
260
	unset($file);
261
	unset($fileBackup);
262
}
263

    
264
?>
    (1-1/1)