PHP包括问题 [英] PHP includes question

查看:53
本文介绍了PHP包括问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的index.php有两个包含:


require_once(''。/ include / WebStart.php'');

require_once(" ;包含/ Wiki.php");

然后每个包括,然后每个......等等。

等... .......


一旦调用了index.php,即使它中止(不是来自错误,而是通过

程序''自己的设计),通过require_once来完成我的数千个PHP

互连文件中的每一个。行全部加载,编译,并将

存入内存?

If my index.php has two includes:

require_once( ''./includes/WebStart.php'' );
require_once( "includes/Wiki.php" );
Then each of those have includes, then each of those...... etc. etc.
etc..........

Once index.php is called, even if it aborts (not from an error but say by
the program''s own design), do every single one of my thousands of PHP
interlinked files by "require_once" lines get all loaded, compiled, and put
into memory?

推荐答案



怒 < no@spam.com写信息

news:jb ********************* @ bgtnsc05-news.ops.worldnet。 att.net ...

"Nu" <no@spam.comwrote in message
news:jb*********************@bgtnsc05-news.ops.worldnet.att.net...

如果我的index.php有两个包括:


require_once(''。/ include /WebStart.php'');

require_once(" includes / Wiki.php");


然后每个包含,然后每个那些......等等。

等..........


一旦调用了index.php,甚至如果它中止(不是来自错误,而是通过程序自己的设计来表示),请将我的数千个PHP

互连文件中的每一个都按照 require_once" line得到所有加载,编译和
If my index.php has two includes:

require_once( ''./includes/WebStart.php'' );
require_once( "includes/Wiki.php" );
Then each of those have includes, then each of those...... etc. etc.
etc..........

Once index.php is called, even if it aborts (not from an error but say by
the program''s own design), do every single one of my thousands of PHP
interlinked files by "require_once" lines get all loaded, compiled, and




put


存入内存?
into memory?



另外,如果我把require_once放在

其他一些代码我的中止了吗?



Also, does it matter if I put "require_once" lower down in the code after
some other code my abort it?



Nu写道:
Nu wrote:

另外,如果我把require_once放在

其他一些代码我的中止之后在代码中降低了吗?
Also, does it matter if I put "require_once" lower down in the code after
some other code my abort it?



否 - 您可能会觉得这很奇怪。

无论如何都会包含include / require。


例如:

<? php

if(TRUE){

包括myfile.php;

}否则{

包括" yourfile.php";

}

?>


在上面的例子中 - 将包含BOTH文件无论如何。

No - and you may find this weird.
An include/require will be included no matter what.

For example:
<? php
if(TRUE){
include "myfile.php";
} else {
include "yourfile.php";
}
?>

In the above example - BOTH files will be included no matter what.


" Sanders Kaufman" < bu *** @ kaufman.netwrote in message

news:Kl ***************** @ newssvr17.news.prodigy.ne t。 ..
"Sanders Kaufman" <bu***@kaufman.netwrote in message
news:Kl*****************@newssvr17.news.prodigy.ne t...

Nu写道:
Nu wrote:

另外,如果我把require_once放在在
之后降低代码
Also, does it matter if I put "require_once" lower down in the code



after


其他一些代码我的中止了吗?
some other code my abort it?



否 - 您可能会觉得这很奇怪。

无论如何都会包含include / require。


例如:

<? php

if(TRUE){

包括myfile.php;

}否则{

包括" yourfile.php";

}

?>


在上面的例子中 - 将包含BOTH文件有什么关系。


No - and you may find this weird.
An include/require will be included no matter what.

For example:
<? php
if(TRUE){
include "myfile.php";
} else {
include "yourfile.php";
}
?>

In the above example - BOTH files will be included no matter what.



好​​的,但这两个文件都包含/要求。他们的包含/要求是否也包括在内?

Okay, but both files have include/requires. Will their include/requires be
included, too?


这篇关于PHP包括问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