original_string: public function setMagicFile($file)
      {
          if (empty($file)) {
              $this->_magicfile = null;
          } else if (!(class_exists('finfo', false))) {
              $this->_magicfile = null;
              // require_once 'Zend/Validate/Exception.php';
              throw new Zend_Validate_Exception('Magicfile can not be set. There is no finfo extension installed');
          } else if (!is_file($file) || !is_readable($file)) {
              // require_once 'Zend/Validate/Exception.php';
              throw new Zend_Validate_Exception('The given magicfile can not be read');
          } else {
              $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
              $this->_finfo = @finfo_open($const, $file);
              if (empty($this->_finfo)) {
                  $this->_finfo = null;
                  // require_once 'Zend/Validate/Exception.php';
                  throw new Zend_Validate_Exception('The given magicfile is not accepted by finfo');
              } else {
                  $this->_magicfile = $file;
              }
          }
  
          return $this;
      }
code: public function setMagicFile($file)
      {
          if (empty($file)) {
              $this->_magicfile = null;
          } else if (!(class_exists('finfo', false))) {
              $this->_magicfile = null;
              // require_once 'Zend/Validate/Exception.php';
              throw new Zend_Validate_Exception('Magicfile can not be set. There is no finfo extension installed');
          } else if (!is_file($file) || !is_readable($file)) {
              // require_once 'Zend/Validate/Exception.php';
              throw new Zend_Validate_Exception('The given magicfile can not be read');
          } else {
              $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
              $this->_finfo = @finfo_open($const, $file);
              if (empty($this->_finfo)) {
                  $this->_finfo = null;
                  // require_once 'Zend/Validate/Exception.php';
                  throw new Zend_Validate_Exception('The given magicfile is not accepted by finfo');
              } else {
                  $this->_magicfile = $file;
              }
          }
  
          return $this;
      }
code_tokens: public function setMagicFile ( $ file ) { if ( empty ( $ file ) ) { $ this -> _magicfile = null ; } else if ( ! ( class_exists ( 'finfo' , false ) ) ) { $ this -> _magicfile = null ; // require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ( 'Magicfile can not be set. There is no finfo extension installed' ) ; } else if ( ! is_file ( $ file ) || ! is_readable ( $ file ) ) { // require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ( 'The given magicfile can not be read' ) ; } else { $ const = defined ( 'FILEINFO_MIME_TYPE' ) ? FILEINFO_MIME_TYPE : FILEINFO_MIME ; $ this -> _finfo = @ finfo_open ( $ const , $ file ) ; if ( empty ( $ this -> _finfo ) ) { $ this -> _finfo = null ; // require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ( 'The given magicfile is not accepted by finfo' ) ; } else { $ this -> _magicfile = $ file ; } } return $ this ; }
docstring: Sets the magicfile to use
  if null, the MAGIC constant from php is used
  if the MAGIC file is errorous, no file will be set
  
  @param  string $file
  @throws Zend_Validate_Exception When finfo can not read the magicfile
  @return Zend_Validate_File_MimeType Provides fluid interface
docstring_tokens: Sets the magicfile to use if null the MAGIC constant from php is used if the MAGIC file is errorous no file will be set