BP_GOPP_Image_Editor_GS::test_gs_cmd( string $cmd )
Tests whether a purported Ghostscript executable works.
Description
Parameters
- $cmd
-
(Required) Ghostscript executable to try.
Return
(bool)
Source
File: bp-document/classes/class-bp-gopp-image-editor-gs.php
protected static function test_gs_cmd( $cmd ) {
// Note if exec() has been disabled by means not reflected in function_exists() it may barf here and throw warnings so initial vars.
$return_var = -1;
$output = array();
exec( self::escapeshellarg( $cmd ) . ' -dBATCH -dNOPAUSE -dNOPROMPT -dSAFER -v 2>&1', $output, $return_var );
return 0 === $return_var && is_array( $output ) && ! empty( $output[0] ) && is_string( $output[0] ) && false !== stripos( $output[0], 'ghostscript' );
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.4.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.