Joomla 3 CLI Development

208 views
Skip to first unread message

Aaron Clausen

unread,
Jul 30, 2013, 1:41:49 PM7/30/13
to joomla-de...@googlegroups.com
As part of my upgrading my 1.5 extension to Joomla 3, I want to
offload some of the database importing and processing to batched cron
jobs. Some of the data crunching is pretty intensive and in some cases
the server is taking upwards of five minutes or more massage, import
and create relations between various CSV files.

I certainly could just write independent CLI PHP scripts to do it, but
it would be nice to write them in the Joomla environment to be
installed with the extension and to use the Joomla database functions
(including the Joomla config).

Any tips on this?

--
Aaron Clausen
mightym...@gmail.com

Michael Babker

unread,
Jul 30, 2013, 2:16:22 PM7/30/13
to joomla-de...@googlegroups.com
Check out the CLI scripts located in the cli folder to see how you can bootstrap a CLI application in the Joomla environment.



--
Aaron Clausen
mightym...@gmail.com

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/groups/opt_out.



David Hurley

unread,
Jul 30, 2013, 2:19:03 PM7/30/13
to joomla-de...@googlegroups.com

You can also checkout the JACS repository in github for Joomla! That uses CLI scripts with both local and remote servers using Joomla


http://github.com/joomla/jacs


--
David Hurley
Joomla! Community Development Manager 

Aaron Clausen

unread,
Jul 31, 2013, 11:57:55 AM7/31/13
to joomla-de...@googlegroups.com
On Tue, Jul 30, 2013 at 11:19 AM, David Hurley <david....@joomla.org> wrote:
> You can also checkout the JACS repository in github for Joomla! That uses
> CLI scripts with both local and remote servers using Joomla
>
>
> http://github.com/joomla/jacs

Okay, got a test script working from the command line. Thanks!

One question though. I'm using the following line to set the JPATH
(the actual PHP CLI script is sitting under
/joomla/administrator/components/com_newcomponent/cli):
define('JPATH_BASE', realpath(__DIR__ . "/../../../.."));

I'm assuming Joomla is going to maintain its current directory
structure for a considerable length of time, or is there another,
better way way to figure Joomla's root path?

--
Aaron Clausen
mightym...@gmail.com
Reply all
Reply to author
Forward
0 new messages