original_string: public function chmodR($path, $filemode)
      {
  
          if (!$this->isFolder($path)) {
              return $this->chmod($path, $filemode);
          }
  
          $dirh = @opendir($path);
          while ($file = readdir($dirh)) {
              if ($file != '.' && $file != '..') {
                  $fullpath = $path . '/' . $file;
                  if (!$this->isFolder($fullpath)) {
                      if (!$this->chmod($fullpath, $filemode)) {
                          return false;
                      }
                  } else {
                      if (!$this->chmodR($fullpath, $filemode)) {
                          return false;
                      }
                  }
              }
          }
  
          closedir($dirh);
  
          if ($this->chmod($path, $filemode)) {
              return true;
          } else {
              return false;
          }
      }
code: public function chmodR($path, $filemode)
      {
  
          if (!$this->isFolder($path)) {
              return $this->chmod($path, $filemode);
          }
  
          $dirh = @opendir($path);
          while ($file = readdir($dirh)) {
              if ($file != '.' && $file != '..') {
                  $fullpath = $path . '/' . $file;
                  if (!$this->isFolder($fullpath)) {
                      if (!$this->chmod($fullpath, $filemode)) {
                          return false;
                      }
                  } else {
                      if (!$this->chmodR($fullpath, $filemode)) {
                          return false;
                      }
                  }
              }
          }
  
          closedir($dirh);
  
          if ($this->chmod($path, $filemode)) {
              return true;
          } else {
              return false;
          }
      }
code_tokens: public function chmodR ( $ path , $ filemode ) { if ( ! $ this -> isFolder ( $ path ) ) { return $ this -> chmod ( $ path , $ filemode ) ; } $ dirh = @ opendir ( $ path ) ; while ( $ file = readdir ( $ dirh ) ) { if ( $ file != '.' && $ file != '..' ) { $ fullpath = $ path . '/' . $ file ; if ( ! $ this -> isFolder ( $ fullpath ) ) { if ( ! $ this -> chmod ( $ fullpath , $ filemode ) ) { return false ; } } else { if ( ! $ this -> chmodR ( $ fullpath , $ filemode ) ) { return false ; } } } } closedir ( $ dirh ) ; if ( $ this -> chmod ( $ path , $ filemode ) ) { return true ; } else { return false ; } }
docstring: Recursively sets permissions for all files in a folder
  
  @param type $path
  @param type $permission
docstring_tokens: Recursively sets permissions for all files in a folder