Changeset 1207

Show
Ignore:
Timestamp:
11/01/06 23:41:45 (2 years ago)
Author:
dominik
Message:

Add normalizePath to AgaviToolkit? and use it in the config handlers

Location:
trunk/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/config/AgaviConfigCache.class.php

    r1198 r1207  
    124124  public static function checkConfig($config, $context = null) 
    125125  { 
     126    $config = AgaviToolkit::normalizePath($config); 
    126127    // the full filename path to the config, which might not be what we were given. 
    127     $filename = AgaviToolkit::isPathAbsolute($config) ? $config : AgaviConfig::get('core.app_dir') . '/' . $config; 
     128    $filename = AgaviToolkit::isPathAbsolute($config) ? $config : AgaviToolkit::normalizePath(AgaviConfig::get('core.app_dir')) . '/' . $config; 
    128129 
    129130    if(!is_readable($filename)) { 
  • trunk/src/config/AgaviConfigHandlersConfigHandler.class.php

    r1199 r1207  
    5959        $pattern = $handler->getAttribute('pattern'); 
    6060 
    61         $category = var_export($this->replaceConstants($pattern), true); 
     61        $category = var_export(AgaviToolkit::normalizePath($this->replaceConstants($pattern)), true); 
    6262 
    6363        $class = $handler->getAttribute('class'); 
  • trunk/src/util/AgaviToolkit.class.php

    r1180 r1207  
    5353 
    5454    return false; 
     55  } 
     56 
     57  /** 
     58   * Normalizes a path to contain only '/' as path delimiter. 
     59   * 
     60   * @param      string The path to normalize. 
     61   * 
     62   * @return     string The unified bool The mkdir return value. 
     63   * 
     64   * @author     Dominik del Bondio <ddb@bitxtender.com> 
     65   * @since      0.11.0 
     66   */ 
     67  public static function normalizePath($path) 
     68  { 
     69    return str_replace('\\', '/', $path); 
    5570  } 
    5671