Exemplo n.º 1
0
function getBaseMagentoDir($path = false)
{
    if ($path && isAboveRoot($path)) {
        output("Could not find base Magento directory");
        exit;
    }
    $path = $path ? $path : getcwd();
    if (file_exists($path . '/app/etc/di.xml')) {
        return realpath($path);
    }
    return getBaseMagentoDir($path . '/..');
    // return $path;
}
Exemplo n.º 2
0
 public function testIsAboveRoot4()
 {
     $path = '/foo/baz/bar/../..';
     $this->assertTrue(!isAboveRoot($path));
 }