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


PHP require_file函數代碼示例

本文整理匯總了PHP中require_file函數的典型用法代碼示例。如果您正苦於以下問題:PHP require_file函數的具體用法?PHP require_file怎麽用?PHP require_file使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: load_file

 function load_file($template)
 {
     global $site;
     $theme_template = public_folder . "/shared/theme/" . $site["site_theme"] . "/" . $template . ".php";
     if (file_exists(root_directory . $theme_template)) {
         $this->set_content(require_file($theme_template));
     } else {
         $this->set_content(require_file(blastpad_path . "/site/" . $template . ".php"));
     }
 }
開發者ID:hscale,項目名稱:BlastPad,代碼行數:10,代碼來源:template_class.php

示例2: require_file

 function require_file($paths, $file_name)
 {
     foreach ($paths as $path) {
         $file = $path . DS . $file_name;
         if (file_exists($file)) {
             require_once $file;
             FileHandler::SaveUsingPath($file_name, $file);
             return true;
         } else {
             if (file_exists($path) && is_dir($path)) {
                 $subs = FileHandler::GetSubDirs($path, true);
                 if (!empty($subs)) {
                     if (require_file($subs, $file_name)) {
                         return true;
                     }
                 }
             }
         }
     }
     return false;
 }
開發者ID:hixbotay,項目名稱:executivetransport,代碼行數:21,代碼來源:debug.php

示例3: require_file

<?php

require "../private_php/print_private_area.php";
require_file();
$conn = connection_db();
session_control();
include '../private_php/getassicurazione.php';
$user = "Admin";
print_arHeader($user);
print_arMenu($user);
print_form_setAssicurazione($conn, $info);
print_arfooter();
print_close();
connection_db_close($conn);
開發者ID:EduBic,項目名稱:Il-Fagiolo-Ac2mms,代碼行數:14,代碼來源:setassicurazione.php

示例4: require_file

<?php

/** 
 * Router for front end of the site.
 */
global $database;
global $site;
$post = "";
$option = [];
$sql = "select post_meta_description, post_keywords, profile_id, post_title, \n\t\tpost_text, post_background_color, post_background_size\n\t\tfrom site, post\n\t\twhere site.site_home_post_id = post.post_id";
if (!empty($site["site_id"])) {
    $sql .= " and site.site_id = :site_id";
    //" . $site[ "site_id" ];
    $option["parameter"] = [":site_id" => $site["site_id"]];
}
$post = $database->fetch($sql, $option);
/** Load the main page. */
require_file(blastpad_path . "/site/main.php");
開發者ID:hscale,項目名稱:BlastPad,代碼行數:18,代碼來源:index.php

示例5: require_file

<?php

require_file(dirname(__FILE__) . "../../.." . blastpad_module_path . "/snowflake_authentication/index.php");
?>
<!DOCTYPE html>
<head>
	<title><?php 
echo $title;
?>
</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="description" content="<?php 
echo $tagline;
?>
">
	<meta name="keywords" content="website, cms, blog, content management system, blogging platform, web, responsive, design, free">
	<link rel="stylesheet" href="blastpad/css/barebones.css" type="text/css">
	<link rel="stylesheet" href="blastpad/css/style.css" type="text/css">
	<link href="http://fonts.googleapis.com/css?family=Ubuntu,Raleway" rel="stylesheet" type="text/css">
</head>
<body>
<div class="main">
	<div class="main-inner-container">
		<div class="container">
			<div class="content">	
				<h1 class="logo"><?php 
echo sanitize($title);
?>
</h1>
				<h2><?php 
echo sanitize($tagline);
開發者ID:hscale,項目名稱:BlastPad,代碼行數:31,代碼來源:index.php

示例6: require_file

