[TYPO3] Loading TYPO3 outside TYPO3

Andreas Balzer eMail at andreas-balzer.de
Tue Mar 21 19:08:48 CET 2006


Mathias Schreiber schrieb:
> "Andreas Balzer" <eMail at andreas-balzer.de> schrieb im Newsbeitrag
> 
>> if you find any solution, please post it :)
>> I noticed, that any output via cmd comes also via webbrowser, so you can 
>> access the script via browser too..
> 
> First off: you can't.
> Call it via command line.
> Second:
> init.php checks paths wrong.
> Meaning: It checks paths wrong on WINDOWS.
> Background:
> The Apache Webserver (and IIS as well possibly) change \ to /.
> As a result TYPO3 works perfectly fine when being called via the webserver.
> But you don't call it via apache...
> Using the standard way, PHP might be installed the call on the CL looks like 
> this:
> c:\php\cli\php 
> d:\wwwroot\kb.internal.dus.wmdb.de\typo3conf\ext\kb_linkchecker\import\class.linkcheck.php
> 
> Now, since no webserver is involved the paths that are returned by PHP are 
> like this:
> d:\wwwroot\kb.dus. [you get the rest]
> 
> init.php check with a substring, if the last parts of that path include 
> ../typo3conf/
> Notice the forward slashes!
> 
> init.php is not x-classable so you will have to patch the complete file.
> Right before the check I wrote this:
> if (defined('TYPO3_cliMode') && TYPO3_OS == 'WIN') {
>  $temp_path = str_replace('\\','/',$temp_path);
> }
> 
> This solution works for us here but I do NOT suggest it since this is a 
> quick hack which is mostly untested!!
> 
> all the best
> Mathias 
> 
> 
Hi!
I don't want to mess up my init.php or create a bug that goes through my 
dev system. I just changed all the paths in my file to \\

// Defining PATH_thisScript here: Must be the ABSOLUTE path of this 
script in the right context:
// This will work as long as the script is called by it's absolute path!
//define(PATH_thisScript, $_ENV['_'] ? $_ENV['_'] : $_SERVER['_']);
define(PATH_thisScript, 
'c:\\Programme\\typo3\htdocs\\typo3wamp\\typo3\\winremote\\');

// Include configuration file:
define('TYPO3_MOD_PATH', 
'c:\\Programme\\typo3\\htdocs\\typo3wamp\\typo3\\winremote\\');
$BACK_PATH = 'c:\\Programme\\typo3\\htdocs\\typo3wamp\\typo3\\';
$MCONF['name'] = '_CLI_winremote';

Well, my problem now is, that there is an error message, saying, that 
the Typo3 Extension sv is not loaded..

Can i solve this with your path check, or is this an other problem?

Andreas



More information about the TYPO3-english mailing list