ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Matchbox RC2

November 25, 2007 2:24pm

Subscribe [65]
  • #46 / Dec 01, 2007 6:58pm

    gerben

    75 posts

    I’m autoloading it for the main app, not for the modules. So I have to remove it from my main autoload file in applications/config/, and then load it in all controllers in my main app and modules? That means that if I want to autoload it for my main app controllers, I can’t autoload it for my modules, and vice versa? Is that correct?

  • #47 / Dec 01, 2007 7:25pm

    zdknudsen

    305 posts

    That is correct and I see your point. Well, as far as I know CI shouldn’t fail just because you already loaded a clas.. Perhaps I’ve done something wrong somewhere. *takes one more look at Loader.php*

    Ah yes. CodeIgniter doesn’t store a list of loaded classes. It stores a list of the filepaths to the classes (wierd…). I’ve made a new commit to the svn where itll store just the class name instead.

    Overwrite your MY_Loader.php with this one: http://matchbox.googlecode.com/svn/trunk/libraries/MY_Loader.php

    It’ll be included in the next release as well.

  • #48 / Dec 01, 2007 7:59pm

    gerben

    75 posts

    Still no luck, I’m afraid. I’ve autoloaded the view library for the main app, and used $this->load->library(‘View’); for the module controllers.

    I don’t get the “already loaded” message, but I just get the old: Unable to load the requested file: settings.php

    Maybe I should give it a rest and look at this later? It’s so strange it keeps on not working.

  • #49 / Dec 01, 2007 8:03pm

    zdknudsen

    305 posts

    Must be because it’s using the autoloaded one.

    We’ll I’ve figured out how to cope with this (and future similar issues), it’s a little hard to explain so I’ll need to document it. Basicly there is going to be another config item with some stuff to configure regarding this. However, I’m not going to get this done untill tomorow so yes you might just as well give it a rest.

    Check back tomorrow.

  • #50 / Dec 01, 2007 8:58pm

    gerben

    75 posts

    Okay, so you think it’s a issue that might happen with other libraries as well. Anyway, thanx so much for your help, I really appreciate it!

    I’ll check back tomorrow-night or monday.

  • #51 / Dec 02, 2007 12:37pm

    zdknudsen

    305 posts

    Matchbox 0.9.2 has been released. It now features configuration of the determination of what modules are loading what resources. Documentation has been updated accordingly.

    Downloads and changelog both found on http://matchbox.googlecode.com/.

  • #52 / Dec 02, 2007 12:38pm

    zdknudsen

    305 posts

    Matchbox 0.9.2 release note on previous page.

    gerben: What you need to do is remove the View library from your modules, and just have it in your standard library folder and autoload it. You then add ‘libraries/View’ to the $config[‘callers’] array in the matchbox config file.

    Please let me know if it works (it worked for me).

  • #53 / Dec 02, 2007 8:19pm

    esra

    485 posts

    esra: Is that a working example, meaning that what he is trying to accomplish is doable?

    It is a working example for MS 2.4.1 with CI 1.5.4. The same approach should work in Matchbox if the View library is loaded.

  • #54 / Dec 03, 2007 4:57am

    zdknudsen

    305 posts

    Ah, I see 😊 Where are your View library and views located in that example?

  • #55 / Dec 03, 2007 7:30am

    gerben

    75 posts

    gerben: What you need to do is remove the View library from your modules, and just have it in your standard library folder and autoload it. You then add ‘libraries/View’ to the $config[’callers’] array in the matchbox config file.

    Please let me know if it works (it worked for me).

    Hi Zacharias, it didn’t work when I did it exactly the way you described, BUT… when I added the view library to Matchbox.php, line 50:

    var $_callers = array('MY_Config', 'MY_Language', 'MY_Loader', 'View');

    it worked perfectly fine!

    So I think for some reason the matchbox.php config file is not loaded. Which is very strange, because I believe CI loads all files in config.php by default.

    When I do (in my module):

    print_r($this->config->item('callers'));

    It returns nothing.

    Anyway, I believe we’re getting there. All I need to find out, is why my config isn’t loaded.

  • #56 / Dec 03, 2007 8:56am

    zdknudsen

    305 posts

    Well CI doesn’t load all files in the config folder (at least I’m pretty sure it doesn’t). My Matchbox library (and most of the other standard libraries that are loaded before CI is fully loaded like the router, etc.) loads the config file a little differently, so it isn’t loaded with $this->load->config and it therefor is not available through $this->config->item either.

    Anyways what Matchbox does it merge the array you found yourself with the one in the config file, however apparantly it is not working as it should. I can see that you have added the value ‘View’. Was that also what you added to the config file?

  • #57 / Dec 03, 2007 9:02am

    zdknudsen

    305 posts

    I just tested it and it appears to merge the two without problems.

  • #58 / Dec 03, 2007 9:22am

    gerben

    75 posts

    I can see that you have added the value ‘View’. Was that also what you added to the config file?

    I’ve tried both ‘library/View’, as well as ‘View’, but both don’t work. The strange thing is that when I echo something in the config file, it does show up, so apparently the config file IS loaded, but not merged with the $_callers array. Is there anything I can do to test why this is?

  • #59 / Dec 03, 2007 9:25am

    zdknudsen

    305 posts

    Strange :S Hm. If you put

    echo $this->_callers;

    in the end of the Matchbox library’s matchbox() method it will print what the array contains after the merge. What does it say?

  • #60 / Dec 03, 2007 10:09am

    gerben

    75 posts

    You mean the CI_Matchbox method in Matchbox.php?

    It says:

    Array ( [0] => MY_Config [1] => MY_Language [2] => MY_Loader )


    :(

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases