apache 禁用 Zend 框架

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1441635/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 18:10:00  来源:igfitidea点击:

disabling Zend Framework

phpapachezend-framework

提问by sunyata

I'm using FreeBSD + Apache. How do I disable Zend Framework from running on a system? I prefer not to delete the entire software if I don't have to.

我正在使用 FreeBSD + Apache。如何禁用 Zend Framework 在系统上运行?如果不需要,我宁愿不删除整个软件。

Secondarily, how do I find out the version of Zend Framework I am using?

其次,我如何找出我使用的 Zend Framework 的版本?

I am refering to Zend Framework, the CMS.

我指的是 Zend Framework,即 CMS。

What would be my DocmentRoot directory? It seems to me that the DocumentRoot which apache.conf is pointing to is not where the Zend directory is located.

我的 DocmentRoot 目录是什么?在我看来,apache.conf 指向的 DocumentRoot 不是 Zend 目录所在的位置。

回答by jldupont

Option 1) Move the directory hierarchy out of PEAR/PHP accessible path

选项 1) 将目录层次结构移出 PEAR/PHP 可访问路径

Option 2) Modify php.ini in order to remove the path to the Zend Framework

选项 2) 修改 php.ini 以删除 Zend 框架的路径

回答by Tomá? Fejfar

Disable ZF:

禁用 ZF:

Locate the ZF directory (/Zend) and rename it (/_Zend).

找到 ZF 目录 (/Zend) 并将其重命名 (/_Zend)。

ZF Version:

采埃孚版本:

echo Zend_Version::VERSION;

You can also compare Zend's versions using Zend_Version::compareVersion($versionYouNeed); This function return 0 if versions are same. -1 if $versionYouNeed is older then installed and 1 if $versionYouNeed is newer then installed.

您还可以使用 Zend_Version::compareVersion($versionYouNeed); 比较 Zend 的版本;如果版本相同,此函数返回 0。-1 如果 $versionYouNeed 较旧然后安装,1 如果 $versionYouNeed 较新然后安装。

回答by David Weinraub

...disable Zend Framework from running on a system?
...禁用 Zend Framework 在系统上运行?

Renaming the /Zend folder to something like /_Zend will certainly make the framework files inaccesible. But if there is code out there that calls that ZF functionality, then it will fail, and most likely fail ugly.

将 /Zend 文件夹重命名为 /_Zend 之类的内容肯定会使框架文件无法访问。但是,如果那里有调用 ZF 功能的代码,那么它就会失败,而且很可能失败得很丑。

It seems to me that how you "disable" ZF depends upon how it is being invoked. If you are using it in the standard MVC approach, it is the .htaccess at the Apache webroot that points all the requests into ZF's public/index.php "bootstrap" file.

在我看来,如何“禁用”ZF 取决于它是如何被调用的。如果您在标准 MVC 方法中使用它,则是 Apache webroot 中的 .htaccess 将所有请求指向 ZF 的 public/index.php “bootstrap”文件。

So I would either:

所以我要么:

  • Change/remove the .htaccess file so that it no longer points to public/index.php
  • Change public/index.php so it no longer invokes the ZF functionality.
  • 更改/删除 .htaccess 文件,使其不再指向 public/index.php
  • 更改 public/index.php 使其不再调用 ZF 功能。