Closed ghost closed 10 years ago
can you show me your example code ?
On Sunday, 6 July 2014 at 1:54 am, mario22792 wrote:
Im testing your library with your example css and js files and when it generate the minified files I get this errors but the files are correctly generated. A PHP Error was encountered Severity: Notice Message: Undefined index: css Filename: libraries/Minify.php Line Number: 224 A PHP Error was encountered Severity: Notice Message: Undefined index: css Filename: libraries/Minify.php Line Number: 224 A PHP Error was encountered Severity: Notice Message: Undefined index: js Filename: libraries/Minify.php Line Number: 224 A PHP Error was encountered Severity: Notice Message: Undefined index: js Filename: libraries/Minify.php Line Number: 224
— Reply to this email directly or view it on GitHub (https://github.com/slav123/CodeIgniter-minify/issues/8).
This is the code of my controller
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$this->load->library('minify');
$this->load->library('cache_fragment');
$data['prueba'] = "hola";
$this->load->view('welcome_message', $data);
}
}
And this is the code of my view
I correct this problem, is because on line 79 on Minify.php when yo do private $_lmod = array('css', 'js'); and the minified files don't exists the array contain:
0 => css, 1=> js
On line 136 you have to css this and the same to js:
if (!file_exists($this->css_file)) { if (!touch($this->css_file)) { die("Can't create file {$this->css_file}"); } } else { $this->_lmod['css'] = filemtime($this->css_file); } }
Then when you don't have the minified files the index css and js of $_lmod doesn't exist, to correct this i only change the line 79 and all work correct.
private $_lmod = array('css'=>"", 'js'=>"");
You are correct ! I made update to source code.
https://github.com/slav123/CodeIgniter-minify/commit/c92d23276dc03498f5dd9dcf6d69b44151ba30dd
I'm testing your library with your example css and js files and when it generate the minified files I get this errors but the files are correctly generated.
I'm working with codeigniter 2.2.0.
A PHP Error was encountered
Severity: Notice
Message: Undefined index: css
Filename: libraries/Minify.php
Line Number: 224
A PHP Error was encountered
Severity: Notice
Message: Undefined index: css
Filename: libraries/Minify.php
Line Number: 224
A PHP Error was encountered
Severity: Notice
Message: Undefined index: js
Filename: libraries/Minify.php
Line Number: 224
A PHP Error was encountered
Severity: Notice
Message: Undefined index: js
Filename: libraries/Minify.php
Line Number: 224