Changeset 54

Show
Ignore:
Timestamp:
02/03/06 09:01:11
Author:
argh
Message:

Fixed and improved the "could not load xxx for filetype" error message.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/autopackage.php

    r51 r54  
    1818/** 
    1919 * uses PackageFileManager 
    20  */  
     20 */ 
    2121require_once 'PEAR/PackageFileManager.php'; 
    2222 
     
    5454- added missing examples 
    5555- prevent PHP-Notices with issetConfigValue() (bug #145, contributed by Frank Kleine) 
     56- fixed and improved the "could not load xxx for filetype" error message (argh) 
    5657EOT; 
    5758 
  • trunk/package.php

    r52 r54  
    1818/** 
    1919 * uses PackageFileManager 
    20  */  
     20 */ 
    2121require_once 'PEAR/PackageFileManager.php'; 
    2222 
     
    4848- added missing examples 
    4949- prevent PHP-Notices with issetConfigValue() (bug #145, contributed by Frank Kleine) 
     50- fixed and improved the "could not load xxx for filetype" error message (argh) 
    5051EOT; 
    5152 
  • trunk/patConfiguration.php

    r50 r54  
    145145                               'alwaysUseCache' => false 
    146146                           ); 
    147          
     147 
    148148   /** 
    149149        * constructor 
     
    270270                return true; 
    271271        } 
    272          
     272 
    273273   /** 
    274274        * get an option 
     
    287287                return $this->options[$name]; 
    288288        } 
    289          
     289 
    290290   /** 
    291291        * load a configuration 
     
    315315                        return $this->loadCachedConfig($file, $options); 
    316316                } 
    317                  
     317 
    318318                //      do not append => clear old config 
    319319                if ($options['mode'] == 'w') { 
    320320                        $this->conf                     =       array(); 
    321321                } 
    322                  
     322 
    323323                //      no filetype given, extract from filename 
    324                 if (isset( $options['filetype'] ) && !empty( $options['filetype'] )) {  
     324                if (isset( $options['filetype'] ) && !empty( $options['filetype'] )) { 
    325325                        $filetype = $options['filetype']; 
    326326                } else { 
     
    468468                        $inConfigDir    =       true; 
    469469                } 
    470                  
     470 
    471471                if( $inConfigDir === true ) { 
    472472                        if (!empty( $this->configDir )) { 
     
    483483                        return  $fullPath; 
    484484                } 
    485                  
     485 
    486486                $realPath       =       realpath( $fullPath ); 
    487487                if( empty( $realPath ) ) { 
     
    542542                if( !file_exists( $driverFile ) ) { 
    543543                        return patErrorManager::raiseError( 
    544                                                                                 PATCONFIGURATION_ERROR_UNKNOWN_DRIVER, 
    545                                                                                 'Could not load $mode for \''.$filetype.'\'.' 
    546                                                                                  ); 
     544                                PATCONFIGURATION_ERROR_UNKNOWN_DRIVER, 
     545                                'Could not load '.$mode.' for "'.$filetype.'". Note that patConfiguration '. 
     546                                'determines the filetype from the file\'s extension, so if you use an exotic '. 
     547                                'extension you should set the "filetype" option in your method call (you can '. 
     548                                'do this with the loadConfigFile() and loadCachedConfigFile() methods.)' 
     549                        ); 
    547550                } 
    548551                //      include writer 
     
    606609                                        } 
    607610                                        break; 
    608                                          
     611 
    609612                                case    'startCache': 
    610613                                        $result = unserialize( fread( $fp, filesize( $cacheFile ) ) ); 
     
    679682                                                                ); 
    680683                } 
    681                  
     684 
    682685                //      options had to be specified as third param prior to version 2.0 
    683686                if (is_array( $oldOptions )) { 
     
    716719                        ); 
    717720                } 
    718                  
     721 
    719722                flock( $fp, LOCK_EX ); 
    720723                fputs( $fp, $content ); 
     
    724727                chmod( $file, 0666 ); 
    725728                umask( $oldMask ); 
    726                  
     729 
    727730                return true; 
    728731        } 
     
    861864                return $tmp[$index]; 
    862865            } 
    863             return false;                       
     866            return false; 
    864867                } 
    865868