Пример #1
0
 /**
  * Tries to load custom profiler. If it doesn't exist then use itself
  *
  * @return SugarXHprof
  */
 public static function getInstance()
 {
     if (self::$instance != null) {
         return self::$instance;
     }
     self::$manager = !empty($GLOBALS['sugar_config']['xhprof_config']['manager']) ? $GLOBALS['sugar_config']['xhprof_config']['manager'] : self::$manager;
     if (is_file('custom/include/SugarXHprof/' . self::$manager . '.php')) {
         require_once 'custom/include/SugarXHprof/' . self::$manager . '.php';
     } elseif (is_file('include/SugarXHprof/' . self::$manager . '.php')) {
         require_once 'include/SugarXHprof/' . self::$manager . '.php';
     }
     if (class_exists(self::$manager) && is_subclass_of(self::$manager, __CLASS__)) {
         self::$instance = new self::$manager();
     } else {
         self::$instance = new self();
     }
     self::$instance->loadConfig();
     return self::$instance;
 }
Пример #2
0
 /**
  * Tries to load custom profiler. If it doesn't exist then use itself
  *
  * @return SugarXHprof
  */
 public static function getInstance()
 {
     if (self::$instance != null) {
         return self::$instance;
     }
     self::loadConfig();
     if (is_file('custom/include/SugarXHprof/' . self::$manager . '.php')) {
         require_once 'custom/include/SugarXHprof/' . self::$manager . '.php';
     } elseif (is_file('include/SugarXHprof/' . self::$manager . '.php')) {
         require_once 'include/SugarXHprof/' . self::$manager . '.php';
     }
     if (class_exists(self::$manager) && is_subclass_of(self::$manager, __CLASS__)) {
         self::$instance = new self::$manager();
     } else {
         self::$instance = new self();
     }
     return self::$instance;
 }