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

PHP join_path函数代码示例

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

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



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

示例1: record

 /**
  * Enregistre un message dans un fichier de log spécifique
  * Message non loggué si
  * 	- environment = SILENT
  * 	- level = WARNING et environment = PRODUCTION
  * 	- level = NOTICE et environment = PRODUCTION
  * @param $information message d'erreur / information à enregistrer
  * @param $level niveau d'erreur
  * @param $file_name fichier de log
  */
 public static function record($information, $level, $file_name = null)
 {
     try {
         $conf = Minz_Configuration::get('system');
         $env = $conf->environment;
     } catch (Minz_ConfigurationException $e) {
         $env = 'production';
     }
     if (!($env === 'silent' || $env === 'production' && $level >= Minz_Log::NOTICE)) {
         if ($file_name === null) {
             $file_name = join_path(USERS_PATH, Minz_Session::param('currentUser', '_'), 'log.txt');
         }
         switch ($level) {
             case Minz_Log::ERROR:
                 $level_label = 'error';
                 break;
             case Minz_Log::WARNING:
                 $level_label = 'warning';
                 break;
             case Minz_Log::NOTICE:
                 $level_label = 'notice';
                 break;
             case Minz_Log::DEBUG:
                 $level_label = 'debug';
                 break;
             default:
                 $level_label = 'unknown';
         }
         $log = '[' . date('r') . ']' . ' [' . $level_label . ']' . ' --- ' . $information . "\n";
         if (file_put_contents($file_name, $log, FILE_APPEND | LOCK_EX) === false) {
             throw new Minz_PermissionDeniedException($file_name, Minz_Exception::ERROR);
         }
     }
 }
开发者ID:buggithubs,项目名称:FreshRSS,代码行数:44,代码来源:Log.php


示例2: applyAction

 public function applyAction()
 {
     if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH)) {
         Minz_Request::forward(array('c' => 'update'), true);
     }
     require UPDATE_FILENAME;
     if (Minz_Request::param('post_conf', false)) {
         $res = do_post_update();
         Minz_ExtensionManager::callHook('post_update');
         if ($res === true) {
             @unlink(UPDATE_FILENAME);
             @file_put_contents(join_path(DATA_PATH, 'last_update.txt'), '');
             Minz_Request::good(_t('feedback.update.finished'));
         } else {
             Minz_Request::bad(_t('feedback.update.error', $res), array('c' => 'update', 'a' => 'index'));
         }
     }
     if (Minz_Request::isPost()) {
         save_info_update();
     }
     if (!need_info_update()) {
         $res = apply_update();
         if ($res === true) {
             Minz_Request::forward(array('c' => 'update', 'a' => 'apply', 'params' => array('post_conf' => true)), true);
         } else {
             Minz_Request::bad(_t('feedback.update.error', $res), array('c' => 'update', 'a' => 'index'));
         }
     }
 }
开发者ID:buggithubs,项目名称:FreshRSS,代码行数:29,代码来源:updateController.php


示例3: init

 /**
  * Initialize the different FreshRSS / Minz components.
  *
  * PLEASE DON'T CHANGE THE ORDER OF INITIALIZATIONS UNLESS YOU KNOW WHAT
  * YOU DO!!
  *
  * Here is the list of components:
  * - Create a configuration setter and register it to system conf
  * - Init extension manager and enable system extensions (has to be done asap)
  * - Init authentication system
  * - Init user configuration (need auth system)
  * - Init FreshRSS context (need user conf)
  * - Init i18n (need context)
  * - Init sharing system (need user conf and i18n)
  * - Init generic styles and scripts (need user conf)
  * - Init notifications
  * - Enable user extensions (need all the other initializations)
  */
 public function init()
 {
     if (!isset($_SESSION)) {
         Minz_Session::init('FreshRSS');
     }
     // Register the configuration setter for the system configuration
     $configuration_setter = new FreshRSS_ConfigurationSetter();
     $system_conf = Minz_Configuration::get('system');
     $system_conf->_configurationSetter($configuration_setter);
     // Load list of extensions and enable the "system" ones.
     Minz_ExtensionManager::init();
     // Auth has to be initialized before using currentUser session parameter
     // because it's this part which create this parameter.
     $this->initAuth();
     // Then, register the user configuration and use the configuration setter
     // created above.
     $current_user = Minz_Session::param('currentUser', '_');
     Minz_Configuration::register('user', join_path(USERS_PATH, $current_user, 'config.php'), join_path(USERS_PATH, '_', 'config.default.php'), $configuration_setter);
     // Finish to initialize the other FreshRSS / Minz components.
     FreshRSS_Context::init();
     $this->initI18n();
     FreshRSS_Share::load(join_path(DATA_PATH, 'shares.php'));
     $this->loadStylesAndScripts();
     $this->loadNotifications();
     // Enable extensions for the current (logged) user.
     if (FreshRSS_Auth::hasAccess()) {
         $ext_list = FreshRSS_Context::$user_conf->extensions_enabled;
         Minz_ExtensionManager::enableByList($ext_list);
     }
 }
