You are here

function ckeditor_resolve_url in CKEditor - WYSIWYG HTML editor 6

Same name and namespace in other branches
  1. 7 includes/ckeditor.lib.inc \ckeditor_resolve_url()

Emulates the asp Server.mapPath function. Given an url path return the physical directory that it corresponds to.

Returns absolute path or false on failure

Parameters

string $path:

Return value

@return string|boolean

2 calls to ckeditor_resolve_url()
ckeditor_path in ./ckeditor.module
Read the CKEditor path from the Global profile.
ckeditor_plugins_path in ./ckeditor.module
Read the CKEditor plugins path from the Global profile.

File

includes/ckeditor.lib.inc, line 89
CKEditor - The text editor for the Internet - http://ckeditor.com Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.

Code

function ckeditor_resolve_url($path) {
  if (function_exists('apache_lookup_uri')) {
    $info = @apache_lookup_uri($path);
    if (!$info) {
      return FALSE;
    }
    return $info->filename . $info->path_info;
  }
  $document_root = ckeditor_get_document_root_full_path();
  if ($document_root !== FALSE) {
    return $document_root . $path;
  }
  return FALSE;
}