NAME

Xcruciate::Utils - Utilities for Xcruciate

SYNOPSIS

check_path('A very nice path',$path,'rw');

DESCRIPTION

Provides utility functions Xcruciate ( http://www.xcruciate.co.uk). You shouldn't need to use these directly.

AUTHOR

Mark Howe, <melonman@cpan.org>

EXPORT

None

FUNCTIONS

check_path(option,path,permissions[,non_fatal])

Checks that the path exists, and that it has the appropriate permissions, where permissions contains some combination of r, w and x. If not, and if non_fatal is perlishly false, it dies, using the value of option to produce a semi-intelligable error message. If non_fatal is perlishly true it returns the error or an empty string.

check_absolute_path(option,path,permissions[,non_fatal])

A lot like &check_path (which it calls), but also checks that the path is absolute (ie is starts with a /).

type_check(path,name,value,record)

Returns errors on typechecking value against record. Name is provided for error messages. Path is from config file.

apache_time(epoch_time)

Produces an apache-style timestamp from an epoch time.

datetime(epoch_time)

Converts GMT epoch time to the format expected by XSLT date functions.

index_docroot($docroot_path,$mimetypes_hash)

Returns XML describing the contents of $docroot_path.

BUGS

The best way to report bugs is via the Xcruciate bugzilla site (http://www.xcruciate.co.uk/bugzilla).

COMING SOON

A lot more code that is currently spread across assorted scripts, probably split into several modules.

PREVIOUS VERSIONS

0.01: First upload

0.03: First upload containing module

0.04: Changed minimum perl version to 5.8.8

0.05: Added debug_list data type, fixed uninitialised variable error when numbers aren't.

0.07: Attempt to put all Xcruciate modules in one PAUSE tarball.

0.08: Added index_docroot (previously inline code in xcruciate script)

0.09: Fixed typo in error message. Use Carp for errors. Non-fatal option for check_path()

0.10: Prepend path entry to relative paths

COPYRIGHT AND LICENSE

Copyright (C) 2007 - 2009 by SARL Cyberporte/Menteith Consulting

This library is distributed under BSD licence (http://www.xcruciate.co.uk/licence-code).