From 203f824ae5a9ec4a979542f4eb9e09fcb07cb36c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 22 Aug 2013 18:09:33 +0200 Subject: Only determine latest client version when needed Signed-off-by: Florian Pritz --- application/controllers/file.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'application/controllers/file.php') 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; -- cgit v1.2.3-24-g4f1b