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")); } }
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; }
<?php require "../private_php/print_private_area.php"; require_file(); $conn = connection_db(); session_control(); include '../private_php/getassicurazione.php'; $user = "******"; print_arHeader($user); print_arMenu($user); print_form_setAssicurazione($conn, $info); print_arfooter(); print_close(); connection_db_close($conn);
<?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");
<?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);
// 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(){
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)) {
/** * 第三方类库调用 * @param name 第三方类库名称 * @author Colin <*****@*****.**> */ 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); }
<?php namespace blastpad; /** * */ // Load the configuration settings. require_file("../../../../../../../custom/config.php"); require_file("/loader_class.php"); new loader();
<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>
<?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"); }
/** * 解析常量方法 * @author Colin <*****@*****.**> */ 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); } }
/** * 一次性包含整个目录里的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; }