我如何从PHP隐藏.SVN目录 [英] How can I hide .SVN directories from PHP

查看:162
本文介绍了我如何从PHP隐藏.SVN目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SVN来管理我的网站的副本。该网站运行typo3安装,它使用PHP创建后端。

I am using SVN to manage a copy of my web site. The site runs a typo3 installation, which uses PHP to create the backend.

问题是,所有的愚蠢的.SVN文件夹显示在PHP的目录列表中。我不是指在apache列表中的构建。

The problem is, all the stupid .SVN folders show up in the directory listing of PHP. I DO NOT mean the build in apache listing. I mean a directoy listing created by the PHP backend.

所以,有没有办法从PHP中隐藏特殊目录?

So, is there any way to hide special directories from PHP?

[注意]
更改PHP源代码不是一个选项。 Typo3太大,每个扩展使用自己的代码。

[NOTE] Changing the PHP source code is not an option. Typo3 is too big, and each extensions uses its own code. Would be much more effort than an SVN export script.

Chris

PS:我不想设置一个svn导出 - > web_root只是为了摆脱这些文件。我知道我可以阻止apache服务.SVN目录,我这样做。但是,当浏览目录树(由PHP创建)时,它们仍然显示在后端。他们很烦人...

PS: I do not want to setup a svn export --> web_root just to get rid of the files. And I know that I can prevent apache from serving the .SVN directories, I did that. But they still show up in the backend, when browsing the directory tree (which is created by PHP). And they are very annoying...

推荐答案

这很难,因为你必须改变文件系统之间某处的行为和Typo3。您有:

This is difficult, since you will have to change behavior of something somewhere between the filesystem and Typo3. You have:


文件系统→操作系统→PHP→Typo3

Filesystem → Operating System → PHP → Typo3

文件必须保留在文件系统中,操作系统必须保持可见,以便可以使用SVN。更改Typo3不是一个选项,并且更改PHP有许多其他主要的不良后果,你应该避免。所以,你剩下的是在OS→PHP或PHP→Typo3之间插入一些东西。

The files must stay in the filesystem and must stay visible by the operating system, so you can use SVN. Changing Typo3 is not an option for you, and changing PHP has many other major undesirable consequences that you should avoid. So, what you have left is to insert something in between OS→PHP or PHP→Typo3.

第一种情况实际上是可能的,这取决于你使用什么操作系统,以及是否具有管理员(root)访问权限。 FUSE 是Linux内核的一部分,也是适用于许多其他操作系统。然后,使用保险丝,您可以安装类似 rofs过滤的过滤器,可以过滤哪些文件并且目录在装入的卷中可见。您使用它来创建一个镜像您的SVN检出目录,筛选 .svn 目录的文件系统。

The first case is actually possible, depending on what operating system you use, and if you have administrator (root) access. FUSE is part of the Linux kernel, and is also available for many other operating systems. Then, with fuse, you may install a filter like rofs-filtered, that allows you to filter which files and directories are visible in a mounted volume. You use it to create a filesystem that mirrors your SVN checkout directory, filtering the .svn directories.

这篇关于我如何从PHP隐藏.SVN目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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