当前位置: 首页>>代码示例>>PHP>>正文


PHP path::real方法代码示例

本文整理汇总了PHP中path::real方法的典型用法代码示例。如果您正苦于以下问题:PHP path::real方法的具体用法?PHP path::real怎么用?PHP path::real使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在path的用法示例。


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

示例1: dc_admin_icon_url

function dc_admin_icon_url($img)
{
    global $core;
    $core->auth->user_prefs->addWorkspace('interface');
    $user_ui_iconset = @$core->auth->user_prefs->interface->iconset;
    if ($user_ui_iconset && $img) {
        $icon = false;
        if (preg_match('/^images\\/menu\\/(.+)$/', $img, $m) || preg_match('/^index\\.php\\?pf=(.+)$/', $img, $m)) {
            if ($m[1]) {
                $icon = path::real(dirname(__FILE__) . '/../../admin/images/iconset/' . $user_ui_iconset . '/' . $m[1], false);
                if ($icon !== false) {
                    $allow_types = array('png', 'jpg', 'jpeg', 'gif');
                    if (is_file($icon) && is_readable($icon) && in_array(files::getExtension($icon), $allow_types)) {
                        return DC_ADMIN_URL . 'images/iconset/' . $user_ui_iconset . '/' . $m[1];
                    }
                }
            }
        }
    }
    return $img;
}
开发者ID:nikrou,项目名称:dotclear,代码行数:21,代码来源:prepend.php

示例2: execute

 public function execute()
 {
     // Get theme path
     $path = $this->core->blog->themes_path;
     $theme = $this->core->blog->settings->system->theme;
     $dir = path::real($path . '/' . $theme);
     if (empty($path) || empty($theme) || !is_dir($dir)) {
         return false;
     }
     // Create zip
     @set_time_limit(300);
     $fp = fopen('php://output', 'wb');
     $zip = new fileZip($fp);
     $zip->addExclusion('#(^|/).(.*?)_(m|s|sq|t).jpg$#');
     $zip->addDirectory($dir . '/', '', true);
     // Log task execution here as we sent file and stop script
     $this->log();
     // Send zip
     header('Content-Disposition: attachment;filename=theme-' . $theme . '.zip');
     header('Content-Type: application/x-zip');
     $zip->write();
     unset($zip);
     exit(1);
 }
开发者ID:nikrou,项目名称:dotclear,代码行数:24,代码来源:class.dc.maintenance.ziptheme.php

示例3: __flushCache

	protected function __flushCache() {
		$this->__putLog('Flushing cache');
		$sCacheFiles = files::scanDir($this->sCacheDir);
		foreach ($sCacheFiles as $v) {
			$sCacheFile = $this->sCacheDir.'/'.$v;
			$sCacheFile = path::clean(path::real($sCacheFile));
			if (is_file($sCacheFile)) {
				if (time() - filemtime($sCacheFile) >= $this->nCacheTime) {
					unlink($sCacheFile);
					$this->__putLog('Deleting '.$v);
				}
			}
		}
		$sCacheFiles = files::scanDir($this->sCacheDir);
		return true;
	}
开发者ID:robotconscience,项目名称:Robotconscience.com,代码行数:16,代码来源:class.read.tumblr.cache.php

