當前位置: 首頁>>代碼示例>>PHP>>正文


PHP path::url2fullPath方法代碼示例

本文整理匯總了PHP中path::url2fullPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP path::url2fullPath方法的具體用法?PHP path::url2fullPath怎麽用?PHP path::url2fullPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在path的用法示例。


在下文中一共展示了path::url2fullPath方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct()
 {
     // DISABLE MAGIC QUOTES
     if (function_exists('set_magic_quotes_runtime')) {
         @set_magic_quotes_runtime(false);
     }
     // INPUT INIT
     $input = new input();
     $this->get =& $input->get;
     $this->post =& $input->post;
     $this->cookie =& $input->cookie;
     // SET CMS INTEGRATION ATTRIBUTE
     if (isset($this->get['cms']) && in_array($this->get['cms'], array("drupal"))) {
         $this->cms = $this->get['cms'];
     }
     // LINKING UPLOADED FILE
     if (count($_FILES)) {
         $this->file =& $_FILES[key($_FILES)];
     }
     // LOAD DEFAULT CONFIGURATION
     require "config.php";
     // SETTING UP SESSION
     if (isset($_CONFIG['_sessionLifetime'])) {
         ini_set('session.gc_maxlifetime', $_CONFIG['_sessionLifetime'] * 60);
     }
     if (isset($_CONFIG['_sessionDir'])) {
         ini_set('session.save_path', $_CONFIG['_sessionDir']);
     }
     if (isset($_CONFIG['_sessionDomain'])) {
         ini_set('session.cookie_domain', $_CONFIG['_sessionDomain']);
     }
     switch ($this->cms) {
         case "drupal":
             break;
         default:
             session_start();
             break;
     }
     // RELOAD DEFAULT CONFIGURATION
     require "config.php";
     $this->config = $_CONFIG;
     // LOAD SESSION CONFIGURATION IF EXISTS
     if (isset($_CONFIG['_sessionVar']) && is_array($_CONFIG['_sessionVar'])) {
         foreach ($_CONFIG['_sessionVar'] as $key => $val) {
             if (substr($key, 0, 1) != "_" && isset($_CONFIG[$key])) {
                 $this->config[$key] = $val;
             }
         }
         if (!isset($this->config['_sessionVar']['self'])) {
             $this->config['_sessionVar']['self'] = array();
         }
         $this->session =& $this->config['_sessionVar']['self'];
     } else {
         $this->session =& $_SESSION;
     }
     // GET TYPE DIRECTORY
     $this->types =& $this->config['types'];
     $firstType = array_keys($this->types);
     $firstType = $firstType[0];
     $this->type = isset($this->get['type']) && isset($this->types[$this->get['type']]) ? $this->get['type'] : $firstType;
     // LOAD TYPE DIRECTORY SPECIFIC CONFIGURATION IF EXISTS
     if (is_array($this->types[$this->type])) {
         foreach ($this->types[$this->type] as $key => $val) {
             if (in_array($key, $this->typeSettings)) {
                 $this->config[$key] = $val;
             }
         }
         $this->types[$this->type] = isset($this->types[$this->type]['type']) ? $this->types[$this->type]['type'] : "";
     }
     // COOKIES INIT
     $ip = '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
     $ip = '/^' . implode('\\.', array($ip, $ip, $ip, $ip)) . '$/';
     if (preg_match($ip, $_SERVER['HTTP_HOST']) || preg_match('/^[^\\.]+$/', $_SERVER['HTTP_HOST'])) {
         $this->config['cookieDomain'] = "";
     } elseif (!strlen($this->config['cookieDomain'])) {
         $this->config['cookieDomain'] = $_SERVER['HTTP_HOST'];
     }
     if (!strlen($this->config['cookiePath'])) {
         $this->config['cookiePath'] = "/";
     }
     // UPLOAD FOLDER INIT
     // FULL URL
     if (preg_match('/^([a-z]+)\\:\\/\\/([^\\/^\\:]+)(\\:(\\d+))?\\/(.+)\\/?$/', $this->config['uploadURL'], $patt)) {
         list($unused, $protocol, $domain, $unused, $port, $path) = $patt;
         $path = path::normalize($path);
         $this->config['uploadURL'] = "{$protocol}://{$domain}" . (strlen($port) ? ":{$port}" : "") . "/{$path}";
         $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath("/{$path}");
         $this->typeDir = "{$this->config['uploadDir']}/{$this->type}";
         $this->typeURL = "{$this->config['uploadURL']}/{$this->type}";
         // SITE ROOT
     } elseif ($this->config['uploadURL'] == "/") {
         $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::normalize($_SERVER['DOCUMENT_ROOT']);
         $this->typeDir = "{$this->config['uploadDir']}/{$this->type}";
         $this->typeURL = "/{$this->type}";
         // ABSOLUTE & RELATIVE
     } else {
         $this->config['uploadURL'] = substr($this->config['uploadURL'], 0, 1) === "/" ? path::normalize($this->config['uploadURL']) : path::rel2abs_url($this->config['uploadURL']);
         $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath($this->config['uploadURL']);
         $this->typeDir = "{$this->config['uploadDir']}/{$this->type}";
         $this->typeURL = "{$this->config['uploadURL']}/{$this->type}";
//.........這裏部分代碼省略.........
開發者ID:hilmysyarif,項目名稱:e-learning-smp,代碼行數:101,代碼來源:uploader.php

示例2: __construct


//.........這裏部分代碼省略.........
         $this->config['watermark'] = array('file' => $this->config['watermark']);
     }
     // GET TYPE DIRECTORY
     $this->types =& $this->config['types'];
     $firstType = array_keys($this->types);
     $firstType = $firstType[0];
     $this->type = isset($_GET['type']) && isset($this->types[$_GET['type']]) ? $_GET['type'] : $firstType;
     // LOAD TYPE DIRECTORY SPECIFIC CONFIGURATION IF EXISTS
     if (is_array($this->types[$this->type])) {
         foreach ($this->types[$this->type] as $key => $val) {
             if (in_array($key, $this->typeSettings)) {
                 $this->config[$key] = $val;
             }
         }
         $this->types[$this->type] = isset($this->types[$this->type]['type']) ? $this->types[$this->type]['type'] : "";
     }
     // COOKIES INIT
     $ip = '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
     $ip = '/^' . implode('\\.', array($ip, $ip, $ip, $ip)) . '$/';
     if (preg_match($ip, $_SERVER['HTTP_HOST']) || preg_match('/^[^\\.]+$/', $_SERVER['HTTP_HOST'])) {
         $this->config['cookieDomain'] = "";
     } elseif (!strlen($this->config['cookieDomain'])) {
         $this->config['cookieDomain'] = $_SERVER['HTTP_HOST'];
     }
     if (!strlen($this->config['cookiePath'])) {
         $this->config['cookiePath'] = "/";
     }
     // UPLOAD FOLDER INIT
     // FULL URL
     if (preg_match('/^([a-z]+)\\:\\/\\/([^\\/^\\:]+)(\\:(\\d+))?\\/(.+)\\/?$/', $this->config['uploadURL'], $patt)) {
         list($unused, $protocol, $domain, $unused, $port, $path) = $patt;
         $path = path::normalize($path);
         $this->config['uploadURL'] = "{$protocol}://{$domain}" . (strlen($port) ? ":{$port}" : "") . "/{$path}";
         $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath("/{$path}");
         $this->typeDir = "{$this->config['uploadDir']}/{$this->type}";
         $this->typeURL = "{$this->config['uploadURL']}/{$this->type}";
         // SITE ROOT
     } elseif ($this->config['uploadURL'] == "/") {
         $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::normalize($_SERVER['DOCUMENT_ROOT']);
         $this->typeDir = "{$this->config['uploadDir']}/{$this->type}";
         $this->typeURL = "/{$this->type}";
         // ABSOLUTE & RELATIVE
     } else {
         $this->config['uploadURL'] = substr($this->config['uploadURL'], 0, 1) === "/" ? path::normalize($this->config['uploadURL']) : path::rel2abs_url($this->config['uploadURL']);
         $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath($this->config['uploadURL']);
         $this->typeDir = "{$this->config['uploadDir']}/{$this->type}";
         $this->typeURL = "{$this->config['uploadURL']}/{$this->type}";
     }
     // HOST APPLICATIONS INIT
     if (isset($_GET['CKEditorFuncNum'])) {
         $this->opener['name'] = "ckeditor";
         $this->opener['CKEditor'] = array('funcNum' => $_GET['CKEditorFuncNum']);
     } elseif (isset($_GET['opener'])) {
         $this->opener['name'] = $_GET['opener'];
         if ($_GET['opener'] == "tinymce") {
             if (!isset($this->config['_tinyMCEPath']) || !strlen($this->config['_tinyMCEPath'])) {
                 $this->opener['name'] = false;
             }
         } elseif ($_GET['opener'] == "tinymce4") {
             if (!isset($_GET['field'])) {
                 $this->opener['name'] = false;
             } else {
                 $this->opener['TinyMCE'] = array('field' => $_GET['field']);
             }
         }
     } else {
開發者ID:mikegrahamjones,項目名稱:kcfinder,代碼行數:67,代碼來源:uploader.php

示例3: __construct

 public function __construct()
 {
     // DISABLE MAGIC QUOTES
     if (function_exists('set_magic_quotes_runtime')) {
         @set_magic_quotes_runtime(false);
     }
     // INPUT INIT
     $input = new input();
     $this->get =& $input->get;
     $this->post =& $input->post;
     $this->cookie =& $input->cookie;
     // LINKING UPLOADED FILE
     if (count($_FILES)) {
         $this->file =& $_FILES[key($_FILES)];
     }
     // LOAD DEFAULT CONFIGURATION
     require "config.php";
     // SETTING UP SESSION
     if (isset($_CONFIG['_sessionLifetime'])) {
         ini_set('session.gc_maxlifetime', $_CONFIG['_sessionLifetime'] * 60);
     }
     if (isset($_CONFIG['_sessionDir'])) {
         ini_set('session.save_path', $_CONFIG['_sessionDir']);
     }
     if (isset($_CONFIG['_sessionDomain'])) {
         ini_set('session.cookie_domain', $_CONFIG['_sessionDomain']);
     }
     session_start();
     // RELOAD DEFAULT CONFIGURATION
     require "config.php";
     $this->config = $_CONFIG;
     // LOAD SESSION CONFIGURATION IF EXISTS
     if (isset($_CONFIG['_sessionVar']) && is_array($_CONFIG['_sessionVar'])) {
         foreach ($_CONFIG['_sessionVar'] as $key => $val) {
             if (substr($key, 0, 1) != "_" && isset($_CONFIG[$key])) {
                 $this->config[$key] = $val;
             }
         }
         if (!isset($this->config['_sessionVar']['self'])) {
             $this->config['_sessionVar']['self'] = array();
         }
         $this->session =& $this->config['_sessionVar']['self'];
     } else {
         $this->session =& $_SESSION;
     }
     // GET TYPE DIRECTORY
     $this->types =& $this->config['types'];
     $firstType = array_keys($this->types);
     $firstType = $firstType[0];
     $this->type = isset($this->get['type']) && isset($this->types[$this->get['type']]) ? $this->get['type'] : $firstType;
     // LOAD DIRECTORY TYPE SPECIFIC CONFIGURATION IF EXISTS
     if (is_array($this->types[$this->type])) {
         foreach ($this->types[$this->type] as $key => $val) {
             if (in_array($key, $this->typeSettings)) {
                 $this->config[$key] = $val;
             }
         }
         $this->types[$this->type] = isset($this->types[$this->type]['type']) ? $this->types[$this->type]['type'] : "";
     }
     // COOKIES INIT
     if (!strlen($this->config['cookieDomain'])) {
         $this->config['cookieDomain'] = $_SERVER['HTTP_HOST'];
     }
     if (!strlen($this->config['cookiePath'])) {
         $this->config['cookiePath'] = "/";
     }
     // UPLOAD FOLDER INIT
     if ($this->config['uploadURL'] == "/") {
         $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::normalize($_SERVER['DOCUMENT_ROOT']);
         $this->typeDir = "{$this->config['uploadDir']}/{$this->type}";
         $this->typeURL = "/{$this->type}";
     } else {
         $this->config['uploadURL'] = substr($this->config['uploadURL'], 0, 1) === "/" ? path::normalize($this->config['uploadURL']) : path::rel2abs_url($this->config['uploadURL']);
         $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath($this->config['uploadURL']);
         $this->typeDir = "{$this->config['uploadDir']}/{$this->type}";
         $this->typeURL = "{$this->config['uploadURL']}/{$this->type}";
     }
     if (!is_dir($this->config['uploadDir'])) {
         @mkdir($this->config['uploadDir'], $this->config['dirPerms']);
     }
     // HOST APPLICATIONS INIT
     if (isset($this->get['CKEditorFuncNum'])) {
         $this->opener['CKEditor']['funcNum'] = $this->get['CKEditorFuncNum'];
     }
     if (isset($this->get['opener']) && strtolower($this->get['opener']) == "tinymce" && isset($this->config['_tinyMCEPath']) && strlen($this->config['_tinyMCEPath'])) {
         $this->opener['TinyMCE'] = true;
     }
     // LOCALIZATION
     foreach ($this->langInputNames as $key) {
         if (isset($this->get[$key]) && preg_match('/^[a-z][a-z\\._\\-]*$/i', $this->get[$key]) && file_exists("lang/" . strtolower($this->get[$key]) . ".php")) {
             $this->lang = $this->get[$key];
             break;
         }
     }
     $this->localize($this->lang);
     // CHECK & MAKE DEFAULT .htaccess
     $htaccess = "{$this->config['uploadDir']}/.htaccess";
     if (isset($this->config['_check4htaccess']) && $this->config['_check4htaccess']) {
         if (!file_exists($htaccess)) {
             if (!@file_put_contents($htaccess, $this->get_htaccess())) {
//.........這裏部分代碼省略.........
開發者ID:nstungxd,項目名稱:F2CA5,代碼行數:101,代碼來源:uploader.php


注:本文中的path::url2fullPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。