| CMS-Joomla documentation | view source | Contained in the CMS-Joomla distribution. |
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.
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.
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'}.
Some functional example scripts are available at:
Copyright (c) 2008 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.
| CMS-Joomla documentation | view source | Contained in the CMS-Joomla distribution. |