~phpdevshell/phpdevshell/3.2.1

« back to all changes in this revision

Viewing changes to includes/PHPDS.inc.php

  • Committer: greg
  • Date: 2012-11-07 00:15:40 UTC
  • Revision ID: greg@silencer-20121107001540-pyi3ifheqh0420q7
- added "support" link to both the installer page and the error report page
- sorted out problem with main configuration array being a PHPDS_array (hopefully)
- widened the scope of the exception catcher for session-related errors
- added support for E_STRICT error level
- MySQL exception #1044 added
- installer dumps a log file in case of error (o be submited to support)
- PHPDS_documentReady() call added to login page

Show diffs side-by-side

added added

removed removed

Lines of Context:
235
235
        protected function loadConfig()
236
236
        {
237
237
                // starts with an empty array which will contain the actual names of the configurations files used
238
 
                $configuration = new PHPDS_array;
 
238
                $configuration = array();
239
239
                $configuration['config_files_used'] = array();
240
240
                $configuration['config_files_missing'] = array();
241
241
 
300
300
                        $this->configuration['absolute_url'] = $protocol . $_SERVER['HTTP_HOST'] . str_replace('/index.php', '', $_SERVER['PHP_SELF']);
301
301
                }
302
302
 
303
 
                if ($this->embedded) {
304
 
                        $this->configuration['session_name'] = session_name();
305
 
                        // TODO: deal with empty session
306
 
                } else {
307
 
                        if (!empty($this->configuration['absolute_url']))
308
 
                                        $this->configuration['session_name'] = md5($this->configuration['absolute_url']);
309
 
 
310
 
                        if (!empty($this->configuration['session_name']))
311
 
                                        session_name(md5($this->configuration['session_name']));
312
 
                        if (!empty($this->configuration['session_path']))
313
 
                                        session_save_path($this->configuration['session_path']);
314
 
 
315
 
                        try {
 
303
                try {
 
304
                        if ($this->embedded) {
 
305
                                $this->configuration['session_name'] = session_name();
 
306
                                // TODO: deal with empty session
 
307
                        } else {
 
308
                                if (!empty($this->configuration['absolute_url']))
 
309
                                                $this->configuration['session_name'] = md5($this->configuration['absolute_url']);
 
310
 
 
311
                                if (!empty($this->configuration['session_name']))
 
312
                                                session_name(md5($this->configuration['session_name']));
 
313
                                if (!empty($this->configuration['session_path']))
 
314
                                                session_save_path($this->configuration['session_path']);
 
315
 
316
316
                                session_start();
317
 
                        } catch (Exception $e) {
318
 
                                throw new PHPDS_sessionException(session_save_path(), 0, $e);
319
317
                        }
320
 
                }
321
318
 
322
 
                // Make sure we dont keep our session longer then it should be.
323
 
                if (! empty($this->configuration['session_life'])) {
324
 
                        if (isset($_SESSION['SYSTEM_SESSION_TIME']) && (time() - $_SESSION['SYSTEM_SESSION_TIME']) > $this->configuration['session_life']) {
325
 
                                // Session can now be destroyed.
326
 
                                session_destroy();
327
 
                                session_regenerate_id(true);
328
 
                                $_SESSION = array();
329
 
                        } else {
330
 
                                $_SESSION['SYSTEM_SESSION_TIME'] = time();
 
319
                        // Make sure we dont keep our session longer then it should be.
 
320
                        if (! empty($this->configuration['session_life'])) {
 
321
                                if (isset($_SESSION['SYSTEM_SESSION_TIME']) && (time() - $_SESSION['SYSTEM_SESSION_TIME']) > $this->configuration['session_life']) {
 
322
                                        // Session can now be destroyed.
 
323
                                        session_destroy();
 
324
                                        session_regenerate_id(true);
 
325
                                        $_SESSION = array();
 
326
                                } else {
 
327
                                        $_SESSION['SYSTEM_SESSION_TIME'] = time();
 
328
                                }
331
329
                        }
 
330
                } catch (Exception $e) {
 
331
                        throw new PHPDS_sessionException(session_save_path(), 0, $e);
332
332
                }
333
333
 
334
334
                return $this; // to allow fluent interface
576
576
         */
577
577
        public function PHPDS_configuration($configuration = null)
578
578
        {
579
 
                if (empty($this->configuration) && is_a($configuration, 'PHPDS_array')) {
 
579
                if (empty($this->configuration) && is_array($configuration)) {
580
580
                        $this->configuration = new PHPDS_array($configuration);
581
581
                        $this->configuration['time'] = time();
582
582
                        //if ($this->compatMode < 2)