CodeIgniter Forums
Undefined variable: mimes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: Undefined variable: mimes (/showthread.php?tid=385)



Undefined variable: mimes - kylevorster - 11-27-2014

Hey,

I upgrade my CI installation from 2 to 3 and got the following php notice error when opening one of my existing controllers.

Message: Undefined variable: mimes
Filename: core/Output.php
Line Number: 107

PHP Code:
function __construct()
{
 
 $this->_zlib_oc = @ini_get('zlib.output_compression');

 
 // Get mime types for later
 
 if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
 
 {
 
   include APPPATH.'config/'.ENVIRONMENT.'/mimes.php';
 
 }
 
 else
  
{
 
   include APPPATH.'config/mimes.php';
 
 }

 
 $this->mime_types $mimes;

 
 log_message('debug'"Output Class Initialized");


Could I change the following

PHP Code:
$this->mime_types $mimes

to

PHP Code:
if (isset($mimes))
{
 
 $this->mime_types $mimes;


In order to resolve the problem ?


RE: Undefined variable: mimes - slax0r - 11-27-2014

Are you sure updated correctly?
The core/Output.php constructor is a little bit different than the one you posted here:
https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/Output.php#L132


RE: Undefined variable: mimes - msteudel - 05-12-2015

(11-27-2014, 12:02 PM)slax0r Wrote: Are you sure updated correctly?
The core/Output.php constructor is a little bit different than the one you posted here:
https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/Output.php#L132

I had the same problem and somehow I messed up the upgrade, after I re-downloaded the files off the site and copied over the system folder again it all worked fine.