public function addResourceDir($dir)
    {
        if (null === $this->resourceDir) {
            $this->initResourceDir();
        }

        if (!is_array($this->resourceDir)) {
            throw new BBException(
                'Misconfiguration of the BBApplication : resource dir has to be an array',
                BBException::INVALID_ARGUMENT
            );
        }

        if (!file_exists($dir) || !is_dir($dir)) {
            throw new BBException(
                sprintf('The resource folder `%s` does not exist or is not a directory', $dir),
                BBException::INVALID_ARGUMENT
            );
        }

        array_unshift($this->resourceDir, $dir);

        return $this;
    }
public function addResourceDir($dir)
    {
        if (null === $this->resourceDir) {
            $this->initResourceDir();
        }

        if (!is_array($this->resourceDir)) {
            throw new BBException(
                'Misconfiguration of the BBApplication : resource dir has to be an array',
                BBException::INVALID_ARGUMENT
            );
        }

        if (!file_exists($dir) || !is_dir($dir)) {
            throw new BBException(
                sprintf('The resource folder `%s` does not exist or is not a directory', $dir),
                BBException::INVALID_ARGUMENT
            );
        }

        array_unshift($this->resourceDir, $dir);

        return $this;
    }
public function addResourceDir ( $ dir ) { if ( null === $ this -> resourceDir ) { $ this -> initResourceDir ( ) ; } if ( ! is_array ( $ this -> resourceDir ) ) { throw new BBException ( 'Misconfiguration of the BBApplication : resource dir has to be an array' , BBException :: INVALID_ARGUMENT ) ; } if ( ! file_exists ( $ dir ) || ! is_dir ( $ dir ) ) { throw new BBException ( sprintf ( 'The resource folder `%s` does not exist or is not a directory' , $ dir ) , BBException :: INVALID_ARGUMENT ) ; } array_unshift ( $ this -> resourceDir , $ dir ) ; return $ this ; }
Prepend one directory of resources.

@param String $dir The new resource directory to add

@return ApplicationInterface The current BBApplication

@throws BBException Occur on invalid path or invalid resource directories
Prepend one directory of resources .