original_string: public function is_directory_removable($fullpath) {
  
          if (!is_writable($fullpath)) {
              return false;
          }
  
          if (is_dir($fullpath)) {
              $handle = opendir($fullpath);
          } else {
              return false;
          }
  
          $result = true;
  
          while ($filename = readdir($handle)) {
  
              if ($filename === '.' or $filename === '..') {
                  continue;
              }
  
              $subfilepath = $fullpath.'/'.$filename;
  
              if (is_dir($subfilepath)) {
                  $result = $result && $this->is_directory_removable($subfilepath);
  
              } else {
                  $result = $result && is_writable($subfilepath);
              }
          }
  
          closedir($handle);
  
          return $result;
      }
code: public function is_directory_removable($fullpath) {
  
          if (!is_writable($fullpath)) {
              return false;
          }
  
          if (is_dir($fullpath)) {
              $handle = opendir($fullpath);
          } else {
              return false;
          }
  
          $result = true;
  
          while ($filename = readdir($handle)) {
  
              if ($filename === '.' or $filename === '..') {
                  continue;
              }
  
              $subfilepath = $fullpath.'/'.$filename;
  
              if (is_dir($subfilepath)) {
                  $result = $result && $this->is_directory_removable($subfilepath);
  
              } else {
                  $result = $result && is_writable($subfilepath);
              }
          }
  
          closedir($handle);
  
          return $result;
      }
code_tokens: public function is_directory_removable ( $ fullpath ) { if ( ! is_writable ( $ fullpath ) ) { return false ; } if ( is_dir ( $ fullpath ) ) { $ handle = opendir ( $ fullpath ) ; } else { return false ; } $ result = true ; while ( $ filename = readdir ( $ handle ) ) { if ( $ filename === '.' or $ filename === '..' ) { continue ; } $ subfilepath = $ fullpath . '/' . $ filename ; if ( is_dir ( $ subfilepath ) ) { $ result = $ result && $ this -> is_directory_removable ( $ subfilepath ) ; } else { $ result = $ result && is_writable ( $ subfilepath ) ; } } closedir ( $ handle ) ; return $ result ; }
docstring: Check if the given directory can be removed by the web server process.
  
  This recursively checks that the given directory and all its contents
  it writable.
  
  @param string $fullpath
  @return boolean
docstring_tokens: Check if the given directory can be removed by the web server process .