Using SplClassLoader
<p>I a trying to use the SplClassLoader under its full implementation <a href="https://wiki.php.net/rfc/splclassloader" rel="nofollow">here</a> as SplClassLoader.php.</p>

<p>I am running it with this code on index.php.</p>

<pre><code>session_start();

require_once('./lib/TRIXi/SplClassLoader.php');

$classLoader = new \SplClassLoader();

$classLoader-&gt;setMode(\SplClassLoader::MODE_NORMAL);

// Add a namespace of classes
$classLoader-&gt;add('Components', './lib/TRIXi/');

// Register the autoloader, prepending it in the stack
$classLoader-&gt;register();  

try {

    $environment = new Components\Environment();

    $_SESSION['environment'] = $environment-&gt;checkEnvironment();

    print($_SESSION['environment']);

} catch (AlertException $alert) {

    $_SESSION['alert'] = $alert-&gt;getData();

    print("Encountered Exception");

}

print("Complete");
</code></pre>

<p>But when I run the above script I get str_replace() expects at least 3 parameters, 2 given in SplClassLoader.php on line 285 when it runs the getResourceRelativePath() function.</p>

<p>If I print the return at this function I get <code>Components/.php</code>.</p>

<p>Not sure what I'm missing here.</p>
