44 lines
882 B
PHP
44 lines
882 B
PHP
<?php
|
|
|
|
/**
|
|
* Check whether the current php-armadillo build supports certain feature.
|
|
*
|
|
* @param bool $feature
|
|
* @param string $msg
|
|
* @return bool
|
|
*/
|
|
function arma_supports($feature, $msg) {
|
|
if (!$feature) {
|
|
echo "skip $msg is not supported.";
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Check whether operator overloading is supported.
|
|
*
|
|
* @return bool
|
|
*/
|
|
function supports_operator_overloading() {
|
|
return arma_supports(Arma\Features::OPERATORS, 'operator overloading');
|
|
}
|
|
|
|
/**
|
|
* Check whether I/O with PHP stream resource is supported.
|
|
*
|
|
* @return bool
|
|
*/
|
|
function supports_stream_resource() {
|
|
return arma_supports(Arma\Features::STREAM_RES, 'stream resource');
|
|
}
|
|
|
|
/**
|
|
* Check whether HDF5 data format is supported.
|
|
*
|
|
* @return bool
|
|
*/
|
|
function supports_hdf5() {
|
|
return arma_supports(Arma\Features::HDF5, 'HDF5 data format');
|
|
}
|