Php 组件安装错误:JInstaller::install:文件不存在
我只是按照这个步骤创建了一个组件。我已经创建了名为admin.zip的组件。我在joomla 3.0中安装时收到以下警告 警告 JInstaller::Install:文件不存在C:\wamp\www\Content\tmp\Install\u 52009de34a2c1\site\language\en-GB.com\u helloworld.ini JInstaller::Install:文件不存在C:\wamp\www\Content\tmp\Install\u 52009de34a2c1\admin\language\en-GB.com\u helloworld.ini 我正在组件菜单下获取helloworld组件。但当我点击它时,它会给我错误。它应该向我展示视频中显示的Hello world 我的WampServer版本是2.4,使用joomla 3.0 我怎样才能纠正这个问题 我的helloworld.xml文件包含以下代码Php 组件安装错误:JInstaller::install:文件不存在,php,joomla,joomla3.0,Php,Joomla,Joomla3.0,我只是按照这个步骤创建了一个组件。我已经创建了名为admin.zip的组件。我在joomla 3.0中安装时收到以下警告 警告 JInstaller::Install:文件不存在C:\wamp\www\Content\tmp\Install\u 52009de34a2c1\site\language\en-GB.com\u helloworld.ini JInstaller::Install:文件不存在C:\wamp\www\Content\tmp\Install\u 52009de34a2c1
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="2.5.0" method="upgrade">
<name>com_helloworld</name>
<creationDate>November 2009</creationDate>
<author>David Thorn</author>
<authorEmail>info@thornwebdesign.org</authorEmail>
<authorUrl>http://www.example.org</authorUrl>
<copyright>Copyright Info</copyright>
<license>License Info</license>
<version>1.0.0.1</version>
<description>Description of the Hello World component ...</description>
<files folder="site">
<filename>index.html</filename>
<filename>helloworld.php</filename>
<filename>controller.php</filename>
<folder>css</folder>
<folder>js</folder>
<folder>views</folder>
<folder>models</folder>
<folder>controllers</folder>
<folder>helpers</folder>
<folder>language</folder>
</files>
<languages folder="site">
<language tag="en-GB">language/en-GB.com_helloworld.ini</language>
<language tag="en-GB">language/en-GB.com_helloworld.sys.ini</language>
</languages>
<administration>
<menu>com_helloworld</menu>
<files folder="admin">
<filename>index.html</filename>
<filename>helloworld.php</filename>
<filename>controller.php</filename>
<folder>css</folder>
<folder>js</folder>
<folder>views</folder>
<folder>models</folder>
<folder>controllers</folder>
<folder>helpers</folder>
<folder>language</folder>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB.com_helloworld.ini</language>
<language tag="en-GB">language/en-GB.com_helloworld.sys.ini</language>
</languages>
</administration>
</extension>
com_helloworld
2009年11月
大卫·索恩
info@thornwebdesign.org
http://www.example.org
版权信息
许可证信息
1.0.0.1
Hello World组件的说明。。。
index.html
helloworld.php
controller.php
css
js
意见
模型
控制器
助手
语言
语言/en-GB.com_helloworld.ini
语言/en-GB.com_helloworld.sys.ini
com_helloworld
index.html
helloworld.php
controller.php
css
js
意见
模型
控制器
助手
语言
语言/en-GB.com_helloworld.ini
语言/en-GB.com_helloworld.sys.ini
在我的helloworld.php中,我有以下代码
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import joomla controller library
jimport('joomla.application.component.controller');
// Get an instance of the controller prefixed by HelloWorld
$controller = JController::getInstance('Helloworld');
// Perform the Request task
$input = JFactory::getApplication()->input;
$controller->execute($input->getCmd('task'));
// Redirect if set by the controller
$controller->redirect();
?>
更新
我在joomla 2.5中成功地做到了这一点,但在joomla的最新版本中它不起作用。我应该怎么做才能使它在joomla 3.0中工作呢检查您是否已将此代码添加到XML中:
<languages>
<language tag="en-GB" client="site">language/en-GB/en-GB.com_helloworld.ini</language>
<language tag="en-GB" client="site">language/en-GB/en-GB.com_helloworldt.sys.ini</language>
</languages>
语言/en-GB/en-GB.com_helloworld.ini
语言/en-GB/en-GB.com_helloworldt.sys.ini
以及:
...
语言/en-GB/en-GB.com_helloworld.ini
语言/en-GB/en-GB.com_helloworld.sys.ini
...
并检查这些文件是否包含在安装ZIP-in-right文件夹中,例如:
语言/英语GB/
请注意,对于您的扩展名,文件的路径可能不同
Jan您的xml文件路径中缺少en GB子文件夹声明。 xml:language/en-GB.com_helloword.sys.ini,而它应该是language/en-GB/en-GB.helloworld.sys.ini 和路径:language/en-GB/en-GB.helloworld.sys.ini 当然,其他语言文件也是如此 *由于您的编辑和源代码包含,包括完整的xml代码和更正(文件路径和扩展关闭标记) ` 之后
defined('_JEXEC') or die('Restricted access');
并将其替换为:
$controller = JController::getInstance('Helloworld');
关于这一点:
$controller = JControllerLegacy::getInstance('Helloworld');
它告诉你有一个文件丢失了。创建这个文件。我已经在指定的位置有了那个php文件。安装我的组件后,这些文件将在这些目录中创建。检查xml文件某些文件不是extis也遵循Joomla的正确教程我编辑了我的问题并显示了我的helloworld.xml文件。请告诉我如何编辑它好吗?在我的xml文件中,我有language/en-GB.com\u helloworld.ini language/en-GB.com\u helloworld.sys.ini和language/en-GB.com\u helloworld.ini language/en-GB.com\u helloworld.sys.ini我有一个en-GB文件夹,其中有这两个文件/en-GB.helloworld.sys.ini和en-GB.com_helloworld.ini。此外,我还编辑了我的问题,并显示了我的helloworld.php文件,其中我导入了joomla控件库。结束扩展标记位于行的末尾。没有扩展标签,我在安装软件包时出错。它说“JInstaller::Install:找不到Joomla XML安装文件”。另外,我想问一下,只要在我的php页面中添加JControllerLegacy,Joomla 3.0就可以了,或者我还需要做一些其他的更改。如果复制/粘贴我提供的代码并包含标记,是否可以?至于JControllerLegacy,您可以尝试一下,并请告诉我们。如果需要任何更改,您可以咨询此项
jimport('joomla.application.component.controller');
defined('_JEXEC') or die('Restricted access');
$controller = JController::getInstance('Helloworld');
$controller = JControllerLegacy::getInstance('Helloworld');