Sprinkle icon indicating copy to clipboard operation
Sprinkle copied to clipboard

cant get hmvc to work with sprinkles

Open RelativeMedia opened this issue 12 years ago • 6 comments

Trying to get hmvc to work with 2.1.. getting the following error: The configuration file sprinkle.php does not exist.. I have an autoload.php file inside of my modules/index/config folder that has the following line in it: $autoload['sparks'] = array('video_helper/1.0.2', 'Sprinkle/1.0.5','template/1.9.');

RelativeMedia avatar Mar 18 '12 03:03 RelativeMedia

just a bit of an update to this.. i am extending my index controller from MX_Controller. If i extend CI_Controller i dont get any error messages, however sprinkles does not parse through the css/js files, it instead creates empty files. It does however pull the jquery libs down. So it must be a file read problem. Here is my file/folder structure: https://skitch.com/gorelative/8myqk/screen-shot-2012-03-17-at-8.43.10-pm

and my index controller:

<?php 
/**
 * The controller for the front end of MapIT.
 * 
 * @author Mike DeVita
 * @category controller
 * @copyright 2011 MapIT USA
 * @package map_controller
 */

 if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Index extends CI_Controller {
    function __construct(){
        parent::__construct();



        $this->load->spark('Sprinkle/1.0.5');
        $this->load->library('sprinkle');
        #load the video helper spark
        $this->load->spark('video_helper/1.0.2');
        #load the video helper to parse vimeo and youtube videos
        $this->load->helper('video');

        $this->sprinkle->load('jquery-libs');
        $this->sprinkle->load('frontend-js');

        $this->sprinkle->load('modernizr');

        $this->sprinkle->load('frontend-css');
        $this->sprinkle->load('frontend-mapit');
    }
    public function index(){
        #load a random video advertisement from the getAdvertisements(status {numerical}, RANDOM{boolean} );
        $advertisement = $this->mapAdvertisements->getAdvertisements(1, FALSE);
        #generate the embed code for advertisement and set it to an array that can be loaded into the view.
        foreach ($advertisement as $a){
            if ($a->type == 'picture'){
                $this->data['advertisement'][] = '<a href="'.$a->url.'" target="_blank"><img src="'.base_url().'uploads/advertisements/'.$a->filename.'" /></a>';
            }elseif($a->type == 'video'){
                $this->data['advertisement'][] = youtube_embed($a->youtube_id, '200', '160');
            }           
        }

        /** set the main_content, and load the view */
        $this->data['main_content'] = 'index';
        $this->load->view('index/template', $this->data);
    }#END Index Function
}

RelativeMedia avatar Mar 18 '12 03:03 RelativeMedia

Thanks, I'll look into it ASAP.

edmundask avatar Mar 18 '12 08:03 edmundask

Further review shows that it specifically has to do with the filters cssmin, jsmin, and combine. If i disable all three of these everything works. I have a feeling it has greatly to do with the libraries that are loaded in sprinkles.php

RelativeMedia avatar Mar 18 '12 19:03 RelativeMedia

Sorry for the delay, I've been pretty busy the last few days. If I am not mistaken, the tmp folder in Sprinkle root folder does not have the required permissions (I decided to store asset contents in temporary files instead of loading everything into memory and creating massive overhead). I forgot to document this and I should probably add a config option to set the path where temporary files would be stored (just in case).

As for the config file loading issue, I wasn't able to replicate it. Could you maybe store the code with the whole CodeIgniter setup (except the models, controllers and other stuff that is irrelevant). Cheers.

edmundask avatar Mar 25 '12 19:03 edmundask

Also, set log_threshold to 4 and check the logs, maybe you'll find something interesting there.

edmundask avatar Mar 25 '12 19:03 edmundask

the tmp folder has write permissions, for testing purposes, i chmod -r 777 the entire sprinkle folder.

Edmundas wrote:

Sorry for the delay, I've been pretty busy the last few days. If I am not mistaken, the tmp folder in Sprinkle root folder does not have the required permissions (I decided to store asset contents in temporary files instead of loading everything into memory and creating massive overhead). I forgot to document this and I should probably add a config option to set the path where temporary files would be stored (just in case).

As for the config file loading issue, I wasn't able to replicate it. Could you maybe store the code with the whole CodeIgniter setup (except the models, controllers and other stuff that is irrelevant). Cheers.


Reply to this email directly or view it on GitHub: https://github.com/edmundask/Sprinkle/issues/8#issuecomment-4684058

RelativeMedia avatar Mar 25 '12 19:03 RelativeMedia