The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Joomla autoinstaller

Discussion in 'cPanel Developers' started by asmithjr, Oct 12, 2007.

  1. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Anyone create a autoinstaller (cpaddon) for Joomla?
     
  2. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    I started working on one, install works but looks like I have something wrong with the DB install part. Not getting the admin login to work properly with the DB install.
    my Joomla.pm file:
    Code:
    package cPanel::CMS::Joomla;
    use strict;
    use warnings;
    
    our $VERSION = '0.0.1';
    my $pkg = __PACKAGE__;
    
    our $meta_info = {
        setphpsuexecvar => 1,
        adminuser_pass => 1,
        #admin_email    => 2,
        installdir     => 'joomla',
        description    => 'PHP/MySQL based CMS<br />More...',
        security       => 'Configuration has to be world readable. Last updated in Jul
    y 2007. Subject to all common PHP security problems',
        version        => '1.5RC3',
        security_rank  => 1,
        security       => 'Configuration has to be world readable. Subject to all comm
    on PHP security problems',
        website        => 'http://www.joomla.org/',
        config_files   => ['configuration.php'],
        mysql          => ['joomla'],
        #adminarea_path => 'administrator',
       table_prefix   => 'jos',
    };
    
    #### action functions ##
    sub install {
        my $cpo = shift;
        $cpo->stdinstall(@_);
        $cpo->_do_phpsuexec_perms();
    }
    #sub install { shift->stdinstall(@_) }
    sub upgrade { shift->stdupgrade(@_) }
    sub uninstall { shift->stduninstall(@_) }
    
    #### non action functions ##
    sub installform { print shift->{installform} }
    sub upgradeform { print shift->{upgradeform} }
    sub uninstallform { print shift->{uninstallform} }
    
    1;
    my joomla.mysql:
    Code:
    use [% joomla %];
    # $Id: joomla.sql 6311 2007-01-18 23:18:53Z hackwar $
    
    # --------------------------------------------------------
    
    #
    # Table structure for table `[% table_prefix %]_banner`
    #
    
    CREATE TABLE `[% table_prefix %]_banner` (
      `bid` int(11) NOT NULL auto_increment,
      `cid` int(11) NOT NULL default '0',
      `type` varchar(30) NOT NULL default 'banner',
      `name` varchar(255) NOT NULL default '',
      `alias` varchar(255) NOT NULL default '',
      `imptotal` int(11) NOT NULL default '0',
      `impmade` int(11) NOT NULL default '0',
      `clicks` int(11) NOT NULL default '0',
      `imageurl` varchar(100) NOT NULL default '',
      `clickurl` varchar(200) NOT NULL default '',
      `date` datetime default NULL,
      `showBanner` tinyint(1) NOT NULL default '0',
      `checked_out` tinyint(1) NOT NULL default '0',
      `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
      `editor` varchar(50) default NULL,
      `custombannercode` text,
      `catid` INTEGER UNSIGNED NOT NULL DEFAULT 0,
      `description` TEXT NOT NULL DEFAULT '',
      `sticky` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
      `ordering` INTEGER NOT NULL DEFAULT 0,
      `publish_up` datetime NOT NULL default '0000-00-00 00:00:00',
      `publish_down` datetime NOT NULL default '0000-00-00 00:00:00',
      `tags` TEXT NOT NULL DEFAULT '',
      `params` TEXT NOT NULL DEFAULT '',
      PRIMARY KEY  (`bid`),
      KEY `viewbanner` (`showBanner`),
      INDEX `idx_banner_catid`(`catid`)
    ) TYPE=MyISAM CHARACTER SET `utf8`;
    
    ............continue...........
    CREATE TABLE `[% table_prefix %]_users` (
      `id` int(11) NOT NULL auto_increment,
      `name` varchar(255) NOT NULL default '',
      `username` varchar(150) NOT NULL default '',
      `email` varchar(100) NOT NULL default '',
      `password` varchar(100) NOT NULL default '',
      `usertype` varchar(25) NOT NULL default '',
      `block` tinyint(4) NOT NULL default '0',
      `sendEmail` tinyint(4) default '0',
      `gid` tinyint(3) unsigned NOT NULL default '1',
      `registerDate` datetime NOT NULL default '0000-00-00 00:00:00',
      `lastvisitDate` datetime NOT NULL default '0000-00-00 00:00:00',
      `activation` varchar(100) NOT NULL default '',
      `params` text NOT NULL,
      PRIMARY KEY  (`id`),
      KEY `usertype` (`usertype`),
      KEY `idx_name` (`name`)
    ) TYPE=MyISAM CHARACTER SET `utf8`;
    
    
    INSERT INTO `[% table_prefix %]_users` VALUES (62, 'Administrator', '[% username %
    ]', '[% email %]', '[% password_md5_hex %]', 'SuperAdministrator', 0, 1, 25, '', '
    ', '', '')";
    

    The installer is installing (more work to do because the configuration.php file is working but until the DB is correct no need to continue)
     

Share This Page