从Joomla 2.5迁移到3x生成错误 [英] Migrating from Joomla 2.5 to 3x Generating Errors
问题描述
尝试将一些在Joomla 2.5.14中运行良好的自定义组件迁移到Joomla 3.1.5,但是出现一些错误,例如-在Joomla Backend&中找不到404组件.前端的其他错误
Trying to migrate some of the custom components which works well in Joomla 2.5.14 to Joomla 3.1.5, however getting some errors like - 404 component not found in Joomla Backend & other errors in frontend
是否有从Jooma 2.5到3x系列的任何迁移指南,需要在自定义组件中进行哪些更改
Is there any migration guide from Jooma 2.5 to 3x series, of what changes need to be done in custom components
网站的前端部分 第一个错误
Front End Section of Site 1st error
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的所有错误中,它是
Been all errors showing forms.php, it is
<?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.
The DS constant has been removed. If you really need it you can use DIRECTORY_SEPARATOR instead.
这篇关于从Joomla 2.5迁移到3x生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!