Welcome Guest, Not a member yet? Register   Sign In
index.php - Defined Constants not Absolute [with fix]
#2

[eluser]Pascal Kriete[/eluser]
Hehe, makes me laugh. The only thing you're right about is that application_path is not necessarily absolute, since is_dir handles relative paths. Everything else..

Let's read the comments:
Quote:| Include the path if the folder is not in the same directory
| as this file.

Oh, I get it, so I add a ./ if it's in the same folder. Not.

Bring us straight to using strpos('/'). Oh wait, if we follow directions this does exactly what it's supposed to. It also checks if dirname is available, because some hosts disable it. Bummer.

So far so good, now comes the funny bit:
[quote author="Pygon" date="1216442143"]
using realpath(dirname()) (err why?)

....
Code:
//Try the default
    $system_folder = str_replace('\\','/',realpath(__FILE__).'/system');
[/quote]

realpath(__FILE__) leaves you with: /something/another/index.php
Add /system and we get: /something/another/index.php/system

Well, congratulations.


Messages In This Thread
index.php - Defined Constants not Absolute [with fix] - by El Forum - 07-18-2008, 05:35 PM
index.php - Defined Constants not Absolute [with fix] - by El Forum - 07-18-2008, 07:16 PM
index.php - Defined Constants not Absolute [with fix] - by El Forum - 07-18-2008, 09:04 PM
index.php - Defined Constants not Absolute [with fix] - by El Forum - 07-19-2008, 06:50 AM
index.php - Defined Constants not Absolute [with fix] - by El Forum - 07-19-2008, 07:15 AM
index.php - Defined Constants not Absolute [with fix] - by El Forum - 07-19-2008, 09:48 AM
index.php - Defined Constants not Absolute [with fix] - by El Forum - 07-19-2008, 10:55 AM
index.php - Defined Constants not Absolute [with fix] - by El Forum - 07-19-2008, 12:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB