[RELEASE] Release of TYPO3 6.1.0alpha1
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Core / SystemEnvironmentBuilder.php
1 <?php
2 namespace TYPO3\CMS\Core\Core;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the textfile GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29
30 /**
31 * Class to encapsulate base setup of bootstrap.
32 *
33 * This class contains all code that must be executed by every entry script.
34 *
35 * It sets up all basic paths, constants, global variables and checks
36 * the basic environment TYPO3 runs in.
37 *
38 * This class does not use any TYPO3 instance specific configuration, it only
39 * sets up things based on the server environment and core code. Even with a
40 * missing typo3conf/localconf.php this script will be successful.
41 *
42 * The script aborts execution with an error message if
43 * some part fails or conditions are not met.
44 *
45 * This script is internal code and subject to change.
46 * DO NOT use it in own code, or be prepared your code might
47 * break in future versions of the core.
48 */
49 class SystemEnvironmentBuilder {
50
51 /**
52 * Run base setup.
53 * This entry method is used in all scopes (FE, BE, eid, ajax, ...)
54 *
55 * @internal This method should not be used by 3rd party code. It will change without further notice.
56 * @param string $relativePathPart Relative path of the entry script back to document root
57 * @return void
58 */
59 static public function run($relativePathPart = '') {
60 self::ensureRequiredEnvironment();
61 self::checkGlobalsAreNotSetViaPostOrGet();
62 self::defineBaseConstants();
63 self::definePaths($relativePathPart);
64 self::checkMainPathsExist();
65 self::requireBaseClasses();
66 self::setupClassAliasForLegacyBaseClasses();
67 self::handleMagicQuotesGpc();
68 self::addCorePearPathToIncludePath();
69 self::initializeGlobalVariables();
70 self::initializeGlobalTimeTrackingVariables();
71 self::initializeBasicErrorReporting();
72 }
73
74 /**
75 * Check php version requirement or exit script
76 *
77 * @return void
78 */
79 static protected function ensureRequiredEnvironment() {
80 if (version_compare(phpversion(), '5.3', '<')) {
81 die('TYPO3 requires PHP 5.3.0 or higher.');
82 }
83 if (self::getPhpIniValueBoolean('register_globals')) {
84 die('TYPO3 requires PHP setting "register_globals" set to Off. (Error: #1345284320)');
85 }
86 }
87
88 /**
89 * Cast a on/off php ini value to boolean
90 *
91 * @param string $configOption
92 * @return boolean TRUE if the given option is enabled, FALSE if disabled
93 * @see t3lib_utility_PhpOptions::getIniValueBoolean
94 */
95 static protected function getPhpIniValueBoolean($configOption) {
96 return filter_var(ini_get($configOption), FILTER_VALIDATE_BOOLEAN, array(FILTER_REQUIRE_SCALAR, FILTER_NULL_ON_FAILURE));
97 }
98
99 /**
100 * Exit script if globals are set via post or get
101 *
102 * @return void
103 */
104 static protected function checkGlobalsAreNotSetViaPostOrGet() {
105 if (isset($_POST['GLOBALS']) || isset($_GET['GLOBALS'])) {
106 die('You cannot set the GLOBALS array from outside the script.');
107 }
108 }
109
110 /**
111 * Define all simple constants that have no dependency to local configuration
112 *
113 * @return void
114 */
115 static protected function defineBaseConstants() {
116 // This version, branch and copyright
117 define('TYPO3_version', '6.1.0alpha1');
118 define('TYPO3_branch', '6.1');
119 define('TYPO3_copyright_year', '1998-2013');
120 // TYPO3 external links
121 define('TYPO3_URL_GENERAL', 'http://typo3.org/');
122 define('TYPO3_URL_ORG', 'http://typo3.org/');
123 define('TYPO3_URL_LICENSE', 'http://typo3.org/licenses');
124 define('TYPO3_URL_EXCEPTION', 'http://typo3.org/go/exception/v4/');
125 define('TYPO3_URL_MAILINGLISTS', 'http://lists.typo3.org/cgi-bin/mailman/listinfo');
126 define('TYPO3_URL_DOCUMENTATION', 'http://typo3.org/documentation/');
127 define('TYPO3_URL_DOCUMENTATION_TSREF', 'http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/current/view/');
128 define('TYPO3_URL_DOCUMENTATION_TSCONFIG', 'http://typo3.org/documentation/document-library/core-documentation/doc_core_tsconfig/current/view/');
129 define('TYPO3_URL_CONSULTANCY', 'http://typo3.org/support/professional-services/');
130 define('TYPO3_URL_CONTRIBUTE', 'http://typo3.org/contribute/');
131 define('TYPO3_URL_SECURITY', 'http://typo3.org/teams/security/');
132 define('TYPO3_URL_DOWNLOAD', 'http://typo3.org/download/');
133 define('TYPO3_URL_SYSTEMREQUIREMENTS', 'http://typo3.org/about/typo3-the-cms/system-requirements/');
134 define('TYPO3_URL_DONATE', 'http://typo3.org/donate/online-donation/');
135 // A tabulator, a linefeed, a carriage return, a CR-LF combination
136 define('TAB', chr(9));
137 define('LF', chr(10));
138 define('CR', chr(13));
139 define('CRLF', CR . LF);
140 // Security related constant: Default value of fileDenyPattern
141 define('FILE_DENY_PATTERN_DEFAULT', '\\.(php[3-6]?|phpsh|phtml)(\\..*)?$|^\\.htaccess$');
142 // Security related constant: List of file extensions that should be registered as php script file extensions
143 define('PHP_EXTENSIONS_DEFAULT', 'php,php3,php4,php5,php6,phpsh,inc,phtml');
144 // List of extensions required to run the core
145 define('REQUIRED_EXTENSIONS', 'core,backend,frontend,cms,lang,sv,extensionmanager,recordlist,extbase,fluid,cshmanual,install');
146 // Operating system identifier
147 // Either "WIN" or empty string
148 define('TYPO3_OS', self::getTypo3Os());
149 }
150
151 /**
152 * Calculate all required base paths and set as constants.
153 *
154 * @param string $relativePathPart Relative path of the entry script back to document root
155 * @return void
156 */
157 static protected function definePaths($relativePathPart = '') {
158 // Relative path from document root to typo3/ directory
159 // Hardcoded to "typo3/"
160 define('TYPO3_mainDir', 'typo3/');
161 // Absolute path of the entry script that was called
162 // All paths are unified between Windows and Unix, so the \ of Windows is substituted to a /
163 // Example "/var/www/instance-name/htdocs/typo3conf/ext/wec_map/mod1/index.php"
164 // Example "c:/var/www/instance-name/htdocs/typo3/backend.php" for a path in Windows
165 define('PATH_thisScript', self::getPathThisScript());
166 // Absolute path of the document root of the instance with trailing slash
167 // Example "/var/www/instance-name/htdocs/"
168 define('PATH_site', self::getPathSite($relativePathPart));
169 // Absolute path of the typo3 directory of the instance with trailing slash
170 // Example "/var/www/instance-name/htdocs/typo3/"
171 define('PATH_typo3', PATH_site . TYPO3_mainDir);
172 // Relative path (from the PATH_typo3) to a BE module NOT using mod.php dispatcher with trailing slash
173 // Example "sysext/perms/mod/" for an extension installed in typo3/sysext/
174 // Example "install/" for the install tool entry script
175 // Example "../typo3conf/ext/templavoila/mod2/ for an extension installed in typo3conf/ext/
176 define('PATH_typo3_mod', defined('TYPO3_MOD_PATH') ? TYPO3_MOD_PATH : '');
177 // Absolute path to the t3lib directory with trailing slash
178 // Example "/var/www/instance-name/htdocs/t3lib/"
179 define('PATH_t3lib', PATH_site . 't3lib/');
180 // Absolute path to the typo3conf directory with trailing slash
181 // Example "/var/www/instance-name/htdocs/typo3conf/"
182 define('PATH_typo3conf', PATH_site . 'typo3conf/');
183 // Absolute path to the tslib directory with trailing slash
184 // Example "/var/www/instance-name/htdocs/typo3/sysext/cms/tslib/"
185 define('PATH_tslib', PATH_typo3 . 'sysext/cms/tslib/');
186 }
187
188 /**
189 * Check if path and script file name calculation was successful, exit if not.
190 *
191 * @return void
192 */
193 static protected function checkMainPathsExist() {
194 if (!is_file(PATH_thisScript)) {
195 die('Unable to determine path to entry script.');
196 }
197 if (!is_dir(PATH_t3lib)) {
198 die('Calculated absolute path to t3lib directory does not exist.');
199 }
200 if (!is_dir(PATH_tslib)) {
201 die('Calculated absolute path to tslib directory does not exist.');
202 }
203 if (!is_dir(PATH_typo3conf)) {
204 die('Calculated absolute path to typo3conf directory does not exist');
205 }
206 }
207
208 /**
209 * Load several base classes during bootstrap
210 *
211 * @return void
212 */
213 static protected function requireBaseClasses() {
214 require_once __DIR__ . '/../Utility/GeneralUtility.php';
215 require_once __DIR__ . '/../Utility/ArrayUtility.php';
216 require_once __DIR__ . '/../SingletonInterface.php';
217 require_once __DIR__ . '/../Configuration/ConfigurationManager.php';
218 require_once __DIR__ . '/../Utility/ExtensionManagementUtility.php';
219 require_once __DIR__ . '/../Cache/Cache.php';
220 require_once __DIR__ . '/../Cache/Exception.php';
221 require_once __DIR__ . '/../Cache/Exception/NoSuchCacheException.php';
222 require_once __DIR__ . '/../Cache/Exception/InvalidDataException.php';
223 require_once __DIR__ . '/../Cache/CacheFactory.php';
224 require_once __DIR__ . '/../Cache/CacheManager.php';
225 require_once __DIR__ . '/../Cache/Frontend/FrontendInterface.php';
226 require_once __DIR__ . '/../Cache/Frontend/AbstractFrontend.php';
227 require_once __DIR__ . '/../Cache/Frontend/StringFrontend.php';
228 require_once __DIR__ . '/../Cache/Frontend/PhpFrontend.php';
229 require_once __DIR__ . '/../Cache/Backend/BackendInterface.php';
230 require_once __DIR__ . '/../Cache/Backend/TaggableBackendInterface.php';
231 require_once __DIR__ . '/../Cache/Backend/AbstractBackend.php';
232 require_once __DIR__ . '/../Cache/Backend/PhpCapableBackendInterface.php';
233 require_once __DIR__ . '/../Cache/Backend/SimpleFileBackend.php';
234 require_once __DIR__ . '/../Cache/Backend/NullBackend.php';
235 require_once __DIR__ . '/../Log/LogLevel.php';
236 require_once __DIR__ . '/../Utility/MathUtility.php';
237 require_once __DIR__ . '/ClassLoader.php';
238 if (PHP_VERSION_ID < 50307) {
239 require_once __DIR__ . '/../Compatibility/CompatbilityClassLoaderPhpBelow50307.php';
240 }
241 }
242
243 /**
244 * Compatibility layer for early t3lib_div or t3lib_extMgm usage
245 *
246 * @return void
247 * @deprecated since 6.0, will be removed in 6.2
248 * @see t3lib/class.t3lib_div.php, t3lib/class.t3lib_extmgm.php
249 */
250 static public function setupClassAliasForLegacyBaseClasses() {
251 class_alias('TYPO3\\CMS\\Core\\Utility\\GeneralUtility', 't3lib_div');
252 class_alias('TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility', 't3lib_extMgm');
253 }
254
255 /**
256 * Compatibility layer for magic quotes
257 *
258 * @return void
259 */
260 static protected function handleMagicQuotesGpc() {
261 if (!get_magic_quotes_gpc()) {
262 \TYPO3\CMS\Core\Utility\GeneralUtility::addSlashesOnArray($_GET);
263 \TYPO3\CMS\Core\Utility\GeneralUtility::addSlashesOnArray($_POST);
264 $GLOBALS['HTTP_GET_VARS'] = $_GET;
265 $GLOBALS['HTTP_POST_VARS'] = $_POST;
266 }
267 }
268
269 /**
270 * Add typo3/contrib/pear/ as first include folder in
271 * include path, because the shipped PEAR packages use
272 * relative paths to include their files.
273 *
274 * This is required for t3lib_http_Request to work.
275 *
276 * Having the TYPO3 folder first will make sure that the
277 * shipped version is loaded before any local PEAR package,
278 * thus avoiding any incompatibilities with newer or older
279 * versions.
280 *
281 * @return void
282 */
283 static protected function addCorePearPathToIncludePath() {
284 set_include_path(PATH_typo3 . 'contrib/pear/' . PATH_SEPARATOR . get_include_path());
285 }
286
287 /**
288 * Set up / initialize several globals variables
289 *
290 * @return void
291 */
292 static protected function initializeGlobalVariables() {
293 // Unset variable(s) in global scope (security issue #13959)
294 unset($GLOBALS['error']);
295 // Set up base information about browser/user-agent
296 $GLOBALS['CLIENT'] = \TYPO3\CMS\Core\Utility\GeneralUtility::clientInfo();
297 $GLOBALS['TYPO3_MISC'] = array();
298 $GLOBALS['T3_VAR'] = array();
299 $GLOBALS['T3_SERVICES'] = array();
300 }
301
302 /**
303 * Initialize global time tracking variables.
304 * These are helpers to for example output script parsetime at the end of a script.
305 *
306 * @return void
307 */
308 static protected function initializeGlobalTimeTrackingVariables() {
309 // Set PARSETIME_START to the system time in milliseconds.
310 $GLOBALS['PARSETIME_START'] = \TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds();
311 // Microtime of (nearly) script start
312 $GLOBALS['TYPO3_MISC']['microtime_start'] = microtime(TRUE);
313 // EXEC_TIME is set so that the rest of the script has a common value for the script execution time
314 $GLOBALS['EXEC_TIME'] = time();
315 // $ACCESS_TIME is a common time in minutes for access control
316 $GLOBALS['ACCESS_TIME'] = $GLOBALS['EXEC_TIME'] - $GLOBALS['EXEC_TIME'] % 60;
317 // $SIM_EXEC_TIME is set to $EXEC_TIME but can be altered later in the script if we want to
318 // simulate another execution-time when selecting from eg. a database
319 $GLOBALS['SIM_EXEC_TIME'] = $GLOBALS['EXEC_TIME'];
320 // If $SIM_EXEC_TIME is changed this value must be set accordingly
321 $GLOBALS['SIM_ACCESS_TIME'] = $GLOBALS['ACCESS_TIME'];
322 }
323
324 /**
325 * Initialize basic error reporting.
326 *
327 * There are a lot of extensions that have no strict / notice / deprecated free
328 * ext_localconf or ext_tables. Since the final error reporting must be set up
329 * after those extension files are read, a default configuration is needed to
330 * suppress error reporting meanwhile during further bootstrap.
331 *
332 * @return void
333 */
334 static protected function initializeBasicErrorReporting() {
335 // Core should be notice free at least until this point ...
336 error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
337 }
338
339 /**
340 * Determine the operating system TYPO3 is running on.
341 *
342 * @return string Either 'WIN' if running on Windows, else empty string
343 */
344 static protected function getTypo3Os() {
345 $typoOs = '';
346 if (!stristr(PHP_OS, 'darwin') && stristr(PHP_OS, 'win')) {
347 $typoOs = 'WIN';
348 }
349 return $typoOs;
350 }
351
352 /**
353 * Calculate PATH_thisScript
354 *
355 * First step in path calculation: Goal is to find the absolute path of the entry script
356 * that was called without resolving any links. This is important since the TYPO3 entry
357 * points are often linked to a central core location, so we can not use the php magic
358 * __FILE__ here, but resolve the called script path from given server environments.
359 *
360 * This path is important to calculate the document root (PATH_site). The strategy is to
361 * find out the script name that was called in the first place and to subtract the local
362 * part from it to find the document root.
363 *
364 * @return string Absolute path to entry script
365 */
366 static protected function getPathThisScript() {
367 if (defined('TYPO3_cliMode') && TYPO3_cliMode === TRUE) {
368 return self::getPathThisScriptCli();
369 } else {
370 return self::getPathThisScriptNonCli();
371 }
372 }
373
374 /**
375 * Calculate path to entry script if not in cli mode.
376 *
377 * Depending on the environment, the script path is found in different $_SERVER variables.
378 *
379 * @return string Absolute path to entry script
380 */
381 static protected function getPathThisScriptNonCli() {
382 $cgiPath = '';
383 if (isset($_SERVER['ORIG_PATH_TRANSLATED'])) {
384 $cgiPath = $_SERVER['ORIG_PATH_TRANSLATED'];
385 } elseif (isset($_SERVER['PATH_TRANSLATED'])) {
386 $cgiPath = $_SERVER['PATH_TRANSLATED'];
387 }
388 if ($cgiPath && (PHP_SAPI === 'fpm-fcgi' || PHP_SAPI === 'cgi' || PHP_SAPI === 'isapi' || PHP_SAPI === 'cgi-fcgi')) {
389 $scriptPath = $cgiPath;
390 } else {
391 if (isset($_SERVER['ORIG_SCRIPT_FILENAME'])) {
392 $scriptPath = $_SERVER['ORIG_SCRIPT_FILENAME'];
393 } else {
394 $scriptPath = $_SERVER['SCRIPT_FILENAME'];
395 }
396 }
397 // Replace \ to / for Windows
398 $scriptPath = str_replace('\\', '/', $scriptPath);
399 // Replace double // to /
400 $scriptPath = str_replace('//', '/', $scriptPath);
401 return $scriptPath;
402 }
403
404 /**
405 * Calculate path to entry script if in cli mode.
406 *
407 * First argument of a cli script is the path to the script that was called. If the script does not start
408 * with / (or A:\ for Windows), the path is not absolute yet, and the current working directory is added.
409 *
410 * @return string Absolute path to entry script
411 */
412 static protected function getPathThisScriptCli() {
413 // Possible relative path of the called script
414 if (isset($_SERVER['argv'][0])) {
415 $scriptPath = $_SERVER['argv'][0];
416 } elseif (isset($_ENV['_'])) {
417 $scriptPath = $_ENV['_'];
418 } else {
419 $scriptPath = $_SERVER['_'];
420 }
421 // Find out if path is relative or not
422 $isRelativePath = FALSE;
423 if (TYPO3_OS === 'WIN') {
424 if (!preg_match('/^([A-Z]:)?\\\\/', $scriptPath)) {
425 $isRelativePath = TRUE;
426 }
427 } else {
428 if (substr($scriptPath, 0, 1) !== '/') {
429 $isRelativePath = TRUE;
430 }
431 }
432 // Concatenate path to current working directory with relative path and remove "/./" constructs
433 if ($isRelativePath) {
434 if (isset($_SERVER['PWD'])) {
435 $workingDirectory = $_SERVER['PWD'];
436 } else {
437 $workingDirectory = getcwd();
438 }
439 $scriptPath = $workingDirectory . '/' . preg_replace('/\\.\\//', '', $scriptPath);
440 }
441 return $scriptPath;
442 }
443
444 /**
445 * Calculate the document root part to the instance from PATH_thisScript
446 *
447 * There are two ways to hint correct calculation:
448 * Either an explicit specified sub path or the defined constant TYPO3_MOD_PATH. Which one is
449 * used depends on which entry script was called in the first place.
450 *
451 * We have two main scenarios for entry points:
452 * - Directly called documentRoot/index.php (-> FE call or eiD include): index.php sets $relativePathPart to
453 * empty string to hint this code that the document root is identical to the directory the script is located at.
454 * - An indirect include of typo3/init.php (-> a backend module, the install tool, or scripts like thumbs.php).
455 * If init.php is included we distinguish two cases:
456 * -- A backend module defines 'TYPO3_MOD_PATH': This is the case for "old" modules that are not called through
457 * "mod.php" dispatcher, and in the install tool. The TYPO3_MOD_PATH defines the relative path to the typo3/
458 * directory. This is taken as base to calculate the document root.
459 * -- A script includes init.php and does not define 'TYPO3_MOD_PATH': This is the case for the mod.php dispatcher
460 * and other entry scripts like 'cli_dispatch.phpsh' or 'thumbs.php' that are located parallel to init.php. In
461 * this case init.php sets 'typo3/' as $relativePathPart as base to calculate the document root.
462 *
463 * This basically boils down to the following code:
464 * If TYPO3_MOD_PATH is defined, subtract this 'local' part from the entry point directory, else use
465 * $relativePathPart to subtract this from the the script entry point to find out the document root.
466 *
467 * @param string $relativePathPart Relative directory part from document root to script path if TYPO3_MOD_PATH is not used
468 * @return string Absolute path to document root of installation
469 */
470 static protected function getPathSite($relativePathPart) {
471 // If end of path is not "typo3/" and TYPO3_MOD_PATH is given
472 if (defined('TYPO3_MOD_PATH')) {
473 return self::getPathSiteByTypo3ModulePath();
474 } else {
475 return self::getPathSiteByRelativePathPart($relativePathPart);
476 }
477 }
478
479 /**
480 * Calculate document root by TYPO3_MOD_PATH
481 *
482 * TYPO3_MOD_PATH can have the following values:
483 * - "sysext/extensionName/path/entryScript.php" -> extension is below 'docRoot'/typo3/sysext
484 * - "ext/extensionName/path/entryScript.php" -> extension is below 'docRoot'/typo3/ext
485 * - "../typo3conf/ext/extensionName/path/entryScript.php" -> extension is below 'docRoot'/typo3conf/ext
486 * - "install/index.php" -> install tool in 'docRoot'/typo3/install/
487 *
488 * The method unifies the above and subtracts the calculated path part from PATH_thisScript
489 *
490 * @return string Absolute path to document root of installation
491 */
492 static protected function getPathSiteByTypo3ModulePath() {
493 if (substr(TYPO3_MOD_PATH, 0, strlen('sysext/')) === 'sysext/' || substr(TYPO3_MOD_PATH, 0, strlen('ext/')) === 'ext/' || substr(TYPO3_MOD_PATH, 0, strlen('install/')) === 'install/') {
494 $pathPartRelativeToDocumentRoot = TYPO3_mainDir . TYPO3_MOD_PATH;
495 } elseif (substr(TYPO3_MOD_PATH, 0, strlen('../typo3conf/')) === '../typo3conf/') {
496 $pathPartRelativeToDocumentRoot = substr(TYPO3_MOD_PATH, 3);
497 } else {
498 die('Unable to determine TYPO3 document root.');
499 }
500 $entryScriptDirectory = self::getUnifiedDirectoryNameWithTrailingSlash(PATH_thisScript);
501 return substr($entryScriptDirectory, 0, -strlen($pathPartRelativeToDocumentRoot));
502 }
503
504 /**
505 * Find out document root by subtracting $relativePathPart from PATH_thisScript
506 *
507 * @param string $relativePathPart Relative part of script from document root
508 * @return string Absolute path to document root of installation
509 */
510 static protected function getPathSiteByRelativePathPart($relativePathPart) {
511 $entryScriptDirectory = self::getUnifiedDirectoryNameWithTrailingSlash(PATH_thisScript);
512 if (strlen($relativePathPart) > 0) {
513 $pathSite = substr($entryScriptDirectory, 0, -strlen($relativePathPart));
514 } else {
515 $pathSite = $entryScriptDirectory;
516 }
517 return $pathSite;
518 }
519
520 /**
521 * Remove file name from script path and unify for Windows and Unix
522 *
523 * @param string $absolutePath Absolute path to script
524 * @return string Directory name of script file location, unified for Windows and Unix
525 */
526 static protected function getUnifiedDirectoryNameWithTrailingSlash($absolutePath) {
527 $directory = dirname($absolutePath);
528 if (TYPO3_OS === 'WIN') {
529 $directory = str_replace('\\', '/', $directory);
530 }
531 return $directory . '/';
532 }
533
534 }
535
536
537 ?>