• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP fullpath函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fullpath函数的典型用法代码示例。如果您正苦于以下问题:PHP fullpath函数的具体用法?PHP fullpath怎么用?PHP fullpath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了fullpath函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: handle

 /**
  * Handle matches of the <feedaggregator> tag, storing the list of feeds in
  * a file in the ~/data/tmp/feedaggregator directory.
  *
  * @param string $match The match of the syntax
  * @param int    $state The state of the handler
  * @param int    $pos The position in the document
  * @param Doku_Handler    $handler The handler
  * @return array Data for the renderer
  */
 public function handle($match, $state, $pos, Doku_Handler $handler)
 {
     global $conf;
     $data = array();
     // Are we to handle this match? If not, don't.
     if ($state !== DOKU_LEXER_UNMATCHED) {
         return $data;
     }
     // Get the feed URLs.
     $matchedFeeds = preg_split('/[\\n\\r]+/', $match, -1, PREG_SPLIT_NO_EMPTY);
     $feeds = array();
     foreach ($matchedFeeds as $feed) {
         if (filter_var($feed, FILTER_VALIDATE_URL) === false) {
             msg("Feed URL not valid: <code>{$feed}</code>", 2);
             continue;
         }
         $feeds[] = $feed;
     }
     $feedList = array_unique($feeds);
     // Save the feeds to a temporary CSV. It'll be ready by the action script.
     $file = fullpath($conf['tmpdir'] . '/feedaggregator.csv');
     file_put_contents($file, join("\n", $feedList));
     // Get the most-recently generated HTML feed aggregation. This won't be
     // up to date with the above feeds yet, but that's okay.
     $data['html'] = io_readFile(fullpath($conf['cachedir'] . '/feedaggregator/output.html'));
     return $data;
 }
开发者ID:samwilson,项目名称:dokuwiki-plugin-feedaggregator,代码行数:37,代码来源:syntax.php


示例2: setWorkDir

 public function setWorkDir($directory)
 {
     $dir = addslash($this->userdir . trim($directory, DIRECTORY_SEPARATOR));
     $path_check = explode($this->userdir, addslash(fullpath($dir, $this->userdir)));
     if (count($path_check) < 2) {
         $dir = $this->userdir;
     }
     $this->workdir = $dir;
     return $dir;
 }
开发者ID:stroebs,项目名称:rutorrent-thirdparty-plugins,代码行数:10,代码来源:flm.class.php


