Exemple #1
0
 /**
  * Runs the action for the second step of the installation
  * where you enter database information
  *
  * @param framework\Request $request The request object
  *
  * @return null
  */
 public function runInstallStep2(framework\Request $request)
 {
     $this->preloaded = false;
     $this->selected_connection_detail = 'custom';
     if (!$this->error) {
         try {
             $b2db_filename = \THEBUGGENIE_CONFIGURATION_PATH . "b2db.yml";
             if (file_exists($b2db_filename)) {
                 $b2db_config = \Spyc::YAMLLoad($b2db_filename);
                 \b2db\Core::initialize($b2db_config);
             }
         } catch (\Exception $e) {
         }
         if (\b2db\Core::isInitialized()) {
             $this->preloaded = true;
             $this->username = \b2db\Core::getUname();
             $this->password = \b2db\Core::getPasswd();
             $this->dsn = \b2db\Core::getDSN();
             $this->hostname = \b2db\Core::getHost();
             $this->port = \b2db\Core::getPort();
             $this->b2db_dbtype = \b2db\Core::getDBtype();
             $this->db_name = \b2db\Core::getDBname();
         }
     }
 }
Exemple #2
0
?>
 seconds</li>
							<li><b>AJAX query?</b> <?php 
if ($csp_debugger->isAjaxRequest()) {
    ?>
Yes<?php 
} else {
    ?>
No<?php 
}
?>
</li>
						</ul>
						<b>SQL details:</b>
<?php 
if (\b2db\Core::isInitialized()) {
    ?>
						<ul>
							<li><b>Driver:</b> <?php 
    echo \b2db\Core::getDBtype();
    ?>
</li>
							<li><b>DSN:</b> <?php 
    echo \b2db\Core::getDSN();
    ?>
								<ul>
									<li><b>Hostname:</b> <?php 
    echo \b2db\Core::getHost();
    ?>
:<?php 
    echo \b2db\Core::getPort();
Exemple #3
0
 /**
  * Runs the action for the second step of the installation
  * where you enter database information
  * 
  * @param TBGRequest $request The request object
  * 
  * @return null
  */
 public function runInstallStep2(TBGRequest $request)
 {
     $this->preloaded = false;
     $this->selected_connection_detail = 'custom';
     if (!$this->error) {
         try {
             \b2db\Core::initialize(THEBUGGENIE_CORE_PATH . 'b2db_bootstrap.inc.php');
         } catch (Exception $e) {
         }
         if (\b2db\Core::isInitialized()) {
             $this->preloaded = true;
             $this->username = \b2db\Core::getUname();
             $this->password = \b2db\Core::getPasswd();
             $this->dsn = \b2db\Core::getDSN();
             $this->hostname = \b2db\Core::getHost();
             $this->port = \b2db\Core::getPort();
             $this->b2db_dbtype = \b2db\Core::getDBtype();
             $this->db_name = \b2db\Core::getDBname();
         }
     }
 }
Exemple #4
0
 protected static function generateDebugInfo()
 {
     $tbg_summary = array();
     $load_time = self::getLoadtime();
     if (\b2db\Core::isInitialized()) {
         $tbg_summary['db']['queries'] = \b2db\Core::getSQLHits();
         $tbg_summary['db']['timing'] = \b2db\Core::getSQLTiming();
         $tbg_summary['db']['objectpopulation'] = \b2db\Core::getObjectPopulationHits();
         $tbg_summary['db']['objecttiming'] = \b2db\Core::getObjectPopulationTiming();
         $tbg_summary['db']['objectcount'] = \b2db\Core::getObjectPopulationCount();
     }
     $tbg_summary['load_time'] = $load_time >= 1 ? round($load_time, 2) . 's' : round($load_time * 1000, 1) . 'ms';
     $tbg_summary['scope'] = array();
     $scope = self::getScope();
     $tbg_summary['scope']['id'] = $scope instanceof Scope ? $scope->getID() : 'unknown';
     $tbg_summary['scope']['hostnames'] = $scope instanceof Scope && \b2db\Core::isConnected() ? implode(', ', $scope->getHostnames()) : 'unknown';
     $tbg_summary['settings'] = Settings::getAll();
     $tbg_summary['memory'] = memory_get_usage();
     $tbg_summary['partials'] = self::getVisitedPartials();
     $tbg_summary['log'] = Logging::getEntries();
     $tbg_summary['routing'] = array('name' => self::getRouting()->getCurrentRouteName(), 'module' => self::getRouting()->getCurrentRouteModule(), 'action' => self::getRouting()->getCurrentRouteAction());
     if (isset($_SESSION)) {
         if (!array_key_exists('___DEBUGINFO___', $_SESSION)) {
             $_SESSION['___DEBUGINFO___'] = array();
         }
         $_SESSION['___DEBUGINFO___'][self::$debug_id] = $tbg_summary;
         while (count($_SESSION['___DEBUGINFO___']) > 25) {
             array_shift($_SESSION['___DEBUGINFO___']);
         }
     }
 }
 protected static function generateDebugInfo()
 {
     $tbg_summary = array();
     $load_time = self::getLoadtime();
     if (\b2db\Core::isInitialized()) {
         $tbg_summary['db']['queries'] = \b2db\Core::getSQLHits();
         $tbg_summary['db']['timing'] = \b2db\Core::getSQLTiming();
     }
     $tbg_summary['load_time'] = $load_time >= 1 ? round($load_time, 2) . 's' : round($load_time * 1000, 1) . 'ms';
     $tbg_summary['scope'] = array();
     $scope = self::getScope();
     $tbg_summary['scope']['id'] = $scope instanceof TBGScope ? $scope->getID() : 'unknown';
     $tbg_summary['scope']['hostnames'] = $scope instanceof TBGScope && \b2db\Core::isConnected() ? implode(', ', $scope->getHostnames()) : 'unknown';
     $tbg_summary['settings'] = TBGSettings::getAll();
     $tbg_summary['memory'] = memory_get_usage();
     $tbg_summary['partials'] = self::getVisitedPartials();
     if (self::$_i18n instanceof TBGI18n) {
         foreach (self::getI18n()->getMissingStrings() as $text => $value) {
             TBGLogging::log('The text "' . $text . '" does not exist in list of translated strings, and was added automatically', 'i18n', TBGLogging::LEVEL_NOTICE);
         }
     }
     $tbg_summary['log'] = TBGLogging::getEntries();
     $tbg_summary['routing'] = array('name' => self::getRouting()->getCurrentRouteName(), 'module' => self::getRouting()->getCurrentRouteModule(), 'action' => self::getRouting()->getCurrentRouteAction());
     if (isset($_SESSION)) {
         if (!array_key_exists('___DEBUGINFO___', $_SESSION)) {
             $_SESSION['___DEBUGINFO___'] = array();
         }
         $_SESSION['___DEBUGINFO___'][self::$debug_id] = $tbg_summary;
         while (count($_SESSION['___DEBUGINFO___']) > 10) {
             array_shift($_SESSION['___DEBUGINFO___']);
         }
     }
 }