本文整理汇总了PHP中includeFile函数的典型用法代码示例。如果您正苦于以下问题:PHP includeFile函数的具体用法?PHP includeFile怎么用?PHP includeFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了includeFile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadClass
/**
* @param string $className
*/
public function loadClass(string $className)
{
if ($filename = $this->generator->checkClass($className)) {
includeFile($filename);
return true;
}
}
示例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();
}
示例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));
}
示例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;
}
示例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]);
}
}
示例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;
}
}
示例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();
}
示例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();
}
示例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;
}
}
}
示例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!';
}
}
示例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();
}
示例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));
}
示例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);
}
}
}
示例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();
}
示例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.");
}
}