コード例 #1
0
ファイル: Scaffold_Core.php プロジェクト: behaba/csscaffold
 function setupCore()
 {
     if ($this->config == null) {
         $this->loadConfig();
     }
     $this->assertTrue(Scaffold::setup($this->config));
     foreach (Scaffold::modules() as $module) {
         $this->assertTrue(is_object($module));
     }
     $this->assertTrue(is_array(Scaffold::include_paths()));
     $this->assertTrue(is_array(Scaffold::modules()));
     return true;
 }
コード例 #2
0
 /**
  * During the output phase, gather all the logs and send them to FireBug
  *
  * @author Anthony Short
  * @param $css
  * @return void
  */
 public static function display()
 {
     # Log the benchmarks
     self::benchmark();
     # Log about the completed file
     if (Scaffold::$config['Firelog']['file_information'] === true) {
         self::_file(Scaffold::$css->file, 'File Information');
     }
     # Constants
     if (Scaffold::$config['Firelog']['constants'] === true && class_exists('Constants') && Constants::$constants) {
         $table = array();
         $table[] = array('Constants Name', 'Value');
         foreach (Constants::$constants as $key => $value) {
             $table[] = array($key, $value);
         }
         FB::table('Constants', $table);
     }
     # Mixins
     if (Scaffold::$config['Firelog']['mixins'] === true && class_exists('Mixins') && Mixins::$mixins) {
         $table = array();
         $table[] = array('Mixin Name', 'Parameters', 'Properties');
         foreach (Mixins::$mixins as $key => $value) {
             $table[] = array($key, implode(',', $value['params']), $value['properties']);
         }
         FB::table('Mixins', $table);
     }
     # Included files
     if (Scaffold::$config['Firelog']['included_files'] === true && class_exists('Import') && Import::$loaded) {
         self::_group('Included Files', Import::$loaded, 3);
     }
     # Flags
     if (Scaffold::$config['Firelog']['flags'] === true) {
         self::_group('Flags', Scaffold::flags() ? Scaffold::flags() : 'No flags are set');
     }
     # Include Paths
     if (Scaffold::$config['Firelog']['include_paths'] === true) {
         self::_group('Include Paths', Scaffold::include_paths());
     }
     # Error Log
     if (Scaffold::$config['Firelog']['error_log'] === true) {
         foreach (Scaffold_Log::$log as $type => $value) {
             FB::group(self::$log_levels[$type]);
             foreach ($value as $date => $message) {
                 self::_log($message, $type);
             }
             FB::groupEnd();
         }
     }
     # Custom Functions
     /*
     if(Scaffold::$config['Firelog']['custom_functions'] === true && class_exists('Extensions') && Extensions::$functions)
     {
     	self::_group('Custom Functions', Extensions::$functions);
     }
     
     # Custom Properties
     if(Scaffold::$config['Firelog']['custom_properties'] === true && class_exists('Extensions') && Extensions::$properties)
     {
     	self::_group('Custom Properties', Extensions::$properties);
     }
     */
     # Gradients
     if (Scaffold::$config['Firelog']['gradients'] === true && class_exists('Gradient') && Gradient::$gradients) {
         $table = array();
         $table[] = array('Direction', 'Size', 'From', 'To', 'Location');
         foreach (Gradient::$gradients as $key => $value) {
             $table[] = array($value[0], $value[1], $value[2], $value[3], str_replace($_SERVER['DOCUMENT_ROOT'], '', $value[4]));
         }
         FB::table('Gradients', $table);
     }
     /*
     # Layout module
     if(Scaffold::$config['Firelog']['layout'] === true && isset(Layout::$columns))
     {
     	FB::group('Layout');
     
     	$table = array();
     	$table[] = array
     	(
     		'Column Count', 
     		'Column Width', 
     		'Total Gutter', 
     		'Left Gutter', 
     		'Right Gutter', 
     		'Total Width', 
     		'Baseline', 
     		'Unit'
     	);
     
     	$table[] = array
     	(
     		Layout::$column_count,
     		Layout::$column_width,
     		Layout::$gutter_width,
     		Layout::$left_gutter_width,
     		Layout::$right_gutter_width,
     		Layout::$grid_width,
     		Layout::$baseline,
     		Layout::$unit
     	);
     	
     	FB::table('Grid Structure', $table);
     	
     	# Columns
     	$table = array();
     	$table[] = array
     	(
     		'Column #',
     		'Width'
     	);
     	
     	foreach(Layout::$columns as $key => $width)
     	{
     		$table[] = array($key,$width);
     	}
     	
     	FB::table('Columns', $table);
     	
     	# Grid Classes
     	
     	FB::groupEnd();
     }
     */
     # Validation Errors
     if (Scaffold::$config['Firelog']['validation_errors'] === true && Validate::$errors) {
         FB::group('Validation Errors');
         foreach (Validate::$errors as $error) {
             self::_log("line {$error['line']} near {$error['near']} => {$error['message']}", 1);
         }
         FB::groupEnd();
     }
 }