CMS::Joomla - Joomla! CMS configuration and database access Perl module
Read Joomla! configuration variables:
use CMS::Joomla; my ($joomla) = CMS::Joomla->new("/path/to/joomla/configuration.php"); print "Site name: " . $joomla->cfg->{'sitename'} . "\n";
Access Joomla! database:
my ($jdb) = $joomla->dbhandle( { AutoCommit => 1 } ); my ($sth) = $jdb->prepare("SELECT introtext " . "FROM " . $joomla->dbprefix . "content " . "WHERE title=?"); $sth->execute("about"); while (my ($introtext) = $sth->fetchrow_array) { print "$introtext\n"; } ...
This module provides an interface for reading Joomla! CMS configuration variables and connecting to the Joomla! database from Perl script.
Creates CMS::Joomla object. The CFGFILE parameter should be a file name of a valid readable Joomla! configuration.php file. Returns undef in case of error.
CMS::Joomla
Return a reference to a hash containing all Joomla! configuration variables in this CMS::Joomla object.
Returns a DBI database handle object which is connected to the corresponding Joomla! database. See DBI for more information on how to use the returned database handle. Consecutive calls to this function will return the same DBI handle instead of opening a new connection each time.
DBI
ARGS is passed directly to the DBI handle constructor.
Returns undef in case of error.
Return a reference to the Joomla! database prefix. This is effectively a shortcut for $joomla->cfg->{'dbprefix'}.
$joomla->cfg->{'dbprefix'}
Some functional example scripts are available at:
http://dist.epipe.com/joomla/perl/
DBI, DBD::mysql, http://www.joomla.org/
Copyright (c) 2008, 2011 EPIPE Communications <epipe at cpan.org> http://epipe.com/
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install CMS::Joomla, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CMS::Joomla
CPAN shell
perl -MCPAN -e shell install CMS::Joomla
For more information on module installation, please visit the detailed CPAN module installation guide.