| 1 | <?php
|
|---|
| 2 | /**
|
|---|
| 3 | * --------------------------------------------------------------
|
|---|
| 4 | * omCollab Installation Utility
|
|---|
| 5 | * -----------------------------
|
|---|
| 6 | * Version : 1.0
|
|---|
| 7 | * Description: Installs the omCollab application suite
|
|---|
| 8 | * (MediaWiki, WordPress, omBookmarks, omExplore)
|
|---|
| 9 | * Author : Pete Dakin <petedakin@gmail.com> for BearingPoint
|
|---|
| 10 | * --------------------------------------------------------------
|
|---|
| 11 | */
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | require_once( 'common/skins/mike2/common.php' );
|
|---|
| 15 | require_once( 'wiki/install-utils.inc' );
|
|---|
| 16 |
|
|---|
| 17 | install_version_checks(); #here we use the wiki's version checker
|
|---|
| 18 |
|
|---|
| 19 | function omcollab_installation_dir(){
|
|---|
| 20 | $sInstallScriptUri = $_SERVER['REQUEST_URI'];
|
|---|
| 21 | $iInstallScriptUriLength = strlen( $_SERVER['REQUEST_URI'] ) - strlen( basename($_SERVER['SCRIPT_NAME']) );
|
|---|
| 22 | return str_replace( basename($_SERVER['SCRIPT_NAME'])
|
|---|
| 23 | , ''
|
|---|
| 24 | , $sInstallScriptUri
|
|---|
| 25 | , $iInstallScriptUriLength );
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | ?>
|
|---|
| 29 | <html>
|
|---|
| 30 |
|
|---|
| 31 | <head>
|
|---|
| 32 | <title>omCollab Installer</title>
|
|---|
| 33 | <style>
|
|---|
| 34 | * { margin:0pt; padding:0pt; }
|
|---|
| 35 | body { margin:10pt;color:black; font-family:verdana,sans-serif; font-size:8pt; font-size-adjust:none; font-style:normal; font-variant:normal; font-weight:normal; line-height:normal; }
|
|---|
| 36 | .header-corner-tl { background: url(<?php echo omcollab_installation_dir() ?>common/skins/mike2/images/corner-tl-w.png) 0 0 no-repeat; width: 10px; height: 10px; line-height: 1px; font-size: 1px; }
|
|---|
| 37 | .header-corner-t { background: #4F81BD; border-top: 3px solid #385D8A; height: 7px; line-height: 1px; font-size: 1px; }
|
|---|
| 38 | .header-corner-tr { background: url(<?php echo omcollab_installation_dir() ?>common/skins/mike2/images/corner-tr-w.png) 0 0 no-repeat; width: 10px; height: 10px; line-height: 1px; font-size: 1px; }
|
|---|
| 39 | .header-corner-ml { background: #4F81BD; border-left: 3px solid #385D8A; width: 7px; }
|
|---|
| 40 | .header-corner-m { background: #4F81BD; color: #DCE6F2; }
|
|---|
| 41 | .header-corner-mr { background: #4F81BD; border-right: 3px solid #385D8A; width: 7px; }
|
|---|
| 42 | .header-corner-bl { background: url(<?php echo omcollab_installation_dir() ?>common/skins/mike2/images/corner-bl-w.png) 0 0 no-repeat; width: 10px; height: 10px; line-height: 1px; font-size: 1px; }
|
|---|
| 43 | .header-corner-b { background: #4F81BD; border-bottom: 3px solid #385D8A; height: 7px; line-height: 1px; font-size: 1px; }
|
|---|
| 44 | .header-corner-br { background: url(<?php echo omcollab_installation_dir() ?>common/skins/mike2/images/corner-br-w.png) 0 0 no-repeat; width: 10px; height: 10px; line-height: 1px; font-size: 1px; }
|
|---|
| 45 | </style>
|
|---|
| 46 | <link rel="shortcut icon" href="favicon.ico" />
|
|---|
| 47 | </head>
|
|---|
| 48 |
|
|---|
| 49 | <body>
|
|---|
| 50 | <pre style="text-align:left;">
|
|---|
| 51 | <?php echo omCollabRoundBox('','<img src="common/skins/mike2/images/omCollab-logo-165x48.gif">'); ?>
|
|---|
| 52 |
|
|---|
| 53 | <h1>Installation utility for the omCollab Suite</h1>
|
|---|
| 54 | <?php
|
|---|
| 55 |
|
|---|
| 56 | if( isset($_POST['do']) && $_POST['do']='install' ){
|
|---|
| 57 |
|
|---|
| 58 | $omcollab_admin_email = '';
|
|---|
| 59 |
|
|---|
| 60 | $omcollab_db_hostname = '';
|
|---|
| 61 | $omcollab_db_table_prefix = '';
|
|---|
| 62 | $path_to_mysql = '';
|
|---|
| 63 |
|
|---|
| 64 | $omwiki_database_name = '';
|
|---|
| 65 | $omwiki_db_username = '';
|
|---|
| 66 | $omwiki_db_password = '';
|
|---|
| 67 |
|
|---|
| 68 | $omblogs_database_name = '';
|
|---|
| 69 | $omblogs_db_username = '';
|
|---|
| 70 | $omblogs_db_password = '';
|
|---|
| 71 |
|
|---|
| 72 | $ombookmarks_database_name = '';
|
|---|
| 73 | $ombookmarks_db_username = '';
|
|---|
| 74 | $ombookmarks_db_password = '';
|
|---|
| 75 |
|
|---|
| 76 | $omforum_database_name = '';
|
|---|
| 77 | $omforum_db_username = '';
|
|---|
| 78 | $omforum_db_password = '';
|
|---|
| 79 |
|
|---|
| 80 | $omwiki_application_name = '';
|
|---|
| 81 | $omblog_application_name = '';
|
|---|
| 82 | $ombookmarks_application_name = '';
|
|---|
| 83 | $omforum_application_name = '';
|
|---|
| 84 | $omexplore_application_name = '';
|
|---|
| 85 |
|
|---|
| 86 | $omcollab_initial_skin = '';
|
|---|
| 87 | $omwiki_use_short_urls = '';
|
|---|
| 88 |
|
|---|
| 89 | $omwiki_enable_docconvert = '';
|
|---|
| 90 | $omwiki_docconvert_oo_path = '';
|
|---|
| 91 |
|
|---|
| 92 | $omcollab_google_analytics = '';
|
|---|
| 93 | $omcollab_google_cse_code = '';
|
|---|
| 94 | $omcollab_google_cse_forid = '';
|
|---|
| 95 | $omcollab_google_blog_key = '';
|
|---|
| 96 |
|
|---|
| 97 | extract( $_POST, EXTR_IF_EXISTS );
|
|---|
| 98 |
|
|---|
| 99 | $aErrors = array();
|
|---|
| 100 |
|
|---|
| 101 | if( empty( $omcollab_admin_email ) ) $aErrors[] = 'Admin email';
|
|---|
| 102 | if( empty( $omcollab_db_hostname ) ) $aErrors[] = 'Database hostname (eg localhost)';
|
|---|
| 103 | if( empty( $omcollab_db_table_prefix ) ) $aErrors[] = 'Database table prefix (eg "om")';
|
|---|
| 104 | if( empty( $path_to_mysql ) ) $aErrors[] = 'Full path to mysql (eg \path\to\mysql\)';
|
|---|
| 105 | if( empty( $omwiki_database_name ) ) $aErrors[] = 'Wiki database name';
|
|---|
| 106 | if( empty( $omwiki_db_username ) ) $aErrors[] = 'Wiki database username';
|
|---|
| 107 | if( empty( $omwiki_db_password ) ) $aErrors[] = 'Wiki database password';
|
|---|
| 108 | if( empty( $omblogs_database_name ) ) $aErrors[] = 'Blogs database name';
|
|---|
| 109 | if( empty( $omblogs_db_username ) ) $aErrors[] = 'Blogs database username';
|
|---|
| 110 | if( empty( $omblogs_db_password ) ) $aErrors[] = 'Blogs database password';
|
|---|
| 111 | if( empty( $ombookmarks_database_name ) ) $aErrors[] = 'Bookmarks database name';
|
|---|
| 112 | if( empty( $ombookmarks_db_username ) ) $aErrors[] = 'Bookmarks database username';
|
|---|
| 113 | if( empty( $ombookmarks_db_password ) ) $aErrors[] = 'Bookmarks database password';
|
|---|
| 114 | if( empty( $omforum_database_name ) ) $aErrors[] = 'Forum database name';
|
|---|
| 115 | if( empty( $omforum_db_username ) ) $aErrors[] = 'Forum database username';
|
|---|
| 116 | if( empty( $omforum_db_password ) ) $aErrors[] = 'Forum database password';
|
|---|
| 117 | if( empty( $omwiki_application_name ) ) $aErrors[] = 'Wiki application name (eg "omCollab Wiki")';
|
|---|
| 118 | if( empty( $omblog_application_name ) ) $aErrors[] = 'Blog application name (eg "omCollab Blogs")';
|
|---|
| 119 | if( empty( $ombookmarks_application_name ) ) $aErrors[] = 'Bookmarks application name (eg "omBookmarks")';
|
|---|
| 120 | if( empty( $omforum_application_name ) ) $aErrors[] = 'Forum application name (eg "omCollab Forum")';
|
|---|
| 121 | if( empty( $omexplore_application_name ) ) $aErrors[] = 'Explore application name (eg "omCollab Explore")';
|
|---|
| 122 |
|
|---|
| 123 | #figure out the directory in which the app is being installed
|
|---|
| 124 | $omcollab_installation_dir = omcollab_installation_dir();
|
|---|
| 125 |
|
|---|
| 126 | #set a couple of values that don't get posted
|
|---|
| 127 | $omcollab_http_hostname = $_SERVER['HTTP_HOST'];
|
|---|
| 128 | $_POST['omcollab_http_hostname'] = $omcollab_http_hostname;
|
|---|
| 129 | $_POST['omcollab_installation_dir'] = $omcollab_installation_dir;
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 | #make sure last character of table prefix is an underscore
|
|---|
| 133 | if( substr( $omcollab_db_table_prefix, -1 ) != '_' ){
|
|---|
| 134 | $omcollab_db_table_prefix .= '_';
|
|---|
| 135 | $_POST['omcollab_db_table_prefix'] .= '_';
|
|---|
| 136 | }
|
|---|
| 137 |
|
|---|
| 138 | #verify location of mysql executable
|
|---|
| 139 | $sOpSys = '';
|
|---|
| 140 | if( isset( $_SERVER['WINDIR'] ) ){
|
|---|
| 141 | $sOpSys = 'WIN';
|
|---|
| 142 | }
|
|---|
| 143 | $sMySqlExecutable = "{$path_to_mysql}mysql" . ( $sOpSys == 'WIN' ? '.exe' : '' );
|
|---|
| 144 | if( ! file_exists( $sMySqlExecutable ) || is_dir( $sMySqlExecutable ) ){
|
|---|
| 145 | $aErrors[] = "Path to MySql is incorrect (tried '$sMySqlExecutable')";
|
|---|
| 146 | }
|
|---|
| 147 |
|
|---|
| 148 | #verify that OpenOffice executables exist if DocConvert extension is enabled
|
|---|
| 149 |
|
|---|
| 150 | if($omwiki_enable_docconvert == true)
|
|---|
| 151 | {
|
|---|
| 152 | $output = null;
|
|---|
| 153 | $result = null;
|
|---|
| 154 |
|
|---|
| 155 | if($sOpSys == 'WIN')
|
|---|
| 156 | $docConvertCmd = "\"$omwiki_docconvert_oo_path" . "unopkg\" add wiki\extensions\DocConvert\DocConvert.oxt -f";
|
|---|
| 157 | else
|
|---|
| 158 | $docConvertCmd = "$omwiki_docconvert_oo_path" . "unopkg add wiki/extensions/DocConvert/DocConvert.oxt -f";
|
|---|
| 159 |
|
|---|
| 160 | exec($docConvertCmd,$output,$result);
|
|---|
| 161 |
|
|---|
| 162 | if($result == 1)
|
|---|
| 163 | {
|
|---|
| 164 | $aErrors[] = "Path to OpenOffice.org program directory is incorrect or not in your system path variable (tried '$docConvertCmd')";
|
|---|
| 165 | }
|
|---|
| 166 | }
|
|---|
| 167 |
|
|---|
| 168 | #die if any errors so far
|
|---|
| 169 | if( ! empty( $aErrors ) ){
|
|---|
| 170 | die( "ERROR: Missing or invalid...\n\n" . implode( "\n", $aErrors ) . "\n\n" . '<a href="javascript:history.go(-1);">Go back</a>' );
|
|---|
| 171 | }
|
|---|
| 172 |
|
|---|
| 173 | #test the db connections
|
|---|
| 174 | $DbIni = array();
|
|---|
| 175 |
|
|---|
| 176 | $DbIni ['wiki'] ['Database'] = $omwiki_database_name;
|
|---|
| 177 | $DbIni ['wiki'] ['Username'] = $omwiki_db_username;
|
|---|
| 178 | $DbIni ['wiki'] ['Password'] = $omwiki_db_password;
|
|---|
| 179 |
|
|---|
| 180 | $DbIni ['blogs'] ['Database'] = $omblogs_database_name;
|
|---|
| 181 | $DbIni ['blogs'] ['Username'] = $omblogs_db_username;
|
|---|
| 182 | $DbIni ['blogs'] ['Password'] = $omblogs_db_password;
|
|---|
| 183 |
|
|---|
| 184 | $DbIni ['bookmarks'] ['Database'] = $ombookmarks_database_name;
|
|---|
| 185 | $DbIni ['bookmarks'] ['Username'] = $ombookmarks_db_username;
|
|---|
| 186 | $DbIni ['bookmarks'] ['Password'] = $ombookmarks_db_password;
|
|---|
| 187 |
|
|---|
| 188 | $DbIni ['forum'] ['Database'] = $omforum_database_name;
|
|---|
| 189 | $DbIni ['forum'] ['Username'] = $omforum_db_username;
|
|---|
| 190 | $DbIni ['forum'] ['Password'] = $omforum_db_password;
|
|---|
| 191 |
|
|---|
| 192 | $aApps = array( 'wiki', 'blogs', 'bookmarks', 'forum' );
|
|---|
| 193 | foreach( $aApps as $sAppDb ){
|
|---|
| 194 | $rConn = mysql_connect( $omcollab_db_hostname
|
|---|
| 195 | , $DbIni [ $sAppDb ] [ 'Username' ]
|
|---|
| 196 | , $DbIni [ $sAppDb ] [ 'Password' ]
|
|---|
| 197 | , true );
|
|---|
| 198 | if( ! $rConn ) {
|
|---|
| 199 | $aErrors[] = "\n\n$sAppDb:\n\n" . trim( strip_tags( $sErrors ) );
|
|---|
| 200 | }
|
|---|
| 201 |
|
|---|
| 202 | if( ! mysql_select_db( $DbIni [ $sAppDb ] [ 'Database' ] ) ){
|
|---|
| 203 | $aErrors[] = "\n\n$sAppDb:\n\nCouldn't connect to the $sAppDb database.";
|
|---|
| 204 | }
|
|---|
| 205 |
|
|---|
| 206 | if( ! mysql_ping( $rConn ) ){
|
|---|
| 207 | $aErrors[] = "\n\n$sAppDb:\n\nCouldn't ping the db host with the credentials supplied.";
|
|---|
| 208 | }
|
|---|
| 209 | }
|
|---|
| 210 | if( ! empty( $aErrors ) ){
|
|---|
| 211 | die( "\n\nERROR: Database errors...<dir>" . implode( "\n", $aErrors ) . "\n\n" . '</dir><a href="javascript:history.go(-1);">Go back</a>' );
|
|---|
| 212 | }
|
|---|
| 213 |
|
|---|
| 214 | $_POST[ 'default_style_num' ] = 2;
|
|---|
| 215 | if( $omcollab_initial_skin == "red" ) {
|
|---|
| 216 | $_POST[ 'default_style_num' ] = 3;
|
|---|
| 217 | }
|
|---|
| 218 | #replace within sql dumps (these will be saved as temp files)
|
|---|
| 219 | $aAppPlaceholders = array( 'wiki' => array( 'omwiki_database_name'
|
|---|
| 220 | , 'omcollab_db_table_prefix' )
|
|---|
| 221 |
|
|---|
| 222 | , 'blogs' => array( 'omblogs_database_name'
|
|---|
| 223 | , 'omcollab_db_table_prefix'
|
|---|
| 224 | , 'omcollab_http_hostname'
|
|---|
| 225 | , 'omcollab_installation_dir'
|
|---|
| 226 | , 'omblog_application_name'
|
|---|
| 227 | , 'omcollab_admin_email' )
|
|---|
| 228 |
|
|---|
| 229 | , 'bookmarks' => array( 'ombookmarks_database_name'
|
|---|
| 230 | , 'omcollab_db_table_prefix' )
|
|---|
| 231 |
|
|---|
| 232 | , 'forum' => array( 'omforum_database_name'
|
|---|
| 233 | , 'omcollab_db_table_prefix'
|
|---|
| 234 | , 'omcollab_admin_email'
|
|---|
| 235 | , 'omcollab_installation_dir'
|
|---|
| 236 | , 'omforum_application_name'
|
|---|
| 237 | , 'default_style_num' )
|
|---|
| 238 | );
|
|---|
| 239 |
|
|---|
| 240 | foreach( $aAppPlaceholders as $sApp => $aPlaceholders ){
|
|---|
| 241 | if ($sApp == 'wiki' && $omcollab_initial_skin == 'red')
|
|---|
| 242 | $sSqlConfigure = file_get_contents( "_InstallationResources/om{$sApp}_red.sql" );
|
|---|
| 243 | else
|
|---|
| 244 | $sSqlConfigure = file_get_contents( "_InstallationResources/om{$sApp}.sql" );
|
|---|
| 245 |
|
|---|
| 246 | foreach( $aPlaceholders as $sPlaceholder ){
|
|---|
| 247 | $sSqlConfigure = str_replace( '{' . $sPlaceholder . '}', $_POST[ $sPlaceholder ], $sSqlConfigure );
|
|---|
| 248 | }
|
|---|
| 249 | $aAppPlaceholders[ $sApp ][ 'sql' ] = $sSqlConfigure;
|
|---|
| 250 | $sTmpFilename = "_InstallationResources/om{$sApp}_temp.sql";
|
|---|
| 251 | file_put_contents( $sTmpFilename, $sSqlConfigure );
|
|---|
| 252 | }
|
|---|
| 253 |
|
|---|
| 254 | #set up wiki for short urls if the web server is Apache and the user checked the box
|
|---|
| 255 | if( $omwiki_use_short_urls && stripos( $_SERVER['SERVER_SOFTWARE'], 'apache' ) !== false ){
|
|---|
| 256 | $_POST['omwiki_script_path'] = "{$omcollab_installation_dir}w";
|
|---|
| 257 | $_POST['omwiki_article_path'] = "{$omcollab_installation_dir}wiki/$1";
|
|---|
| 258 | }else{
|
|---|
| 259 | $_POST['omwiki_script_path'] = "{$omcollab_installation_dir}wiki";
|
|---|
| 260 | $_POST['omwiki_article_path'] = "{$omcollab_installation_dir}wiki/index.php/$1";
|
|---|
| 261 | }
|
|---|
| 262 |
|
|---|
| 263 | #replace within misc files
|
|---|
| 264 | $aMiscResources = array(
|
|---|
| 265 | //common css for the blue skin
|
|---|
| 266 | 'common-blue.css' => array( 'destination' => "common/skins/mike2/common.css"
|
|---|
| 267 | , 'placeholders' => array( 'rr_common_skin_directory' => "{$omcollab_installation_dir}common/skins/mike2" ) )
|
|---|
| 268 |
|
|---|
| 269 | //common css for the red skin
|
|---|
| 270 | , 'common-red.css' => array( 'destination' => "common/skins/mike2red/common.css"
|
|---|
| 271 | , 'placeholders' => array( 'rr_common_skin_directory' => "{$omcollab_installation_dir}common/skins/mike2red" ) )
|
|---|
| 272 |
|
|---|
| 273 | //wiki css for the blue skin
|
|---|
| 274 | , 'main-blue.css' => array( 'destination' => "wiki/skins/mike2/main.css"
|
|---|
| 275 | , 'placeholders' => array( 'rr_common_skin_directory' => "{$omcollab_installation_dir}common/skins/mike2" ) )
|
|---|
| 276 |
|
|---|
| 277 | //wiki css for the red skin
|
|---|
| 278 | , 'main-red.css' => array( 'destination' => "wiki/skins/mike2red/main.css"
|
|---|
| 279 | , 'placeholders' => array( 'rr_common_skin_directory' => "{$omcollab_installation_dir}common/skins/mike2red" ) )
|
|---|
| 280 |
|
|---|
| 281 | //javascript file for the common jquery php api
|
|---|
| 282 | , 'common-jquery-extensions.js' => array( 'destination' => "common/ajax/jquery/javascript/extensions.js"
|
|---|
| 283 | , 'placeholders' => array( 'omcollab_http_hostname' => $omcollab_http_hostname
|
|---|
| 284 | , 'omcollab_installation_dir' => $omcollab_installation_dir ) )
|
|---|
| 285 |
|
|---|
| 286 | //javascript file for the wiki's SocialProfile extension
|
|---|
| 287 | , 'UserProfilePage.js' => array( 'destination' => "wiki/extensions/SocialProfile/UserProfile/UserProfilePage.js"
|
|---|
| 288 | , 'placeholders' => array( 'omcollab_http_hostname' => $omcollab_http_hostname
|
|---|
| 289 | , 'omwiki_script_path' => $_POST['omwiki_script_path'] ) )
|
|---|
| 290 |
|
|---|
| 291 | //javascript file for the wiki's SocialProfile extension
|
|---|
| 292 | , 'UserRelationship.js' => array( 'destination' => "wiki/extensions/SocialProfile/UserRelationship/UserRelationship.js"
|
|---|
| 293 | , 'placeholders' => array( 'omwiki_script_path' => $_POST['omwiki_script_path'] ) )
|
|---|
| 294 |
|
|---|
| 295 | //configuration file for the forum
|
|---|
| 296 | , 'config.php' => array( 'destination' => "forum/config.php"
|
|---|
| 297 | , 'placeholders' => array( 'omforum_db_host' => $omcollab_db_hostname
|
|---|
| 298 | , 'omforum_db_name' => $omforum_database_name
|
|---|
| 299 | , 'omforum_db_user' => $omforum_db_username
|
|---|
| 300 | , 'omforum_db_pwd' => $omforum_db_password
|
|---|
| 301 | , 'omforum_tbl_prefix' => $omcollab_db_table_prefix ) )
|
|---|
| 302 | , 'header-red.css' => array( 'destination' => "forum/styles/mike2red/theme/header.css"
|
|---|
| 303 | , 'placeholders' => array( 'omcollab_installation_dir' => $omcollab_installation_dir ) )
|
|---|
| 304 | , 'header-blue.css' => array( 'destination' => "forum/styles/mike2/theme/header.css"
|
|---|
| 305 | , 'placeholders' => array( 'omcollab_installation_dir' => $omcollab_installation_dir ) )
|
|---|
| 306 |
|
|---|
| 307 | );
|
|---|
| 308 |
|
|---|
| 309 | foreach( $aMiscResources as $sSource => $aMiscData ){
|
|---|
| 310 | $sMiscOutput = file_get_contents( "_InstallationResources/$sSource" );
|
|---|
| 311 | foreach( $aMiscData['placeholders'] as $sPlaceholder => $sValue ){
|
|---|
| 312 | $sMiscOutput = str_replace( '{' . $sPlaceholder . '}'
|
|---|
| 313 | , $sValue
|
|---|
| 314 | , $sMiscOutput );
|
|---|
| 315 | }
|
|---|
| 316 | file_put_contents( $aMiscData['destination'], $sMiscOutput );
|
|---|
| 317 | echo "setting up {$aMiscData['destination']}\n";
|
|---|
| 318 | }
|
|---|
| 319 |
|
|---|
| 320 | #shell to mysql and build the databases from the dumpfiles
|
|---|
| 321 | $aDbs = array( 'wiki', 'blogs', 'bookmarks', 'forum' );
|
|---|
| 322 | $aExecResults = array();
|
|---|
| 323 | foreach( $aDbs as $sDb ){
|
|---|
| 324 | $sCommand = "$sMySqlExecutable "
|
|---|
| 325 | . "-h {$omcollab_db_hostname} "
|
|---|
| 326 | . "-u {$DbIni[$sDb]['Username']} "
|
|---|
| 327 | . "-p{$DbIni[$sDb]['Password']} "
|
|---|
| 328 | . "{$DbIni[$sDb]['Database']} < "
|
|---|
| 329 | . realpath("_InstallationResources/om{$sDb}_temp.sql");
|
|---|
| 330 | exec( $sCommand, $aOutput );
|
|---|
| 331 | $aExecResults[$sCommand][] = $aOutput;
|
|---|
| 332 | }
|
|---|
| 333 |
|
|---|
| 334 | #if the above went well, we can
|
|---|
| 335 | # - set up the wiki dirname & htaccess
|
|---|
| 336 | # - rewrite the omconfig.php file
|
|---|
| 337 | # - rename this installation file
|
|---|
| 338 | # - rewrite the main index file to point to the wiki (default app)
|
|---|
| 339 | # - remove the temporary sqldump files
|
|---|
| 340 |
|
|---|
| 341 | #rename wiki directory and set the .htaccess file if the web server is Apache and the user checked the box
|
|---|
| 342 | if( $omwiki_use_short_urls && stripos( $_SERVER['SERVER_SOFTWARE'], 'apache' ) !== false ){
|
|---|
| 343 | rename( 'wiki', 'w' ); //renames the wiki directory
|
|---|
| 344 | copy( '_InstallationResources/.htaccess', './.htaccess' );
|
|---|
| 345 | }
|
|---|
| 346 |
|
|---|
| 347 | #replace within omconfig.php and rewrite
|
|---|
| 348 | $aPlaceholders = array( 'omcollab_installation_dir'
|
|---|
| 349 | , 'omcollab_admin_email'
|
|---|
| 350 | , 'omcollab_db_hostname'
|
|---|
| 351 | , 'omwiki_database_name'
|
|---|
| 352 | , 'omwiki_db_username'
|
|---|
| 353 | , 'omwiki_db_password'
|
|---|
| 354 | , 'omcollab_db_table_prefix'
|
|---|
| 355 | , 'omblogs_database_name'
|
|---|
| 356 | , 'omblogs_db_username'
|
|---|
| 357 | , 'omblogs_db_password'
|
|---|
| 358 | , 'omcollab_db_table_prefix'
|
|---|
| 359 | , 'ombookmarks_database_name'
|
|---|
| 360 | , 'ombookmarks_db_username'
|
|---|
| 361 | , 'ombookmarks_db_password'
|
|---|
| 362 | , 'omcollab_db_table_prefix'
|
|---|
| 363 | , 'omforum_database_name'
|
|---|
| 364 | , 'omforum_db_username'
|
|---|
| 365 | , 'omforum_db_password'
|
|---|
| 366 | , 'omcollab_db_table_prefix'
|
|---|
| 367 | , 'omwiki_application_name'
|
|---|
| 368 | , 'omblog_application_name'
|
|---|
| 369 | , 'ombookmarks_application_name'
|
|---|
| 370 | , 'omforum_application_name'
|
|---|
| 371 | , 'omexplore_application_name'
|
|---|
| 372 | , 'omwiki_script_path'
|
|---|
| 373 | , 'omwiki_article_path'
|
|---|
| 374 | , 'omcollab_initial_skin'
|
|---|
| 375 | , 'omcollab_google_analytics'
|
|---|
| 376 | , 'omcollab_google_cse_code'
|
|---|
| 377 | , 'omcollab_google_cse_forid'
|
|---|
| 378 | , 'omcollab_google_blog_key'
|
|---|
| 379 | , 'omwiki_enable_docconvert'
|
|---|
| 380 | , 'omwiki_docconvert_oo_path');
|
|---|
| 381 |
|
|---|
| 382 | $sOmConfigPhp = file_get_contents( '_InstallationResources/omconfig.php' );
|
|---|
| 383 | foreach( $aPlaceholders as $sPlaceholder ){
|
|---|
| 384 | $sOmConfigPhp = str_replace( '{' . $sPlaceholder . '}', $_POST[ $sPlaceholder ], $sOmConfigPhp );
|
|---|
| 385 | }
|
|---|
| 386 | file_put_contents( 'common/omconfig.php', $sOmConfigPhp );
|
|---|
| 387 |
|
|---|
| 388 | #remove the temporary sqldump files
|
|---|
| 389 | /*
|
|---|
| 390 | unlink( '_InstallationResources/omwiki_temp.sql' );
|
|---|
| 391 | unlink( '_InstallationResources/omblogs_temp.sql' );
|
|---|
| 392 | unlink( '_InstallationResources/ombookmarks_temp.sql' );
|
|---|
| 393 | unlink( '_InstallationResources/omforum_temp.sql' );
|
|---|
| 394 | */
|
|---|
| 395 |
|
|---|
| 396 | #rename install.php
|
|---|
| 397 | copy( dirname( __file__) . '/install.php', dirname( __file__) . '/install.completed.php' );
|
|---|
| 398 | unlink( dirname( __file__) . '/install.php' );
|
|---|
| 399 |
|
|---|
| 400 | #rewrite index.php
|
|---|
| 401 | $sIndexContents = "<" . "?php\nheader( \"location:{$omcollab_installation_dir}wiki/\" );\n?" . ">";
|
|---|
| 402 | file_put_contents( 'index.php', $sIndexContents );
|
|---|
| 403 |
|
|---|
| 404 | die( "\n\nInstallation completed with probable success!\n\nCheck it <a href='$omcollab_installation_dir'>here</a>!" );
|
|---|
| 405 |
|
|---|
| 406 | }
|
|---|
| 407 |
|
|---|
| 408 | ?>
|
|---|
| 409 |
|
|---|
| 410 | Welcome to the installation utility for the omCollab Suite.
|
|---|
| 411 | Your inputs will be checked, and a certain amount of sanity checking will take place.
|
|---|
| 412 | Please read the <a href="readme.txt" target="_blank">readme</a>!
|
|---|
| 413 | <form method="post" action="install.php">
|
|---|
| 414 | <input type="hidden" name="do" value="install">
|
|---|
| 415 | <input name="omcollab_admin_email"> Admin email
|
|---|
| 416 | <input name="omcollab_db_hostname"> Database hostname ( eg <span style="color:blue;font-weight:bold;">localhost</span> )
|
|---|
| 417 | <input name="omcollab_db_table_prefix"> Database table prefix ( eg "<span style="color:blue;font-weight:bold;">om</span>" )
|
|---|
| 418 | <input name="path_to_mysql"> Full path to mysql ( eg <span style="color:blue;font-weight:bold;">\path\to\mysql\ or D:\xamppfiles\mysql\bin\</span> )
|
|---|
| 419 | <input name="omwiki_database_name"> Wiki database name
|
|---|
| 420 | <input name="omwiki_db_username"> Wiki database username
|
|---|
| 421 | <input name="omwiki_db_password"> Wiki database password
|
|---|
| 422 | <input name="omblogs_database_name"> Blogs database name
|
|---|
| 423 | <input name="omblogs_db_username"> Blogs database username
|
|---|
| 424 | <input name="omblogs_db_password"> Blogs database password
|
|---|
| 425 | <input name="ombookmarks_database_name"> Bookmarks database name
|
|---|
| 426 | <input name="ombookmarks_db_username"> Bookmarks database username
|
|---|
| 427 | <input name="ombookmarks_db_password"> Bookmarks database password
|
|---|
| 428 | <input name="omforum_database_name"> Forum database name
|
|---|
| 429 | <input name="omforum_db_username"> Forum database username
|
|---|
| 430 | <input name="omforum_db_password"> Forum database password
|
|---|
| 431 | <input name="omwiki_application_name"> Wiki application name ( eg "<span style="color:blue;font-weight:bold;">omCollab Wiki</span>" )
|
|---|
| 432 | <input name="omblog_application_name"> Blog application name ( eg "<span style="color:blue;font-weight:bold;">omCollab Blogs</span>" )
|
|---|
| 433 | <input name="ombookmarks_application_name"> Bookmarks application name (eg "<span style="color:blue;font-weight:bold;">omCollab Bookmarks</span>")
|
|---|
| 434 | <input name="omforum_application_name"> Forum application name (eg "<span style="color:blue;font-weight:bold;">omCollab Forum</span>")
|
|---|
| 435 | <input name="omexplore_application_name"> Explore application name (eg "<span style="color:blue;font-weight:bold;">omCollab Explore</span>")
|
|---|
| 436 |
|
|---|
| 437 | Initial Configuration
|
|---|
| 438 | <input name="omcollab_initial_skin" type="radio" value="" checked> Mike2 ( blue skin with <span style="color:blue;font-weight:bold;">wiki</span> + <span style="color:blue;font-weight:bold;">blogs</span> + <span style="color:blue;font-weight:bold;">bookmarks</span> + <span style="color:blue;font-weight:bold;">explore</span> )
|
|---|
| 439 | <input name="omcollab_initial_skin" type="radio" value="red"> Mike2red ( red skin with <span style="color:blue;font-weight:bold;">wiki</span> + <span style="color:blue;font-weight:bold;">blogs</span> + <span style="color:blue;font-weight:bold;">bookmarks</span> )
|
|---|
| 440 |
|
|---|
| 441 | Use short URLs in MediaWiki?
|
|---|
| 442 | <?php if( stripos( $_SERVER['SERVER_SOFTWARE'], 'apache' ) !== false ): ?>
|
|---|
| 443 | <input name="omwiki_use_short_urls" type="checkbox"> ( read <a href="readme.txt" target="_blank">this</a> and <a href='http://www.mediawiki.org/wiki/Manual:Short_URL' target='_blank'>this</a> first! )
|
|---|
| 444 | <?php endif; ?>
|
|---|
| 445 |
|
|---|
| 446 | Enable DocConvert Extension for MS Word to MediaWiki Conversion?
|
|---|
| 447 | <input name="omwiki_enable_docconvert" type="checkbox">
|
|---|
| 448 | If Enabled, make sure you have OpenOffice.org installed, and enter your fully qualified path to the Open Office "program" directory here:
|
|---|
| 449 | Example: C:\Program Files\OpenOffice.org 3\program\
|
|---|
| 450 | <input name="omwiki_docconvert_oo_path" type="text">
|
|---|
| 451 | Alternatively, leave this blank and have the Open Office program path (directory where soffice executable is) on your system path envinronment variable.
|
|---|
| 452 | If you add OpenOffice program directory to system path environment variable, make sure you reset your web server before going forward.
|
|---|
| 453 |
|
|---|
| 454 | Google extras <span style="color:red;font-weight:bold;">Optional [requires Google account]</span>.
|
|---|
| 455 | You'll need to look closely at your Google-provided code to retrieve the required values (copy and paste the relevant values here)
|
|---|
| 456 | <input name="omcollab_google_analytics"> Google Anayltics Code ( Harvest Google Analytics for your site. Looks something like "<span style="color:blue;font-weight:bold;">ZZ-9999999-9</span>" or leave blank )
|
|---|
| 457 | <input name="omcollab_google_cse_code"> Google Custom Search Code ( Show Google results for your site. Takes the form of "<span style="color:blue;font-weight:bold;">999999999999999999999:xxxxxxxxxxx</span>" or leave blank )
|
|---|
| 458 | <input name="omcollab_google_cse_forid"> Google Custom Search FORID Code ( Required when using the custom search defined above. Takes the form of "<span style="color:blue;font-weight:bold;">an integer provided by Google</span>" or leave blank )
|
|---|
| 459 | <input name="omcollab_google_blog_key"> Google API Key for blogbar ( Required for integrated blog searches in omCollab Explore. Takes the form of "<span style="color:blue;font-weight:bold;">an 86-character long API code</span>" or leave blank )
|
|---|
| 460 |
|
|---|
| 461 | <input type="Submit" name="submit" value="Install omCollab">
|
|---|
| 462 | </form>
|
|---|
| 463 |
|
|---|
| 464 | </pre>
|
|---|
| 465 | </body>
|
|---|
| 466 | </html> |
|---|