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

鲁奇卡

尝试将一些在Joomla 2.5.14中运行良好的自定义组件迁移到Joomla 3.1.5,但是遇到一些错误,例如-在Joomla后端中找不到404组件以及前端中的其他错误

是否有从Jooma 2.5到3x系列的任何迁移指南,需要在自定义组件中进行哪些更改

网站1st错误的前端部分

   Notice: Use of undefined constant DS - assumed 'DS' in forms.php

第二次错误

   Warning: require_once(com_formsDScontroller.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in forms.php

第三次错误

  Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'com_formsDScontroller.php' (include_path='.;C:\php\pear') in forms.php

被显示forms.php的所有错误,它是

   <?php
   defined( '_JEXEC' ) or die( 'Restricted access' );
   require_once( JPATH_COMPONENT.DS.'controller.php' );
   if ($controller = JRequest::getWord('controller')) {
$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
if (file_exists($path)) {
    require_once $path;
} else {
    $controller = '';
}
     }
   $classname   = 'FormsController'.$controller;
   $controller  = new $classname();
   $controller->execute( JRequest::getVar( 'layout' ) );
   $controller->redirect();
    ?>
技术员

添加以下行

defined( '_JEXEC' ) or die( 'Restricted access' );
if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR);

来自文档

DS常数已删除。如果确实需要,可以改用DIRECTORY_SEPARATOR。

类似问题

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章