Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 2.47 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Class Errors with remote PHP website being setup locally with MAMP
  2. `//AUTOLOAD
  3. function __autoload($class_name)
  4. {
  5.     if($GLOBALS['show_dev'])
  6.     {
  7.         if(!isset($GLOBALS['starttime'])) {
  8.             $GLOBALS['starttime'] = microtime(true);
  9.         }
  10.         $stack = array();
  11.         foreach(debug_backtrace() as $stack_item) {
  12.             $stack[] = $stack_item['file'] . ': ' . $stack_item['function'] . ': ' .                        $stack_item['line'];
  13.         }
  14.         $debug =  array(
  15.             'Loading Class' => $class_name,
  16.             'Class Loaded at' => number_format(microtime(true) - $GLOBALS['starttime'], 4, '.', ''),
  17.             'Memory (MB) used before class load' => (memory_get_usage() / (1024 * 1024)),
  18.             'Current Stack Trace'=> implode("<br />", $stack)
  19.         );
  20.  
  21.         $GLOBALS['debug'][] = $debug;
  22.     }
  23.     echo $class_name;
  24.     require_once($class_name . ".php");
  25. }`
  26.        
  27. if (!$this->info['constants'] || $GLOBALS['nocache'])
  28.     {
  29.         $this->info['constants'] = array
  30.         (
  31.             'SECTION'       => $this->section,
  32.             'CONST_DEFINED' => true,
  33.             'PEAR_ROOT'     => "/Applications/MAMP/htdocs/core/pear/",
  34.             'SERVERS'       => "localhost:8888",
  35.  
  36.             'DOCUMENT_ROOT' => realpath('/Applications/MAMP/htdocs/view/') . "/",          
  37.             'CORE_ROOT'     => realpath('/Applications/MAMP/htdocs/core/') . "/",          
  38.             'CLASS_PATH'    => realpath('/Applications/MAMP/htdocs/classes/') . "/",            
  39.             'CORE_CLASS_PATH'   => realpath('/Applications/MAMP/htdocs/core/classes/') . "/",
  40.  
  41.             'EMAIL_DATA_PATH'   => realpath('/Applications/MAMP/htdocs/core/emails/data/') . "/",
  42.  
  43.             'CORE_DATA_PATH'    => realpath('/Applications/MAMP/htdocs/view/'.$this->section.'/data/') . "/",
  44.             'CORE_ACTION_PATH'  => realpath('/Applications/MAMP/htdocs/view/'.$this->section.'/actions/') . "/",
  45.             'CORE_CONTROL_PATH' => realpath('/Applications/MAMP/htdocs/view/'.$this->section.'/controllers/') . "/",
  46.             'CORE_HTML_PATH' => realpath('/Applications/MAMP/htdocs/view/'.$this->section.'/html/') . "/",
  47.  
  48.             'COMPONENT_DATA_PATH'   => realpath('/Applications/MAMP/htdocs/view/'.$this->section.'/data/components/') . "/",
  49.             'COMPONENT_HTML_PATH' => realpath('/Applications/MAMP/htdocs/view/'.$this->section.'/html/components/') . "/",              
  50.         );
  51.  
  52.         //$GLOBALS['cache']->set($this->cache_file_name,$GLOBALS['info'],1);
  53.     }
  54. }