开发者ID:buggithubs,项目名称:FreshRSS,代码行数:48,代码来源:FreshRSS.php


示例4: load_routes

 public static function load_routes($path = '')
 {
     if ($path == '') {
         $path = join_path(ROOT_DIR, 'config', 'routes.php');
     }
     include_once $path;
 }
开发者ID:JackSpratt,项目名称:silk,代码行数:7,代码来源:class.silk_route.php


示例5: handleRequest

 public function handleRequest()
 {
     $config = Registry::getInstance();
     $scriptdir = str_replace($config->web_root, '', $config->site_root);
     $scriptname = basename($_SERVER['SCRIPT_FILENAME']);
     $request = trim(str_replace(join_path($scriptdir, $scriptname), '', $_SERVER['REQUEST_URI']), DIRECTORY_SEPARATOR);
     $config->base_dir = $scriptdir;
     $view = 'default';
     if (strlen($request) > 0) {
         $args = explode(DIRECTORY_SEPARATOR, $request);
         if (count($args) > 0) {
             $controller = array_shift($args);
         }
         if (count($args) > 0) {
             $view = array_shift($args);
         }
         if (count($args) > 0) {
             foreach ($args as $k => $v) {
                 $args[$k] = urldecode($v);
             }
         }
     }
     if (!isset($controller)) {
         $controller = $config->default_controller;
         $args = array();
     }
     $controller = 'V7F\\Controller\\' . $controller;
     if (class_exists($controller)) {
         $active_controller = new $controller();
         $active_controller->{$view}($args);
     } else {
         trigger_error('Controller not found - ' . $controller, E_USER_ERROR);
     }
 }
开发者ID:hemantshekhawat,项目名称:Snippets,代码行数:34,代码来源:frontcontroller.php


示例6: setup

 public function setup()
 {
     //Setup session stuff
     SilkSession::setup();
     //Load up the configuration file
     if (is_file(join_path(ROOT_DIR, 'config', 'setup.yml'))) {
         $config = SilkYaml::load(join_path(ROOT_DIR, 'config', 'setup.yml'));
     } else {
         die("Config file not found!");
     }
     //Add class path entries
     if (isset($config['class_autoload'])) {
         foreach ($config['class_autoload'] as $dir) {
             add_class_directory(join_path(ROOT_DIR, $dir));
         }
     }
     //Setup the database connection
     if (!isset($config['database']['dsn'])) {
         die("No database information found in the configuration file");
     }
     if (null == SilkDatabase::connect($config['database']['dsn'], $config['debug'], true, $config['database']['prefix'])) {
         die("Could not connect to the database");
     }
     silk()->set('config', $config);
     //Load components
     SilkComponentManager::load();
 }
开发者ID:JackSpratt,项目名称:silk,代码行数:27,代码来源:class.silk_bootstrap.php


示例7: renderRoute

 public function renderRoute($vars)
 {
     $config = Config::getInstance();
     $queries = CMS7_Queries::getInstance();
     $config->queries = $queries;
     $config->theme_path = join_path($config->base_path, 'themes');
     $config->module_path = join_path($config->base_path, 'modules');
     $config->plugin_path = join_path($config->base_path, 'plugin');
     $config->request_vars = $vars;
     $config->site = $config->queries->site->get_site_details();
     $this->site = $config->site;
     if (isset($vars->page)) {
         if (ctype_digit($vars->page)) {
             $page_id = $vars->page;
         } else {
             $page_id = $config->queries->site->find_page_id_by_name(strtolower($vars->page));
         }
     }
     if (!isset($page_id) || !$page_id) {
         $page_id = $this->site->site_home_page_id;
     }
     $this->page_id = $page_id;
     $layout = new Layout($page_id);
     $this->layout = $layout;
     $layout->vars = $vars;
     $content = $layout->render();
     return $content;
 }
开发者ID:hemantshekhawat,项目名称:Snippets,代码行数:28,代码来源:controller.php


示例8: find_template

	function find_template ($template) {
		
		// Template param may be a string or an array
		// If it's not an array, put the string in a new array
		if (!is_array($template)) {
			$template = array($template);
		}
		
		// Loop through template paths config
		foreach (Frix::config('TEMPLATE_PATHS') as $path) {
			
			foreach ($template as $template_file) {
				
				$template_path = join_path(array($path, $template_file . '.php'));
				
				if (file_exists($template_path)) {
					return $template_path;
				}
				
			}
			
		}
		
		// No template found? Throw an exception.
		// debug($template);
		throw new TemplateException(sprintf('Template(s) "%s" not found!', implode('", "', $template)));
		
	}
