Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

$use_sub_dirs

$use_sub_dirs设置成true的时候, Smarty将在编译目录缓存目录下面创建子目录。 默认是false。 在一些情况下,上述的目录有可能会生成成千上万的文件, 建立子目录的方式有助于加快文件系统的搜索速度。 另外,一些环境是不允许PHP进程创建目录的,所以这只能默认是关闭。

子目录是非常高效的,所以如有可能的话,尽可能采用它。 理论上来说,在文件系统上的10个目录里每个目录有100个文件, 比起1个目录有1000个文件,前者性能高得多。 在Solaris 7 (UFS)系统上已经被证实了这点,还有较新的文件系统如ext3,甚至是reiserfs,均大同小异。

技术说明

  • $use_sub_dirs=true不会和 safe_mode=On一起工作, 那就是为什么它是可选并且默认关闭的。

  • 在Windows上设置$use_sub_dirs=true将会引起一些问题。

  • PHP6已经废除了安全模式。

参见 $compile_id, $cache_dir, 和 $compile_dir.

Comments
No comments for this page.

Advertisement

Sponsors [info]

Sponsors