// Variables.
global $database_connection;
global $server_environment;
global $title, $tagline, $google_analytics_code;
global $database;
// Load helper functions.
require_file(blastpad_module_path . "/common/validation.php");
// Load validation functions.
// Load configuration files.
require_once root_directory . blastpad_path . "/common/global_variable.php";
// Load the global variables.
require_once root_directory . custom_folder . "/config.php";
// Load configuration.
require_file(custom_folder . "/customize.php");
// Load customization file.
require_file(custom_folder . "/config/database/config_" . $server_environment . ".php");
// Load database configuration details.
require_once root_directory . custom_folder . "/config/route/config_route.php";
// Load route configuration file.
$database = new database($database_connection, $server_environment);
/* If connection to database fails, go to installation script to create database tables and properly configure database.  
header( "Location: welcome.php" );
exit;*/
$site_builder = new site_builder();
$site = $site_builder->get_site();
$routing = new routing();
$routing->set($route);
// Set errors.
// ini_set( "error_reporting", $config[ $server_environment ][ "error_reporting" ] );
/*	
	function set_assert(){
開發者ID:hscale,項目名稱:BlastPad,代碼行數:31,代碼來源:load_main.php

示例7: defined

defined('USE_FRAMEWORK') || define('USE_FRAMEWORK', false);
defined('IS_SUB_DIR') || define('IS_SUB_DIR', false);
define('NOW_TIME', $_SERVER['REQUEST_TIME']);
define('REQUEST_METHOD', $_SERVER['REQUEST_METHOD']);
define('IS_GET', REQUEST_METHOD == 'GET' ? true : false);
define('IS_POST', REQUEST_METHOD == 'POST' ? true : false);
define('IS_PUT', REQUEST_METHOD == 'PUT' ? true : false);
define('IS_DELETE', REQUEST_METHOD == 'DELETE' ? true : false);
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' ? true : false);
define('IM_SERVER_PATH', 'http://im-link.meihua.com');
require_file(PIGCMS_PATH . 'source/functions/common.php');
foreach ($_GET as &$get_value) {
    $get_value = htmlspecialchars(str_replace(array('<', '>', '\'', '"', '(', ')'), '', $get_value));
}
doStripslashes();
$_G['system'] = require_file(PIGCMS_PATH . 'config/config.php');
$config = F('config');
if (empty($config)) {
    $configs = D('Config')->field('`name`,`value`')->select();
    foreach ($configs as $key => $value) {
        $config[$value['name']] = $value['value'];
    }
    F('config', $config);
}
$_G['config'] = $config;
defined('TPL_PATH') || define('TPL_PATH', PIGCMS_PATH . 'template/');
defined('TPL_URL') || define('TPL_URL', !IS_SUB_DIR ? $config['site_url'] . '/template/' . GROUP_NAME . '/' . $_G['config']['theme_' . GROUP_NAME . '_group'] . '/' : $config['site_url'] . '/template/' . GROUP_NAME . '/' . $config['theme_' . GROUP_NAME . '_group'] . '/');
$_G['plugins'] = array();
if (!empty($_G['config']['active_plugins'])) {
    $active_plugins = json_decode($_G['config']['active_plugins'], true);
    if (is_array($active_plugins)) {
開發者ID:fkssei,項目名稱:pigcms10,代碼行數:31,代碼來源:init.php

示例8: library

/**
 * 第三方類庫調用
 * @param name 第三方類庫名稱
 * @author Colin <15070091894@163.com>
 */
function library($name = null)
{
    list($filedir, $filename) = explode('/', $name);
    //把@替換成.
    $filename = str_replace('@', '.', $filename);
    $path = Library . '/' . $filedir . '/' . $filename . '.php';
    if (!file_exists($path)) {
        E('文件不存在' . $name);
    }
    require_file($path);
}
開發者ID:a1586256143,項目名稱:MyClassPHP,代碼行數:16,代碼來源:functions.php

示例9: require_file

<?php

namespace blastpad;

/**
 * 
 */
// Load the configuration settings.
require_file("../../../../../../../custom/config.php");
require_file("/loader_class.php");
new loader();
開發者ID:hscale,項目名稱:BlastPad,代碼行數:11,代碼來源:load_dashboard.php

示例10: sanitize

		<meta name="author" content="<?php 
echo sanitize($post[0]["profile_id"]);
?>
">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--meta name="robots" content="noindex"-->
		<link rel="apple-touch-icon" href="apple-touch-icon.png">
		<!-- Place favicon.ico in the root directory -->
		<!--link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
		<link rel="canonical" href="">
		<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss.xml">
		<link rel="alternate" type="application/atom+xml" title="Atom" href="/atom.xml">
		<link rel="pingback" href=""-->
		
		<?php 