开发者ID:ricobl,项目名称:frix,代码行数:28,代码来源:Template.php


示例9: get_path

 /**
  * Get relative path to a directory/file
  * @param  string  $path         Path to a directory/file
  * @param  boolean $use_doc_root Use document root or relative path?
  * @return string
  */
 function get_path($path, $use_doc_root = false)
 {
     $doc_root = DOCUMENT_ROOT;
     if (!$use_doc_root) {
         $doc_root = get_relative_path();
     }
     return join_path(preg_replace('/(\\/)+$/', '', $doc_root), preg_replace('/^(\\/+)/', '', $path));
 }
开发者ID:TemplatemonsterDocumentation,项目名称:wordpress-complex,代码行数:14,代码来源:functions.php


示例10: getURL

 public function getURL()
 {
     $path = $this->asset_module . '_path';
     if (!isset($this->{$path})) {
         throw new AssetNoModuleException('Asset path not found! ' . var_export($this));
     }
     return join_path(Config::get('webroot'), $this->asset_module . 's', $this->{$path}, $this->asset_format_path, $this->asset_path);
 }
开发者ID:hemantshekhawat,项目名称:Snippets,代码行数:8,代码来源:asset.php


示例11: truncate

 public static function truncate()
 {
     file_put_contents(join_path(DATA_PATH, 'users', Minz_Session::param('currentUser', '_'), 'log.txt'), '');
     if (FreshRSS_Auth::hasAccess('admin')) {
         file_put_contents(join_path(DATA_PATH, 'users', '_', 'log.txt'), '');
         file_put_contents(join_path(DATA_PATH, 'users', '_', 'log_api.txt'), '');
         file_put_contents(join_path(DATA_PATH, 'users', '_', 'log_pshb.txt'), '');
     }
 }
开发者ID:buggithubs,项目名称:FreshRSS,代码行数:9,代码来源:LogDAO.php


示例12: uninstall

 public function uninstall()
 {
     $filename = 'ttrss.php';
     $file_destination = join_path(PUBLIC_PATH, 'api', $filename);
     if (file_exists($file_destination) && !unlink($file_destination)) {
         return 'API file cannot be removed';
     }
     return true;
 }
开发者ID:krisfremen,项目名称:Extensions,代码行数:9,代码来源:extension.php


示例13: __construct

 function __construct()
 {
     parent::__construct();
     $this->mailer_object = null;
     $fn = join_path(SILK_LIB_PATH, 'phpmailer', 'class.phpmailer.php');
     require_once $fn;
     $this->mailer_object = new PHPMailer();
     $this->reset();
 }
开发者ID:JackSpratt,项目名称:silk,代码行数:9,代码来源:class.silk_mail.php


示例14: __construct

 function __construct()
 {
     parent::__construct();
     $this->template_dir = join_path(ROOT_DIR, 'tmp', 'templates');
     $this->compile_dir = join_path(ROOT_DIR, 'tmp', 'templates_c');
     $this->config_dir = join_path(ROOT_DIR, 'tmp', 'configs');
     $this->cache_dir = join_path(ROOT_DIR, 'tmp', 'cache');
     $this->plugins_dir = array(join_path(SILK_LIB_DIR, 'plugins'), join_path(SILK_LIB_DIR, 'smarty', 'plugins'));
     $this->cache_plugins = false;
 }
开发者ID:JackSpratt,项目名称:silk,代码行数:10,代码来源:class.silk_smarty.php


示例15: list_controllers

 public static function list_controllers($component)
 {
     $controllers = array();
     $component_dir = join_path(ROOT_DIR, 'components');
     foreach (scandir(join_path($component_dir, $component, "controllers")) as $one_controller) {
         $filename = join_path($component_dir, $component, "controllers", $one_controller);
         if (is_file($filename) && substr($one_controller, 0, 1) != ".") {
             $controllers[] = $one_controller;
         }
     }
     return $controllers;
 }
开发者ID:JackSpratt,项目名称:silk,代码行数:12,代码来源:class.silk_component_manager.php


示例16: render

 public function render($template, $vars)
 {
     $registry = Registry::getInstance();
     require_once join_path($registry->web_root, 'system/template/h2o.php');
     $path = join_path($registry->web_root, 'view/' . $template . '.html');
     if (!file_exists($path)) {
         trigger_error('Template: View ' . $path . ' not found!');
     }
     $vars = array_merge($vars, array('config' => $registry));
     $h2o = new h2o($path, array('cache' => 'apc', 'safeClass' => array('V7F\\Helpers\\Registry', 'V7F\\Template\\Template_Helpers')));
     echo $h2o->render($vars);
 }
