1

最近我们为我们的客户制作了一个自定义组件。现在我们通过以下 xml 文件为这个组件构建了安装文件:

<?xml version="1.0"?>
<install type="component" version="1.5.0">  
<name>customblog</name>  
<author>Jogesh Sharma</author>  
<creationDate>March 2013</creationDate>  
<copyright>Copyright (C) 2013 Open Source Matters. All rights reserved.</copyright>  
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>  
<authorEmail>hello@webomnizz.com</authorEmail>  
<authorUrl>http://webomnizz.com</authorUrl>  
<version>1.5.0</version>  
<description>This component manage all the Blog sections!</description>  
<installfile>install.customblog.php</installfile>  
<uninstallfile>uninstall.customblog.php</uninstallfile>  

<files>      
    <filename>customblog.php</filename>      
    <filename>customblog.html.php</filename>
</files>
<files folder="images">
    <filename>style.css</filename>
    <filename>plus-icon.png</filename>
    <filename>twitter-icon.png</filename>
    <filename>facebook-icon.png</filename>
</files>      

<install>      
    <sql>          
        <file driver="mysql">install.mysql.sql</file>      
    </sql>  
</install>    

<uninstall>      
    <sql>          
        <file driver="mysql">uninstall.mysql.sql</file>      
    </sql>  
</uninstall>      

<administration>      
    <menu img="js/ThemeOffice/component.png">Blog Component</menu>      
    <submenu>          
        <menu link="option=com_customblog">Blog</menu>
        <menu link="option=com_customblog&amp;c=general">General Options</menu>
    </submenu>            
    <files>          
        <filename>install.mysql.sql</filename>          
        <filename>uninstall.mysql.sql</filename>          
        <filename>admin.customblog.php</filename>          
        <filename>admin.customblog.html.php</filename>          
        <filename>toolbar.customblog.php</filename>          
        <filename>toolbar.customblog.html.php</filename>          
        <filename>index.html</filename>
    </files>
    <files folder="tables">
        <filename>customblog.php</filename> 
        <filename>general.php</filename>
    </files>  
</administration>
</install>

但问题是我们的 sql 文件install.mysql.sql没有安装在 joomla 中,我不知道为什么,并且在安装过程中它没有提供任何错误消息等。我使用的是 joomla 1.5.26,

谁能告诉我我错过了什么??

更新:这是我的install.mysql.sql文件:

CREATE TABLE IF NOT EXISTS `#__blog` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `title` varchar(255) NOT NULL,
 `full_text` mediumtext NOT NULL,
 `state` tinyint(1) NOT NULL,
 `publish_up` date NOT NULL,
 `gp_button` varchar(255) DEFAULT NULL,
 `fb_button` varchar(255) DEFAULT NULL,
 `tw_button` varchar(255) DEFAULT NULL,
 `user_id` tinyint(2) NOT NULL,
 `social_key` tinyint(2) DEFAULT NULL,
 PRIMARY KEY (`id`)
);


CREATE TABLE `#__generalopt` (
  `id` int(2) unsigned NOT NULL auto_increment,
  `title` varchar(200) default NULL,
  `gp_status` tinyint(2) default NULL,
  `fb_status` tinyint(2) default NULL,
  `tw_status` tinyint(2) default NULL,
  `userImg` varchar(200) default NULL,
  PRIMARY KEY  (`id`)
);
INSERT INTO `jos_generalopt` VALUES(1, 'General Options', 1, 1, 1, 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/12/User_icon_2.svg/120px-User_icon_2.svg.png'); 

结构在此处输入图像描述

4

1 回答 1

0

您必须放入install.mysql.sql文件admin夹,即使路径中没有提到它。保持xml不变,只需创建一个新文件夹admin并移动install.mysql.sql到那里,然后Joomla就能找到它

于 2013-04-02T07:57:29.330 回答