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]
  • #271 / Mar 14, 2008 6:21am

    miguelp

    10 posts

    adamp1, Zacharias Knudsen, thanks for your help, on my question, but i have another one, I’m developing a cms system for a client, and i think that it would be usefull to write it using modules (matchbox), I’m running the latest version of code igniter 1.6.1 on a Linux server using Apache 2.0 and PHP Version 4.3.10-18 (client’s server) and i was looking at the logs file to see if there’s any erros, and i found this one:

    DEBUG - 2008-03-14 06:17:21 --> ---Matchbox---
    ERROR - 2008-03-14 06:17:21 --> Severity: Warning  --> chmod() [<a href="http://function.chmod">function.chmod</a>]: Operation not permitted /var/www/askmelisboa/system/libraries/Log.php 112

    there is a lot of them on the file so i guess this error gets fired up every time the library log.php is called.
    i checked what the file does on that line, and the line is part of the function “write_log” and after it write the file try’s to change the file permitions to 0666

    @chmod($filepath, 0666);

    the logs folder is set to 0777 so it can be written, so what’s causing this error?
    and how to fix it?
    It probably dosen’t have anything to do with matchbox it self (i guess) but anyway hope you can help me out to find a solution.

    Thanks in advance

  • #272 / Mar 14, 2008 6:30am

    zdknudsen

    305 posts

    No, this isn’t related to Matchbox and I can’t say what the problem is if you’ve already made the folder writable :S I think that question is worthy of it’s own thread.

  • #273 / Mar 14, 2008 6:54am

    frenzal

    136 posts

    Also, Matchbox overwrites the (lacking) default controller mechanism, so you can supply an actual uri. That means you should be able to set the default controller to “site/atesanato”.

    frenzal: Please let me know if you have any problems with the subfolder system.

    It’s up and running like a charm, and got some nice routing set up too.
    Usually the url would be site.com/module/admin/admin_module but I want site.com/admin/admin_module So in my routing I loop through all the modules and make a route dynamically for each module:
    $route[“admin/admin_module”] = “module/admin/admin_module”

  • #274 / Mar 14, 2008 6:57am

    zdknudsen

    305 posts

    Allright. 😊

    Actually I had originally set it up so subfolders were a segment before the modulename, (which means you wouldn’t have needed routing in your case), however I later found it unlogical and changed it back.

  • #275 / Mar 14, 2008 7:58am

    miguelp

    10 posts

    Zacharias, thanks for you quick reply.
    I followed your advice and created a “brand New thread” 😊  for that question.
    I’m posting the link here in case anyone else is interested to know how this issue goes:

    http://ellislab.com/forums/viewthread/74152/

    Thanks for all.

    hooo and Zacharias, thanks for matchbox, and keep up the good work. I’ll help in anyway i can.

  • #276 / Mar 14, 2008 9:05am

    Tony Nash

    42 posts

    Zacharias,

    Thanks for the fast reply. Also your google forge seems very consistent and nice.

    I have few more questions if you mind 😉

    A) You’ll have to keep the “application/controllers” folder no matter what library you use. However, in Matchbox you won’t have to place anything in there. ME on the other hand, will require you to have at least one controller for routing purposes in there.

    How would matchbox handle this then? From other posts I think its from route file. Please correct me?

    B) Both are capable of calling resources from other modules with one major difference. Only ME can call controllers from other modules. Apart from that, it’s the same.

    Dose that mean I cannot call controllers in /app../modules/module1/module1.php from /app../modules/module2/module2.php?

    Also can I not call any libraries or helpers in moduler1 from moduler2?

    Now, on the matter of which to choose, I think it boils down to personal preference. Basicly this is how the two differ
    Matchbox
    No need to alter codingstyle
    Extends CodeIgniter core
    Includes routing functionality (e.g. URI /modulename/controller will lead to correct module)

    Will this work with language sites? ex: domain.com/nl/modules/modulename/controller

    You can split an existing application into modules and still have it work

    Modular Extensions
    Requires some adjustments in the way you code
    An additonal library, no extending of core
    No built-in routing (you have to route yourself)
    Can be used as HMVC controllers

  • #277 / Mar 14, 2008 10:37am

    zdknudsen

    305 posts

    How would matchbox handle [routing] then? From other posts I think its from route file. Please correct me?

    Matchbox handles it natively, by extending the router class, so no need to think about that. ME doesn’t, so you’ll most likely route your requests to a master controller in the standard folder and have that call the corresponding module controller.

    Dose that mean I cannot call controllers in /app../modules/module1/module1.php from /app../modules/module2/module2.php?

    Matchbox works exactly like CodeIgniter, which means that sice CodeIgniter can’t call a another controller, neither can Matchbox. Modular Extensions main feature is the fact that you can do this.

    Also can I not call any libraries or helpers in moduler1 from moduler2?

    This is fully doable in both Matchbox and ME. Plus, Matchbox uses backtracing to figure out what module is calling what resource, so you don’t need to tell it where to look.

    Will this work with language sites? ex: domain.com/nl/modules/modulename/controller

    Nope, you’ll need to do some routing for that, a lot of people have asked this before, though, so I guess you’d be able to find some answers on the forum.

  • #278 / Mar 14, 2008 11:28am

    Tony Nash

    42 posts

    Thanks Zacharias, Things are lot clear to me know. But let me explain my problem. Basically my application will be fully modularized. Here how I planed it. ex: I will have 3 modules like page(read contents), user (user management), shopping cart (cart and catalogue management)

    app../
         modules/
                /page/page.php
                     /admin/page.php
                /user/user.php
                     /profile.php   <------ *** XXX
                     /admin/user.php
                /shoppingcart/shoppingcart.php
                     /admin/shoppingcart.php

           
    I am confident this is possible with matchbox.

    But when I want to check if a particular user has privilege to access page X or can edit catalogue in shopping cart, I will need to call a function in /user/user.php. In this case Matchbox not allow me to call controller in user.php from page.php right? (* because thats how CI work)

    A) Do you have a suggestion how can I do above? (Ex: do you think my application structure not feasible with CI/Matchbox?

    B) could _privatefunction() could help me? (can this call from another module)

    C) Can I call a function in model (because its not a controller) from another controller or model? even in another module?

    D) XXX is possible with Matchbox right?

    Many Many thanks again!

  • #279 / Mar 14, 2008 11:33am

    Tony Nash

    42 posts

    .

    Will this work with language sites? ex: domain.com/nl/modules/modulename/controller

    Nope, you’ll need to do some routing for that, a lot of people have asked this before, though, so I guess you’d be able to find some answers on the forum.


    I have already search this forum for above. Not did not find something as good as

    http://kohanaphp.com/tutorials/multilingual.html.

    Perhaps you can help me. Because, you have developed a 404 localized solution already 😉  I will defiantly try this with my application 😊

  • #280 / Mar 14, 2008 3:48pm

    zdknudsen

    305 posts

    A) Do you have a suggestion how can I do above? (Ex: do you think my application structure not feasible with CI/Matchbox?

    Sure it’s possible. Noone ever told you to use controllers exclusively, what I do for my sites is put reused code in helpers/libraries. My suggestion is that you create a (or use one of the many available) authentication library and put it in your users module. You can then $this->load->module_library(‘users’,‘epicauthlib’); on whatever page needs the functionality (or even autoload it).

    B) could _privatefunction() could help me? (can this call from another module)

    Not sure if I understand the question, but above answer might also answer this.

    C) Can I call a function in model (because its not a controller) from another controller or model? even in another module?

    Sure you can! 😊 Any other resource than controllers can be called from within the module itself, or from other modules.

    D) XXX is possible with Matchbox right?

    ... Fire-fetish, eh? I fail to understand this question.

    Regarding the multilingualization, I don’t know if you can use Kohana-stuff. I think it’s forked away from CI too much. The 404 localization is quite different from what you seek. One way you could do it is route every request to the same uri but without the first segment (language segment). You could then read the language with $this->uri->segment(1), which should return the first segment before being routed. Still, I’m almost certain you can find a solution on the boards.

  • #281 / Mar 14, 2008 11:25pm

    steelaz

    252 posts

    Hey Zach, can you give me a hand with this one?

    Fresh CI 1.6 setup, fresh Matchbox 0.94

    My test controller:

    function index()
    {
        $this->load->view('index');
    }

    PHP Error:

    Message: Undefined index: file
    Filename: libraries/Matchbox.php
    Line Number: 176

    In Matchbox.php before line 176 I added:

    log_message('error', 'Trace: '. var_export($trace, true));

    It looks like foreach is looping successfully through trace until last.

    These are the last two steps:

    ERROR - 2008-03-15 02:06:01—> Traces: array (
      ‘file’ => ‘/home2/webworks/develop/system/application/modules/matchbox/controllers/matchbox.php’,
      ‘line’ => 12,
      ‘function’ => ‘view’,
      ‘class’ => ‘CI_Loader’,
      ‘type’ => ‘->’,
      ‘args’ =>
      array (
      0 => ‘index’,
      ),
    )

    ERROR - 2008-03-15 02:06:01—> Traces: array (
      ‘function’ => ‘index’,
      ‘class’ => ‘Matchbox’,
      ‘type’ => ‘->’,
      ‘args’ =>
      array (
      ),
    )

    ‘file’ index is missing on last one, any ideas on how to approach this?

    Oh, never mind, change module name from matchbox to stupid_me and it works now 😊

  • #282 / Mar 15, 2008 7:16am

    zdknudsen

    305 posts

    Glad you made it work 😉

  • #283 / Mar 16, 2008 3:49pm

    Lovecannon

    42 posts

    Well, Ive noticed as soon as I installed Matchbox, my performance dropped by quite a few milliseconds, and I do not like that, is there any way you can work on speeding this thing up?

  • #284 / Mar 16, 2008 4:46pm

    zdknudsen

    305 posts

    Well, for each value in the $config[‘directories’] array in the matchbox config file, two additional file_exist()s must be called when loading a resource, since there are two new places they can be placed (sometimes less, depending on how fast it finds the resouce, have a look at the files if you want to know the specifics).

  • #285 / Mar 16, 2008 5:00pm

    Lovecannon

    42 posts

    Well, Im gettin a bad performance overhead with just default settings.

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

ExpressionEngine News!

#eecms, #events, #releases