function installPath() { $path = dirname(str_replace('//', '/', str_replace(str_replace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT'])), '/', str_replace('\\', '/', dirname(realpath(__FILE__)))))); $path = checkSlash($path, 'remove'); return $path; }
if ($fromPath && substr($ocrFilesPath, 0, 3) == '../') { $zoomDirInfo = pathinfo(checkSlash(dirname(dirname($fromPath)) . substr($ocrFilesPath, 2), 'add')); if (!is_dir(checkSlash($fpPP . checkSlash(dirname(dirname($fromPath)) . substr($ocrFilesPath, 2), 'add'), 'add'))) { unset($zoomDirInfo); } } elseif ($fromPath && substr($ocrFilesPath, 0, 1) != '/') { $zoomDirInfo = pathinfo(checkSlash(dirname(dirname($fromPath)) . '/' . $ocrFilesPath, 'add')); if (!is_dir(checkSlash($fpPP . checkSlash(dirname(dirname($fromPath)) . '/' . $ocrFilesPath, 'add'), 'add'))) { unset($zoomDirInfo); } } if (is_array($zoomDirInfo)) { $ocrFilesPath = checkSlash('/' . $zoomDirInfo['dirname'] . '/' . $zoomDirInfo['basename'], 'add'); } } $ocrFilesPath = checkSlash($ocrFilesPath, 'add'); if (is_dir($fpPP . $ocrFilesPath)) { $scandirResults = array_values(array_diff(scandir($fpPP . $ocrFilesPath), array('..', '.'))); } else { array_push($errorArray, $fpPP . $ocrFilesPath . ' is not a directory.'); azError($errorArray); exit; } if ($pageNumber && $scandirResults[$pageNumber - 1]) { $pageArray = $scandirResults[$pageNumber - 1]; $scandirResults = array(); $scandirResults[$pageNumber - 1] = $pageArray; } if (count($scandirResults) == 0) { array_push($errorArray, $fpPP . $ocrFilesPath . ' contains no files.'); azError($errorArray);