demianturner / sgl-docs-tickets-migration-test

0 stars 0 forks source link

module config files not parsed for CLI requests #1469

Closed demianturner closed 11 years ago

demianturner commented 11 years ago

from Peter's email

{{{ However, I do not run the Manager via HTTP, but as a CLI request, and then the local conf.ini is not merged.

Here's what I did:

I copied my global .conf.php to localhost.conf.php. Run the following command line:

php /var/www/html/www.larus.nl/www/index.php --moduleName=export --managerName=RssMgr --action=news

Using the same breakpoint as you did in your code example, this shows a (partial) $conf:

... [TranslationMgr] => Array ( [requiresAuth] => 1 [adminGuiAllowed] => 1 )

[localConfig] => Array
    (
        [moduleName] => default 
    )

)

...

which obviously comes from the global config and contains no local config.

When I look again at the code in Frontcontroller I see the following:

... // assign request to registry $input = &SGL_Registry::singleton(); $req = &SGL_Request::singleton(); ...

The SGL_Request::singleton brings you to

... class SGL_Request { var $aProps;

function init()
{
    if ($this->isEmpty()) {
        $res = (!SGL::runningFromCLI())
            ? $this->initHttp()
            : $this->initCli();
    }
    return $res; 
}

...

And there the code branches and for CLI commands you'll do the initCli(), which does not process SGL_UrlParser_SefStrategy(), where, as you mentioned the local config gets merged. }}}

demianturner commented 11 years ago

[demian] agreed with your analysis, basically local config parsing needs to be extracted from SGL_UrlParser_SefStrategy().

demianturner commented 11 years ago

[petert] During tests with the new EmailqueueMgr and Newsletter running via CLI, it seems that this has not been solved yet.

demianturner commented 11 years ago

[demian] this is important to fix, will do it in next release

demianturner commented 11 years ago

[demian] basic fix done in [3787]

still need to remove duplication in SGL_Task_ResolveManager::process():649

demianturner commented 11 years ago

[demian](In [3812]) final cleanup done for module config files prob, fixes #1469