API:EPrints/Utils

From EPrints Documentation
Revision as of 13:52, 25 February 2010 by Tdb01r (talk | contribs)
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::Utils - Utility functions for EPrints.

User Comments


SYNOPSIS

 $boolean = EPrints::Utils::is_set( $object ) 
 # return true if an object/scalar/array has any data in it
 
 # copy the contents of the url to a file
 $response = EPrints::Utils::wget( 
   $handle, 
   "http://www.eprints.org/index.php", 
   "temp_dir/my_file" ) 
 if($response->is_sucess()){ do something...}
 
 $name = { given=>"Wendy", family=>"Hall", honourific=>"Dame" };
 # return Dame Wendy Hall
 $string = EPrints::Utils::make_name_string( $name, 1 );
 # return Dame Hall, Wendy
 $string = EPrints::Utils::make_name_string( $name, 0 );
 
 # returns http://www.eprints.org?var=%3Cfoo%3E
 $string = EPrints::Utils::url_escape( "http://www.eprints.org?var=<foo>" ); 
 
 $esc_string = EPrints::Utils::escape_filename( $string );
 $string = EPrints::Utils::unescape_filename( $esc_string );
 
 $filesize_text = EPrints::Utils::human_filesize( 3300 ); 
 # returns "3kb"
 

User Comments


DESCRIPTION

This package contains functions which don't belong anywhere else.

User Comments


METHODS

User Comments