original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Open the dir, suppressing possible errors and try to
  create when it does not exist
  
  @param type $directory
  @return Directory
docstring_tokens: Open the dir suppressing possible errors and try to create when it does not exist