示例3: __construct

 /**
  * Constructor
  *
  * Loads the cache
  */
 public function __construct()
 {
     global $conf;
     $this->logfile = fullpath($conf['metadir'] . '/' . $this->getConf('accesslog'));
     // file not found? assume absolute path
     if (!file_exists($this->logfile)) {
         $this->logfile = $this->getConf('accesslog');
     }
     // load the cache file
     $this->logcache = getCacheName($this->getConf('accesslog'), '.statdisplay');
     if (file_exists($this->logcache)) {
         $this->logdata = unserialize(io_readFile($this->logcache, false));
     }
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:19,代码来源:log.php


示例4: test_windows_paths

 function test_windows_paths()
 {
     $base = $_SERVER['SCRIPT_FILENAME'];
     $_SERVER['SCRIPT_FILENAME'] = '/absolute/path/self.php';
     $GLOBALS['DOKU_UNITTEST_ASSUME_WINDOWS'] = true;
     // paths to check
     $tests = array('c:foo/bar/baz' => 'c:/foo/bar/baz', 'c:foo//bar/baz' => 'c:/foo/bar/baz', 'c:foo/../bar/baz' => 'c:/bar/baz', 'c:foo/./bar/baz' => 'c:/foo/bar/baz', 'c:foo/bar/..' => 'c:/foo', 'c:foo/bar/../../../baz' => 'c:/baz', 'c:/foo/bar/baz' => 'c:/foo/bar/baz', 'c:/foo//bar/baz' => 'c:/foo/bar/baz', 'c:/foo/../bar/baz' => 'c:/bar/baz', 'c:/foo/./bar/baz' => 'c:/foo/bar/baz', 'c:/foo/bar/..' => 'c:/foo', 'c:/foo/bar/../../../baz' => 'c:/baz', 'c:\\foo\\bar\\baz' => 'c:/foo/bar/baz', 'c:\\foo\\\\bar\\baz' => 'c:/foo/bar/baz', 'c:\\foo\\..\\bar\\baz' => 'c:/bar/baz', 'c:\\foo\\.\\bar\\baz' => 'c:/foo/bar/baz', 'c:\\foo\\bar\\..' => 'c:/foo', 'c:\\foo\\bar\\..\\..\\..\\baz' => 'c:/baz', '\\\\server\\share/foo/bar/baz' => '\\\\server\\share/foo/bar/baz', '\\\\server\\share/foo//bar/baz' => '\\\\server\\share/foo/bar/baz', '\\\\server\\share/foo/../bar/baz' => '\\\\server\\share/bar/baz', '\\\\server\\share/foo/./bar/baz' => '\\\\server\\share/foo/bar/baz', '\\\\server\\share/foo/bar/..' => '\\\\server\\share/foo', '\\\\server\\share/foo/bar/../../../baz' => '\\\\server\\share/baz');
     foreach ($tests as $from => $to) {
         $info = "Testing '{$from}' resulted in '" . fullpath($from) . "'";
         $this->assertEquals(fullpath($from), $to, $info);
     }
     $_SERVER['SCRIPT_FILENAME'] = $base;
     unset($GLOBALS['DOKU_UNITTEST_ASSUME_WINDOWS']);
 }
开发者ID:richmahn,项目名称:Door43,代码行数:14,代码来源:init_fullpath.test.php


示例5: load

 /**
  * Load all the style sheets and apply the needed replacements
  * @param $plugin_name
  * @param $format
  * @param $template
  * @return string
  */
 public function load($plugin_name, $format, $template)
 {
     global $conf;
     //reusue the CSS dispatcher functions without triggering the main function
     define('SIMPLE_TEST', 1);
     require_once DOKU_INC . 'lib/exe/css.php';
     // Always only use small letters in format
     $format = strtolower($format);
     // prepare CSS files
     $files = array_merge(array(DOKU_INC . 'lib/styles/screen.css' => DOKU_BASE . 'lib/styles/', DOKU_INC . 'lib/styles/print.css' => DOKU_BASE . 'lib/styles/'), css_pluginstyles('all'), $this->css_pluginFormatStyles($format), array(DOKU_PLUGIN . $plugin_name . '/conf/style.css' => DOKU_BASE . 'lib/plugins/' . $plugin_name . '/conf/', DOKU_PLUGIN . $plugin_name . '/tpl/' . $template . '/style.css' => DOKU_BASE . 'lib/plugins/' . $plugin_name . '/tpl/' . $template . '/', DOKU_PLUGIN . $plugin_name . '/conf/style.local.css' => DOKU_BASE . 'lib/plugins/' . $plugin_name . '/conf/'));
     $css = '';
     foreach ($files as $file => $location) {
         $display = str_replace(fullpath(DOKU_INC), '', fullpath($file));
         $css_content = "\n/* XXXXXXXXX {$display} XXXXXXXXX */\n";
         $css_content = css_loadfile($file, $location);
         if (strpos($file, 'screen.css') !== false) {
             $css .= "\n@media screen {\n" . $css_content . "\n}\n";
         } else {
             if (strpos($file, 'style.css') !== false) {
                 $css .= "\n@media screen {\n" . $css_content . "\n}\n";
             } else {
                 if (strpos($file, $format . '.css') !== false) {
                     $css .= "\n@media print {\n" . $css_content . "\n}\n";
                 } else {
                     if (strpos($file, 'print.css') !== false) {
                         $css .= "\n@media print {\n" . $css_content . "\n}\n";
                     } else {
                         $css .= $css_content;
                     }
                 }
             }
         }
     }
     if (function_exists('css_parseless')) {
         // apply pattern replacements
         $styleini = css_styleini($conf['template']);
         $css = css_applystyle($css, $styleini['replacements']);
         // parse less
         $css = css_parseless($css);
     } else {
         // @deprecated 2013-12-19: fix backward compatibility
         $css = css_applystyle($css, DOKU_INC . 'lib/tpl/' . $conf['template'] . '/');
     }
     return $css;
 }
开发者ID:RnBConsulting,项目名称:dokuwiki-plugin-odt,代码行数:52,代码来源:dwcssloader.php


示例6: handle

 /**
  * 
  *
  * @param Doku_Event $event  Not used
  * @param mixed      $param  Not used
  * @return void
  */
 public function handle(Doku_Event &$event, $param)
 {
     global $conf;
     if ($event->data != 'feedaggregator') {
         return;
     }
     $event->preventDefault();
     // See if we need a token and whether it matches.
     $requiredToken = $this->getConf('token');
     $suppliedToken = isset($_GET['token']) ? $_GET['token'] : false;
     if (!empty($requiredToken) && $suppliedToken !== $requiredToken) {
         msg("Token doesn't match for feedaggregator");
         return true;
     }
     // Get the feed list.
     $feeds = file(fullpath($conf['tmpdir'] . '/feedaggregator.csv'));
     // Set up SimplePie and merge all the feeds together.
     $simplepie = new FeedParser();
     $ua = 'Mozilla/4.0 (compatible; DokuWiki feedaggregator plugin ' . wl('', '', true) . ')';
     $simplepie->set_useragent($ua);
     $simplepie->force_feed($this->getConf('force_feed'));
     $simplepie->force_fsockopen($this->getConf('force_fsockopen'));
     $simplepie->set_feed_url($feeds);
     // Set up caching.
     $cacheDir = fullpath($conf['cachedir'] . '/feedaggregator');
     io_mkdir_p($cacheDir);
     $simplepie->enable_cache();
     $simplepie->set_cache_location($cacheDir);
     // Run the actual feed aggregation.
     $simplepie->init();
     // Check for errors.
     if ($simplepie->error()) {
         header("Content-type:text/plain");
         echo join("\n", $simplepie->error());
     }
     // Create the output HTML and cache it for use by the syntax component.
     $html = '';
     foreach ($simplepie->get_items() as $item) {
         $html .= "<div class='feedaggregator_item'>\n" . "<h2>" . $item->get_title() . "</h2>\n" . $item->get_content() . "\n" . "<p>" . "  <a href='" . $item->get_permalink() . "'>Published " . $item->get_date('j M Y') . "</a> " . "  in <a href='" . $item->get_feed()->get_permalink() . "'>" . $item->get_feed()->get_title() . "</a>" . "</p>\n" . "</div>\n\n";
     }
     io_saveFile($cacheDir . '/output.html', $html);
     // Output nothing, as this should be run from cron and we don't want to
     // flood the logs with success.
     exit(0);
 }
开发者ID:samwilson,项目名称:dokuwiki-plugin-feedaggregator,代码行数:52,代码来源:action.php


示例7: http_sendfile

/**
 * Let the webserver send the given file via x-sendfile method
 *
 * @author Chris Smith <[email protected]>
 *
 * @param string $file absolute path of file to send
 * @returns  void or exits with previous header() commands executed
 */
function http_sendfile($file)
{
    global $conf;
    //use x-sendfile header to pass the delivery to compatible web servers
    if ($conf['xsendfile'] == 1) {
        header("X-LIGHTTPD-send-file: {$file}");
        ob_end_clean();
        exit;
    } elseif ($conf['xsendfile'] == 2) {
        header("X-Sendfile: {$file}");
        ob_end_clean();
        exit;
    } elseif ($conf['xsendfile'] == 3) {
        // FS#2388 nginx just needs the relative path.
        $file = DOKU_REL . substr($file, strlen(fullpath(DOKU_INC)) + 1);
        header("X-Accel-Redirect: {$file}");
        ob_end_clean();
        exit;
    }
}
开发者ID:kevinlovesing,项目名称:dokuwiki,代码行数:28,代码来源:httputils.php


示例8: addFile

 public function addFile($file, $duration, $password)
 {
     $torrentfile = explode('|', $file);
     if (count($torrentfile) > 1) {
         $file = array($torrentfile[1], $torrentfile[0]);
     }
     if (is_array($file)) {
         $file = \Flm\Helper::getTorrentHashFilepath($file[0], $file[1]);
     } else {
         $file = fullpath(trim($file, DIRECTORY_SEPARATOR), $this->userdir);
     }
     $this->validDuration($duration);
     $share = Storage::load();
     if ($this->islimited('links', $share->size())) {
         throw new Exception("File limit reached " . $share->size(), 2);
     }
     if (($stat = LFS::stat($file)) === FALSE) {
         throw new Exception("Invalid file " . $file, 2);
     }
     $data = array('path' => $file, 'size' => $stat['size'], 'expire' => time() + 3600 * $duration, 'password' => $password);
     return $share->add($data);
 }
开发者ID:stroebs,项目名称:rutorrent-thirdparty-plugins,代码行数:22,代码来源:Fileshare.php


示例9: fullpath

/**
 * A realpath() replacement
 *
 * This function behaves similar to PHP's realpath() but does not resolve
 * symlinks or accesses upper directories
 *
 * @author Andreas Gohr <[email protected]>
 * @author <richpageau at yahoo dot co dot uk>
 * @link   http://de3.php.net/manual/en/function.realpath.php#75992
 */
function fullpath($path, $exists = false)
{
    static $run = 0;
    $root = '';
    $iswin = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' || @$GLOBALS['DOKU_UNITTEST_ASSUME_WINDOWS'];
    // find the (indestructable) root of the path - keeps windows stuff intact
    if ($path[0] == '/') {
        $root = '/';
    } elseif ($iswin) {
        // match drive letter and UNC paths
        if (preg_match('!^([a-zA-z]:)(.*)!', $path, $match)) {
            $root = $match[1] . '/';
            $path = $match[2];
        } else {
            if (preg_match('!^(\\\\\\\\[^\\\\/]+\\\\[^\\\\/]+[\\\\/])(.*)!', $path, $match)) {
                $root = $match[1];
                $path = $match[2];
            }
        }
    }
    $path = str_replace('\\', '/', $path);
    // if the given path wasn't absolute already, prepend the script path and retry
    if (!$root) {
        $base = dirname($_SERVER['SCRIPT_FILENAME']);
        $path = $base . '/' . $path;
        if ($run == 0) {
            // avoid endless recursion when base isn't absolute for some reason
            $run++;
            return fullpath($path, $exists);
        }
    }
    $run = 0;
    // canonicalize
    $path = explode('/', $path);
    $newpath = array();
    foreach ($path as $p) {
        if ($p === '' || $p === '.') {
            continue;
        }
        if ($p === '..') {
            array_pop($newpath);
            continue;
        }
        array_push($newpath, $p);
    }
    $finalpath = $root . implode('/', $newpath);
    // check for existance when needed (except when unit testing)
    if ($exists && !defined('DOKU_UNITTEST') && !@file_exists($finalpath)) {
        return false;
    }
    return $finalpath;
}
开发者ID:rezlemic,项目名称:dokuwiki-jQuery,代码行数:62,代码来源:init.php


示例10: pageinfo

/**
 * Return info about the current document as associative
 * array.
 *
 * @author Andreas Gohr <[email protected]>
 */
function pageinfo()
{
    global $ID;
    global $REV;
    global $RANGE;
    global $USERINFO;
    global $lang;
    // include ID & REV not redundant, as some parts of DokuWiki may temporarily change $ID, e.g. p_wiki_xhtml
    // FIXME ... perhaps it would be better to ensure the temporary changes weren't necessary
    $info['id'] = $ID;
    $info['rev'] = $REV;
    // set info about manager/admin status.
    $info['isadmin'] = false;
    $info['ismanager'] = false;
    if (isset($_SERVER['REMOTE_USER'])) {
        $info['userinfo'] = $USERINFO;
        $info['perm'] = auth_quickaclcheck($ID);
        $info['subscribed'] = get_info_subscribed();
        $info['client'] = $_SERVER['REMOTE_USER'];
        if ($info['perm'] == AUTH_ADMIN) {
            $info['isadmin'] = true;
            $info['ismanager'] = true;
        } elseif (auth_ismanager()) {
            $info['ismanager'] = true;
        }
        // if some outside auth were used only REMOTE_USER is set
        if (!$info['userinfo']['name']) {
            $info['userinfo']['name'] = $_SERVER['REMOTE_USER'];
        }
    } else {
        $info['perm'] = auth_aclcheck($ID, '', null);
        $info['subscribed'] = false;
        $info['client'] = clientIP(true);
    }
    $info['namespace'] = getNS($ID);
    $info['locked'] = checklock($ID);
    $info['filepath'] = fullpath(wikiFN($ID));
    $info['exists'] = @file_exists($info['filepath']);
    if ($REV) {
        //check if current revision was meant
        if ($info['exists'] && @filemtime($info['filepath']) == $REV) {
            $REV = '';
        } elseif ($RANGE) {
            //section editing does not work with old revisions!
            $REV = '';
            $RANGE = '';
            msg($lang['nosecedit'], 0);
        } else {
            //really use old revision
            $info['filepath'] = fullpath(wikiFN($ID, $REV));
            $info['exists'] = @file_exists($info['filepath']);
        }
    }
    $info['rev'] = $REV;
    if ($info['exists']) {
        $info['writable'] = is_writable($info['filepath']) && $info['perm'] >= AUTH_EDIT;
    } else {
        $info['writable'] = $info['perm'] >= AUTH_CREATE;
    }
    $info['editable'] = $info['writable'] && empty($info['locked']);
    $info['lastmod'] = @filemtime($info['filepath']);
    //load page meta data
    $info['meta'] = p_get_metadata($ID);
    //who's the editor
    if ($REV) {
        $revinfo = getRevisionInfo($ID, $REV, 1024);
    } else {
        if (is_array($info['meta']['last_change'])) {
            $revinfo = $info['meta']['last_change'];
        } else {
            $revinfo = getRevisionInfo($ID, $info['lastmod'], 1024);
            // cache most recent changelog line in metadata if missing and still valid
            if ($revinfo !== false) {
                $info['meta']['last_change'] = $revinfo;
                p_set_metadata($ID, array('last_change' => $revinfo));
            }
        }
    }
    //and check for an external edit
    if ($revinfo !== false && $revinfo['date'] != $info['lastmod']) {
        // cached changelog line no longer valid
        $revinfo = false;
        $info['meta']['last_change'] = $revinfo;
        p_set_metadata($ID, array('last_change' => $revinfo));
    }
    $info['ip'] = $revinfo['ip'];
    $info['user'] = $revinfo['user'];
    $info['sum'] = $revinfo['sum'];
    // See also $INFO['meta']['last_change'] which is the most recent log line for page $ID.
    // Use $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT in place of $info['minor'].
    if ($revinfo['user']) {
        $info['editor'] = $revinfo['user'];
    } else {
        $info['editor'] = $revinfo['ip'];
//.........这里部分代码省略.........
开发者ID:nextghost,项目名称:dokuwiki,代码行数:101,代码来源:common.php


示例11: io_mkdir_p

/**
 * Creates a directory hierachy.
 *
 * @link    http://www.php.net/manual/en/function.mkdir.php
 * @author  <[email protected]>
 * @author  Andreas Gohr <[email protected]>
 */
function io_mkdir_p($target)
{
    global $conf;
    if (@is_dir($target) || empty($target)) {
        return 1;
    }
    // best case check first
    if (@file_exists($target) && !is_dir($target)) {
        return 0;
    }
    //recursion
    if (io_mkdir_p(substr($target, 0, strrpos($target, '/')))) {
        if ($conf['safemodehack']) {
            $dir = preg_replace('/^' . preg_quote(fullpath($conf['ftp']['root']), '/') . '/', '', $target);
            return io_mkdir_ftp($dir);
        } else {
            $ret = @mkdir($target, $conf['dmode']);
            // crawl back up & create dir tree
            if ($ret && !empty($conf['dperm'])) {
                chmod($target, $conf['dperm']);
            }
            return $ret;
        }
    }
    return 0;
}
开发者ID:rodrigoaustincascao,项目名称:Service-Desk-IMC,代码行数:33,代码来源:io.php


示例12: pageinfo

/**
 * Return info about the current document as associative
 * array.
 *
 * @author Andreas Gohr <[email protected]>
 *
 * @return array with info about current document
 */
function pageinfo()
{
    global $ID;
    global $REV;
    global $RANGE;
    global $lang;
    /* @var Input $INPUT */
    global $INPUT;
    $info = basicinfo($ID);
    // include ID & REV not redundant, as some parts of DokuWiki may temporarily change $ID, e.g. p_wiki_xhtml
    // FIXME ... perhaps it would be better to ensure the temporary changes weren't necessary
    $info['id'] = $ID;
    $info['rev'] = $REV;
    if ($INPUT->server->has('REMOTE_USER')) {
        $sub = new Subscription();
        $info['subscribed'] = $sub->user_subscription();
    } else {
        $info['subscribed'] = false;
    }
    $info['locked'] = checklock($ID);
    $info['filepath'] = fullpath(wikiFN($ID));
    $info['exists'] = file_exists($info['filepath']);
    $info['currentrev'] = @filemtime($info['filepath']);
    if ($REV) {
        //check if current revision was meant
        if ($info['exists'] && $info['currentrev'] == $REV) {
            $REV = '';
        } elseif ($RANGE) {
            //section editing does not work with old revisions!
            $REV = '';
            $RANGE = '';
            msg($lang['nosecedit'], 0);
        } else {
            //really use old revision
            $info['filepath'] = fullpath(wikiFN($ID, $REV));
            $info['exists'] = file_exists($info['filepath']);
        }
    }
    $info['rev'] = $REV;
    if ($info['exists']) {
        $info['writable'] = is_writable($info['filepath']) && $info['perm'] >= AUTH_EDIT;
    } else {
        $info['writable'] = $info['perm'] >= AUTH_CREATE;
    }
    $info['editable'] = $info['writable'] && empty($info['locked']);
    $info['lastmod'] = @filemtime($info['filepath']);
    //load page meta data
    $info['meta'] = p_get_metadata($ID);
    //who's the editor
    $pagelog = new PageChangeLog($ID, 1024);
    if ($REV) {
        $revinfo = $pagelog->getRevisionInfo($REV);
    } else {
        if (!empty($info['meta']['last_change']) && is_array($info['meta']['last_change'])) {
            $revinfo = $info['meta']['last_change'];
        } else {
            $revinfo = $pagelog->getRevisionInfo($info['lastmod']);
            // cache most recent changelog line in metadata if missing and still valid
            if ($revinfo !== false) {
                $info['meta']['last_change'] = $revinfo;
                p_set_metadata($ID, array('last_change' => $revinfo));
            }
        }
    }
    //and check for an external edit
    if ($revinfo !== false && $revinfo['date'] != $info['lastmod']) {
        // cached changelog line no longer valid
        $revinfo = false;
        $info['meta']['last_change'] = $revinfo;
        p_set_metadata($ID, array('last_change' => $revinfo));
    }
    $info['ip'] = $revinfo['ip'];
    $info['user'] = $revinfo['user'];
    $info['sum'] = $revinfo['sum'];
    // See also $INFO['meta']['last_change'] which is the most recent log line for page $ID.
    // Use $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT in place of $info['minor'].
    if ($revinfo['user']) {
        $info['editor'] = $revinfo['user'];
    } else {
        $info['editor'] = $revinfo['ip'];
    }
    // draft
    $draft = getCacheName($info['client'] . $ID, '.draft');
    if (file_exists($draft)) {
        if (@filemtime($draft) < @filemtime(wikiFN($ID))) {
            // remove stale draft
            @unlink($draft);
        } else {
            $info['draft'] = $draft;
        }
    }
    return $info;
//.........这里部分代码省略.........
开发者ID:splitbrain,项目名称:dokuwiki,代码行数:101,代码来源:common.php


示例13: epub_css_out

/**
 * Output all needed Styles
 *
 * @author Andreas Gohr <[email protected]>
 */
function epub_css_out($path)
{
    global $conf;
    global $lang;
    global $config_cascade;
    global $INPUT;
    $mediatypes = array('screen', 'all');
    $type = '';
    // decide from where to get the template
    $tpl = trim(preg_replace('/[^\\w-]+/', '', $INPUT->str('t')));
    if (!$tpl) {
        $tpl = $conf['template'];
    }
    // load styl.ini
    $styleini = css_styleini($tpl);
    // if old 'default' userstyle setting exists, make it 'screen' userstyle for backwards compatibility
    if (isset($config_cascade['userstyle']['default'])) {
        $config_cascade['userstyle']['screen'] = $config_cascade['userstyle']['default'];
    }
    // Array of needed files and their web locations, the latter ones
    // are needed to fix relative paths in the stylesheets
    $files = array();
    foreach ($mediatypes as $mediatype) {
        $files[$mediatype] = array();
        // load core styles
        $files[$mediatype][DOKU_INC . 'lib/styles/' . $mediatype . '.css'] = DOKU_BASE . 'lib/styles/';
        // load jQuery-UI theme
        if ($mediatype == 'screen') {
            $files[$mediatype][DOKU_INC . 'lib/scripts/jquery/jquery-ui-theme/smoothness.css'] = DOKU_BASE . 'lib/scripts/jquery/jquery-ui-theme/';
        }
        // load plugin styles
        $files[$mediatype] = array_merge($files[$mediatype], css_pluginstyles($mediatype));
        // load template styles
        if (isset($styleini['stylesheets'][$mediatype])) {
            $files[$mediatype] = array_merge($files[$mediatype], $styleini['stylesheets'][$mediatype]);
        }
        // load user styles
        if (isset($config_cascade['userstyle'][$mediatype])) {
            $files[$mediatype][$config_cascade['userstyle'][$mediatype]] = DOKU_BASE;
        }
    }
    $css = "";
    // build the stylesheet
    foreach ($mediatypes as $mediatype) {
        // print the default classes for interwiki links and file downloads
        if ($mediatype == 'screen') {
            $css .= '@media screen {';
            css_interwiki($css);
            css_filetypes($css);
            $css .= '}';
        }
        // load files
        $css_content = '';
        foreach ($files[$mediatype] as $file => $location) {
            $display = str_replace(fullpath(DOKU_INC), '', fullpath($file));
            $css_content .= "\n/* XXXXXXXXX {$display} XXXXXXXXX */\n";
            $css_content .= css_loadfile($file, $location);
        }
        switch ($mediatype) {
            case 'screen':
                $css .= NL . '@media screen { /* START screen styles */' . NL . $css_content . NL . '} /* /@media END screen styles */' . NL;
                break;
            case 'all':
            default:
                $css .= NL . '/* START rest styles */ ' . NL . $css_content . NL . '/* END rest styles */' . NL;
                break;
        }
    }
    // apply style replacements
    $css .= css_applystyle($css, $styleini['replacements']);
    // parse less
    $css = css_parseless($css);
    // embed small images right into the stylesheet
    if ($conf['cssdatauri']) {
        $base = preg_quote(DOKU_BASE, '#');
        $css = preg_replace_callback('#(url\\([ \'"]*)(' . $base . ')(.*?(?:\\.(png|gif)))#i', 'css_datauri', $css);
    }
    io_saveFile($path . 'Styles/style.css', $css);
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:84,代码来源:css3.php


示例14: define

<?php

/**
 * Editing toolbar functions
 *
 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
 * @author     Andreas Gohr <[email protected]>
 */
if (!defined('DOKU_INC')) {
    define('DOKU_INC', fullpath(dirname(__FILE__) . '/../') . '/');
}
require_once DOKU_INC . 'inc/JSON.php';
/**
 * Prepares and prints an JavaScript array with all toolbar buttons
 *
 * @todo add toolbar plugins
 * @param  string $varname Name of the JS variable to fill
 * @author Andreas Gohr <[email protected]>
 */
function toolbar_JSdefines($varname)
{
    global $ID;
    global $conf;
    global $lang;
    $menu = array();
    $evt = new Doku_Event('TOOLBAR_DEFINE', $menu);
    if ($evt->advise_before()) {
        // build button array
        $menu = array_merge($menu, array(array('type' => 'format', 'title' => $lang['qb_bold'], 'icon' => 'bold.png', 'key' => 'b', 'open' => '**', 'close' => '**'), array('type' => 'format', 'title' => $lang['qb_italic'], 'icon' => 'italic.png', 'key' => 'i', 'open' => '//', 'close' => '//'), array('type' => 'format', 'title' => $lang['qb_underl'], 'icon' => 'underline.png', 'key' => 'u', 'open' => '__', 'close' => '__'), array('type' => 'format', 'title' => $lang['qb_code'], 'icon' => 'mono.png', 'key' => 'c', 'open' => "''", 'close' => "''"), array('type' => 'format', 'title' => $lang['qb_strike'], 'icon' => 'strike.png', 'key' => 'd', 'open' => '<del>', 'close' => '</del>'), array('type' => 'format', 'title' => $lang['qb_h1'], 'icon' => 'h1.png', 'key' => '1', 'open' => '====== ', 'close' => ' ======\\n'), array('type' => 'format', 'title' => $lang['qb_h2'], 'icon' => 'h2.png', 'key' => '2', 'open' => '===== ', 'close' => ' =====\\n'), array('type' => 'format', 'title' => $lang['qb_h3'], 'icon' => 'h3.png', 'key' => '3', 'open' => '==== ', 'close' => ' ====\\n'), array('type' => 'format', 'title' => $lang['qb_h4'], 'icon' => 'h4.png', 'key' => '4', 'open' => '=== ', 'close' => ' ===\\n'), array('type' => 'format', 'title' => $lang['qb_h5'], 'icon' => 'h5.png', 'key' => '5', 'open' => '== ', 'close' => ' ==\\n'), array('type' => 'format', 'title' => $lang['qb_link'], 'icon' => 'link.png', 'key' => 'l', 'open' => '[[', 'close' => ']]'), array('type' => 'format', 'title' => $lang['qb_extlink'], 'icon' => 'linkextern.png', 'open' => '[[', 'close' => ']]', 'sample' => 'http://example.com|' . $lang['qb_extlink']), array('type' => 'format', 'title' => $lang['qb_ol'], 'icon' => 'ol.png', 'open' => '  - ', 'close' => '\\n'), array('type' => 'format', 'title' => $lang['qb_ul'], 'icon' => 'ul.png', 'open' => '  * ', 'close' => '\\n'), array('type' => 'insert', 'title' => $lang['qb_hr'], 'icon' => 'hr.png', 'insert' => '----\\n'), array('type' => 'mediapopup', 'title' => $lang['qb_media'], 'icon' => 'image.png', 'url' => DOKU_BASE . 'lib/exe/mediamanager.php?ns=', 'name' => 'mediaselect', 'options' => 'width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes'), array('type' => 'picker', 'title' => $lang['qb_smileys'], 'icon' => 'smiley.png', 'list' => getSmileys(), 'icobase' => 'smileys'), array('type' => 'picker', 'title' => $lang['qb_chars'], 'icon' => 'chars.png', 'list' => explode(' ', 'À à Á á  â à ã Ä ä Ǎ ǎ Ă ă Å å Ā ā Ą ą Æ æ Ć ć Ç ç Č č Ĉ ĉ Ċ ċ Ð đ ð Ď ď È è É é Ê ê Ë ë Ě ě Ē ē Ė ė Ę ę Ģ ģ Ĝ ĝ Ğ ğ Ġ ġ Ĥ ĥ Ì ì Í í Î î Ï ï Ǐ ǐ Ī ī İ ı Į į Ĵ ĵ Ķ ķ Ĺ ĺ Ļ ļ Ľ ľ Ł ł Ŀ ŀ Ń ń Ñ ñ Ņ ņ Ň ň Ò ò Ó ó Ô ô Õ õ Ö ö Ǒ ǒ Ō ō Ő ő Œ œ Ø ø Ŕ ŕ Ŗ ŗ Ř ř Ś ś Ş ş Š š Ŝ ŝ Ţ ţ Ť ť Ù ù Ú ú Û û Ü ü Ǔ ǔ Ŭ ŭ Ū ū Ů ů ǖ ǘ ǚ ǜ Ų ų Ű ű Ŵ ŵ Ý ý Ÿ ÿ Ŷ ŷ Ź ź Ž ž Ż ż Þ þ ß Ħ ħ ¿ ¡ ¢ £ ¤ ¥ € ¦ § ª ¬ ¯ ° ± ÷ ‰ ¼ ½ ¾ ¹ ² ³ µ ¶ † ‡ · • º ∀ ∂ ∃ Ə ə ∅ ∇ ∈ ∉ ∋ ∏ ∑ ‾ − ∗ √ ∝ ∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥ ⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ◊ ℘ ℑ ℜ ℵ ♠ ♣ ♥ ♦ α β Γ γ Δ δ ε ζ η Θ θ ι κ Λ λ μ Ξ ξ Π π ρ Σ σ Τ τ υ Φ φ χ Ψ ψ Ω ω ★ ☆ ☎ ☚ ☛ ☜ ☝ ☞ ☟ ☹ ☺ ✔ ✘ × „ “ ” ‚ ‘ ’ « » ‹ › — – … ← ↑ → ↓ ↔ ⇐ ⇑ ⇒ ⇓ ⇔ © ™ ® ′ ″')), array('type' => 'signature', 'title' => $lang['qb_sig'], 'icon' => 'sig.png', 'key' => 'y')));
    }
    // end event TOOLBAR_DEFINE default action
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:31,代码来源:toolbar.php


示例15: isLocalMode

    }
}
if (!$dh) {
    $curFile = null;
    $dir = isLocalMode() ? $theSettings->directory : $topDirectory;
    if (strpos(addslash($dir), $topDirectory) !== 0) {
        $dir = $topDirectory;
    }
    $dh = @opendir($dir);
}
$files = array();
$dirs = array();
if ($dh) {
    $dir = addslash($dir);
    while (false !== ($file = readdir($dh))) {
        $path = fullpath($dir . $file);
        if ($file == ".." && $dir == $topDirectory) {
            continue;
        }
        if (is_dir($path) && is_readable($path) && strpos(addslash($path), $topDirectory) === 0 && ($theSettings->uid < 0 || isUserHavePermission($theSettings->uid, $theSettings->gid, $path, 0x5))) {
            $dirs['/' . $file] = $path;
        } else {
            if (LFS::is_file($path) && is_readable($path) && ($theSettings->uid < 0 || isUserHavePermission($theSettings->uid, $theSettings->gid, $path, 0x4))) {
                $files[$file] = $path;
            }
        }
    }
    closedir($dh);
    ksort($files, SORT_STRING);
    ksort($dirs, SORT_STRING);
    $files = array_merge($dirs, $files);
开发者ID:timelf123,项目名称:rutorrent-relocate,代码行数:31,代码来源:getfiles.php


示例16: init_path

/**
 * Returns absolute path
 *
 * This tries the given path first, then checks in DOKU_INC.
 * Check for accessability on directories as well.
 *
 * @author Andreas Gohr <[email protected]>
 */
function init_path($path)
{
    // check existance
    $p = fullpath($path);
    if (!@file_exists($p)) {
        $p = fullpath(DOKU_INC . $path);
        if (!@file_exists($p)) {
            return '';
        }
    }
    // check writability
    if (!@is_writable($p)) {
        return '';
    }
    // check accessability (execute bit) for directories
    if (@is_dir($p) && !@file_exists("{$p}/.")) {
        return '';
    }
    return $p;
}
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:28,代码来源:init.php


示例17: array

     }
     if ($dh) {
         $files = array();
         $dir = addslash($dir);
         while (false !== ($file = readdir($dh))) {
             $path = fullpath($dir . $file);
             if ($file == ".." && $dir == $topDirectory) {
                 continue;
             }
             if (is_dir($path) && is_readable($path) && strpos(addslash($path), $topDirectory) === 0 && ($theSettings->uid < 0 || isUserHavePermission($theSettings->uid, $theSettings->gid, $path, 0x7))) {
                 $files[] = $file;
             }
         }
         closedir($dh);
         sort($files, SORT_STRING);
         $output["basedir"] = fullpath($dir);
         $output["dirlist"] = $files;
     }
 }
 if (in_array("channels", $modes) && $theSettings->isPluginRegistered('throttle')) {
     require_once '../throttle/throttle.php';
     $trt = rThrottle::load();
     $tnames = array();
     foreach ($trt->thr as $thr) {
         $tnames[] = $thr["name"];
     }
     $output["channels"] = $tnames;
 }
 if (in_array("ratios", $modes) && $theSettings->isPluginRegistered('ratio')) {
     require_once '../ratio/ratio.php';
     $rat = rRatio::load();
开发者ID:chaitanya11,项目名称:rtorrent,代码行数:31,代码来源:info.php


示例18: bootstrap3_pageinfo

/**
 * Print some info about the current page
 *
 * @author  Andreas Gohr <[email protected]>
 * @author  Giuseppe Di Terlizzi <[email protected]>
 *
 * @param   bool $ret return content instead of printing it
 * @return  bool|string
 */
function bootstrap3_pageinfo($ret = false)
{
    global $conf;
    global $lang;
    global $INFO;
    global $ID;
    // return if we are not allowed to view the page
    if (!auth_quickaclcheck($ID)) {
        return false;
    }
    // prepare date and path
    $fn = $INFO['filepath'];
    if (!$conf['fullpath']) {
        if ($INFO['rev']) {
            $fn = str_replace(fullpath($conf['olddir']) . '/', '', $fn);
        } else {
            $fn = str_replace(fullpath($conf['datadir']) . '/', '', $fn);
        }
    }
    $date_format = bootstrap3_conf('pageInfoDateFormat');
    $page_info = bootstrap3_conf('pageInfo');
    $fn = utf8_decodeFN($fn);
    $date = $date_format == 'dformat' ? dformat($INFO['lastmod']) : datetime_h($INFO['lastmod']);
    // print it
    if ($INFO['exists']) {
        $fn_full = $fn;
        if (!in_array('extension', $page_info)) {
            $fn = str_replace(array('.txt.gz', '.txt'), '', $fn);
        }
        $out = '<ul class="list-inline">';
        if (in_array('filename', $page_info)) {
            $out .= sprintf('<li><i class="fa fa-fw fa-file-text-o text-muted"></i> <span title="%s">%s</span></li>', $fn_full, $fn);
        }
        if (in_array('date', $page_info)) {
            $out .= sprintf('<li><i class="fa fa-fw fa-calendar text-muted"></i> %s <span title="%s">%s</span></li>', $lang['lastmod'], dformat($INFO['lastmod']), $date);
        }
        if (in_array('editor', $page_info)) {
            if (isset($INFO['editor'])) {
                $user = editorinfo($INFO['editor']);
                if (bootstrap3_conf('useGravatar')) {
                    global $auth;
                    $user_data = $auth->getUserData($INFO['editor']);
                    $HTTP = new DokuHTTPClient();
                    $gravatar_img = get_gravatar($user_data['mail'], 16);
                    $gravatar_check = $HTTP->get($gravatar_img . '&d=404');
                    if ($gravatar_check) {
                        $user_img = sprintf('<img src="%s" alt="" width="16" class="img-rounded" /> ', $gravatar_img);
                        $user = str_replace(array('iw_user', 'interwiki'), '', $user);
                        $user = $user_img . $user;
                    }
                }
                $out .= sprintf('<li class="text-muted">%s %s</li>', $lang['by'], $user);
            } else {
                $out .= sprintf('<li>(%s)</li>', $lang['external_edit']);
            }
        }
        if ($INFO['locked'] && in_array('locked', $page_info)) {
            $out .= sprintf('<li><i class="fa fa-fw fa-lock text-muted"></i> %s %s</li>', $lang['lockedby'], editorinfo($INFO['locked']));
        }
        $out .= '</ul>';
        if ($ret) {
            return $out;
        } else {
            echo $out;
            return true;
        }
    }
    return false;
}
开发者ID:huksley,项目名称:dokuwiki-template-bootstrap3,代码行数:78,代码来源:tpl_functions.php


示例19: obtain

 public function obtain($dir = '../plugins/extsearch/engines')
 {
     $oldEngines = $this->engines;
     $this->engines = array();
     if ($handle = opendir($dir)) {
         while (false !== ($file = readdir($handle))) {
             if (is_file($dir . '/' . $file)) {
                 $name = basename($file, ".php");
                 $this->engines[$name] = array("name" => $name, "path" => fullpath($dir . '/' . $file), "object" => $name . "Engine", "enabled" => true, "global" => true, "limit" => 100);
                 $obj = $this->getObject($name);
                 $this->engines[$name]["enabled"] = intval($obj->defaults["public"]);
                 $this->engines[$name]["public"] = intval($obj->defaults["public"]);
                 $this->engines[$name]["limit"] = $obj->defaults["page_size"];
                 $this->engines[$name]["cats"] = $obj->categories;
                 $this->engines[$name]["cookies"] = array_key_exists("cookies", $obj->defaults) ? $obj->defaults["cookies"] : '';
                 $this->engines[$name]["auth"] = array_key_exists("auth", $obj->defaults) ? 1 : 0;
                 if (array_key_exists("disabled", $obj->defaults) && $obj->defaults["disabled"]) {
                     $this->engines[$name][ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP funDevuelveArregloRecordset函数代码示例发布时间:2022-05-15
下一篇:
PHP fullname函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap