KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/irtiweb/CATS/lib/artichow/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/irtiweb/CATS/lib/artichow/common.php
<?php
/*
 * This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication,
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */

/*
 * Get the minimum of an array and ignore non numeric values
 */
function array_min($array) {

	if(is_array($array) and count($array) > 0) {

		do {
			$min = array_pop($array);
			if(is_numeric($min === FALSE)) {
				$min = NULL;
			}
		} while(count($array) > 0 and $min === NULL);

		if($min !== NULL) {
			$min = (float)$min;
		}

		foreach($array as $value) {
			if(is_numeric($value) and (float)$value < $min) {
				$min = (float)$value;
			}
		}

		return $min;

	}

	return NULL;

}

/*
 * Get the maximum of an array and ignore non numeric values
 */
function array_max($array) {

	if(is_array($array) and count($array) > 0) {

		do {
			$max = array_pop($array);
			if(is_numeric($max === FALSE)) {
				$max = NULL;
			}
		} while(count($array) > 0 and $max === NULL);

		if($max !== NULL) {
			$max = (float)$max;
		}

		foreach($array as $value) {
			if(is_numeric($value) and (float)$value > $max) {
				$max = (float)$value;
			}
		}

		return $max;

	}

	return NULL;

}

/*
 * Register a class with the prefix in configuration file
 */
function registerClass($class, $abstract = FALSE) {

	if(ARTICHOW_PREFIX === 'aw') {
		return;
	}


	if($abstract) {
		$abstract = 'abstract';
	} else {
		$abstract = '';
	}


	eval($abstract." class ".ARTICHOW_PREFIX.$class." extends aw".$class." { }");

}

/*
 * Register an interface with the prefix in configuration file
 */
function registerInterface($interface) {

	if(ARTICHOW_PREFIX === 'aw') {
		return;
	}


	eval("interface ".ARTICHOW_PREFIX.$interface." extends aw".$interface." { }");


}
?>

Anon7 - 2021