【问题标题】:Joomla 3.0 DS does not work(Use of undefined constant DS)Joomla 3.0 DS 不起作用(使用未定义的常量 DS)
【发布时间】:2013-09-01 10:03:45
【问题描述】:

Joomla 3.0 DS 不工作。它已被删除。我明白了

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

我该如何解决这个问题?

Similar Question

Migrating from Joomla 2.5 to 3x Generating Errors

【问题讨论】:

    标签: php joomla joomla3.0 joomla3.1


    【解决方案1】:

    添加下面一行

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

    来自docs

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

    还有一个plugin 来解决这个问题。

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

    Potential backward compatibility issues in Joomla 3 and Joomla Platform 12.2

    【讨论】:

    • 您也可以在大多数情况下不使用 DS,而是在文件路径中添加一个正斜杠:ajh.us/4
    • 使用正斜杠取决于操作系统
    • 在 2013 年(以及之前)正斜杠在 Windows 上不是问题,除非在非常具体和有限的情况下,其中大多数情况不会在正常扩展中发生。
    • 这对于旧组件来说是一个很好的解决方法,非常感谢。
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-06
      • 1970-01-01
      • 1970-01-01
      • 2011-01-04
      • 2015-02-12
      相关资源
      最近更新 更多