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

[eluser]wiredesignz[/eluser]
It is impossible for the DB() function not to exist. The system/database/DB.php file is loaded only 5 lines earlier in the MX_Loader::database() method.

I will be updating the MX_Loader::database() method in any case.

[eluser]n0xie[/eluser]
I can't seem to get the CI XMLRPC server to run when running the HMVC loader. On a vanilla install with the example from the user_guide I get this error when trying to run the 'Greetings' example:
Code:
---DATA---
HTTP/1.1 200 OK
Date: Wed, 08 Dec 2010 17:02:31 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.5
Vary: Accept-Encoding
Content-Length: 1133
Connection: close
Content-Type: text/html


Fatal error: Call to undefined method CI::process() in /<snip>/system/libraries/Xmlrpcs.php on line 341

Call Stack:
    0.0001     660376   1. {main}() /<snip>/public_html/index.php:0
    0.0004     738472   2. require_once('/<snip>/system/core/CodeIgniter.php') /<snip>/public_html/index.php:163
    0.0611    5045152   3. call_user_func_array() /<snip>/system/core/CodeIgniter.php:297
    0.0611    5045288   4. Test->index() /<snip>/system/core/CodeIgniter.php:0
    0.0612    5049912   5. CI_Xmlrpcs->serve() /<snip>/application/modules/api/controllers/test.php:15
    0.0612    5049912   6. CI_Xmlrpcs->parseRequest() /<snip>/system/libraries/Xmlrpcs.php:122
    0.0647    5213312   7. CI_Xmlrpcs->_execute() /<snip>/system/libraries/Xmlrpcs.php:227


---END DATA---

The server:
Code:
// application/modules/api/controllers/test.php

class Test extends MX_Controller {

    function index()
    {
        $this->load->library('xmlrpc');
        $this->load->library('xmlrpcs');

        $config['functions']['Greetings']        = array('function' => 'Test.process');

        $this->xmlrpcs->initialize($config);
        $this->xmlrpcs->serve();
    }

    function process($request) {}
}
Running latest CI 2.0 build and latest HMVC build from bitbucket

Any ideas why it can't find the method 'process' ?

[eluser]wiredesignz[/eluser]
@n0xie, Try extending Controller or CI_Controller rather than MX_Controller

[eluser]n0xie[/eluser]
I should have mentioned that I tried that before:
Code:
Fatal error: Call to a member function initialize() on a non-object in /<snip>/application/controllers/test.php on line 17

Call Stack:
    0.0001     660328   1. {main}() /<snip>/public_html/index.php:0
    0.0004     738424   2. require_once('/<snip>/system/core/CodeIgniter.php') /<snip>/public_html/index.php:163
    0.0317    5038896   3. call_user_func_array() /<snip>/system/core/CodeIgniter.php:297
    0.0317    5039032   4. Test->index() /<snip>/system/core/CodeIgniter.php:0

Code:
// application/controllers/test.php
class Test extends CI_Controller {

    function index()
    {
        $this->load->library('xmlrpc');
        $this->load->library('xmlrpcs');

        $config['functions']['Greetings']        = array('function' => 'Test.process');

        $this->xmlrpcs->initialize($config);
        $this->xmlrpcs->serve();
    }

Oddly enough:
[/code]
[load] => MY_Loader Object
(
[_ci_loaded_files] => Array
(
[0] => /<snip>/system/libraries/Xmlrpc.php
[1] => /<snip>/system/libraries/Xmlrpcs.php
)
)
[/code]

So it seems like the libraries are loaded but are not instantiated. I hope you can shed some light...

[eluser]wiredesignz[/eluser]
I have this XMLRPC server working properly on a live install from a module.

application/modules/rpc2/controllers/rpc2.php
Code:
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Rpc2 extends CI_Controller {

    function __construct()
    {    
        parent::__construct();
        
        $this->load->library(array('xmlrpc', 'xmlrpcs'));
        
        $config['functions']['Rpc2.process'] = array('function' => 'Rpc2.process');
        
        $this->xmlrpcs->initialize($config);
        $this->xmlrpcs->serve();
    }
    
    function process($request)
    {                
        //log_message('DEBUG', print_r($request->params, TRUE));
        
        $response = array('Hello there from Rpc2', 'string');

        return $this->xmlrpc->send_response($response);
    }
}


Ahh, dude, maybe you can't use the index() method of the XMLRPC server. Change to __construct().

[eluser]n0xie[/eluser]
It was my bad. The MY_Controller was messing things up. Once I cleared that, it works properly. Thanks for the quick help!

[eluser]shanemesser[/eluser]
Can someone help me with view partials please (I need to use a view partial here because the small modules are standalone).

I am trying to 1--use a default controller (which works) 2-- route anything that has "widget" in to /module/controller/function AND 3--route everything else to a third controller (which works).

For example: domain.com/widget/module/controller/function would route to module/controller/function.

I have this in my routes (using an html muodule directory with html controller class and index method:

Code:
$route['default_controller'] = "_page/page";
    $route['html/html/index'] = "html/html/index";
    $route[':any'] = "_page/page";

And and trying to call this:

Code:
Modules::run('html');
    Modules::run('html/html');
    Modules::run('html/html/index');


These DO load the class, (I put an echo statement and see that the __contstruct is being called), but the index() method never gets called no matter what I do.

In fact, I can't seem to do anything to get any actual method to run. I can only get the class to instantiate (which I'm not even sure where it's getting the command to do that). In any event, can someone guide me how to keep line 1 and 3 of my route, but add a line that lets me route the HMVC right in order to run a method. or maybe I'm clueless and doing something else wrong...?

[eluser]wiredesignz[/eluser]
Post the code from your html controller.

[eluser]shanemesser[/eluser]
wired: I just spent 4 hours realizing that a view partial only returns data vs. outputs data. I guess I should have read the directions more closely. I feel incredibly dumb right now, so I'm going to go find something to do to make myself feel smarter today.

[eluser]wiredesignz[/eluser]
We all have those days. I know exactly how you feel. Wink




Theme © iAndrew 2016 - Forum software by © MyBB