Movatterモバイル変換


[0]ホーム

URL:


 / 
Drupal-Admin-0.04
River stage zero No dependents
/Drupal::Admin

NAME

Drupal::Admin - screen scraping Perl API to some Drupal admin functions

SYNOPSIS

use Drupal::Admin;my $admin = new Drupal::Admin(baseurl => 'http://localhost');$admin->login(user => 'admin', password => 'lukeskywalker')$admin->offline;$admin->online;$admin->update;$admin->runcron;my $statusreport = $admin->status;my $status = $admin->enabletheme('garland, 0');my $theme = $admin->defaulttheme('bluemarine');

NOTES

Most of the methods in this class depend on English strings from the pages'value fields, because WWW:Mechanize doesn't useid fields as selectors. This module will most likely not work for sites that aren't in English.

METHODS

new

Constructor takes requiredbaseurl parameter (without a terminating slash).

login

Perform login to the site. Takes two required parameters,user andpassword. The user must have administrator privileges within drupal. Calls die() on error.

offline

Take the site offline.

online

Bring the site online.

update

Runs the update.php script. Calls die() on error.

status

Returns a parsed status report. The returned data structure is of the form:

$report = {           info => [],           ok => [],           warning => [],           error => []          };

The elements of the arrays are Drupal::Admin::Status objects, which have the following read-only accessor methods:

type

info,ok,warning orerror

title

Name of the status item

status

Status message

comment

Additional comment (optional; warnings and errors usually have one)

runcron

Run the cron script once.

enabletheme

Enable/disable a theme. Takes theme name argument (as used in the form; this is generally a lowercase version of the user visible label), and optional boolean status argument. Returns current status.

defaulttheme

Get/set default theme. Takes optional theme name argument. Returns current default theme. Note that setting a theme as default will automatically enable it.

modulestate

Returns a Drupal::Admin::ModuleState object. See documentation in that module.

Module Install Instructions

To install Drupal::Admin, copy and paste the appropriate command in to your terminal.

cpanm

cpanm Drupal::Admin

CPAN shell

perl -MCPAN -e shellinstall Drupal::Admin

For more information on module installation, please visitthe detailed CPAN module installation guide.

Keyboard Shortcuts

Global
sFocus search bar
?Bring up this help dialog
GitHub
gpGo to pull requests
gigo to github issues (only if github is preferred repository)
POD
gaGo to author
gcGo to changes
giGo to issues
gdGo to dist
grGo to repository/SCM
gsGo to source
gbGo to file browse
Search terms
module: (e.g.module:Plugin)
distribution: (e.g.distribution:Dancer auth)
author: (e.g.author:SONGMU Redis)
version: (e.g.version:1.00)

[8]ページ先頭

©2009-2025 Movatter.jp