PHP Class PressBooks\Modules\Export\Odt\Odt

Inheritance: extends Pressbooks\Modules\Export\Export
Mostrar archivo Open project: pressbooks/pressbooks Class Usage Examples

Public Properties

Property Type Description
$compressImages boolean Compress images?
$logfile string Fullpath to log file used by Saxon.
$timeout integer Used with wp_remote_get()
$url string Service URL

Public Methods

Method Description
__construct ( array $args )
convert ( ) : boolean Create $this->outputPath
deleteDirectory ( $dirpath ) * Recursive Directory Deletion for media folder
hasDependencies ( ) : boolean Dependency check.
logError ( $message, array $more_info = [] ) Add $this->url as additional log info, fallback to parent.
validate ( ) : boolean Check the sanity of $this->outputPath

Protected Methods

Method Description
fetchAndSaveUniqueImage ( $url, $fullpath ) : string Fetch an image with wp_remote_get(), save it to $fullpath with a unique name.
isOdt ( string $file ) : boolean Verify if body is actual ODT
queryXhtml ( ) : boolean | string Query the access protected "format/xhtml" URL, return the results.

Method Details

__construct() public method

public __construct ( array $args )
$args array

convert() public method

Create $this->outputPath
public convert ( ) : boolean
return boolean

deleteDirectory() public static method

* Recursive Directory Deletion for media folder
public static deleteDirectory ( $dirpath )

fetchAndSaveUniqueImage() protected method

Will return an empty string if something went wrong.
protected fetchAndSaveUniqueImage ( $url, $fullpath ) : string
$url string
$fullpath string
return string filename

hasDependencies() static public method

Dependency check.
static public hasDependencies ( ) : boolean
return boolean

isOdt() protected method

Verify if body is actual ODT
protected isOdt ( string $file ) : boolean
$file string
return boolean

logError() public method

Add $this->url as additional log info, fallback to parent.
public logError ( $message, array $more_info = [] )
$message
$more_info array (unused, overridden)

queryXhtml() protected method

Query the access protected "format/xhtml" URL, return the results.
protected queryXhtml ( ) : boolean | string
return boolean | string

validate() public method

Check the sanity of $this->outputPath
public validate ( ) : boolean
return boolean

Property Details

$compressImages public_oe property

Compress images?
public bool $compressImages
return boolean

$logfile public_oe property

Fullpath to log file used by Saxon.
public string $logfile
return string

$timeout public_oe property

Used with wp_remote_get()
public int $timeout
return integer

$url public_oe property

Service URL
public string $url
return string