本文整理汇总了PHP中includeFile函数的典型用法代码示例。如果您正苦于以下问题:PHP includeFile函数的具体用法?PHP includeFile怎么用?PHP includeFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了includeFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: loadClass
/**
* @param string $className
*/
public function loadClass(string $className)
{
if ($filename = $this->generator->checkClass($className)) {
includeFile($filename);
return true;
}
}
开发者ID:djmattyg007,项目名称:autocodeloader,代码行数:10,代码来源:Autoloader.php
示例2: testExport
/**
* Test the export and import admin functionality
* @runInSeparateProcess
*/
function testExport()
{
global $wbMessageBuffer;
$this->SessionStart();
includeFile('admin/admin_port.php');
$admin_port = new admin_port();
//create an export
$_POST = array();
foreach ($admin_port->export_fields as $key => $info) {
$_POST[$key] = 'on';
}
$_POST['compression'] = 'zip';
$exported = $admin_port->DoExport();
self::AssertTrue($exported, 'Export Failed');
//restore the archive
$admin_port->SetExported();
$archive = current($admin_port->exported);
$_REQUEST = array('archive' => $archive);
$_POST = array('cmd' => 'revert_confirmed');
$reverted = $admin_port->Revert('revert_confirmed');
echo implode("\n\n", $wbMessageBuffer);
self::AssertTrue($reverted, 'Revert Failed');
//clean up
$_POST = array('old_folder' => array_values($admin_port->extra_dirs));
$admin_port->RevertClean();
$this->SessionEnd();
}
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:31,代码来源:ExportTest.php
示例3: GetForm
/**
* Return the html of a recaptcha area for use in a <form>
* @static
* @return string
*/
static function GetForm()
{
global $config, $dataDir;
$html = '';
if (gp_recaptcha::hasRecaptcha()) {
includeFile('thirdparty/recaptchalib.php');
$themes = array('red', 'white', 'blackglass', 'clean');
$theme = 'clean';
$lang = $config['recaptcha_language'];
if ($lang == 'inherit') {
$lang = $config['language'];
}
$recaptchaLangs['en'] = true;
$recaptchaLangs['nl'] = true;
$recaptchaLangs['fr'] = true;
$recaptchaLangs['de'] = true;
$recaptchaLangs['pt'] = true;
$recaptchaLangs['ru'] = true;
$recaptchaLangs['es'] = true;
$recaptchaLangs['tr'] = true;
if (isset($recaptchaLangs[$lang])) {
$html .= '<script type="text/javascript">var RecaptchaOptions = { lang : "' . $lang . '", theme:"' . $theme . '" };</script>';
}
$html .= recaptcha_get_html($config['recaptcha_public']);
}
return gpPlugin::Filter('AntiSpam_Form', array($html));
}
开发者ID:GedionChang,项目名称:gpEasy-CMS,代码行数:32,代码来源:recaptcha.php
示例4: SaveChanges
/**
* Save changes made to an existing user's permissions
*
*/
function SaveChanges()
{
global $langmessage, $gpAdmin;
$username =& $_REQUEST['username'];
if (!isset($this->users[$username])) {
message($langmessage['OOPS']);
return false;
}
if (!empty($_POST['email'])) {
$this->users[$username]['email'] = $_POST['email'];
}
$this->users[$username]['granted'] = $this->GetPostedPermissions($username);
$this->users[$username]['editing'] = $this->GetEditingPermissions();
//this needs to happen before SaveUserFile();
//update the /_session file
includeFile('tool/sessions.php');
$userinfo =& $this->users[$username];
$userinfo = gpsession::SetSessionFileName($userinfo, $username);
//make sure $userinfo['file_name'] is set
if (!$this->SaveUserFile()) {
message($langmessage['OOPS']);
return false;
}
// update the $user_file_name file
$is_curr_user = $gpAdmin['username'] == $username;
$this->UserFileDetails($username, $is_curr_user);
return true;
}
开发者ID:GedionChang,项目名称:gpEasy-CMS,代码行数:32,代码来源:admin_users.php
示例5: loadClass
protected function loadClass($class)
{
if (isset($this->classMap[$class])) {
return includeFile($this->classMap[$class]);
} elseif (isset($this->classMap['\\' . $class])) {
return includeFile($this->classMap['\\' . $class]);
}
}
开发者ID:mathewhany,项目名称:class-loader,代码行数:8,代码来源:MapClassLoader.php
示例6: loadClass
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
*
* @return bool|null True if loaded, null otherwise
*
* @since 3.4
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
\JLoader::applyAliasFor($class);
return true;
}
}
开发者ID:educakanchay,项目名称:kanchay,代码行数:17,代码来源:ClassLoader.php
示例7: UpdateOutputTest
/**
* Very rough integration test of the updater
* Passes if no errors are thrown
* Also defines $page for subsequent tests
*
*/
function UpdateOutputTest()
{
global $page;
ob_start();
$page = new \gp\admin\Update();
\gp\tool\Output::HeadContent();
includeFile('install/template.php');
ob_get_clean();
}
开发者ID:Bouhnosaure,项目名称:Typesetter,代码行数:15,代码来源:UpdateTest.php
示例8: UpdateOutputTest
/**
* Very rough integration test of the updater
* Passes if no errors are thrown
* Also defines $page for subsequent tests
*
*/
function UpdateOutputTest()
{
global $page;
ob_start();
includeFile('tool/update.php');
$page = new update_class();
gpOutput::HeadContent();
includeFile('install/template.php');
ob_get_clean();
}
开发者ID:jozefkrz,项目名称:gpEasy-CMS,代码行数:16,代码来源:UpdateTest.php
示例9: _autoload
function _autoload($className)
{
$filesPath = array(BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . LIBRARYPATH . DIRECTORY_SEPARATOR . $className . '.php', BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . MODELS . DIRECTORY_SEPARATOR . $className . '.php', BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . CONTROLLERS . DIRECTORY_SEPARATOR . $className . '.controller.php', BASEPATH . DIRECTORY_SEPARATOR . SYSTEMPATH . DIRECTORY_SEPARATOR . LIBRARYPATH . DIRECTORY_SEPARATOR . $className . '.php', BASEPATH . DIRECTORY_SEPARATOR . SYSTEMPATH . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . $className . '.php', BASEPATH . DIRECTORY_SEPARATOR . SYSTEMPATH . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . $className . '.php');
foreach ($filesPath as $file) {
if (file_exists($file)) {
includeFile($file);
break;
}
}
}
开发者ID:Wellingtoncezar,项目名称:pfc,代码行数:10,代码来源:include.php
示例10: MyAutoload
/**
* includes the path to the dedicated class in the proper folder
*
* @param string of class name
*/
function MyAutoload($file_name)
{
$class_path = 'class/' . $file_name . '.php';
if (file_exists($class_path)) {
includeFile($class_path);
echo '<!--' . $class_path . ' loaded with success' . '-->';
} else {
echo $file_name . ' not found!';
}
}
开发者ID:bf-tech,项目名称:calendar,代码行数:15,代码来源:autoload.php
示例11: __construct
public function __construct($file)
{
global $dataDir;
includeFile('thirdparty/cssmin_v.1.0.php');
$this->file = $file;
$this->full_path = $dataDir . $file;
$this->content = file_get_contents($this->full_path);
$this->content = \cssmin::minify($this->content);
$this->CSS_Import();
$this->CSS_FixUrls();
}
开发者ID:Bouhnosaure,项目名称:Typesetter,代码行数:11,代码来源:CombineCss.php
示例12: GetForm
/**
* Return the html of a recaptcha area for use in a <form>
* @static
* @return string
*/
public static function GetForm($theme = 'light')
{
global $config;
$html = '';
if (self::hasRecaptcha()) {
includeFile('thirdparty/recaptcha/autoload.php');
$html = '<script src="https://www.google.com/recaptcha/api.js" async defer></script>';
$html .= '<div class="g-recaptcha" data-theme="' . $theme . '" data-sitekey="' . $config['recaptcha_public'] . '"></div>';
//data-size="compact"
}
return \gp\tool\Plugins::Filter('AntiSpam_Form', array($html));
}
开发者ID:Bouhnosaure,项目名称:Typesetter,代码行数:17,代码来源:Recaptcha.php
示例13: includeDir
function includeDir($directory) {
$list = scandir($directory);
foreach ($list as $listItem) {
if ($listItem[0] == ".") {
continue;
}
if (is_dir($directory.$listItem)) {
includeDir($directory.$listItem."/");
} elseif (substr($listItem, strlen($listItem) - 3) == ".js") {
includeFile($directory.$listItem);
}
}
}
开发者ID:neutrinity,项目名称:jsonary,代码行数:13,代码来源:index.php
示例14: __construct
function __construct()
{
global $dataDir, $langmessage;
includeFile('tool/install.php');
echo '<h2>' . $langmessage['Site Status'] . '</h2>';
$check_dir = $dataDir . '/data';
$this->check_dir_len = strlen($check_dir);
$this->euid = '?';
if (function_exists('posix_geteuid')) {
$this->euid = posix_geteuid();
}
ob_start();
$this->CheckDir($check_dir);
$failed_output = ob_get_clean();
$checked = $this->passed_count + $this->failed_count;
if ($this->failed_count == 0) {
echo '<p class="gp_passed">';
echo sprintf($langmessage['data_check_passed'], $checked, $checked);
echo '</p>';
//$this->CheckPageFiles();
return;
}
echo '<p class="gp_notice">';
echo sprintf($langmessage['data_check_failed'], $this->failed_count, $checked);
echo '</p>';
if ($this->failed_count > $this->show_failed_max) {
echo '<p class="gp_notice">';
echo sprintf($langmessage['showing_max_failed'], $this->show_failed_max);
echo '</p>';
}
echo '<table class="bordered">';
echo '<tr><th>';
echo $langmessage['file_name'];
echo '</th><th colspan="2">';
echo $langmessage['permissions'];
echo '</th><th colspan="2">';
echo $langmessage['File Owner'];
echo '</th></tr>';
echo '<tr><td> </td><td>';
echo $langmessage['Current_Value'];
echo '</td><td>';
echo $langmessage['Expected_Value'];
echo '</td><td>';
echo $langmessage['Current_Value'];
echo '</td><td>';
echo $langmessage['Expected_Value'];
echo '</td></tr>';
echo $failed_output;
echo '</table>';
$this->CheckPageFiles();
}
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:51,代码来源:admin_rm.php
示例15: googleAutoload
function googleAutoload($class)
{
$hasIncluded = false;
$hasIncluded2 = false;
$strClassPath = $class;
// [className].php in basedir
$hasIncluded = includeFile(dirname(__FILE__) . DIRECTORY_SEPARATOR . $class . ".php");
if (empty($hasIncluded) and substr($strClassPath, 0, strlen("Google")) === 'Google') {
$classFile = CLASSESDIR . DIRECTORY_SEPARATOR . str_replace("_", DIRECTORY_SEPARATOR, $strClassPath) . '.php';
$hasIncluded = includeFile($classFile);
if ($hasIncluded) {
$hasIncluded2 = true;
}
}
if (empty($hasIncluded)) {
throw new InvalidArgumentException("autoloading of class {$class} impossible. Namespace syntax for classes seems to be wrong.");
}
}
开发者ID:scaphare,项目名称:QGoogleVisualizationAPI,代码行数:18,代码来源:config.inc.php
示例16: InlineEdit
function InlineEdit()
{
$title = gp_edit::CleanTitle($_REQUEST['file']);
if (empty($title)) {
echo 'false';
return false;
}
$data = array();
$data['type'] = 'text';
$data['content'] = '';
$file = $this->folder . '/' . $title . '.php';
$content = '';
if (file_exists($file)) {
ob_start();
include $file;
$data['content'] = ob_get_clean();
}
includeFile('tool/ajax.php');
gpAjax::InlineEdit($data);
}
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:20,代码来源:admin_extra.php
示例17: Upgrade_234
/**
* Update the gp_index, gp_titles and menus so that special pages can be renamed
*
*/
function Upgrade_234()
{
global $gp_index, $gp_titles, $gp_menu, $config, $dataDir;
includeFile('tool/gpOutput.php');
$special_indexes = array();
$new_index = array();
$new_titles = array();
foreach ($gp_index as $title => $index) {
$info = $gp_titles[$index];
$type = common::SpecialOrAdmin($title);
if ($type === 'special') {
$special_indexes[$index] = strtolower($title);
$index = strtolower($title);
$info['type'] = 'special';
//some older versions didn't maintain this value well
}
$new_index[$title] = $index;
$new_titles[$index] = $info;
}
$gp_titles = $new_titles;
$gp_index = $new_index;
//update gp_menu
$gp_menu = $this->FixMenu($gp_menu, $special_indexes);
//save pages
if (!admin_tools::SavePagesPHP()) {
return;
}
$config['gpversion'] = '2.3.4';
admin_tools::SaveConfig();
//update alt menus
if (isset($config['menus']) && is_array($config['menus'])) {
foreach ($config['menus'] as $key => $value) {
$menu_file = $dataDir . '/data/_menus/' . $key . '.php';
if (gpFiles::Exists($menu_file)) {
$menu = gpOutput::GetMenuArray($key);
$menu = $this->FixMenu($menu, $special_indexes);
gpFiles::SaveData($menu_file, 'menu', $menu);
}
}
}
}
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:45,代码来源:upgrade.php
示例18: testInstall
/**
*
* @runInSeparateProcess
*/
function testInstall()
{
global $dataDir;
//make sure it's not installed
$config_file = $dataDir . '/data/_site/config.php';
self::AssertFileNotExists($config_file, 'Cannot test installation (Already Installed)');
//mimic POST
$_POST = array();
$_POST['email'] = '[email protected]';
$_POST['username'] = 'phpunit-username';
$_POST['password'] = 'phpunit-test-password';
$_POST['password1'] = $_POST['password'];
//attempt to install
ob_start();
includeFile('tool/install.php');
$success = Install_Tools::Install_DataFiles_New();
ob_get_clean();
self::AssertTrue($success, 'Installation Failed');
//double check
self::AssertFileExists($config_file);
}
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:25,代码来源:InstallTest.php
示例19: loadClass
protected function loadClass($class)
{
$classPath = str_replace(['\\', '_'], DIRECTORY_SEPARATOR, $class) . '.php';
$findFile = function ($dir) use($classPath) {
if (is_file($file = $this->normalizeDir($dir) . DIRECTORY_SEPARATOR . $classPath)) {
return $file;
}
};
foreach ($this->prefixes as $prefix => $dirs) {
if (strpos($class, $this->normalizeNamespace($prefix)) === 0) {
foreach ($dirs as $dir) {
if ($file = $findFile($dir)) {
return includeFile($file);
}
}
}
}
foreach ($this->fallbackDirs as $dir) {
if ($file = $findFile($dir)) {
return includeFile($file);
}
}
}
开发者ID:mathewhany,项目名称:class-loader,代码行数:23,代码来源:Psr0ClassLoader.php
示例20: includeFile
<div class='col-sm-10'>
<input type='email' id='email' class='form-control' name='email' value='<?php
echo $email;
?>
' placeholder='Email'>
</div>
</div>
<div class='form-group'>
<label for='message' class='col-sm-2 control-label'>Message</label>
<div class='col-sm-10'>
<textarea id='message' class='form-control' name='message' rows='4' placeholder='Message...'><?php
echo $msg;
?>
</textarea>
</div>
</div>
<div class='form-group'>
<div class='col-sm-offset-2 col-sm-10'>
<input type='submit' class='btn btn-info' name='send' value='Send'>
</div>
</div>
</form>
</div>
</div>
<?php
includeFile('site/footer.php');
开发者ID:RezNikTaylor,项目名称:RNK-Redesign,代码行数:30,代码来源:index.php
注:本文中的includeFile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论