CGI::Wiki::Store::Mediawiki

CGI::Wiki::Store::Mediawiki is a Mediawiki (MySQL) storage backend for CGI::Wiki.
Download

CGI::Wiki::Store::Mediawiki Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Derek Price
  • Publisher web site:
  • http://search.cpan.org/~dprice/CGI-Wiki-Store-Mediawiki-0.02/lib/CGI/Wiki/Store/Mediawiki.pm

CGI::Wiki::Store::Mediawiki Tags


CGI::Wiki::Store::Mediawiki Description

CGI::Wiki::Store::Mediawiki is a Mediawiki (MySQL) storage backend for CGI::Wiki. CGI::Wiki::Store::Mediawiki is a Mediawiki (MySQL) storage backend for CGI::Wiki.SYNOPSISImplementation of CGI::Wiki::Store::Database which reads and writes to a Mediawiki 1.6 database running in MySQL.All date and time values are returned as Time::Piece::Adaptive objects. This should be transparent for most uses.See CGI::Wiki::Store::Database for more.METHODScheck_and_write_node $store->check_and_write_node (node => $node, checksum => $checksum, %other_args);Locks the node, verifies the checksum, calls write_node_post_locking with all supplied arguments, unlocks the node. Returns 1 on successful writing, 0 if checksum doesn't match, croaks on error.Note: Uses MySQL's user level locking, so any locks are released when the database handle disconnects. Doing it like this because I can't seem to get it to work properly with transactions.newLike the new function from CGI::Wiki::Store::MySQL, but also requires a `wikiname' argument.list_all_nodesLike the parent function, but accepts limit & offset arguments.list_recent_changesLike the parent method, but the limit argument may be used in conjunction with the others (since, days, and between_days are still mutually exclusive). A new, $args{between_secs} argument is also processed. Its contents should be two unix timestamps.get_previous_version $store->get_previous_version ($node_name, $node_version, %other_args);Given a version number, returns the previous version for the given node. This function is necessary because mediawiki gives every revision of every page a version number which is unique across all pages.Techincally, node name shouldn't be necessary here, but it allows for a faster search and you probably have it. Not requiring it would be an easy hack.get_next_version $store->get_next_version ($node_name, $node_version, %other_args);Given a version number, returns the next version for the given node. This function is necessary because mediawiki gives every revision of every page a version number which is unique across all pages.Techincally, node name shouldn't be necessary here, but it allows for a faster search and you probably have it. Not requiring it would be an easy hack.get_current_version $store->get_current_version ($node); $store->get_current_version (name => $node, %other_args);Given a node, returns the current (most recent) version, or undef, if the node does not exist.write_node_post_lockingLike the parent function, but works with the mediawiki DB.node_exists $store->node_exists ($node); $store->node_exists (name => $node, %other_args);Like the parent function of the same name, but much faster. Really just a wrapper for get_current_version, returns the current version number when it exists and undef otherwise.list_backlinks # List all nodes that link to the Home Page. my @links = $store->list_backlinks (node => "Home Page");list_dangling_links # List all nodes that have been linked to from other nodes but don't # yet exist. my @links = $store->list_dangling_links;Each node is returned once only, regardless of how many other nodes link to it. Nodes are be returned unsorted.list_dangling_links_w_count # List all nodes that have been linked to from other nodes but don't # yet exist, with a reference count. foreach my $link ($store->list_dangling_links_w_count) { print "Missing `", $link->, "' has ", $link->, " references.n"; }Nodes are returned sorted primarily by the reference count, greatest first, and secondarily in alphabetical order.validate_user my $username = $store->validate_user ($username, $password, %other_args);Given a username and a password, return the username if it exists and password is correct, or undef, otherwise.The returned username may be different from the one passed in when $args{ignore_case} is set.create_new_user my $errmsg = $store->create_new_user (name => $username, password => $p);Create a new user. name and password are required arguments. Optional arguments are email & real_name.Returns a potentially empty list of error messages. Requirements: · CGI::Wiki::Store::Database · Perl


CGI::Wiki::Store::Mediawiki Related Software