示例4: dropImage

 /**
  * Delete an image from images folder (with its thumbnails if any)
  *
  * @param  string $folder images folder
  * @param  string $img    image filename
  */
 public static function dropImage($folder, $img)
 {
     global $core;
     $img = path::real(self::imagesPath($folder) . '/' . $img);
     if (is_writable(dirname($img))) {
         // Delete thumbnails if any
         try {
             $media = new dcMedia($core);
             $media->imageThumbRemove($img);
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
         // Delete image
         @unlink($img);
     }
 }
开发者ID:nikrou,项目名称:dotclear,代码行数:22,代码来源:lib.themeconfig.php

示例5: displayModules

 public function displayModules($cols = array('name', 'config', 'version', 'desc'), $actions = array(), $nav_limit = false)
 {
     echo '<form action="' . $this->getURL() . '" method="post" class="modules-form-actions">' . '<div id="' . html::escapeHTML($this->list_id) . '" class="modules' . (in_array('expander', $cols) ? ' expandable' : '') . ' one-box">';
     $sort_field = $this->getSort();
     # Sort modules by id
     $modules = $this->getSearch() === null ? self::sortModules($this->data, $sort_field, $this->sort_asc) : $this->data;
     $res = '';
     $count = 0;
     foreach ($modules as $id => $module) {
         # Show only requested modules
         if ($nav_limit && $this->getSearch() === null) {
             $char = substr($module[$sort_field], 0, 1);
             if (!in_array($char, $this->nav_list)) {
                 $char = $this->nav_special;
             }
             if ($this->getIndex() != $char) {
                 continue;
             }
         }
         $current = $this->core->blog->settings->system->theme == $id && $this->modules->moduleExists($id);
         $distrib = self::isDistributedModule($id) ? ' dc-box' : '';
         $line = '<div class="box ' . ($current ? 'medium current-theme' : 'theme') . $distrib . '">';
         if (in_array('name', $cols) && !$current) {
             $line .= '<h4 class="module-name">';
             if (in_array('checkbox', $cols)) {
                 $line .= '<label for="' . html::escapeHTML($this->list_id) . '_modules_' . html::escapeHTML($id) . '">' . form::checkbox(array('modules[' . $count . ']', html::escapeHTML($this->list_id) . '_modules_' . html::escapeHTML($id)), html::escapeHTML($id)) . html::escapeHTML($module['name']) . '</label>';
             } else {
                 $line .= form::hidden(array('modules[' . $count . ']'), html::escapeHTML($id)) . html::escapeHTML($module['name']);
             }
             $line .= $this->core->formNonce() . '</h4>';
         }
         # Display score only for debug purpose
         if (in_array('score', $cols) && $this->getSearch() !== null && defined('DC_DEBUG') && DC_DEBUG) {
             $line .= '<p class="module-score debug">' . sprintf(__('Score: %s'), $module['score']) . '</p>';
         }
         if (in_array('sshot', $cols)) {
             # Screenshot from url
             if (preg_match('#^http(s)?://#', $module['sshot'])) {
                 $sshot = $module['sshot'];
             } elseif (file_exists($this->core->blog->themes_path . '/' . $id . '/screenshot.jpg')) {
                 $sshot = $this->getURL('shot=' . rawurlencode($id));
             } else {
                 $sshot = 'images/noscreenshot.png';
             }
             $line .= '<div class="module-sshot"><img src="' . $sshot . '" alt="' . sprintf(__('%s screenshot.'), html::escapeHTML($module['name'])) . '" /></div>';
         }
         $line .= '<div class="module-infos toggle-bloc">';
         if (in_array('name', $cols) && $current) {
             $line .= '<h4 class="module-name">';
             if (in_array('checkbox', $cols)) {
                 $line .= '<label for="' . html::escapeHTML($this->list_id) . '_modules_' . html::escapeHTML($id) . '">' . form::checkbox(array('modules[' . $count . ']', html::escapeHTML($this->list_id) . '_modules_' . html::escapeHTML($id)), html::escapeHTML($id)) . html::escapeHTML($module['name']) . '</label>';
             } else {
                 $line .= form::hidden(array('modules[' . $count . ']'), html::escapeHTML($id)) . html::escapeHTML($module['name']);
             }
             $line .= '</h4>';
         }
         $line .= '<p>';
         if (in_array('desc', $cols)) {
             $line .= '<span class="module-desc">' . html::escapeHTML(__($module['desc'])) . '</span> ';
         }
         if (in_array('author', $cols)) {
             $line .= '<span class="module-author">' . sprintf(__('by %s'), html::escapeHTML($module['author'])) . '</span> ';
         }
         if (in_array('version', $cols)) {
             $line .= '<span class="module-version">' . sprintf(__('version %s'), html::escapeHTML($module['version'])) . '</span> ';
         }
         if (in_array('current_version', $cols)) {
             $line .= '<span class="module-current-version">' . sprintf(__('(current version %s)'), html::escapeHTML($module['current_version'])) . '</span> ';
         }
         if (in_array('parent', $cols) && !empty($module['parent'])) {
             if ($this->modules->moduleExists($module['parent'])) {
                 $line .= '<span class="module-parent-ok">' . sprintf(__('(built on "%s")'), html::escapeHTML($module['parent'])) . '</span> ';
             } else {
                 $line .= '<span class="module-parent-missing">' . sprintf(__('(requires "%s")'), html::escapeHTML($module['parent'])) . '</span> ';
             }
         }
         $has_details = in_array('details', $cols) && !empty($module['details']);
         $has_support = in_array('support', $cols) && !empty($module['support']);
         if ($has_details || $has_support) {
             $line .= '<span class="mod-more">';
             if ($has_details) {
                 $line .= '<a class="module-details" href="' . $module['details'] . '">' . __('Details') . '</a>';
             }
             if ($has_support) {
                 $line .= ' - <a class="module-support" href="' . $module['support'] . '">' . __('Support') . '</a>';
             }
             $line .= '</span>';
         }
         $line .= '</p>' . '</div>';
         $line .= '<div class="module-actions toggle-bloc">';
         # Plugins actions
         if ($current) {
             # _GET actions
             if (file_exists(path::real($this->core->blog->themes_path . '/' . $id) . '/style.css')) {
                 $theme_url = preg_match('#^http(s)?://#', $this->core->blog->settings->system->themes_url) ? http::concatURL($this->core->blog->settings->system->themes_url, '/' . $id) : http::concatURL($this->core->blog->url, $this->core->blog->settings->system->themes_url . '/' . $id);
                 $line .= '<p><a href="' . $theme_url . '/style.css">' . __('View stylesheet') . '</a></p>';
             }
             $line .= '<div class="current-actions">';
             if (file_exists(path::real($this->core->blog->themes_path . '/' . $id) . '/_config.php')) {
                 $line .= '<p><a href="' . $this->getURL('module=' . $id . '&amp;conf=1', false) . '" class="button submit">' . __('Configure theme') . '</a></p>';
//.........这里部分代码省略.........
开发者ID:nikrou,项目名称:dotclear,代码行数:101,代码来源:lib.moduleslist.php

示例6: Copyright

# Copyright (c) 2003-2006 Olivier Meunier and contributors. All rights
# reserved.
#
# DotClear is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# DotClear is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with DotClear; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ***** END LICENSE BLOCK *****
l10n::set(dirname(__FILE__) . '/locales/' . $_lang . '/main');
$css_file = path::real($core->blog->themes_path) . '/' . $core->blog->settings->theme . '/style.css';
if (!is_file($css_file) && !is_writable(dirname($css_file))) {
    throw new Exception(sprintf(__('File %s does not exist and directory %s is not writable.'), $css_file, dirname($css_file)));
}
if (isset($_POST['css'])) {
    @($fp = fopen($css_file, 'wb'));
    fwrite($fp, $_POST['css']);
    fclose($fp);
    echo '<div class="message"><p>' . __('Style sheet upgraded.') . '</p></div>';
}
$css_content = is_file($css_file) ? file_get_contents($css_file) : '';
echo '<p class="area"><label>' . __('Style sheet:') . ' ' . form::textarea('css', 60, 20, html::escapeHTML($css_content)) . '</label></p>';
开发者ID:sleberrigaud,项目名称:dotclear,代码行数:31,代码来源:_config.php

示例7: getFilesInDir

 protected function getFilesInDir($dir, $ext = null, $prefix = '', $model = null)
 {
     $dir = path::real($dir);
     if (!$dir || !is_dir($dir) || !is_readable($dir)) {
         return array();
     }
     $d = dir($dir);
     $res = array();
     while (($f = $d->read()) !== false) {
         if (is_file($dir . '/' . $f) && !preg_match('/^\\./', $f) && (!$ext || preg_match('/\\.' . preg_quote($ext) . '$/i', $f))) {
             if (!$model || preg_match('/^' . preg_quote($model) . '$/i', $f)) {
                 $res[$prefix . $f] = $dir . '/' . $f;
             }
         }
     }
     return $res;
 }
开发者ID:nikrou,项目名称:dotclear,代码行数:17,代码来源:class.themeEditor.php

示例8: dirname

}
$DBDRIVER = !empty($_POST['DBDRIVER']) ? $_POST['DBDRIVER'] : (function_exists('mysqli_connect') ? 'mysqli' : 'mysql');
$DBHOST = !empty($_POST['DBHOST']) ? $_POST['DBHOST'] : '';
$DBNAME = !empty($_POST['DBNAME']) ? $_POST['DBNAME'] : '';
$DBUSER = !empty($_POST['DBUSER']) ? $_POST['DBUSER'] : '';
$DBPASSWORD = !empty($_POST['DBPASSWORD']) ? $_POST['DBPASSWORD'] : '';
$DBPREFIX = !empty($_POST['DBPREFIX']) ? $_POST['DBPREFIX'] : 'dc_';
if (!empty($_POST)) {
    try {
        if ($DBDRIVER == 'sqlite') {
            if (strpos($DBNAME, '/') === false) {
                $sqlite_db_directory = dirname(DC_RC_PATH) . '/../db/';
                files::makeDir($sqlite_db_directory, true);
                # Can we write sqlite_db_directory ?
                if (!is_writable($sqlite_db_directory)) {
                    throw new Exception(sprintf(__('Cannot write "%s" directory.'), path::real($sqlite_db_directory, false)));
                }
                $DBNAME = $sqlite_db_directory . $DBNAME;
            }
        }
        # Tries to connect to database
        try {
            $con = dbLayer::init($DBDRIVER, $DBHOST, $DBNAME, $DBUSER, $DBPASSWORD);
        } catch (Exception $e) {
            throw new Exception('<p>' . __($e->getMessage()) . '</p>');
        }
        # Checks system capabilites
        require dirname(__FILE__) . '/check.php';
        if (!dcSystemCheck($con, $_e)) {
            $can_install = false;
            throw new Exception('<p>' . __('Dotclear cannot be installed.') . '</p><ul><li>' . implode('</li><li>', $_e) . '</li></ul>');
开发者ID:nikrou,项目名称:dotclear,代码行数:31,代码来源:wizard.php

示例9: __construct

 /**
  * Constructor
  *
  * Creates an instance of fileItem object.
  *
  * @param string	$file		Absolute file or directory path
  * @param string	$root		File root path
  * @param string	$root_url		File root URL
  */
 public function __construct($file, $root, $root_url = '')
 {
     $file = path::real($file);
     $stat = stat($file);
     $path = path::info($file);
     $rel = preg_replace('/^' . preg_quote($root, '/') . '\\/?/', '', $file);
     $this->file = $file;
     $this->basename = $path['basename'];
     $this->dir = $path['dirname'];
     $this->relname = $rel;
     $this->file_url = str_replace('%2F', '/', rawurlencode($rel));
     $this->file_url = $root_url . $this->file_url;
     $this->dir_url = dirname($this->file_url);
     $this->extension = $path['extension'];
     $this->mtime = $stat[9];
     $this->size = $stat[7];
     $this->mode = $stat[2];
     $this->uid = $stat[4];
     $this->gid = $stat[5];
     $this->w = is_writable($file);
     $this->d = is_dir($file);
     $this->f = is_file($file);
     $this->x = file_exists($file . '/.');
     $this->del = files::isDeletable($file);
     $this->type = $this->d ? null : files::getMimeType($file);
     $this->type_prefix = preg_replace('/^(.+?)\\/.+$/', '$1', $this->type);
 }
开发者ID:HackerMajor,项目名称:root,代码行数:36,代码来源:class.filemanager.php

示例10: define

define('DC_DBPASSWORD', $_ENV['DC_DBPASSWORD']);
// Database name
define('DC_DBNAME', $_ENV['DC_DBNAME']);
// Tables' prefix
define('DC_DBPREFIX', isset($_ENV['DC_DBPREFIX']) ? $_ENV['DC_DBPREFIX'] : 'dc_');
// Persistent database connection
define('DC_DBPERSIST', isset($_ENV['DC_DBPERSIST']) ? $_ENV['DC_DBPERSIST'] : false);
// Crypt key (password storage)
define('DC_MASTER_KEY', $_ENV['DC_MASTER_KEY']);
// Admin URL. You need to set it for some features.
define('DC_ADMIN_URL', $_ENV['DC_ADMIN_URL']);
// Admin mail from address. For password recovery and such.
define('DC_ADMIN_MAILFROM', $_ENV['DC_ADMIN_MAILFROM']);
// Cookie's name
define('DC_SESSION_NAME', isset($_ENV['DC_SESSION_NAME']) ? $_ENV['DC_SESSION_NAME'] : 'dcxd');
// Plugins root
define('DC_PLUGINS_ROOT', isset($_ENV['DC_PLUGINS_ROOT']) ? $_ENV['DC_PLUGINS_ROOT'] : dirname(__FILE__) . '/../plugins');
// Template cache directory
define('DC_TPL_CACHE', isset($_ENV['DC_TPL_CACHE']) ? $_ENV['DC_TPL_CACHE'] : path::real(dirname(__FILE__) . '/..') . '/cache');
// If you have PATH_INFO issue, uncomment following lines
//if (!isset($_SERVER['ORIG_PATH_INFO'])) {
//	$_SERVER['ORIG_PATH_INFO'] = '';
//}
//$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
// If you have mail problems, uncomment following lines and adapt it to your hosting configuration
// For more information about this setting, please refer to http://doc.dotclear.net/2.0/admin/install/custom-sendmail
//function _mail($to,$subject,$message,$headers)
//{
//	socketMail::$smtp_relay = 'my.smtp.relay.org';
//	socketMail::mail($to,$subject,$message,$headers);
//}
开发者ID:buxx,项目名称:docker-dotclear,代码行数:31,代码来源:config.php

示例11: define

define('DC_DBPASSWORD', '[[softdbpass]]');
// Database name
define('DC_DBNAME', '[[softdb]]');
// Tables' prefix
define('DC_DBPREFIX', '[[dbprefix]]');
// Persistent database connection
define('DC_DBPERSIST', false);
// Crypt key (password storage)
define('DC_MASTER_KEY', '[[secret]]');
// Admin URL. You need to set it for some features.
define('DC_ADMIN_URL', '[[softurl]]/admin/');
// Admin mail from address. For password recovery and such.
define('DC_ADMIN_MAILFROM', '[[admin_email]]');
// Cookie's name
define('DC_SESSION_NAME', 'dcxd');
// Plugins root
define('DC_PLUGINS_ROOT', dirname(__FILE__) . '/../plugins');
// Template cache directory
define('DC_TPL_CACHE', path::real(dirname(__FILE__) . '/..') . '/cache');
// If you have PATH_INFO issue, uncomment following lines
//if (!isset($_SERVER['ORIG_PATH_INFO'])) {
//	$_SERVER['ORIG_PATH_INFO'] = '';
//}
//$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
// If you have mail problems, uncomment following lines and adapt it to your hosting configuration
// For more information about this setting, please refer to http://doc.dotclear.net/2.0/admin/install/custom-sendmail
//function _mail($to,$subject,$message,$headers)
//{
//	socketMail::$smtp_relay = 'my.smtp.relay.org';
//	socketMail::mail($to,$subject,$message,$headers);
//}
开发者ID:Git-Host,项目名称:AMPPS,代码行数:31,代码来源:config.php

示例12: foreach

if ($dir && !empty($_POST['medias']) && !empty($_POST['delete_medias'])) {
    try {
        foreach ($_POST['medias'] as $media) {
            $core->media->removeItem(rawurldecode($media));
        }
        dcPage::addSuccessNotice(sprintf(__('Successfully delete one media.', 'Successfully delete %d medias.', count($_POST['medias'])), count($_POST['medias'])));
        $core->adminurl->redirect('admin.media', $page_url_params);
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
# Removing item from popup only
if ($dir && !empty($_POST['rmyes']) && !empty($_POST['remove'])) {
    $_POST['remove'] = rawurldecode($_POST['remove']);
    try {
        if (is_dir(path::real($core->media->getPwd() . '/' . path::clean($_POST['remove'])))) {
            $msg = __('Directory has been successfully removed.');
        } else {
            $msg = __('File has been successfully removed.');
        }
        $core->media->removeItem($_POST['remove']);
        dcPage::addSuccessNotice($msg);
        $core->adminurl->redirect('admin.media', $page_url_params);
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
# Rebuild directory
if ($dir && $core->auth->isSuperAdmin() && !empty($_POST['rebuild'])) {
    try {
        $core->media->rebuild($d);
开发者ID:nikrou,项目名称:dotclear,代码行数:31,代码来源:media.php

示例13: run

 public function run()
 {
     require_once LIB_PATH . 'clearbricks/jelix.inc.php';
     require_once JELIX_LIB_PATH . 'installer/jInstaller.class.php';
     $appPath = $this->getParam('path');
     $appPath = $this->getRealPath($appPath);
     $appName = basename($appPath);
     $appPath .= '/';
     if (file_exists($appPath)) {
         throw new Exception("this application is already created");
     }
     $this->config = JelixScript::loadConfig($appName);
     $this->config->infoIDSuffix = $this->config->newAppInfoIDSuffix;
     $this->config->infoWebsite = $this->config->newAppInfoWebsite;
     $this->config->infoLicence = $this->config->newAppInfoLicence;
     $this->config->infoLicenceUrl = $this->config->newAppInfoLicenceUrl;
     $this->config->newAppInfoLocale = $this->config->newAppInfoLocale;
     $this->config->newAppInfoCopyright = $this->config->newAppInfoCopyright;
     $this->config->initAppPaths($appPath);
     jApp::setEnv('jelix-scripts');
     jApp::initLegacy();
     JelixScript::checkTempPath();
     if ($p = $this->getOption('-wwwpath')) {
         $wwwpath = path::real($appPath . $p, false) . '/';
     } else {
         $wwwpath = jApp::wwwPath();
     }
     $this->createDir($appPath);
     $this->createDir(jApp::tempBasePath());
     $this->createDir($wwwpath);
     $varPath = jApp::varPath();
     $configPath = jApp::configPath();
     $this->createDir($varPath);
     $this->createDir(jApp::logPath());
     $this->createDir($configPath);
     $this->createDir($configPath . 'index/');
     $this->createDir($varPath . 'overloads/');
     $this->createDir($varPath . 'themes/');
     $this->createDir($varPath . 'themes/default/');
     $this->createDir($varPath . 'uploads/');
     $this->createDir($varPath . 'sessions/');
     $this->createDir($varPath . 'mails/');
     $this->createDir($appPath . 'install');
     $this->createDir($appPath . 'modules');
     $this->createDir($appPath . 'plugins');
     $this->createDir($appPath . 'plugins/coord/');
     $this->createDir($appPath . 'plugins/tpl/');
     $this->createDir($appPath . 'plugins/tpl/common');
     $this->createDir($appPath . 'plugins/tpl/html');
     $this->createDir($appPath . 'plugins/tpl/text');
     $this->createDir($appPath . 'plugins/db/');
     $this->createDir($appPath . 'plugins/auth/');
     $this->createDir($appPath . 'responses');
     $this->createDir($appPath . 'tests');
     $this->createDir(jApp::scriptsPath());
     $param = array();
     $param['default_id'] = $appName . $this->config->infoIDSuffix;
     if ($this->getOption('-nodefaultmodule')) {
         $param['tplname'] = 'jelix~defaultmain';
         $param['modulename'] = 'jelix';
     } else {
         // note: since module name are used for name of generated name,
         // only this characters are allowed
         $param['modulename'] = preg_replace('/([^a-zA-Z_0-9])/', '_', $appName);
         $param['tplname'] = $param['modulename'] . '~main';
     }
     $param['config_file'] = 'index/config.ini.php';
     $param['rp_temp'] = $this->getRelativePath($appPath, jApp::tempBasePath());
     $param['rp_var'] = $this->getRelativePath($appPath, jApp::varPath());
     $param['rp_log'] = $this->getRelativePath($appPath, jApp::logPath());
     $param['rp_conf'] = $this->getRelativePath($appPath, $configPath);
     $param['rp_www'] = $this->getRelativePath($appPath, $wwwpath);
     $param['rp_cmd'] = $this->getRelativePath($appPath, jApp::scriptsPath());
     $param['rp_jelix'] = $this->getRelativePath($appPath, JELIX_LIB_PATH);
     $param['rp_app'] = $this->getRelativePath($wwwpath, $appPath);
     $this->createFile($appPath . '.htaccess', 'htaccess_deny', $param);
     $this->createFile($appPath . 'project.xml', 'project.xml.tpl', $param);
     $this->createFile($appPath . 'cmd.php', 'cmd.php.tpl', $param);
     $this->createFile($configPath . 'defaultconfig.ini.php', 'var/config/defaultconfig.ini.php.tpl', $param);
     $this->createFile($configPath . 'profiles.ini.php', 'var/config/profiles.ini.php.tpl', $param);
     $this->createFile($configPath . 'urls.xml', 'var/config/urls.xml.tpl', $param);
     //$this->createFile(JELIX_APP_CONFIG_PATH.'installer.ini.php', 'var/config/installer.ini.php.tpl', $param);
     $this->createFile($configPath . 'index/config.ini.php', 'var/config/index/config.ini.php.tpl', $param);
     $this->createFile($appPath . 'responses/myHtmlResponse.class.php', 'responses/myHtmlResponse.class.php.tpl', $param);
     $this->createFile($appPath . 'install/installer.php', 'installer/installer.php.tpl', $param);
     $this->createFile($appPath . 'tests/runtests.php', 'tests/runtests.php', $param);
     $this->createFile($wwwpath . 'index.php', 'www/index.php.tpl', $param);
     $this->createFile($wwwpath . '.htaccess', 'htaccess_allow', $param);
     $param['php_rp_temp'] = $this->convertRp($param['rp_temp']);
     $param['php_rp_var'] = $this->convertRp($param['rp_var']);
     $param['php_rp_log'] = $this->convertRp($param['rp_log']);
     $param['php_rp_conf'] = $this->convertRp($param['rp_conf']);
     $param['php_rp_www'] = $this->convertRp($param['rp_www']);
     $param['php_rp_cmd'] = $this->convertRp($param['rp_cmd']);
     $param['php_rp_jelix'] = $this->convertRp($param['rp_jelix']);
     $this->createFile($appPath . 'application.init.php', 'application.init.php.tpl', $param);
     $installer = new jInstaller(new textInstallReporter('warning'));
     $installer->installApplication();
     $moduleok = true;
     if (!$this->getOption('-nodefaultmodule')) {
//.........这里部分代码省略.........
开发者ID:hadrienl,项目名称:jelix,代码行数:101,代码来源:createapp.cmd.php

示例14: dotclearUpgrade


//.........这里部分代码省略.........
                $init_fav['newpage'] = array('newpage', 'New page', 'plugin.php?p=pages&amp;act=page', 'index.php?pf=pages/icon-np.png', 'index.php?pf=pages/icon-np-big.png', 'contentadmin,pages', null, null);
                $init_fav['media'] = array('media', 'Media manager', 'media.php', 'images/menu/media.png', 'images/menu/media-b.png', 'media,media_admin', null, null);
                $init_fav['widgets'] = array('widgets', 'Presentation widgets', 'plugin.php?p=widgets', 'index.php?pf=widgets/icon.png', 'index.php?pf=widgets/icon-big.png', 'admin', null, null);
                $init_fav['blog_theme'] = array('blog_theme', 'Blog appearance', 'blog_theme.php', 'images/menu/themes.png', 'images/menu/blog-theme-b.png', 'admin', null, null);
                $count = 0;
                foreach ($init_fav as $k => $f) {
                    $t = array('name' => $f[0], 'title' => $f[1], 'url' => $f[2], 'small-icon' => $f[3], 'large-icon' => $f[4], 'permissions' => $f[5], 'id' => $f[6], 'class' => $f[7]);
                    $sqlstr = 'INSERT INTO ' . $core->prefix . 'pref (pref_id, user_id, pref_ws, pref_value, pref_type, pref_label) VALUES (' . '\'' . sprintf("g%03s", $count) . '\',NULL,\'favorites\',\'' . serialize($t) . '\',\'string\',NULL);';
                    $core->con->execute($sqlstr);
                    $count++;
                }
                # A bit of housecleaning for no longer needed files
                $remfiles = array('admin/style/cat-bg.png', 'admin/style/footer-bg.png', 'admin/style/head-logo.png', 'admin/style/tab-bg.png', 'admin/style/tab-c-l.png', 'admin/style/tab-c-r.png', 'admin/style/tab-l-l.png', 'admin/style/tab-l-r.png', 'admin/style/tab-n-l.png', 'admin/style/tab-n-r.png', 'inc/clearbricks/_common.php', 'inc/clearbricks/common/lib.crypt.php', 'inc/clearbricks/common/lib.date.php', 'inc/clearbricks/common/lib.files.php', 'inc/clearbricks/common/lib.form.php', 'inc/clearbricks/common/lib.html.php', 'inc/clearbricks/common/lib.http.php', 'inc/clearbricks/common/lib.l10n.php', 'inc/clearbricks/common/lib.text.php', 'inc/clearbricks/common/tz.dat', 'inc/clearbricks/common/_main.php', 'inc/clearbricks/dblayer/class.cursor.php', 'inc/clearbricks/dblayer/class.mysql.php', 'inc/clearbricks/dblayer/class.pgsql.php', 'inc/clearbricks/dblayer/class.sqlite.php', 'inc/clearbricks/dblayer/dblayer.php', 'inc/clearbricks/dbschema/class.dbschema.php', 'inc/clearbricks/dbschema/class.dbstruct.php', 'inc/clearbricks/dbschema/class.mysql.dbschema.php', 'inc/clearbricks/dbschema/class.pgsql.dbschema.php', 'inc/clearbricks/dbschema/class.sqlite.dbschema.php', 'inc/clearbricks/diff/lib.diff.php', 'inc/clearbricks/diff/lib.unified.diff.php', 'inc/clearbricks/filemanager/class.filemanager.php', 'inc/clearbricks/html.filter/class.html.filter.php', 'inc/clearbricks/html.validator/class.html.validator.php', 'inc/clearbricks/image/class.image.meta.php', 'inc/clearbricks/image/class.image.tools.php', 'inc/clearbricks/mail/class.mail.php', 'inc/clearbricks/mail/class.socket.mail.php', 'inc/clearbricks/net/class.net.socket.php', 'inc/clearbricks/net.http/class.net.http.php', 'inc/clearbricks/net.http.feed/class.feed.parser.php', 'inc/clearbricks/net.http.feed/class.feed.reader.php', 'inc/clearbricks/net.xmlrpc/class.net.xmlrpc.php', 'inc/clearbricks/pager/class.pager.php', 'inc/clearbricks/rest/class.rest.php', 'inc/clearbricks/session.db/class.session.db.php', 'inc/clearbricks/template/class.template.php', 'inc/clearbricks/text.wiki2xhtml/class.wiki2xhtml.php', 'inc/clearbricks/url.handler/class.url.handler.php', 'inc/clearbricks/zip/class.unzip.php', 'inc/clearbricks/zip/class.zip.php', 'themes/default/tpl/.htaccess', 'themes/default/tpl/404.html', 'themes/default/tpl/archive.html', 'themes/default/tpl/archive_month.html', 'themes/default/tpl/category.html', 'themes/default/tpl/home.html', 'themes/default/tpl/post.html', 'themes/default/tpl/search.html', 'themes/default/tpl/tag.html', 'themes/default/tpl/tags.html', 'themes/default/tpl/user_head.html', 'themes/default/tpl/_flv_player.html', 'themes/default/tpl/_footer.html', 'themes/default/tpl/_head.html', 'themes/default/tpl/_mp3_player.html', 'themes/default/tpl/_top.html');
                $remfolders = array('inc/clearbricks/common', 'inc/clearbricks/dblayer', 'inc/clearbricks/dbschema', 'inc/clearbricks/diff', 'inc/clearbricks/filemanager', 'inc/clearbricks/html.filter', 'inc/clearbricks/html.validator', 'inc/clearbricks/image', 'inc/clearbricks/mail', 'inc/clearbricks/net', 'inc/clearbricks/net.http', 'inc/clearbricks/net.http.feed', 'inc/clearbricks/net.xmlrpc', 'inc/clearbricks/pager', 'inc/clearbricks/rest', 'inc/clearbricks/session.db', 'inc/clearbricks/template', 'inc/clearbricks/text.wiki2xhtml', 'inc/clearbricks/url.handler', 'inc/clearbricks/zip', 'inc/clearbricks', 'themes/default/tpl');
                foreach ($remfiles as $f) {
                    @unlink(DC_ROOT . '/' . $f);
                }
                foreach ($remfolders as $f) {
                    @rmdir(DC_ROOT . '/' . $f);
                }
            }
            if (version_compare($version, '2.3.1', '<')) {
                # Remove unecessary file
                @unlink(DC_ROOT . '/' . 'inc/libs/clearbricks/.hgignore');
            }
            if (version_compare($version, '2.4.0', '<=')) {
                # setup media_exclusion
                $strReq = 'UPDATE ' . $core->prefix . 'setting ' . "SET setting_value = '/\\.php\$/i' " . "WHERE setting_id = 'media_exclusion' " . "AND setting_value = '' ";
                $core->con->execute($strReq);
            }
            if (version_compare($version, '2.5', '<=')) {
                # Try to disable daInstaller plugin if it has been installed outside the default plugins directory
                $path = explode(PATH_SEPARATOR, DC_PLUGINS_ROOT);
                $default = path::real(dirname(__FILE__) . '/../../plugins/');
                foreach ($path as $root) {
                    if (!is_dir($root) || !is_readable($root)) {
                        continue;
                    }
                    if (substr($root, -1) != '/') {
                        $root .= '/';
                    }
                    if (($p = @dir($root)) === false) {
                        continue;
                    }
                    if (path::real($root) == $default) {
                        continue;
                    }
                    if (($d = @dir($root . 'daInstaller')) === false) {
                        continue;
                    }
                    $f = $root . '/daInstaller/_disabled';
                    if (!file_exists($f)) {
                        @file_put_contents($f, '');
                    }
                }
            }
            if (version_compare($version, '2.5.1', '<=')) {
                // Flash enhanced upload no longer needed
                @unlink(DC_ROOT . '/' . 'inc/swf/swfupload.swf');
            }
            if (version_compare($version, '2.6', '<=')) {
                // README has been replaced by README.md and CONTRIBUTING.md
                @unlink(DC_ROOT . '/' . 'README');
                // trackbacks are now merged into posts
                @unlink(DC_ROOT . '/' . 'admin/trackbacks.php');
                # daInstaller has been integrated to the core.
开发者ID:nikrou,项目名称:dotclear,代码行数:67,代码来源:upgrade.php

示例15: dirname

# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('admin');
# -- Loading themes --
$core->themes = new dcThemes($core);
$core->themes->loadModules($core->blog->themes_path, null);
# -- Page helper --
$list = new adminThemesList($core->themes, $core->blog->themes_path, $core->blog->settings->system->store_theme_url);
adminThemesList::$distributed_modules = explode(',', DC_DISTRIB_THEMES);
# -- Theme screenshot --
if (!empty($_GET['shot']) && $list->modules->moduleExists($_GET['shot'])) {
    $f = path::real(empty($_GET['src']) ? $core->blog->themes_path . '/' . $_GET['shot'] . '/screenshot.jpg' : $core->blog->themes_path . '/' . $_GET['shot'] . '/' . path::clean($_GET['src']));
    if (!file_exists($f)) {
        $f = dirname(__FILE__) . '/images/noscreenshot.png';
    }
    http::cache(array_merge(array($f), get_included_files()));
    header('Content-Type: ' . files::getMimeType($f));
    header('Content-Length: ' . filesize($f));
    readfile($f);
    exit;
}
# -- Display module configuration page --
if ($list->setConfiguration($core->blog->settings->system->theme)) {
    # Get content before page headers
    include $list->includeConfiguration();
    # Gather content
    $list->getConfiguration();
开发者ID:nikrou,项目名称:dotclear,代码行数:31,代码来源:blog_theme.php


注:本文中的path::real方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。