Open Journal Systems  3.3.0
BagItFetch Class Reference

Public Member Functions

 __construct ($fileName, $fileEncoding='UTF-8')
 
 add ($url, $filename)
 
 clear ()
 
 download ()
 
 getData ()
 
 read ()
 
 write ()
 

Data Fields

 $data
 
 $fileEncoding
 
 $fileName
 

Detailed Description

Definition at line 45 of file bagit_fetch.php.

Constructor & Destructor Documentation

◆ __construct()

BagItFetch::__construct (   $fileName,
  $fileEncoding = 'UTF-8' 
)

This initializes a new BagItFetch instance.

Parameters
string$fileNameThis is the file name for the fetch file.
string$fileEncodingThis is the encoding to use when reading or writing the fetch file. The default is 'UTF-8'.

Definition at line 94 of file bagit_fetch.php.

References $fileEncoding, $fileName, and read().

Member Function Documentation

◆ add()

BagItFetch::add (   $url,
  $filename 
)

This adds an entry to the fetch data.

Parameters
string$urlThis is the URL to load the file from.
string$filenameThis is the file name, relative to the fetch file's directory, to save the data to.
Returns
void

Definition at line 182 of file bagit_fetch.php.

References write().

◆ clear()

BagItFetch::clear ( )

This clears the fetch data and the file.

Returns
void

Definition at line 167 of file bagit_fetch.php.

◆ download()

BagItFetch::download ( )

This downloads the files in the fetch information that aren't on the file system.

Returns
void

Definition at line 197 of file bagit_fetch.php.

◆ getData()

BagItFetch::getData ( )

This returns the fetch data.

Returns
array The fetch data.

Definition at line 110 of file bagit_fetch.php.

References $data.

◆ read()

BagItFetch::read ( )

This reads the data from the fetch file and populates the data array.

Returns
array The data from the file.

Definition at line 120 of file bagit_fetch.php.

Referenced by __construct().

◆ write()

BagItFetch::write ( )

This writes the data to the fetch file.

Returns
void

Definition at line 144 of file bagit_fetch.php.

References $data.

Referenced by add().

Field Documentation

◆ $data

array BagItFetch::$data

The data from the fetch file.

This is an array-list containing array-mappings with the keys 'url', 'length', and 'filename'.

Definition at line 71 of file bagit_fetch.php.

Referenced by getData(), and write().

◆ $fileEncoding

string BagItFetch::$fileEncoding

The character encoding for the data in the fetch file.

Definition at line 81 of file bagit_fetch.php.

Referenced by __construct().

◆ $fileName

string BagItFetch::$fileName

The file name containing the fetch information.

Definition at line 58 of file bagit_fetch.php.

Referenced by __construct().


The documentation for this class was generated from the following file: