Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - HMVC version 5.2

[eluser]Sam Dark[/eluser]
To enable profiler in CI 1.7 you need to add router binding to Controller.php. Haven't checked with CI 1.6.3:
Code:
/* the CI core classes */
$classes = array(
    'config'    => 'Config',
    'input'        => 'Input',
    'benchmark'    => 'Benchmark',
    'uri'        => 'URI',
    'output'    => 'Output',
    'lang'        => 'Language',
    'router'    => 'Router' //added
);

[eluser]wiredesignz[/eluser]
@Sam,

ME uses config sections by default, it always has. (allows the entire config section to be returned in one call)

There is no $CI->router object in CI 1.7, what you see is a bug in the profiler class.

Here's the fix I applied to Profiler.php
Code:
//profiler.php line 290    
    function _compile_controller_info()
    {    
        global $RTR;
        
        $output  = "\n\n";
        $output .= '<fieldset style="border:1px solid #995300;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
        $output .= "\n";
        $output .= '<legend style="color:#995300;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_controller_info').'&nbsp;&nbsp;</legend>';
        $output .= "\n";
        
        $output .= "<div style='color:#995300;font-weight:normal;padding:4px 0 4px 0'>".$RTR->fetch_class()."/".$RTR->fetch_method()."</div>";                

        
        $output .= "</fieldset>";

        return $output;    
    }

[eluser]Sam Dark[/eluser]
Have you submitted bug report regarding it?

[eluser]wiredesignz[/eluser]
Well if the problem still exists when CI 1.7 is released I will. Tongue

[eluser]Sam Dark[/eluser]
wiredesignz
Check SVN. There is Router now Wink

[eluser]wiredesignz[/eluser]
Yes thanks Sam. Wink

[eluser]Gnative[/eluser]
Anyone interested in working on a ME5 hooks system.. ?

I was looking at this
http://code.google.com/p/codeigniter-extrahooks/

and thought this would be great if we have a built in system for hooks in ME, registering and running modular based hooks.

Just thought i'd put it out there and see the responses.

[eluser]wiredesignz[/eluser]
Show some code give us some ideas.

[eluser]tdktank59[/eluser]
Just upgraded to the last release you sent out

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Authentication::$validation

Filename: libraries/Controller.php

Line Number: 326

I get that error message...

Not sure if its just ME or if its everything together...
Ill be looking at the problem when I get off work... However Im guessing it was my fault and i updated something wrong...

[eluser]Gnative[/eluser]
O.K this is what i got with a little play this arvo for an idea for module hooks.
This will help in the separation / encapsulation of modules..


attached Module_Hooks.php (application library)

in Controller.php add at line 5

Code:
require_once 'Module_Hooks.php';


create hook.php files in the modules you wish to listen for a specific hook in a hooks directory.

-- Module
-- config
-- controllers
-- hooks
-- hooks.php
-- library
-- models
-- views


hook.php files should have the structure

Code:
&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');


$hook['hook_event'][] = array(
    'function' => 'module/controller/method'
);

$hook['hook_event'][] = array(
    'function' => 'module2/controller/method2'
);

$hook['hook_event_two'][] = array(
    'function' => 'module2/controller/method2'
);

//
$hook['user_added'][] = array(
    'function' => 'user_module/controller/add_user'
);


?&gt;


Module hooks will autoload hook.php files found in your modules' base in the hooks directory. It does not need the module to be initiated.


to call/run a hook .. say the hook_event described above, use:

Code:
$output = module_hook::call('hook_event', $arg_1, $arg_2, ...);


Module_Hooks will cater for multiple functions for a set event and load / run a module that is required.


The function off the hook receives as arguments [ hook_data, supplied_args ]

Hope i didn't make this too confusing.

- It also has the function to pass on set static params in the hooks array and also set and use a specific class file.. i haven't shown this functionality here.
- I spose it would possible to add a hook and remove dynamically as well thou i just whipped this up, so haven't done this yet.


Just wanted to get some feedback to see what thoughts were.
I'll try and upload a small app version in the morrow

S




Theme © iAndrew 2016 - Forum software by © MyBB