34        define(
'PHPEXCEL_ROOT', dirname(__FILE__) . 
'/../../');
 
   35        require(PHPEXCEL_ROOT . 
'PHPExcel/Autoloader.php');
 
   40define(
'MAX_VALUE', 1.2e308);
 
   43define(
'M_2DIVPI', 0.63661977236758134307553505349006);
 
   46define(
'MAX_ITERATIONS', 256);
 
   49define(
'PRECISION', 8.88E-016);
 
   94                                                                                         'divisionbyzero'       => 
'#DIV/0!',
 
   96                                                                                         'reference'            => 
'#REF!',
 
  100                                                                                         'gettingdata'          => 
'#GETTING_DATA' 
  156                if (($returnDateType == self::RETURNDATE_PHP_NUMERIC) ||
 
  157                        ($returnDateType == self::RETURNDATE_PHP_OBJECT) ||
 
  158                        ($returnDateType == self::RETURNDATE_EXCEL)) {
 
  159                        self::$ReturnDateType = $returnDateType;
 
  190                return '#Not Yet Implemented';
 
  201        public static function DIV0() {
 
  202                return self::$_errorCodes[
'divisionbyzero'];
 
  219        public static function NA() {
 
  220                return self::$_errorCodes[
'na'];
 
  233        public static function NaN() {
 
  234                return self::$_errorCodes[
'num'];
 
  247        public static function NAME() {
 
  248                return self::$_errorCodes[
'name'];
 
  261        public static function REF() {
 
  262                return self::$_errorCodes[
'reference'];
 
  275        public static function NULL() {
 
  276                return self::$_errorCodes[
'null'];
 
  290                return self::$_errorCodes[
'value'];
 
  295                return ((substr_count($idx,
'.') <= 1) || (preg_match(
'/\.[A-Z]/',$idx) > 0));
 
  300                return (substr_count($idx,
'.') == 0);
 
  305                return (substr_count($idx,
'.') > 1);
 
  311                if (!isset($condition{0}))
 
  313                if (!in_array($condition{0},array(
'>', 
'<', 
'='))) {
 
  315                        return '='.$condition;
 
  317                        preg_match(
'/([<>=]+)(.*)/',$condition,$matches);
 
  318                        list(,$operator,$operand) = $matches;
 
  320                        if (!is_numeric($operand)) {
 
  321                                $operand = str_replace(
'"', 
'""', $operand);
 
  325                        return $operator.$operand;
 
  357                if (!is_null($value)) {
 
  361                return is_null($value);
 
  371        public static function IS_ERR($value = 
'') {
 
  387                if (!is_string($value))
 
  389                return in_array($value, array_values(self::$_errorCodes));
 
  399        public static function IS_NA($value = 
'') {
 
  402                return ($value === self::NA());
 
  417                if ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value))))
 
  419                return ($value % 2 == 0);
 
  434                if ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value))))
 
  436                return (abs($value) % 2 == 1);
 
  449                if (is_string($value)) {
 
  452                return is_numeric($value);
 
  465                return is_bool($value);
 
  478                return (is_string($value) && !self::IS_ERROR($value));
 
  499                return 'PHPExcel 1.8.1, 2015-04-30';
 
  518        public static function N($value = 
NULL) {
 
  519                while (is_array($value)) {
 
  520                        $value = array_shift($value);
 
  523                switch (gettype($value)) {
 
  530                                return (integer) $value;
 
  534                                if ((strlen($value) > 0) && ($value{0} == 
'#')) {
 
  559                if (is_array($value) && (count($value) > 1)) {
 
  560                        $a = array_keys($value);
 
  563                        if (self::isCellValue($a)) {
 
  566                        } elseif (self::isMatrixValue($a)) {
 
  569                } elseif(empty($value)) {
 
  575                if (($value === 
NULL) || (is_float($value)) || (is_int($value))) {
 
  577                } elseif(is_bool($value)) {
 
  579                } elseif(is_array($value)) {
 
  581                } elseif(is_string($value)) {
 
  583                        if ((strlen($value) > 0) && ($value{0} == 
'#')) {
 
  599                if (!is_array($array)) {
 
  600                        return (array) $array;
 
  603                $arrayValues = array();
 
  604                foreach ($array as $value) {
 
  605                        if (is_array($value)) {
 
  606                                foreach ($value as $val) {
 
  607                                        if (is_array($val)) {
 
  608                                                foreach ($val as $v) {
 
  612                                                $arrayValues[] = $val;
 
  616                                $arrayValues[] = $value;
 
  631                if (!is_array($array)) {
 
  632                        return (array) $array;
 
  635                $arrayValues = array();
 
  636                foreach ($array as $k1 => $value) {
 
  637                        if (is_array($value)) {
 
  638                                foreach ($value as $k2 => $val) {
 
  639                                        if (is_array($val)) {
 
  640                                                foreach ($val as $k3 => $v) {
 
  641                                                        $arrayValues[$k1.
'.'.$k2.
'.'.$k3] = $v;
 
  644                                                $arrayValues[$k1.
'.'.$k2] = $val;
 
  648                                $arrayValues[$k1] = $value;
 
  663                while (is_array($value)) {
 
  664                        $value = array_pop($value);
 
  678if (!function_exists(
'acosh')) {
 
  680                return 2 * log(sqrt((
$x + 1) / 2) + sqrt((
$x - 1) / 2));
 
  684if (!function_exists(
'asinh')) {
 
  686                return log(
$x + sqrt(1 + 
$x * 
$x));
 
  690if (!function_exists(
'atanh')) {
 
  692                return (log(1 + 
$x) - log(1 - 
$x)) / 2;
 
  701if ((!function_exists(
'mb_str_replace')) &&
 
  702        (function_exists(
'mb_substr')) && (function_exists(
'mb_strlen')) && (function_exists(
'mb_strpos'))) {
 
  703        function mb_str_replace($search, $replace, $subject) {
 
  704                if(is_array($subject)) {
 
  706                        foreach($subject as 
$key => $val) {
 
  707                                $ret[
$key] = mb_str_replace($search, $replace, $val);
 
  712                foreach((array) $search as 
$key => 
$s) {
 
  713                        if(
$s == 
'' && 
$s !== 0) {
 
  716                        $r = !is_array($replace) ? $replace : (array_key_exists(
$key, $replace) ? $replace[
$key] : 
'');
 
  717                        $pos = mb_strpos($subject, 
$s, 0, 
'UTF-8');
 
  718                        while($pos !== 
false) {
 
  719                                $subject = mb_substr($subject, 0, $pos, 
'UTF-8') . 
$r . mb_substr($subject, $pos + mb_strlen(
$s, 
'UTF-8'), 65535, 
'UTF-8');
 
  720                                $pos = mb_strpos($subject, 
$s, $pos + mb_strlen(
$r, 
'UTF-8'), 
'UTF-8');
 
An exception for terminatinating execution or to throw for unit testing.
static isMatrixValue($idx)
const RETURNDATE_PHP_OBJECT
static IS_TEXT($value=NULL)
IS_TEXT.
static getReturnDateType()
static $compatibilityMode
static getCompatibilityMode()
static _ifCondition($condition)
static IS_NUMBER($value=NULL)
IS_NUMBER.
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
const COMPATIBILITY_GNUMERIC
static IS_NONTEXT($value=NULL)
IS_NONTEXT.
static setReturnDateType($returnDateType)
static IS_LOGICAL($value=NULL)
IS_LOGICAL.
static IS_ERR($value='')
IS_ERR.
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
const COMPATIBILITY_EXCEL
constants
static IS_BLANK($value=NULL)
IS_BLANK.
static setCompatibilityMode($compatibilityMode)
const RETURNDATE_PHP_NUMERIC
static IS_ODD($value=NULL)
IS_ODD.
static flattenArrayIndexed($array)
Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing.
static ERROR_TYPE($value='')
ERROR_TYPE.
static IS_ERROR($value='')
IS_ERROR.
const COMPATIBILITY_OPENOFFICE
static IS_NA($value='')
IS_NA.
static IS_EVEN($value=NULL)
IS_EVEN.
static TYPE($value=NULL)
TYPE.
static _wrapResult($value)
Wrap string values in quotes.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'