protected function _checkDir($directory)
    {
        $eDir = @dir($directory);
        if (false == $eDir) {
            // Dir does probably not exist
            if (!is_dir($directory)) {
                if (false === @mkdir($directory, 0777, true)) {
                    \MUtil_Echo::pre(sprintf($this->translate->_('Directory %s not found and unable to create'), $directory), 'OpenRosa ERROR');
                } else {
                    $eDir = @dir($directory);
                }
            }
        }

        return $eDir;
    }
protected function _checkDir($directory)
    {
        $eDir = @dir($directory);
        if (false == $eDir) {
            // Dir does probably not exist
            if (!is_dir($directory)) {
                if (false === @mkdir($directory, 0777, true)) {
                    \MUtil_Echo::pre(sprintf($this->translate->_('Directory %s not found and unable to create'), $directory), 'OpenRosa ERROR');
                } else {
                    $eDir = @dir($directory);
                }
            }
        }

        return $eDir;
    }
protected function _checkDir ( $ directory ) { $ eDir = @ dir ( $ directory ) ; if ( false == $ eDir ) { // Dir does probably not exist if ( ! is_dir ( $ directory ) ) { if ( false === @ mkdir ( $ directory , 0777 , true ) ) { \ MUtil_Echo :: pre ( sprintf ( $ this -> translate -> _ ( 'Directory %s not found and unable to create' ) , $ directory ) , 'OpenRosa ERROR' ) ; } else { $ eDir = @ dir ( $ directory ) ; } } } return $ eDir ; }
Open the dir, suppressing possible errors and try to
create when it does not exist

@param type $directory
@return Directory
Open the dir suppressing possible errors and try to create when it does not exist