original_string: public function add_file_from_pathname($localname, $pathname) {
          if ($this->emptyziphack) {
              $this->close();
              $this->open($this->archivepathname, file_archive::OVERWRITE, $this->encoding);
          }
  
          if (!isset($this->za)) {
              return false;
          }
  
          if ($this->archivepathname === realpath($pathname)) {
              // Do not add self into archive.
              return false;
          }
  
          if (!is_readable($pathname) or is_dir($pathname)) {
              return false;
          }
  
          if (is_null($localname)) {
              $localname = clean_param($pathname, PARAM_PATH);
          }
          $localname = trim($localname, '/'); // No leading slashes in archives!
          $localname = $this->mangle_pathname($localname);
  
          if ($localname === '') {
              // Sorry - conversion failed badly.
              return false;
          }
  
          if (!$this->za->addFile($pathname, $localname)) {
              return false;
          }
          $this->modified = true;
          return true;
      }
code: public function add_file_from_pathname($localname, $pathname) {
          if ($this->emptyziphack) {
              $this->close();
              $this->open($this->archivepathname, file_archive::OVERWRITE, $this->encoding);
          }
  
          if (!isset($this->za)) {
              return false;
          }
  
          if ($this->archivepathname === realpath($pathname)) {
              // Do not add self into archive.
              return false;
          }
  
          if (!is_readable($pathname) or is_dir($pathname)) {
              return false;
          }
  
          if (is_null($localname)) {
              $localname = clean_param($pathname, PARAM_PATH);
          }
          $localname = trim($localname, '/'); // No leading slashes in archives!
          $localname = $this->mangle_pathname($localname);
  
          if ($localname === '') {
              // Sorry - conversion failed badly.
              return false;
          }
  
          if (!$this->za->addFile($pathname, $localname)) {
              return false;
          }
          $this->modified = true;
          return true;
      }
code_tokens: public function add_file_from_pathname ( $ localname , $ pathname ) { if ( $ this -> emptyziphack ) { $ this -> close ( ) ; $ this -> open ( $ this -> archivepathname , file_archive :: OVERWRITE , $ this -> encoding ) ; } if ( ! isset ( $ this -> za ) ) { return false ; } if ( $ this -> archivepathname === realpath ( $ pathname ) ) { // Do not add self into archive. return false ; } if ( ! is_readable ( $ pathname ) or is_dir ( $ pathname ) ) { return false ; } if ( is_null ( $ localname ) ) { $ localname = clean_param ( $ pathname , PARAM_PATH ) ; } $ localname = trim ( $ localname , '/' ) ; // No leading slashes in archives! $ localname = $ this -> mangle_pathname ( $ localname ) ; if ( $ localname === '' ) { // Sorry - conversion failed badly. return false ; } if ( ! $ this -> za -> addFile ( $ pathname , $ localname ) ) { return false ; } $ this -> modified = true ; return true ; }
docstring: Add file into archive.
  
  @param string $localname name of file in archive
  @param string $pathname location of file
  @return bool success
docstring_tokens: Add file into archive .