summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-08-22 18:09:33 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-08-22 18:14:10 +0200
commit203f824ae5a9ec4a979542f4eb9e09fcb07cb36c (patch)
tree1cb8dd5ca7be72118bc7b10a3578d7717488664d
parentb706456847640ce714d537e781ea59587b0f0298 (diff)
Only determine latest client version when needed
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/controllers/file.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index d510badc0..e8bb5896f 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -31,11 +31,6 @@ class File extends CI_Controller {
$this->load->model('mfile');
$this->load->model('muser');
- $this->var->latest_client = false;
- if (file_exists(FCPATH.'data/client/latest')) {
- $this->var->latest_client = trim(file_get_contents(FCPATH.'data/client/latest'));
- }
-
if (is_cli_client()) {
$this->var->view_dir = "file_plaintext";
} else {
@@ -315,7 +310,9 @@ class File extends CI_Controller {
function client()
{
$this->data['title'] .= ' - Client';
- if ($this->var->latest_client) {
+
+ if (file_exists(FCPATH.'data/client/latest')) {
+ $this->var->latest_client = trim(file_get_contents(FCPATH.'data/client/latest'));
$this->data['client_link'] = base_url().'data/client/fb-'.$this->var->latest_client.'.tar.gz';
} else {
$this->data['client_link'] = false;