Changeset 491 for trunk/lib/App.inc.php
- Timestamp:
- Sep 3, 2014 7:20:54 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r489 r491 71 71 'site_url' => '', // URL automatically determined by _SERVER['HTTP_HOST'] if not set here. 72 72 'images_path' => '', // Location for codebase-generated interface widgets (ex: "/admin/i"). 73 'site_version_file' => 'docs/version.txt', // File containing version number of this app, relative to the include path. 73 74 74 75 // The location the user will go if the system doesn't know where else to send them. … … 380 381 $codebase_version_file = dirname(__FILE__) . '/../docs/version.txt'; 381 382 $codebase_version = ''; 382 if (is_readable($codebase_version_file) ) {383 if (is_readable($codebase_version_file) && !is_dir($codebase_version_file)) { 383 384 $codebase_version = trim(file_get_contents($codebase_version_file)); 384 385 $this->setParam(array('codebase_version' => $codebase_version)); … … 390 391 if (version_compare(PHP_VERSION, self::CODEBASE_MIN_PHP_VERSION, '<')) { 391 392 $this->logMsg(sprintf('PHP %s required for Codebase %s, using %s; some things will break.', self::CODEBASE_MIN_PHP_VERSION, $codebase_version, PHP_VERSION), LOG_NOTICE, __FILE__, __LINE__); 393 } 394 395 // Set the application version if defined. 396 if (is_readable($this->getParam('site_version_file')) && !is_dir($this->getParam('site_version_file'))) { 397 $site_version = trim(file_get_contents($this->getParam('site_version_file'), true)); 398 $app->setParam(array('site_version' => $site_version)); 399 header('X-Site-Version: ' . $site_version); 392 400 } 393 401
Note: See TracChangeset
for help on using the changeset viewer.