With Joomla CMS version 3.3.6, and following http://docs.joomla.org/How_to_create_a_stand-alone_application_using_the_Joomla!_Platform#Example_1:_Hello_World_Command_Line_Interface_.28CLI.29_App to create a simple CLI app, I get PHP Fatal error: Class 'JRegistry' not found in /libraries/joomla/application/cli.php on line 90
Thanks!
Looking at the docs compared to deletefiles.php
, and a bit of testing, it seems that:
define('JPATH_BASE', dirname(__FILE__));
require '../libraries/import.php';
Ought to be changed to
define('JPATH_BASE', dirname(__DIR__));
// Load system defines
if (file_exists(JPATH_BASE . '/defines.php'))
{
require_once JPATH_BASE . '/defines.php';
}
if (!defined('_JDEFINES'))
{
require_once JPATH_BASE . '/includes/defines.php';
}
// Get the framework.
require_once JPATH_LIBRARIES . '/import.legacy.php';
// Bootstrap the CMS libraries.
require_once JPATH_LIBRARIES . '/cms.php';
Do you agree?
I should add that the reason being
PHP Notice: Use of undefined constant JPATH_LIBRARIES - assumed 'JPATH_LIBRARIES' in /libraries/import.legacy.php on line 95
PHP Notice: Use of undefined constant JPATH_LIBRARIES - assumed 'JPATH_LIBRARIES' in /libraries/cms.php on line 42
PHP Warning: include_once(JPATH_LIBRARIES/fof/include.php): failed to open stream: No such file or directory in/libraries/cms.php on line 42
PHP Warning: include_once(): Failed opening 'JPATH_LIBRARIES/fof/include.php' for inclusion
Looks good.
Docs updated, thanks!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-02 14:52:09 |
Labels |
Added:
?
|
The docs need to be updated, applications should import
libraries/import.legacy.php
andlibraries/cms.php
to get a proper environment.https://github.com/joomla/joomla-cms/blob/staging/cli/deletefiles.php shows a good application startup routine.