Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Loader)
- *
- * @ Version : 2.0.0.3
- * @ Author : DeZender
- * @ Release on : 06.05.2013
- * @ Official site : http://DeZender.Net
- *
- */
- function config() {
- $args = func_get_args();
- foreach ($args as $arg) {
- if (file_exists(APP . "Config" . DS . $arg . ".php")) {
- include_once(APP . "Config" . DS . $arg . ".php");
- if (!(count($args) == 1)) {
- continue;
- }
- return true;
- }
- if (!(count($args) == 1)) {
- continue;
- }
- return false;
- }
- return true;
- }
- function debug($var = false, $showHtml = null, $showFrom = true) {
- if (0 < Configure::read("debug")) {
- App::uses("Debugger", "Utility");
- $file = "";
- $line = "";
- $lineInfo = "";
- if ($showFrom) {
- $trace = Debugger::trace(array("start" => 1, "depth" => 2, "format" => "array"));
- $file = str_replace(array(CAKE_CORE_INCLUDE_PATH, ROOT), "", $trace[0]["file"]);
- $line = $trace[0]["line"];
- }
- $html = "<div class=\"cake-debug-output\">\x0d\x0a%s\x0d\x0a<pre class=\"cake-debug\">\x0d\x0a%s\x0d\x0a</pre>\x0d\x0a</div>";
- $text = "%s\x0d\x0a########## DEBUG ##########\x0d\x0a%s\x0d\x0a###########################";
- $template = $html;
- if (php_sapi_name() == "cli" || $showHtml === false) {
- $template = $text;
- if ($showFrom) {
- $lineInfo = sprintf("%s (line %s)", $file, $line);
- }
- }
- if ($showHtml === null && $template !== $text) {
- $showHtml = true;
- }
- $var = Debugger::exportVar($var, 25);
- if ($showHtml) {
- $template = $html;
- $var = h($var);
- if ($showFrom) {
- $lineInfo = sprintf("<span><strong>%s</strong> (line <strong>%s</strong>)</span>", $file, $line);
- }
- }
- printf($template, $lineInfo, $var);
- }
- }
- function h($text, $double = true, $charset = null) {
- if (is_array($text)) {
- $texts = array();
- foreach ($text as $k => $t) {
- $texts[$k] = h($t, $double, $charset);
- }
- return $texts;
- }
- if (is_object($text)) {
- if (method_exists($text, "__toString")) {
- $text = (string)$text;
- }
- else {
- $text = "(object)" . get_class($text);
- }
- }
- static $defaultCharset;
- if ($defaultCharset === false) {
- $defaultCharset = Configure::read("App.encoding");
- if ($defaultCharset === null) {
- $defaultCharset = "UTF-8";
- }
- }
- if (is_string($double)) {
- $charset = $double;
- }
- return htmlspecialchars($text, ENT_QUOTES, $charset ? $charset : $defaultCharset, $double);
- }
- function pluginSplit($name, $dotAppend = false, $plugin = null) {
- if (strpos($name, ".") !== false) {
- $parts = explode(".", $name, 2);
- if ($dotAppend) {
- $parts[0] .= ".";
- }
- return $parts;
- }
- return array($plugin, $name);
- }
- function pr($var) {
- if (0 < Configure::read("debug")) {
- echo("<pre>");
- print_r($var);
- echo("</pre>");
- }
- }
- function am() {
- $r = array();
- $args = func_get_args();
- foreach ($args as $a) {
- if (!(is_array($a))) {
- $a = array($a);
- }
- $r = array_merge($r, $a);
- }
- return $r;
- }
- function env($key) {
- if ($key === "HTTPS") {
- if (isset($_SERVER["HTTPS"])) {
- return !(empty($_SERVER["HTTPS"])) && $_SERVER["HTTPS"] !== "off";
- }
- return strpos(env("SCRIPT_URI"), "https://") === 0;
- }
- if ($key === "SCRIPT_NAME") {
- if (env("CGI_MODE") && isset($_ENV["SCRIPT_URL"])) {
- $key = "SCRIPT_URL";
- }
- }
- $val = null;
- if (isset($_SERVER[$key])) {
- $val = $_SERVER[$key];
- }
- else {
- if (isset($_ENV[$key])) {
- $val = $_ENV[$key];
- }
- else {
- if (getenv($key) !== false) {
- $val = getenv($key);
- }
- }
- }
- if ($key === "REMOTE_ADDR" && $val === env("SERVER_ADDR")) {
- $addr = env("HTTP_PC_REMOTE_ADDR");
- if ($addr !== null) {
- $val = $addr;
- }
- }
- if ($val !== null) {
- return $val;
- }
- switch ($key) {
- case "SCRIPT_FILENAME":
- if (defined("SERVER_IIS") && SERVER_IIS === true) {
- return str_replace("\\\\", "\\", env("PATH_TRANSLATED"));
- }
- break;
- case "DOCUMENT_ROOT":
- $name = env("SCRIPT_NAME");
- $filename = env("SCRIPT_FILENAME");
- $offset = 0;
- if (!(strpos($name, ".php"))) {
- $offset = 4;
- }
- return substr($filename, 0, 0 - (strlen($name) + $offset));
- case "PHP_SELF":
- return str_replace(env("DOCUMENT_ROOT"), "", env("SCRIPT_FILENAME"));
- case "CGI_MODE":
- return PHP_SAPI === "cgi";
- case "HTTP_BASE":
- $host = env("HTTP_HOST");
- $parts = explode(".", $host);
- $count = count($parts);
- if ($count === 1) {
- return "." . $host;
- }
- if ($count === 2) {
- return "." . $host;
- }
- if ($count === 3) {
- $gTLD = array("aero", "asia", "biz", "cat", "com", "coop", "edu", "gov", "info", "int", "jobs", "mil", "mobi", "museum", "name", "net", "org", "pro", "tel", "travel", "xxx");
- if (in_array($parts[1], $gTLD)) {
- return "." . $host;
- }
- }
- array_shift($parts);
- return "." . implode(".", $parts);
- }
- }
- function cache($path, $data = null, $expires = "+1 day", $target = "cache") {
- if (Configure::read("Cache.disable")) {
- return null;
- }
- $now = time();
- if (!(is_numeric($expires))) {
- $expires = strtotime($expires, $now);
- }
- switch (strtolower($target)) {
- case "cache":
- $filename = CACHE . $path;
- ....................................................................
- .................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement