php Joomla 3.0 DS 不工作(使用未定义的常量 DS)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18503023/
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-08-25 17:40:33  来源:igfitidea点击:

Joomla 3.0 DS does not work(Use of undefined constant DS)

phpjoomlajoomla3.0joomla3.1

提问by Techie

Joomla 3.0 DS does not work. It has been removed. I get

Joomla 3.0 DS 不工作。它已被移除。我得到

Notice: Use of undefined constant DS - assumed 'DS' in

How can I fix this?

我怎样才能解决这个问题?

Similar Question

类似问题

Migrating from Joomla 2.5 to 3x Generating Errors

从 Joomla 2.5 迁移到 3x 生成错误

回答by Techie

Add the below line

添加以下行

if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR);

From the docs.

文档

The DS constant has been removed. If you really need it you can use DIRECTORY_SEPARATOR instead.

DS 常量已被删除。如果你真的需要它,你可以使用 DIRECTORY_SEPARATOR 代替。

Also there is a pluginto fix this issue.

还有一个插件可以解决这个问题。

You can find the full list here.

您可以在此处找到完整列表。

Potential backward compatibility issues in Joomla 3 and Joomla Platform 12.2

Joomla 3 和 Joomla Platform 12.2 中潜在的向后兼容性问题

回答by András

Sometimes you need this: if(!defined('DS')) define('DS', '/');

有时你需要这个: if(!defined('DS')) define('DS', '/');