require_file(blastpad_path . "/site/css_style.php");
?>
		
		<!--
		<meta property="og:title" content="">
		<meta property="og:description" content="">
		<meta property="og:image" content="">
		<meta name="twitter:card" content="summary">
		<meta name="twitter:site" content="@site_account">
		<meta name="twitter:creator" content="@individual_account">
		<meta name="twitter:url" content="http://www.example.com/path/to/page.html">
		<meta name="twitter:title" content="">
		<meta name="twitter:description" content="">
		<meta name="twitter:image" content="http://www.example.com/path/to/image.jpg"-->	
		<link href="http://fonts.googleapis.com/css?family=Muli" rel="stylesheet" type="text/css">
	</head>
開發者ID:hscale,項目名稱:BlastPad,代碼行數:31,代碼來源:head.php

示例11: require_file

<?php

/**
 * Routes dashboard to dashboard and others to the master site.
 */
if (isset($dashboard)) {
    require_file("/dashboard/index.php");
} else {
    require_file(blastpad_path . "/site/index.php");
}
開發者ID:hscale,項目名稱:BlastPad,代碼行數:10,代碼來源:index.php

示例12: ParConst

 /**
  * 解析常量方法
  * @author Colin <15070091894@163.com>
  */
 public static function ParConst()
 {
     //解析session
     if (Config('SESSION_START')) {
         session_start();
     }
     //解析自動引入
     if (Config('AUTO_REQUIRE')) {
         //自動引入
         $auto_require_file = Config('AUTO_REQUIRE_FILE');
         if (empty($auto_require_file)) {
             return;
         }
         $dir = explode(',', Config('AUTO_REQUIRE_FILE'));
         require_file($dir, APP_PATH);
     }
 }
開發者ID:a1586256143,項目名稱:MyClassPHP,代碼行數:21,代碼來源:MyClass.php

示例13: require_path

/**
 * 一次性包含整個目錄裏的PHP代碼,用於包含框架基礎代碼(幾乎每個請求都必須用到的代碼).
 * 為了提高性能,我把所有需要包含的代碼合並成了一個文件,並進行了優化(php_strip_whitespace).
 * 當源文件更新時,會自動重新合並文件。
 * 結合APC、XCache等byte code緩存的適用可以極大提高性能。
 **/
function require_path($dir, $files = null)
{
    /*{{{*/
    if (!file_exists($dir)) {
        die("目錄{$dir}不存在");
    }
    if (is_null($files)) {
        $files = glob($dir . '/*.php');
    } else {
        $tmp = array();
        foreach ($files as $name) {
            $tmp[] = join_path($dir, $name);
        }
        $files = $tmp;
    }
    if (!defined('OPTIMIZE_REQUIRE_DIR') || !OPTIMIZE_REQUIRE_DIR) {
        // 不用合並文件,一個個加載
        foreach ($files as $filename) {
            require_file($filename);
        }
        return true;
    }
    $scripts_cache_dir = CACHE_DIR . '/phpscripts';
    if (!file_exists($scripts_cache_dir)) {
        mkdir($scripts_cache_dir, 0777, true);
    }
    $cached_file = $scripts_cache_dir . '/' . md5($dir) . '.php';
    if (file_exists($cached_file) && filemtime($cached_file) > filemtime($dir)) {
        // 文件已經合並,並且源文件目錄沒有更新,加載合並的文件
        require_file($cached_file);
        return true;
    }
    // 那麽我們來合並目錄裏的php文件
    $lock = fopen($scripts_cache_dir . '/scripts_optimzer.lock', 'w');
    if (!flock($lock, LOCK_EX | LOCK_NB)) {
        // do an exclusive lock
        // 已經有其他進程在合並了,我們先直接加載源文件
        foreach ($files as $filename) {
            require_file($filename);
        }
        return true;
    }
    $fd = fopen($cached_file, 'w') or die("文件{$cached_file}打不開");
    fwrite($fd, "<?php\n");
    // compile files into one file and cache it
    foreach ($files as $filename) {
        $lines = file($filename);
        $lines[0] = '';
        fwrite($fd, implode('', $lines));
    }
    fclose($fd);
    // 優化,去掉注釋什麽的
    $stripped = php_strip_whitespace($cached_file);
    $fd = fopen($cached_file, 'w');
    fwrite($fd, $stripped);
    fclose($fd);
    flock($lock, LOCK_UN);
    // release the lock
    fclose($lock);
    require_file($cached_file);
    return true;
}
開發者ID:rose1988c,項目名稱:insky,代碼行數:68,代碼來源:fuc_helper.php


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