- Timestamp:
- Jun 17, 2015 11:47:23 PM (9 years ago)
- Location:
- trunk/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r524 r526 75 75 'site_url' => '', // URL automatically determined by _SERVER['HTTP_HOST'] if not set here. 76 76 'images_path' => '', // Location for codebase-generated interface widgets (ex: "/admin/i"). 77 'site_version' => '', // Version of this application (set automatically during start() if site_version_file is used). 77 78 'site_version_file' => 'docs/version.txt', // File containing version number of this app, relative to the include path. 78 79 … … 470 471 // Set the application version if defined. 471 472 if (false !== $site_version_file = stream_resolve_include_path($this->getParam('site_version_file'))) { 472 $site_version = trim(file_get_contents($site_version_file)); 473 if (mb_strpos($site_version_file, '.json') !== false) { 474 $version_json = json_decode(trim(file_get_contents($site_version_file)), true); 475 $site_version = $version_json['version']; 476 } else { 477 $site_version = trim(file_get_contents($site_version_file)); 478 } 473 479 $this->setParam(array('site_version' => $site_version)); 474 if (!defined('_CLI')) {475 if (!headers_sent($h_file, $h_line)) {476 header('X-Site-Version: ' . $site_version);477 } else {478 $this->logMsg(sprintf('Unable to set X-Site-Version; headers already sent (output started in %s : %s)', $h_file, $h_line), LOG_DEBUG, __FILE__, __LINE__);479 }480 } 481 if (!defined('_CLI') && $this->getParam('site_version')) { 482 if (!headers_sent($h_file, $h_line)) { 483 header('X-Site-Version: ' . $site_version); 484 } else { 485 $this->logMsg(sprintf('Unable to set X-Site-Version; headers already sent (output started in %s : %s)', $h_file, $h_line), LOG_DEBUG, __FILE__, __LINE__); 480 486 } 481 487 } -
trunk/lib/Lock.inc.php
r523 r526 377 377 $app =& App::getInstance(); 378 378 379 $app->dieURL( sprintf('%s?lock_id=%s&boomerang=%s', $this->getParam('error_url'), $this->data['lock_id'],urlencode(absoluteMe())));379 $app->dieURL($this->getParam('error_url'), array('lock_id' => $this->data['lock_id'], 'boomerang' => urlencode(absoluteMe()))); 380 380 } 381 381 -
trunk/lib/Prefs.inc.php
r502 r526 333 333 $name = $this->_getCookieName($key); 334 334 if ($this->exists($key)) { 335 $val = json_decode($_COOKIE[$name] );335 $val = json_decode($_COOKIE[$name], true); 336 336 $app->logMsg(sprintf('Found %s in cookie: %s', $key, getDump($val)), LOG_DEBUG, __FILE__, __LINE__); 337 337 return $val;
Note: See TracChangeset
for help on using the changeset viewer.