Changeset 1207 for trunk/locker
- Timestamp:
- Jun 24, 2009, 12:40:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/locker/deploy/bin/joomla
r697 r1207 3 3 use lib '/mit/scripts/deploy/bin'; 4 4 use onserver; 5 use Cwd;6 5 use File::Path; 7 6 … … 13 12 chomp($title); 14 13 15 fetch_uri( 16 'installation/install2.php', 17 {}, 18 {DBhostname => $sqlhost, 19 DBuserName => $sqluser, 20 DBpassword => $sqlpass, 21 DBDel => 0, 22 DBname => $sqldb, 23 DBPrefix => 'jos_', 24 DBSample => 1}); 14 print "\nSetting up your configuration file...\n"; 15 open CONFIGTEMPLATE, "configuration.php-dist"; 16 open CONFIGURATION, ">configuration.php"; 17 while (<CONFIGTEMPLATE>) { 18 chomp; 19 if (/var \$sitename /) { 20 $_ = " var \$sitename = '$title';"; 21 } elsif (/var \$dbtype /) { 22 $_ = " var \$dbtype = 'mysql';"; 23 } elsif (/var \$host /) { 24 $_ = " var \$host = '$sqlhost';"; 25 } elsif (/var \$user /) { 26 $_ = " var \$user = '$sqluser';"; 27 } elsif (/var \$password /) { 28 $_ = " var \$password = '$sqlpass';"; 29 } elsif (/var \$db /) { 30 $_ = " var \$db = '$sqldb';"; 31 } elsif (/var \$dbprefix /) { 32 $_ = " var \$dbprefix = 'jos_';"; 33 } elsif (/var \$secret /) { 34 my $random = `dd if=/dev/urandom bs=1k count=1 | md5sum | cut -c1-32`; 35 $random =~ s/\n//; 36 $_ = " var \$secret = '$random';"; 37 } elsif (/var \$mailfrom /) { 38 $_ = " var \$mailfrom = '$email';"; 39 } elsif (/var \$fromname /) { 40 $_ = " var \$fromname = '$title';"; 41 } 42 print CONFIGURATION "$_\n"; 43 } 44 close CONFIGURATION; 45 close CONFIGTEMPLATE; 25 46 26 fetch_uri( 27 'installation/install4.php', 28 {}, 29 {DBhostname => $sqlhost, 30 DBuserName => $sqluser, 31 DBpassword => $sqlpass, 32 DBname => $sqldb, 33 DBPrefix => 'jos_', 34 sitename => $title, 35 siteUrl => $base_uri, 36 absolutePath => getcwd(), 37 adminEmail => $email, 38 adminPassword => $admin_password, 39 filePerms => 0, 40 dirPerms => 0}); 47 print "\nInitializing database schema...\n"; 48 my $schemafile = "installation/sql/mysql/joomla-real.sql"; 49 open SCHEMATEMPLATE, "installation/sql/mysql/joomla.sql"; 50 open SCHEMA, ">$schemafile"; 51 while (<SCHEMATEMPLATE>) { 52 if (/#__/) { 53 $_ =~ s/#__/jos_/g; 54 } 55 print SCHEMA "$_"; 56 } 57 close SCHEMA; 58 close SCHEMATEMPLATE; 59 system("cat $schemafile | mysql $sqldb"); 41 60 61 print "\nLoading sample data...\n"; 62 my $sampledatafile = "installation/sql/mysql/sample_data-real.sql"; 63 open SAMPLETEMPLATE, "installation/sql/mysql/sample_data.sql"; 64 open SAMPLE, ">$sampledatafile"; 65 while (<SAMPLETEMPLATE>) { 66 if (/#__/) { 67 $_ =~ s/#__/jos_/g; 68 } 69 print SAMPLE "$_"; 70 } 71 close SAMPLE; 72 close SAMPLETEMPLATE; 73 system("cat $sampledatafile | mysql $sqldb"); 74 75 print "\nCreating your admin account...\n"; 76 system("mysql -e \"INSERT INTO jos_users VALUES (62, 'Administrator', '$admin_username', '$email', MD5('$admin_password'), 'Super Administrator', 0, 1, 25, NOW(), NOW(), '', '')\" $sqldb"); 77 system("mysql -e \"INSERT INTO jos_core_acl_aro VALUES (10, 'users', '62', 0, 'Administrator', 0)\" $sqldb"); 78 system("mysql -e \"INSERT INTO jos_core_acl_groups_aro_map VALUES (25, '', 10)\" $sqldb"); 79 80 print "\nCleaning up installation tree...\n"; 42 81 rmtree('installation'); 82 83 print "\nDone!\n"; 84 exit 0; 85
Note: See TracChangeset
for help on using the changeset viewer.