Welcome Guest, Not a member yet? Register   Sign In
Matchbox RC2

[eluser]zwippie[/eluser]
OMG, I feel stupid. It must have been really too late for me yesterday...

[eluser]adamp1[/eluser]
I have a question. In one of my librarys I use the following
Code:
$this->CI->load->helper('cookie');

Now before Revision 198 this loaded the CI cookie helper. But now it says cannot find. This is the debug messages
Code:
DEBUG - 2008-02-11 11:21:39 --> ---Matchbox---
DEBUG - 2008-02-11 11:21:39 --> Finding: helpers/MY_cookie_helper.php
DEBUG - 2008-02-11 11:21:39 --> Calling module: language
DEBUG - 2008-02-11 11:21:39 --> Looking in: E:\xampplite\htdocs\new/system/application/modules/language/helpers/MY_cookie_helper.php
DEBUG - 2008-02-11 11:21:39 --> Not found
DEBUG - 2008-02-11 11:21:39 --> --------------
DEBUG - 2008-02-11 11:21:39 --> ---Matchbox---
DEBUG - 2008-02-11 11:21:39 --> Finding: helpers/cookie_helper.php
DEBUG - 2008-02-11 11:21:40 --> Calling module: language
DEBUG - 2008-02-11 11:21:40 --> Looking in: E:\xampplite\htdocs\new/system/application/modules/language/helpers/cookie_helper.php
DEBUG - 2008-02-11 11:21:40 --> Not found
DEBUG - 2008-02-11 11:21:40 --> --------------

After the last message it says it cannot find it. Why doesn't matchbox look in the default application helper folder if all else fails?

I think the problem is here in the find method in the Matchbox.php library
Code:
if ($module == '') {
            $module = $this->detect_caller();
        }

        if ($module !== '') {
            foreach ($this->directory_array() as $directory) {
                $directories[] = APPPATH . $directory . '/' . $module . '/';
            }
        }

        if ($search == 3) {
            $directories[] = '';
        } elseif (!$module) {
            $directories[] = APPPATH;

            if ($search == 2) {
                $directories[] = BASEPATH;
            }
        }

When you call a helper from inside a module library, it gets assigned a caller module. This means it never checks inside either the APPPATH OR BASEPATH dirs for the helper. So at current it means only a helper loaded in a non module library or the autoload config can load the default CI helpers.

[eluser]zdknudsen[/eluser]
Matchbox 0.9.3 Beta (Revision 199)
This might fix it:
http://matchbox.googlecode.com/files/Mat...a-r199.zip

[eluser]adamp1[/eluser]
You left a debug line in the revision
Code:
var_dump($directories)."<br>";

Line 150 in Matchbox.php

Prints a load of dir information out. If theres an error.

[eluser]zdknudsen[/eluser]
/facepalm

My god. Please tell I did not just do that Smile

There you go:
http://matchbox.googlecode.com/files/Mat...a-r200.zip

[eluser]E1M2[/eluser]
Zacharias you're fast, works like a charm.

Thanks much.

[eluser]wiredesignz[/eluser]
/facepalm :coolsmile: I love it.

[eluser]Ethan Dunham[/eluser]
Zacharias -

I too would like to see you change/update your license. The GPL would keep me from using Matchbox in a commercial software distribution... because I'd have to allow whoever buys it to give it away for free. I think the MIT license is a bit more "free" in that it allows one to include code in for-profit software without giving up rights.

http://en.wikipedia.org/wiki/MIT_License

Thank you!

[eluser]sophistry[/eluser]
[quote author="Ethan Dunham" date="1202941891"]...without giving up rights.[/quote]

Without giving up whose rights? Yours or Zacharias's... ;-)
So, if I read your post right, you want him to change the license so you can make better money off his hard work? He might not care. But, he might have chosen GPL for its strength and reach.

http://www.gnu.org/philosophy/x.html

Just a thought... not trying to start a license flame war. The GPL is a lever that forces you (as a developer who wants to use the GPL'd software) to consider whether you want to support freed, open-sourced software or free beer software. MIT is a free-for-all.

[eluser]Ethan Dunham[/eluser]
Yeah, I understand the nature of GPL'd software and can appreciate what it does. We all benefit greatly from it. And yes, I guess I do want to profit from Z's work (in a sense)... hmmm. I guess that would leave me with having to create my own version of modular separation huh?

I'm thinking that for something that integrates so fundamentally with CI, that having a license that at least matches CI's own would be appropriate. I guess I am merely linking the fitness of the software to the license? Imagine if CI was licensed under GPL, then no one could use CI as a basis for proprietary work. But their license, like MIT is a "free-for-all" as you stated.

I'll admit my own noobiness in the license arena, but it makes sense to me.




Theme © iAndrew 2016 - Forum software by © MyBB