Changeset 673

Show
Ignore:
Timestamp:
10/05/2007 03:12:01 PM (12 months ago)
Author:
Shadowhand
Message:

Small changes:

  • Implemented a work around for Profiler being displayed in external resources (scripts can be output with views with Profiler globally enabled)
  • Added inflector::uncountable($str)
Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/application/config/config.php

    r658 r673  
    133133$config['autoload'] = array 
    134134( 
    135         'libraries' => 'profiler', 
     135        'libraries' => '', 
    136136        'models'    => '' 
    137137); 
  • trunk/system/helpers/inflector.php

    r671 r673  
    33class inflector { 
    44 
    5         protected static $uncountables = array(); 
     5        public static function uncountable($str) 
     6        { 
     7                static $uncountables = NULL; 
     8 
     9                if ($uncountables === NULL) 
     10                { 
     11                        // Makes a mirrored array, eg: foo => foo 
     12                        $uncountables = array_combine(Kohana::lang('inflector'), Kohana::lang('inflector')); 
     13                } 
     14 
     15                return isset($uncountables[$str]); 
     16        } 
    617 
    718        public static function singular($str) 
     
    920                $str = trim($str); 
    1021 
    11                 if (empty(self::$uncountables)) 
    12                 { 
    13                         self::$uncountables = Kohana::lang('inflector'); 
    14                 } 
    15  
    1622                // We can just return uncountable words 
    17                 if (in_array(strtolower($str), self::$uncountables)) 
     23                if (self::uncountable($str)) 
    1824                        return $str; 
    1925 
     
    4349                $str = trim($str); 
    4450 
    45                 if (empty(self::$uncountables)) 
    46                 { 
    47                         self::$uncountables = Kohana::lang('inflector'); 
    48                 } 
    49  
    5051                // We can just return uncountable words 
    51                 if (in_array(strtolower($str), self::$uncountables)) 
     52                if (self::uncountable($str)) 
    5253                        return $str; 
    5354 
  • trunk/system/libraries/View.php

    r656 r673  
    4848                        $this->kohana_filename = Kohana::find_file('views', $name, TRUE, $type); 
    4949                        $this->kohana_filetype = current(Config::item('mimes.'.$type)); 
     50 
     51                        // Clear output Events to be safe 
     52                        Event::clear('system.output'); 
    5053                } 
    5154                else