开发者ID:hemantshekhawat,项目名称:Snippets,代码行数:12,代码来源:template.php


示例17: connect

 static function connect($dsn, $debug = false, $die = true, $prefix = null, $make_global = true)
 {
     /*
     $gCms = silk();
     $persistent = false;
     
     if ($dbms == '')
     {
     	$config = cms_config();
     	$dbms = $config['dbms'];
     	$hostname = $config['db_hostname'];
     	$username = $config['db_username'];
     	$password = $config['db_password'];
     	$dbname = $config['db_name'];
     	$debug = $config['debug'];
     	$persistent = $config['persistent_db_conn'];
     }
     */
     if ($prefix !== null) {
         self::$prefix = $prefix;
     }
     $dbinstance = null;
     $_GLOBALS['ADODB_CACHE_DIR'] = join_path(ROOT_DIR, 'tmp', 'cache');
     require_once join_path(SILK_LIB_DIR, 'adodb', 'adodb-exceptions.inc.php');
     require_once join_path(SILK_LIB_DIR, 'adodb', 'adodb.inc.php');
     try {
         $dbinstance = ADONewConnection($dsn);
         $dbinstance->fnExecute = 'count_execs';
         $dbinstance->fnCacheExecute = 'count_cached_execs';
     } catch (exception $e) {
         if ($die) {
             echo "<strong>Database Connection Failed</strong><br />";
             echo "Error: {$dbinstance->_errorMsg}<br />";
             echo "Function Performed: {$e->fn}<br />";
             echo "Host/DB: {$e->host}/{$e->database}<br />";
             die;
         } else {
             return null;
         }
     }
     $dbinstance->SetFetchMode(ADODB_FETCH_ASSOC);
     $dbinstance->debug = $debug;
     if (isset($dbms) && $dbms == 'sqlite') {
         $dbinstance->Execute("PRAGMA short_column_names = 1;");
         sqlite_create_function($dbinstance->_connectionID, 'now', 'time', 0);
     }
     if ($make_global) {
         self::$instance = $dbinstance;
     }
     //Initialize the CMS_DB_PREFIX define
     self::get_prefix();
     return $dbinstance;
 }
开发者ID:JackSpratt,项目名称:silk,代码行数:53,代码来源:class.silk_database.php


示例18: TextBox

 public function TextBox($name, $value = "")
 {
     $sBasePath = join_path(Registry::get('base_dir'), 'system/editor/fckeditor/');
     $oFCKeditor = new \FCKeditor($name);
     $oFCKeditor->BasePath = $sBasePath;
     $oFCKeditor->Value = $value;
     $oFCKeditor->Width = 800;
     $oFCKeditor->Height = 700;
     ob_start();
     $oFCKeditor->Create();
     unset($oFCKeditor);
     return ob_get_clean();
 }
开发者ID:hemantshekhawat,项目名称:Snippets,代码行数:13,代码来源:editor.php


示例19: addChild

 public function addChild($path)
 {
     if (isset($this->methods[$path])) {
         throw new LazyLoad_Module_Name_Conflict("Module \"{$path}\" has a name conflict with an existing method");
     }
     $qualified_path = join_path($this->qualified_path, $path);
     if (!is_dir($path)) {
         throw new LazyLoad_Module_Not_Found("Module \"{$path}\" folder not found");
     }
     $qualified_path = join_path($this->qualified_path, $path);
     $class = get_called_class();
     $this->modules[$path] = new $class();
     $this->modules[$path]->_init($path, $this->qualified_path);
     return $this->modules[$path];
 }
开发者ID:hemantshekhawat,项目名称:Snippets,代码行数:15,代码来源:lazyload.php


示例20: handleConfigureAction

 public function handleConfigureAction()
 {
     $this->registerTranslates();
     $current_user = Minz_Session::param('currentUser');
     $filename = 'style.' . $current_user . '.css';
     $filepath = join_path($this->getPath(), 'static', $filename);
     if (Minz_Request::isPost()) {
         $css_rules = Minz_Request::param('css-rules', '');
         file_put_contents($filepath, $css_rules);
     }
     $this->css_rules = '';
     if (file_exists($filepath)) {
         $this->css_rules = file_get_contents($filepath);
     }
 }
开发者ID:krisfremen,项目名称:Extensions,代码行数:15,代码来源:extension.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP join_paths函数代码示例发布时间:2022-05-15
下一篇:
PHP join_arrays函数代码示例发布时间: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