This repository has been archived on 2020-06-07. You can view files and clone it, but cannot push or open issues or pull requests.
php-armadillo/tests/includes/supports.php

44 lines
882 B
PHP
Raw Normal View History

2019-04-16 11:00:26 +00:00
<?php
2019-04-16 11:00:50 +00:00
/**
2019-06-08 10:04:30 +00:00
* Check whether the current php-armadillo build supports certain feature.
2019-04-16 11:00:50 +00:00
*
2019-06-08 10:04:30 +00:00
* @param bool $feature
* @param string $msg
2019-04-16 11:00:50 +00:00
* @return bool
*/
2019-06-08 10:04:30 +00:00
function arma_supports($feature, $msg) {
if (!$feature) {
echo "skip $msg is not supported.";
2019-04-16 11:00:50 +00:00
return false;
}
return true;
}
2019-06-08 10:04:30 +00:00
/**
* Check whether operator overloading is supported.
*
* @return bool
*/
function supports_operator_overloading() {
return arma_supports(Arma\Features::OPERATORS, 'operator overloading');
}
2019-07-12 17:50:16 +00:00
/**
* 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');
}
2019-06-08 10:04:30 +00:00
/**
* Check whether HDF5 data format is supported.
*
* @return bool
*/
function supports_hdf5() {
return arma_supports(Arma\Features::HDF5, 'HDF5 data format');
}