public function extend($basedir = null, $overwrite = false)
    {
        if (null === $basedir) {
            $basedir = $this->basedir;
        }

        $basedir = File::realpath($basedir);

        if (false === $this->loadFromCache($basedir)) {
            $this->loadFromBaseDir($basedir, $overwrite);
            $this->saveToCache($basedir);
        }

        if (
            !empty($this->environment)
            && false === strpos($this->environment, $basedir)
            && is_dir($basedir.DIRECTORY_SEPARATOR.$this->environment)
        ) {
            $this->extend($basedir.DIRECTORY_SEPARATOR.$this->environment, $overwrite);
        }

        return $this;
    }
public function extend($basedir = null, $overwrite = false)
    {
        if (null === $basedir) {
            $basedir = $this->basedir;
        }

        $basedir = File::realpath($basedir);

        if (false === $this->loadFromCache($basedir)) {
            $this->loadFromBaseDir($basedir, $overwrite);
            $this->saveToCache($basedir);
        }

        if (
            !empty($this->environment)
            && false === strpos($this->environment, $basedir)
            && is_dir($basedir.DIRECTORY_SEPARATOR.$this->environment)
        ) {
            $this->extend($basedir.DIRECTORY_SEPARATOR.$this->environment, $overwrite);
        }

        return $this;
    }
public function extend ( $ basedir = null , $ overwrite = false ) { if ( null === $ basedir ) { $ basedir = $ this -> basedir ; } $ basedir = File :: realpath ( $ basedir ) ; if ( false === $ this -> loadFromCache ( $ basedir ) ) { $ this -> loadFromBaseDir ( $ basedir , $ overwrite ) ; $ this -> saveToCache ( $ basedir ) ; } if ( ! empty ( $ this -> environment ) && false === strpos ( $ this -> environment , $ basedir ) && is_dir ( $ basedir . DIRECTORY_SEPARATOR . $ this -> environment ) ) { $ this -> extend ( $ basedir . DIRECTORY_SEPARATOR . $ this -> environment , $ overwrite ) ; } return $ this ; }
Extends the current instance with a new base directory.

@param string $basedir Optional base directory
Extends the current instance with a new base directory .