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

[eluser]wilso417[/eluser]
Yes, I tried MY_Lang.php in application/core which returned the controller error. I also tried it in application/libraries and it just did not pick up. After digging around the HMVC I noticed it was not being checked for at all, so I put in some checks for it. In base.php I did a check to include the file (at the top):

if (file_exists(APPPATH . 'libraries/MY_Lang.php')) require_once APPPATH . 'libraries/MY_Lang.php';
else require_once dirname(__FILE__).'/Lang.php';

Next I checked to initialize in the CI constructor:

if (!is_a($this->lang, 'MY_Lang') && !is_a($this->lang, 'MX_Lang')) $this->lang = (class_exists('MY_Lang', FALSE)) ? new MY_Lang : new MX_Lang;

Not sure if this is the best approach, but this was a workaround I found. I was just surprised something like this was not built in to HMVC since the wiki says you can still extend libraries.
#42

[eluser]manik005[/eluser]
whats the version of CI you use???
#43

[eluser]wilso417[/eluser]
Newest CI & ME HMVC. Just downloaded and set them up a few days ago
#44

[eluser]manik005[/eluser]
did you inherited my_lang like this inside core?

require APPPATH."third_party/MX/Lang.php";

class MY_Lang extends MX_Lang {}
#45

[eluser]wilso417[/eluser]
Yes I did. In fact, even with my workaround I still have to do that.
#46

[eluser]Keat Liang[/eluser]
hi, has every one try the latest code from codeigniter reactor 2011 04 22 ?

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI::$_ci_cached_vars

Filename: MX/Loader.php

Line Number: 265
#47

[eluser]Boris Strahija[/eluser]
All the properties in the core Loader library are now protected, HMVC doesn't work because of this.
I know changing the core is not a good solution, but the only 2 solutions are:
1. Go to an older CI version, 2.0.2 should work fine
2. Change the Loader library in system/core/Loader.php:
Code:
public $_ci_ob_level;
public $_ci_view_paths        = array();
public $_ci_library_paths    = array();
public $_ci_model_paths        = array();
public $_ci_helper_paths    = array();
public $_base_classes        = array(); // Set by the controller class
public $_ci_cached_vars        = array();
public $_ci_classes            = array();
public $_ci_loaded_files    = array();
public $_ci_models            = array();
public $_ci_helpers            = array();
public $_ci_varmap            = array('unit_test' => 'unit',
                                        'user_agent' => 'agent');

It's a quick and dirty fix, but it works Wink
#48

[eluser]wiredesignz[/eluser]
Pushed an update to Bitbucket to resolve $_ci_cached_vars error. Further updates to follow.
#49

[eluser]osci[/eluser]
Tried to use your last update and I got these errors:
Code:
Fatal error: Access level to MX_Loader::_ci_load() must be public (as in class CI_Loader) in E:\web\ci_test\application\third_party\MX\Loader.php on line 378

turning _ci_load to public produces
Code:
Fatal error: Access level to MX_Loader::_ci_get_component() must be public (as in class CI_Loader) in E:\web\ci_test\application\third_party\MX\Loader.php on line 378

And if _ci_get_component is turned to public everything seems to work as expected in a vanilla installation.
#50

[eluser]Keat Liang[/eluser]
gonna try new code after i complete a module i am working on.




Theme © iAndrew 2016 - Forum software by © MyBB