Changeset 546 for trunk/lib/App.inc.php
- Timestamp:
- Aug 27, 2015 2:35:55 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r536 r546 351 351 // DB credentials for CLI scripts stored in a JSON file with read rights given only to the user who will be executing the scripts: -r-------- 352 352 // But not if all DB credentials have been defined already by other means. 353 if ( defined('_CLI') && (!$this->getParam('db_server') || !$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass'))) {353 if (('cli' === php_sapi_name() || defined('_CLI')) && (!$this->getParam('db_server') || !$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass'))) { 354 354 if (false !== $db_auth_file = stream_resolve_include_path($this->getParam('db_auth_file'))) { 355 355 if (is_readable($db_auth_file)) { … … 386 386 387 387 // Skip sessions if disabled or automatically skip if run in a CLI script. 388 if (true === $this->getParam('enable_session') && !defined('_CLI') ) {388 if (true === $this->getParam('enable_session') && !defined('_CLI') && 'cli' !== php_sapi_name()) { 389 389 390 390 // Session parameters. … … 450 450 451 451 // Character set. This should also be printed in the html header template. 452 if (!defined('_CLI') ) {452 if (!defined('_CLI') && 'cli' !== php_sapi_name()) { 453 453 if (!headers_sent($h_file, $h_line)) { 454 454 header('Content-type: text/html; charset=' . $this->getParam('character_set')); … … 464 464 $codebase_version = trim(file_get_contents($codebase_version_file)); 465 465 $this->setParam(array('codebase_version' => $codebase_version)); 466 if (!defined('_CLI') ) {466 if (!defined('_CLI') && 'cli' !== php_sapi_name()) { 467 467 if (!headers_sent($h_file, $h_line)) { 468 468 header('X-Codebase-Version: ' . $codebase_version); … … 487 487 $this->setParam(array('site_version' => $site_version)); 488 488 } 489 if (!defined('_CLI') && $this->getParam('site_version')) {489 if (!defined('_CLI') && 'cli' !== php_sapi_name() && $this->getParam('site_version')) { 490 490 if (!headers_sent($h_file, $h_line)) { 491 491 header('X-Site-Version: ' . $site_version);
Note: See TracChangeset
for help on using the changeset viewer.