Completed
Push — develop ( 695bbe...affb48 )
by Adam
19:17
created
include/utils.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
         $isSelected = false;
1728 1728
 
1729 1729
         if(empty($option_key)) {
1730
-         continue;
1730
+            continue;
1731 1731
         }
1732 1732
 
1733 1733
         if(empty($option_value)) {
@@ -3128,8 +3128,8 @@  discard block
 block discarded – undo
3128 3128
     }
3129 3129
 
3130 3130
     // If there are some bug ridden versions, we should include them here
3131
-	// and check immediately for one of this versions
3132
-	$bug_php_versions = array();
3131
+    // and check immediately for one of this versions
3132
+    $bug_php_versions = array();
3133 3133
     foreach ($bug_php_versions as $v) {
3134 3134
         if ( version_compare($sys_php_version, $v, '=') === true) {
3135 3135
             return -1;
Please login to merge, or discard this patch.
include/database/MysqlManager.php 1 patch
Indentation   +1344 added lines, -1344 removed lines patch added patch discarded remove patch
@@ -100,368 +100,368 @@  discard block
 block discarded – undo
100 100
  */
101 101
 class MysqlManager extends DBManager
102 102
 {
103
-	/**
104
-	 * @see DBManager::$dbType
105
-	 */
106
-	public $dbType = 'mysql';
107
-	public $variant = 'mysql';
108
-	public $dbName = 'MySQL';
109
-	public $label = 'LBL_MYSQL';
110
-
111
-	protected $maxNameLengths = array(
112
-		'table' => 64,
113
-		'column' => 64,
114
-		'index' => 64,
115
-		'alias' => 256
116
-	);
117
-
118
-	protected $type_map = array(
119
-			'int'      => 'int',
120
-			'double'   => 'double',
121
-			'float'    => 'float',
122
-			'uint'     => 'int unsigned',
123
-			'ulong'    => 'bigint unsigned',
124
-			'long'     => 'bigint',
125
-			'short'    => 'smallint',
126
-			'varchar'  => 'varchar',
127
-			'text'     => 'text',
128
-			'longtext' => 'longtext',
129
-			'date'     => 'date',
130
-			'enum'     => 'varchar',
131
-			'relate'   => 'varchar',
132
-			'multienum'=> 'text',
133
-			'html'     => 'text',
134
-			'longhtml' => 'longtext',
135
-			'datetime' => 'datetime',
136
-			'datetimecombo' => 'datetime',
137
-			'time'     => 'time',
138
-			'bool'     => 'bool',
139
-			'tinyint'  => 'tinyint',
140
-			'char'     => 'char',
141
-			'blob'     => 'blob',
142
-			'longblob' => 'longblob',
143
-			'currency' => 'decimal(26,6)',
144
-			'decimal'  => 'decimal',
145
-			'decimal2' => 'decimal',
146
-			'id'       => 'char(36)',
147
-			'url'      => 'varchar',
148
-			'encrypt'  => 'varchar',
149
-			'file'     => 'varchar',
150
-			'decimal_tpl' => 'decimal(%d, %d)',
151
-
152
-	);
153
-
154
-	protected $capabilities = array(
155
-		"affected_rows" => true,
156
-		"select_rows" => true,
157
-		"inline_keys" => true,
158
-		"create_user" => true,
159
-		"fulltext" => true,
160
-	    "collation" => true,
161
-	    "create_db" => true,
162
-	    "disable_keys" => true,
163
-	);
164
-
165
-	/**
166
-	 * Parses and runs queries
167
-	 *
168
-	 * @param  string   $sql        SQL Statement to execute
169
-	 * @param  bool     $dieOnError True if we want to call die if the query returns errors
170
-	 * @param  string   $msg        Message to log if error occurs
171
-	 * @param  bool     $suppress   Flag to suppress all error output unless in debug logging mode.
172
-	 * @param  bool     $keepResult True if we want to push this result into the $lastResult array.
173
-	 * @return resource result set
174
-	 */
175
-	public function query($sql, $dieOnError = false, $msg = '', $suppress = false, $keepResult = false)
176
-	{
177
-		if(is_array($sql)) {
178
-			return $this->queryArray($sql, $dieOnError, $msg, $suppress);
179
-		}
180
-
181
-		parent::countQuery($sql);
182
-		$GLOBALS['log']->info('Query:' . $sql);
183
-		$this->checkConnection();
184
-		$this->query_time = microtime(true);
185
-		$this->lastsql = $sql;
186
-		$result = $suppress?@mysql_query($sql, $this->database):mysql_query($sql, $this->database);
187
-
188
-		$this->query_time = microtime(true) - $this->query_time;
189
-		$GLOBALS['log']->info('Query Execution Time:'.$this->query_time);
190
-
191
-
192
-		if($keepResult)
193
-			$this->lastResult = $result;
194
-
195
-		$this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError);
196
-		return $result;
197
-	}
103
+    /**
104
+     * @see DBManager::$dbType
105
+     */
106
+    public $dbType = 'mysql';
107
+    public $variant = 'mysql';
108
+    public $dbName = 'MySQL';
109
+    public $label = 'LBL_MYSQL';
110
+
111
+    protected $maxNameLengths = array(
112
+        'table' => 64,
113
+        'column' => 64,
114
+        'index' => 64,
115
+        'alias' => 256
116
+    );
117
+
118
+    protected $type_map = array(
119
+            'int'      => 'int',
120
+            'double'   => 'double',
121
+            'float'    => 'float',
122
+            'uint'     => 'int unsigned',
123
+            'ulong'    => 'bigint unsigned',
124
+            'long'     => 'bigint',
125
+            'short'    => 'smallint',
126
+            'varchar'  => 'varchar',
127
+            'text'     => 'text',
128
+            'longtext' => 'longtext',
129
+            'date'     => 'date',
130
+            'enum'     => 'varchar',
131
+            'relate'   => 'varchar',
132
+            'multienum'=> 'text',
133
+            'html'     => 'text',
134
+            'longhtml' => 'longtext',
135
+            'datetime' => 'datetime',
136
+            'datetimecombo' => 'datetime',
137
+            'time'     => 'time',
138
+            'bool'     => 'bool',
139
+            'tinyint'  => 'tinyint',
140
+            'char'     => 'char',
141
+            'blob'     => 'blob',
142
+            'longblob' => 'longblob',
143
+            'currency' => 'decimal(26,6)',
144
+            'decimal'  => 'decimal',
145
+            'decimal2' => 'decimal',
146
+            'id'       => 'char(36)',
147
+            'url'      => 'varchar',
148
+            'encrypt'  => 'varchar',
149
+            'file'     => 'varchar',
150
+            'decimal_tpl' => 'decimal(%d, %d)',
151
+
152
+    );
153
+
154
+    protected $capabilities = array(
155
+        "affected_rows" => true,
156
+        "select_rows" => true,
157
+        "inline_keys" => true,
158
+        "create_user" => true,
159
+        "fulltext" => true,
160
+        "collation" => true,
161
+        "create_db" => true,
162
+        "disable_keys" => true,
163
+    );
164
+
165
+    /**
166
+     * Parses and runs queries
167
+     *
168
+     * @param  string   $sql        SQL Statement to execute
169
+     * @param  bool     $dieOnError True if we want to call die if the query returns errors
170
+     * @param  string   $msg        Message to log if error occurs
171
+     * @param  bool     $suppress   Flag to suppress all error output unless in debug logging mode.
172
+     * @param  bool     $keepResult True if we want to push this result into the $lastResult array.
173
+     * @return resource result set
174
+     */
175
+    public function query($sql, $dieOnError = false, $msg = '', $suppress = false, $keepResult = false)
176
+    {
177
+        if(is_array($sql)) {
178
+            return $this->queryArray($sql, $dieOnError, $msg, $suppress);
179
+        }
180
+
181
+        parent::countQuery($sql);
182
+        $GLOBALS['log']->info('Query:' . $sql);
183
+        $this->checkConnection();
184
+        $this->query_time = microtime(true);
185
+        $this->lastsql = $sql;
186
+        $result = $suppress?@mysql_query($sql, $this->database):mysql_query($sql, $this->database);
187
+
188
+        $this->query_time = microtime(true) - $this->query_time;
189
+        $GLOBALS['log']->info('Query Execution Time:'.$this->query_time);
190
+
191
+
192
+        if($keepResult)
193
+            $this->lastResult = $result;
194
+
195
+        $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError);
196
+        return $result;
197
+    }
198 198
 
199 199
     /**
200 200
      * Returns the number of rows affected by the last query
201 201
      * @param $result
202 202
      * @return int
203 203
      */
204
-	public function getAffectedRowCount($result)
205
-	{
206
-		return mysql_affected_rows($this->getDatabase());
207
-	}
208
-
209
-	/**
210
-	 * Returns the number of rows returned by the result
211
-	 *
212
-	 * This function can't be reliably implemented on most DB, do not use it.
213
-	 * @abstract
214
-	 * @deprecated
215
-	 * @param  resource $result
216
-	 * @return int
217
-	 */
218
-	public function getRowCount($result)
219
-	{
220
-	    return mysql_num_rows($result);
221
-	}
222
-
223
-	/**
224
-	 * Disconnects from the database
225
-	 *
226
-	 * Also handles any cleanup needed
227
-	 */
228
-	public function disconnect()
229
-	{
230
-		$GLOBALS['log']->debug('Calling MySQL::disconnect()');
231
-		if(!empty($this->database)){
232
-			$this->freeResult();
233
-			mysql_close($this->database);
234
-			$this->database = null;
235
-		}
236
-	}
237
-
238
-	/**
239
-	 * @see DBManager::freeDbResult()
240
-	 */
241
-	protected function freeDbResult($dbResult)
242
-	{
243
-		if(!empty($dbResult))
244
-			mysql_free_result($dbResult);
245
-	}
246
-
247
-
248
-	/**
249
-	 * @abstract
250
-	 * Check if query has LIMIT clause
251
-	 * Relevant for now only for Mysql
252
-	 * @param string $sql
253
-	 * @return bool
254
-	 */
255
-	protected function hasLimit($sql)
256
-	{
257
-	    return stripos($sql, " limit ") !== false;
258
-	}
259
-
260
-	/**
261
-	 * @see DBManager::limitQuery()
262
-	 */
263
-	public function limitQuery($sql, $start, $count, $dieOnError = false, $msg = '', $execute = true)
264
-	{
204
+    public function getAffectedRowCount($result)
205
+    {
206
+        return mysql_affected_rows($this->getDatabase());
207
+    }
208
+
209
+    /**
210
+     * Returns the number of rows returned by the result
211
+     *
212
+     * This function can't be reliably implemented on most DB, do not use it.
213
+     * @abstract
214
+     * @deprecated
215
+     * @param  resource $result
216
+     * @return int
217
+     */
218
+    public function getRowCount($result)
219
+    {
220
+        return mysql_num_rows($result);
221
+    }
222
+
223
+    /**
224
+     * Disconnects from the database
225
+     *
226
+     * Also handles any cleanup needed
227
+     */
228
+    public function disconnect()
229
+    {
230
+        $GLOBALS['log']->debug('Calling MySQL::disconnect()');
231
+        if(!empty($this->database)){
232
+            $this->freeResult();
233
+            mysql_close($this->database);
234
+            $this->database = null;
235
+        }
236
+    }
237
+
238
+    /**
239
+     * @see DBManager::freeDbResult()
240
+     */
241
+    protected function freeDbResult($dbResult)
242
+    {
243
+        if(!empty($dbResult))
244
+            mysql_free_result($dbResult);
245
+    }
246
+
247
+
248
+    /**
249
+     * @abstract
250
+     * Check if query has LIMIT clause
251
+     * Relevant for now only for Mysql
252
+     * @param string $sql
253
+     * @return bool
254
+     */
255
+    protected function hasLimit($sql)
256
+    {
257
+        return stripos($sql, " limit ") !== false;
258
+    }
259
+
260
+    /**
261
+     * @see DBManager::limitQuery()
262
+     */
263
+    public function limitQuery($sql, $start, $count, $dieOnError = false, $msg = '', $execute = true)
264
+    {
265 265
         $start = (int)$start;
266 266
         $count = (int)$count;
267
-	    if ($start < 0)
268
-			$start = 0;
269
-		$GLOBALS['log']->debug('Limit Query:' . $sql. ' Start: ' .$start . ' count: ' . $count);
270
-
271
-	    $sql = "$sql LIMIT $start,$count";
272
-		$this->lastsql = $sql;
273
-
274
-		if(!empty($GLOBALS['sugar_config']['check_query'])){
275
-			$this->checkQuery($sql);
276
-		}
277
-		if(!$execute) {
278
-			return $sql;
279
-		}
280
-
281
-		return $this->query($sql, $dieOnError, $msg);
282
-	}
283
-
284
-
285
-	/**
286
-	 * @see DBManager::checkQuery()
287
-	 */
288
-	protected function checkQuery($sql, $object_name = false)
289
-	{
290
-		$result   = $this->query('EXPLAIN ' . $sql);
291
-		$badQuery = array();
292
-		while ($row = $this->fetchByAssoc($result)) {
293
-			if (empty($row['table']))
294
-				continue;
295
-			$badQuery[$row['table']] = '';
296
-			if (strtoupper($row['type']) == 'ALL')
297
-				$badQuery[$row['table']]  .=  ' Full Table Scan;';
298
-			if (empty($row['key']))
299
-				$badQuery[$row['table']] .= ' No Index Key Used;';
300
-			if (!empty($row['Extra']) && substr_count($row['Extra'], 'Using filesort') > 0)
301
-				$badQuery[$row['table']] .= ' Using FileSort;';
302
-			if (!empty($row['Extra']) && substr_count($row['Extra'], 'Using temporary') > 0)
303
-				$badQuery[$row['table']] .= ' Using Temporary Table;';
304
-		}
305
-
306
-		if ( empty($badQuery) )
307
-			return true;
308
-
309
-		foreach($badQuery as $table=>$data ){
310
-			if(!empty($data)){
311
-				$warning = ' Table:' . $table . ' Data:' . $data;
312
-				if(!empty($GLOBALS['sugar_config']['check_query_log'])){
313
-					$GLOBALS['log']->fatal($sql);
314
-					$GLOBALS['log']->fatal('CHECK QUERY:' .$warning);
315
-				}
316
-				else{
317
-					$GLOBALS['log']->warn('CHECK QUERY:' .$warning);
318
-				}
319
-			}
320
-		}
321
-
322
-		return false;
323
-	}
324
-
325
-	/**
326
-	 * @see DBManager::get_columns()
327
-	 */
328
-	public function get_columns($tablename)
329
-	{
330
-		//find all unique indexes and primary keys.
331
-		$result = $this->query("DESCRIBE $tablename");
332
-
333
-		$columns = array();
334
-		while (($row=$this->fetchByAssoc($result)) !=null) {
335
-			$name = strtolower($row['Field']);
336
-			$columns[$name]['name']=$name;
337
-			$matches = array();
338
-			preg_match_all('/(\w+)(?:\(([0-9]+,?[0-9]*)\)|)( unsigned)?/i', $row['Type'], $matches);
339
-			$columns[$name]['type']=strtolower($matches[1][0]);
340
-			if ( isset($matches[2][0]) && in_array(strtolower($matches[1][0]),array('varchar','char','varchar2','int','decimal','float')) )
341
-				$columns[$name]['len']=strtolower($matches[2][0]);
342
-			if ( stristr($row['Extra'],'auto_increment') )
343
-				$columns[$name]['auto_increment'] = '1';
344
-			if ($row['Null'] == 'NO' && !stristr($row['Key'],'PRI'))
345
-				$columns[$name]['required'] = 'true';
346
-			if (!empty($row['Default']) )
347
-				$columns[$name]['default'] = $row['Default'];
348
-		}
349
-		return $columns;
350
-	}
351
-
352
-	/**
353
-	 * @see DBManager::getFieldsArray()
354
-	 */
355
-	public function getFieldsArray($result, $make_lower_case=false)
356
-	{
357
-		$field_array = array();
358
-
359
-		if(empty($result))
360
-			return 0;
361
-
362
-		$fields = mysql_num_fields($result);
363
-		for ($i=0; $i < $fields; $i++) {
364
-			$meta = mysql_fetch_field($result, $i);
365
-			if (!$meta)
366
-				return array();
367
-
368
-			if($make_lower_case == true)
369
-				$meta->name = strtolower($meta->name);
370
-
371
-			$field_array[] = $meta->name;
372
-		}
373
-
374
-		return $field_array;
375
-	}
376
-
377
-	/**
378
-	 * @see DBManager::fetchRow()
379
-	 */
380
-	public function fetchRow($result)
381
-	{
382
-		if (empty($result))	return false;
383
-
384
-		return mysql_fetch_assoc($result);
385
-	}
386
-
387
-	/**
388
-	 * @see DBManager::getTablesArray()
389
-	 */
390
-	public function getTablesArray()
391
-	{
392
-		$this->log->debug('Fetching table list');
393
-
394
-		if ($this->getDatabase()) {
395
-			$tables = array();
396
-			$r = $this->query('SHOW TABLES');
397
-			if (!empty($r)) {
398
-				while ($a = $this->fetchByAssoc($r)) {
399
-					$row = array_values($a);
400
-					$tables[]=$row[0];
401
-				}
402
-				return $tables;
403
-			}
404
-		}
405
-
406
-		return false; // no database available
407
-	}
408
-
409
-	/**
410
-	 * @see DBManager::version()
411
-	 */
412
-	public function version()
413
-	{
414
-		return $this->getOne("SELECT version() version");
415
-	}
416
-
417
-	/**
418
-	 * @see DBManager::tableExists()
419
-	 */
420
-	public function tableExists($tableName)
421
-	{
422
-		$this->log->info("tableExists: $tableName");
423
-
424
-		if ($this->getDatabase()) {
425
-			$result = $this->query("SHOW TABLES LIKE ".$this->quoted($tableName));
426
-			if(empty($result)) return false;
427
-			$row = $this->fetchByAssoc($result);
428
-			return !empty($row);
429
-		}
430
-
431
-		return false;
432
-	}
433
-
434
-	/**
435
-	 * Get tables like expression
436
-	 * @param $like string
437
-	 * @return array
438
-	 */
439
-	public function tablesLike($like)
440
-	{
441
-		if ($this->getDatabase()) {
442
-			$tables = array();
443
-			$r = $this->query('SHOW TABLES LIKE '.$this->quoted($like));
444
-			if (!empty($r)) {
445
-				while ($a = $this->fetchByAssoc($r)) {
446
-					$row = array_values($a);
447
-					$tables[]=$row[0];
448
-				}
449
-				return $tables;
450
-			}
451
-		}
452
-		return false;
453
-	}
454
-
455
-	/**
456
-	 * @see DBManager::quote()
457
-	 */
458
-	public function quote($string)
459
-	{
460
-		if(is_array($string)) {
461
-			return $this->arrayQuote($string);
462
-		}
463
-		return mysqli_real_escape_string($this->quoteInternal($string), $this->getDatabase());
464
-	}
267
+        if ($start < 0)
268
+            $start = 0;
269
+        $GLOBALS['log']->debug('Limit Query:' . $sql. ' Start: ' .$start . ' count: ' . $count);
270
+
271
+        $sql = "$sql LIMIT $start,$count";
272
+        $this->lastsql = $sql;
273
+
274
+        if(!empty($GLOBALS['sugar_config']['check_query'])){
275
+            $this->checkQuery($sql);
276
+        }
277
+        if(!$execute) {
278
+            return $sql;
279
+        }
280
+
281
+        return $this->query($sql, $dieOnError, $msg);
282
+    }
283
+
284
+
285
+    /**
286
+     * @see DBManager::checkQuery()
287
+     */
288
+    protected function checkQuery($sql, $object_name = false)
289
+    {
290
+        $result   = $this->query('EXPLAIN ' . $sql);
291
+        $badQuery = array();
292
+        while ($row = $this->fetchByAssoc($result)) {
293
+            if (empty($row['table']))
294
+                continue;
295
+            $badQuery[$row['table']] = '';
296
+            if (strtoupper($row['type']) == 'ALL')
297
+                $badQuery[$row['table']]  .=  ' Full Table Scan;';
298
+            if (empty($row['key']))
299
+                $badQuery[$row['table']] .= ' No Index Key Used;';
300
+            if (!empty($row['Extra']) && substr_count($row['Extra'], 'Using filesort') > 0)
301
+                $badQuery[$row['table']] .= ' Using FileSort;';
302
+            if (!empty($row['Extra']) && substr_count($row['Extra'], 'Using temporary') > 0)
303
+                $badQuery[$row['table']] .= ' Using Temporary Table;';
304
+        }
305
+
306
+        if ( empty($badQuery) )
307
+            return true;
308
+
309
+        foreach($badQuery as $table=>$data ){
310
+            if(!empty($data)){
311
+                $warning = ' Table:' . $table . ' Data:' . $data;
312
+                if(!empty($GLOBALS['sugar_config']['check_query_log'])){
313
+                    $GLOBALS['log']->fatal($sql);
314
+                    $GLOBALS['log']->fatal('CHECK QUERY:' .$warning);
315
+                }
316
+                else{
317
+                    $GLOBALS['log']->warn('CHECK QUERY:' .$warning);
318
+                }
319
+            }
320
+        }
321
+
322
+        return false;
323
+    }
324
+
325
+    /**
326
+     * @see DBManager::get_columns()
327
+     */
328
+    public function get_columns($tablename)
329
+    {
330
+        //find all unique indexes and primary keys.
331
+        $result = $this->query("DESCRIBE $tablename");
332
+
333
+        $columns = array();
334
+        while (($row=$this->fetchByAssoc($result)) !=null) {
335
+            $name = strtolower($row['Field']);
336
+            $columns[$name]['name']=$name;
337
+            $matches = array();
338
+            preg_match_all('/(\w+)(?:\(([0-9]+,?[0-9]*)\)|)( unsigned)?/i', $row['Type'], $matches);
339
+            $columns[$name]['type']=strtolower($matches[1][0]);
340
+            if ( isset($matches[2][0]) && in_array(strtolower($matches[1][0]),array('varchar','char','varchar2','int','decimal','float')) )
341
+                $columns[$name]['len']=strtolower($matches[2][0]);
342
+            if ( stristr($row['Extra'],'auto_increment') )
343
+                $columns[$name]['auto_increment'] = '1';
344
+            if ($row['Null'] == 'NO' && !stristr($row['Key'],'PRI'))
345
+                $columns[$name]['required'] = 'true';
346
+            if (!empty($row['Default']) )
347
+                $columns[$name]['default'] = $row['Default'];
348
+        }
349
+        return $columns;
350
+    }
351
+
352
+    /**
353
+     * @see DBManager::getFieldsArray()
354
+     */
355
+    public function getFieldsArray($result, $make_lower_case=false)
356
+    {
357
+        $field_array = array();
358
+
359
+        if(empty($result))
360
+            return 0;
361
+
362
+        $fields = mysql_num_fields($result);
363
+        for ($i=0; $i < $fields; $i++) {
364
+            $meta = mysql_fetch_field($result, $i);
365
+            if (!$meta)
366
+                return array();
367
+
368
+            if($make_lower_case == true)
369
+                $meta->name = strtolower($meta->name);
370
+
371
+            $field_array[] = $meta->name;
372
+        }
373
+
374
+        return $field_array;
375
+    }
376
+
377
+    /**
378
+     * @see DBManager::fetchRow()
379
+     */
380
+    public function fetchRow($result)
381
+    {
382
+        if (empty($result))	return false;
383
+
384
+        return mysql_fetch_assoc($result);
385
+    }
386
+
387
+    /**
388
+     * @see DBManager::getTablesArray()
389
+     */
390
+    public function getTablesArray()
391
+    {
392
+        $this->log->debug('Fetching table list');
393
+
394
+        if ($this->getDatabase()) {
395
+            $tables = array();
396
+            $r = $this->query('SHOW TABLES');
397
+            if (!empty($r)) {
398
+                while ($a = $this->fetchByAssoc($r)) {
399
+                    $row = array_values($a);
400
+                    $tables[]=$row[0];
401
+                }
402
+                return $tables;
403
+            }
404
+        }
405
+
406
+        return false; // no database available
407
+    }
408
+
409
+    /**
410
+     * @see DBManager::version()
411
+     */
412
+    public function version()
413
+    {
414
+        return $this->getOne("SELECT version() version");
415
+    }
416
+
417
+    /**
418
+     * @see DBManager::tableExists()
419
+     */
420
+    public function tableExists($tableName)
421
+    {
422
+        $this->log->info("tableExists: $tableName");
423
+
424
+        if ($this->getDatabase()) {
425
+            $result = $this->query("SHOW TABLES LIKE ".$this->quoted($tableName));
426
+            if(empty($result)) return false;
427
+            $row = $this->fetchByAssoc($result);
428
+            return !empty($row);
429
+        }
430
+
431
+        return false;
432
+    }
433
+
434
+    /**
435
+     * Get tables like expression
436
+     * @param $like string
437
+     * @return array
438
+     */
439
+    public function tablesLike($like)
440
+    {
441
+        if ($this->getDatabase()) {
442
+            $tables = array();
443
+            $r = $this->query('SHOW TABLES LIKE '.$this->quoted($like));
444
+            if (!empty($r)) {
445
+                while ($a = $this->fetchByAssoc($r)) {
446
+                    $row = array_values($a);
447
+                    $tables[]=$row[0];
448
+                }
449
+                return $tables;
450
+            }
451
+        }
452
+        return false;
453
+    }
454
+
455
+    /**
456
+     * @see DBManager::quote()
457
+     */
458
+    public function quote($string)
459
+    {
460
+        if(is_array($string)) {
461
+            return $this->arrayQuote($string);
462
+        }
463
+        return mysqli_real_escape_string($this->quoteInternal($string), $this->getDatabase());
464
+    }
465 465
 
466 466
     /**
467 467
      * @see DBManager::quoteIdentifier()
@@ -471,272 +471,272 @@  discard block
 block discarded – undo
471 471
         return '`'.$string.'`';
472 472
     }
473 473
 
474
-	/**
475
-	 * @see DBManager::connect()
476
-	 */
477
-	public function connect(array $configOptions = null, $dieOnError = false)
478
-	{
479
-		global $sugar_config;
480
-
481
-		if(is_null($configOptions))
482
-			$configOptions = $sugar_config['dbconfig'];
483
-
484
-		if ($this->getOption('persistent')) {
485
-			$this->database = @mysql_pconnect(
486
-				$configOptions['db_host_name'],
487
-				$configOptions['db_user_name'],
488
-				$configOptions['db_password']
489
-				);
490
-		}
491
-
492
-		if (!$this->database) {
493
-			$this->database = mysql_connect(
494
-					$configOptions['db_host_name'],
495
-					$configOptions['db_user_name'],
496
-					$configOptions['db_password']
497
-					);
498
-			if(empty($this->database)) {
499
-				$GLOBALS['log']->fatal("Could not connect to server ".$configOptions['db_host_name']." as ".$configOptions['db_user_name'].":".mysql_error());
500
-				if($dieOnError) {
501
-					if(isset($GLOBALS['app_strings']['ERR_NO_DB'])) {
502
-						sugar_die($GLOBALS['app_strings']['ERR_NO_DB']);
503
-					} else {
504
-						sugar_die("Could not connect to the database. Please refer to suitecrm.log for details.");
505
-					}
506
-				} else {
507
-					return false;
508
-				}
509
-			}
510
-			// Do not pass connection information because we have not connected yet
511
-			if($this->database  && $this->getOption('persistent')){
512
-				$_SESSION['administrator_error'] = "<b>Severe Performance Degradation: Persistent Database Connections "
513
-					. "not working.  Please set \$sugar_config['dbconfigoption']['persistent'] to false "
514
-					. "in your config.php file</b>";
515
-			}
516
-		}
517
-		if(!empty($configOptions['db_name']) && !@mysql_select_db($configOptions['db_name'])) {
518
-			$GLOBALS['log']->fatal( "Unable to select database {$configOptions['db_name']}: " . mysql_error($this->database));
519
-			if($dieOnError) {
520
-				sugar_die($GLOBALS['app_strings']['ERR_NO_DB']);
521
-			} else {
522
-				return false;
523
-			}
524
-		}
525
-
526
-		// cn: using direct calls to prevent this from spamming the Logs
527
-	    mysql_query("SET CHARACTER SET utf8", $this->database);
528
-	    $names = "SET NAMES 'utf8'";
529
-	    $collation = $this->getOption('collation');
530
-	    if(!empty($collation)) {
531
-	        $names .= " COLLATE '$collation'";
532
-		}
533
-	    mysql_query($names, $this->database);
534
-
535
-		if(!$this->checkError('Could Not Connect:', $dieOnError))
536
-			$GLOBALS['log']->info("connected to db");
537
-		$this->connectOptions = $configOptions;
538
-
539
-		$GLOBALS['log']->info("Connect:".$this->database);
540
-		return true;
541
-	}
542
-
543
-	/**
544
-	 * @see DBManager::repairTableParams()
545
-	 *
546
-	 * For MySQL, we can write the ALTER TABLE statement all in one line, which speeds things
547
-	 * up quite a bit. So here, we'll parse the returned SQL into a single ALTER TABLE command.
548
-	 */
549
-	public function repairTableParams($tablename, $fielddefs, $indices, $execute = true, $engine = null)
550
-	{
551
-		$sql = parent::repairTableParams($tablename,$fielddefs,$indices,false,$engine);
552
-
553
-		if ( $sql == '' )
554
-			return '';
555
-
556
-		if ( stristr($sql,'create table') )
557
-		{
558
-			if ($execute) {
559
-				$msg = "Error creating table: ".$tablename. ":";
560
-				$this->query($sql,true,$msg);
561
-			}
562
-			return $sql;
563
-		}
564
-
565
-		// first, parse out all the comments
566
-		$match = array();
567
-		preg_match_all('!/\*.*?\*/!is', $sql, $match);
568
-		$commentBlocks = $match[0];
569
-		$sql = preg_replace('!/\*.*?\*/!is','', $sql);
570
-
571
-		// now, we should only have alter table statements
572
-		// let's replace the 'alter table name' part with a comma
573
-		$sql = preg_replace("!alter table $tablename!is",', ', $sql);
574
-
575
-		// re-add it at the beginning
576
-		$sql = substr_replace($sql,'',strpos($sql,','),1);
577
-		$sql = str_replace(";","",$sql);
578
-		$sql = str_replace("\n","",$sql);
579
-		$sql = "ALTER TABLE $tablename $sql";
580
-
581
-		if ( $execute )
582
-			$this->query($sql,'Error with MySQL repair table');
583
-
584
-		// and re-add the comments at the beginning
585
-		$sql = implode("\n",$commentBlocks) . "\n". $sql . "\n";
586
-
587
-		return $sql;
588
-	}
589
-
590
-	/**
591
-	 * @see DBManager::convert()
592
-	 */
593
-	public function convert($string, $type, array $additional_parameters = array())
594
-	{
595
-		$all_parameters = $additional_parameters;
596
-		if(is_array($string)) {
597
-			$all_parameters = array_merge($string, $all_parameters);
598
-		} elseif (!is_null($string)) {
599
-			array_unshift($all_parameters, $string);
600
-		}
601
-		$all_strings = implode(',', $all_parameters);
602
-
603
-		switch (strtolower($type)) {
604
-			case 'today':
605
-				return "CURDATE()";
606
-			case 'left':
607
-				return "LEFT($all_strings)";
608
-			case 'date_format':
609
-				if(empty($additional_parameters)) {
610
-					return "DATE_FORMAT($string,'%Y-%m-%d')";
611
-				} else {
612
-					$format = $additional_parameters[0];
613
-					if($format[0] != "'") {
614
-						$format = $this->quoted($format);
615
-					}
616
-					return "DATE_FORMAT($string,$format)";
617
-				}
618
-			case 'ifnull':
619
-				if(empty($additional_parameters) && !strstr($all_strings, ",")) {
620
-					$all_strings .= ",''";
621
-				}
622
-				return "IFNULL($all_strings)";
623
-			case 'concat':
624
-				return "CONCAT($all_strings)";
625
-			case 'quarter':
626
-					return "QUARTER($string)";
627
-			case "length":
628
-					return "LENGTH($string)";
629
-			case 'month':
630
-					return "MONTH($string)";
631
-			case 'add_date':
632
-					return "DATE_ADD($string, INTERVAL {$additional_parameters[0]} {$additional_parameters[1]})";
633
-			case 'add_time':
634
-					return "DATE_ADD($string, INTERVAL + CONCAT({$additional_parameters[0]}, ':', {$additional_parameters[1]}) HOUR_MINUTE)";
474
+    /**
475
+     * @see DBManager::connect()
476
+     */
477
+    public function connect(array $configOptions = null, $dieOnError = false)
478
+    {
479
+        global $sugar_config;
480
+
481
+        if(is_null($configOptions))
482
+            $configOptions = $sugar_config['dbconfig'];
483
+
484
+        if ($this->getOption('persistent')) {
485
+            $this->database = @mysql_pconnect(
486
+                $configOptions['db_host_name'],
487
+                $configOptions['db_user_name'],
488
+                $configOptions['db_password']
489
+                );
490
+        }
491
+
492
+        if (!$this->database) {
493
+            $this->database = mysql_connect(
494
+                    $configOptions['db_host_name'],
495
+                    $configOptions['db_user_name'],
496
+                    $configOptions['db_password']
497
+                    );
498
+            if(empty($this->database)) {
499
+                $GLOBALS['log']->fatal("Could not connect to server ".$configOptions['db_host_name']." as ".$configOptions['db_user_name'].":".mysql_error());
500
+                if($dieOnError) {
501
+                    if(isset($GLOBALS['app_strings']['ERR_NO_DB'])) {
502
+                        sugar_die($GLOBALS['app_strings']['ERR_NO_DB']);
503
+                    } else {
504
+                        sugar_die("Could not connect to the database. Please refer to suitecrm.log for details.");
505
+                    }
506
+                } else {
507
+                    return false;
508
+                }
509
+            }
510
+            // Do not pass connection information because we have not connected yet
511
+            if($this->database  && $this->getOption('persistent')){
512
+                $_SESSION['administrator_error'] = "<b>Severe Performance Degradation: Persistent Database Connections "
513
+                    . "not working.  Please set \$sugar_config['dbconfigoption']['persistent'] to false "
514
+                    . "in your config.php file</b>";
515
+            }
516
+        }
517
+        if(!empty($configOptions['db_name']) && !@mysql_select_db($configOptions['db_name'])) {
518
+            $GLOBALS['log']->fatal( "Unable to select database {$configOptions['db_name']}: " . mysql_error($this->database));
519
+            if($dieOnError) {
520
+                sugar_die($GLOBALS['app_strings']['ERR_NO_DB']);
521
+            } else {
522
+                return false;
523
+            }
524
+        }
525
+
526
+        // cn: using direct calls to prevent this from spamming the Logs
527
+        mysql_query("SET CHARACTER SET utf8", $this->database);
528
+        $names = "SET NAMES 'utf8'";
529
+        $collation = $this->getOption('collation');
530
+        if(!empty($collation)) {
531
+            $names .= " COLLATE '$collation'";
532
+        }
533
+        mysql_query($names, $this->database);
534
+
535
+        if(!$this->checkError('Could Not Connect:', $dieOnError))
536
+            $GLOBALS['log']->info("connected to db");
537
+        $this->connectOptions = $configOptions;
538
+
539
+        $GLOBALS['log']->info("Connect:".$this->database);
540
+        return true;
541
+    }
542
+
543
+    /**
544
+     * @see DBManager::repairTableParams()
545
+     *
546
+     * For MySQL, we can write the ALTER TABLE statement all in one line, which speeds things
547
+     * up quite a bit. So here, we'll parse the returned SQL into a single ALTER TABLE command.
548
+     */
549
+    public function repairTableParams($tablename, $fielddefs, $indices, $execute = true, $engine = null)
550
+    {
551
+        $sql = parent::repairTableParams($tablename,$fielddefs,$indices,false,$engine);
552
+
553
+        if ( $sql == '' )
554
+            return '';
555
+
556
+        if ( stristr($sql,'create table') )
557
+        {
558
+            if ($execute) {
559
+                $msg = "Error creating table: ".$tablename. ":";
560
+                $this->query($sql,true,$msg);
561
+            }
562
+            return $sql;
563
+        }
564
+
565
+        // first, parse out all the comments
566
+        $match = array();
567
+        preg_match_all('!/\*.*?\*/!is', $sql, $match);
568
+        $commentBlocks = $match[0];
569
+        $sql = preg_replace('!/\*.*?\*/!is','', $sql);
570
+
571
+        // now, we should only have alter table statements
572
+        // let's replace the 'alter table name' part with a comma
573
+        $sql = preg_replace("!alter table $tablename!is",', ', $sql);
574
+
575
+        // re-add it at the beginning
576
+        $sql = substr_replace($sql,'',strpos($sql,','),1);
577
+        $sql = str_replace(";","",$sql);
578
+        $sql = str_replace("\n","",$sql);
579
+        $sql = "ALTER TABLE $tablename $sql";
580
+
581
+        if ( $execute )
582
+            $this->query($sql,'Error with MySQL repair table');
583
+
584
+        // and re-add the comments at the beginning
585
+        $sql = implode("\n",$commentBlocks) . "\n". $sql . "\n";
586
+
587
+        return $sql;
588
+    }
589
+
590
+    /**
591
+     * @see DBManager::convert()
592
+     */
593
+    public function convert($string, $type, array $additional_parameters = array())
594
+    {
595
+        $all_parameters = $additional_parameters;
596
+        if(is_array($string)) {
597
+            $all_parameters = array_merge($string, $all_parameters);
598
+        } elseif (!is_null($string)) {
599
+            array_unshift($all_parameters, $string);
600
+        }
601
+        $all_strings = implode(',', $all_parameters);
602
+
603
+        switch (strtolower($type)) {
604
+            case 'today':
605
+                return "CURDATE()";
606
+            case 'left':
607
+                return "LEFT($all_strings)";
608
+            case 'date_format':
609
+                if(empty($additional_parameters)) {
610
+                    return "DATE_FORMAT($string,'%Y-%m-%d')";
611
+                } else {
612
+                    $format = $additional_parameters[0];
613
+                    if($format[0] != "'") {
614
+                        $format = $this->quoted($format);
615
+                    }
616
+                    return "DATE_FORMAT($string,$format)";
617
+                }
618
+            case 'ifnull':
619
+                if(empty($additional_parameters) && !strstr($all_strings, ",")) {
620
+                    $all_strings .= ",''";
621
+                }
622
+                return "IFNULL($all_strings)";
623
+            case 'concat':
624
+                return "CONCAT($all_strings)";
625
+            case 'quarter':
626
+                    return "QUARTER($string)";
627
+            case "length":
628
+                    return "LENGTH($string)";
629
+            case 'month':
630
+                    return "MONTH($string)";
631
+            case 'add_date':
632
+                    return "DATE_ADD($string, INTERVAL {$additional_parameters[0]} {$additional_parameters[1]})";
633
+            case 'add_time':
634
+                    return "DATE_ADD($string, INTERVAL + CONCAT({$additional_parameters[0]}, ':', {$additional_parameters[1]}) HOUR_MINUTE)";
635 635
             case 'add_tz_offset' :
636 636
                 $getUserUTCOffset = $GLOBALS['timedate']->getUserUTCOffset();
637 637
                 $operation = $getUserUTCOffset < 0 ? '-' : '+';
638 638
                 return $string . ' ' . $operation . ' INTERVAL ' . abs($getUserUTCOffset) . ' MINUTE';
639 639
             case 'avg':
640 640
                 return "avg($string)";
641
-		}
642
-
643
-		return $string;
644
-	}
645
-
646
-	/**
647
-	 * (non-PHPdoc)
648
-	 * @see DBManager::fromConvert()
649
-	 */
650
-	public function fromConvert($string, $type)
651
-	{
652
-		return $string;
653
-	}
654
-
655
-	/**
656
-	 * Returns the name of the engine to use or null if we are to use the default
657
-	 *
658
-	 * @param  object $bean SugarBean instance
659
-	 * @return string
660
-	 */
661
-	protected function getEngine($bean)
662
-	{
663
-		global $dictionary;
664
-		$engine = null;
665
-		if (isset($dictionary[$bean->getObjectName()]['engine'])) {
666
-			$engine = $dictionary[$bean->getObjectName()]['engine'];
667
-		}
668
-		return $engine;
669
-	}
670
-
671
-	/**
672
-	 * Returns true if the engine given is enabled in the backend
673
-	 *
674
-	 * @param  string $engine
675
-	 * @return bool
676
-	 */
677
-	protected function isEngineEnabled($engine)
678
-	{
679
-		if(!is_string($engine)) return false;
680
-
681
-		$engine = strtoupper($engine);
682
-
683
-		$r = $this->query("SHOW ENGINES");
684
-
685
-		while ( $row = $this->fetchByAssoc($r) )
686
-			if ( strtoupper($row['Engine']) == $engine )
687
-				return ($row['Support']=='YES' || $row['Support']=='DEFAULT');
688
-
689
-		return false;
690
-	}
691
-
692
-	/**
693
-	 * @see DBManager::createTableSQL()
694
-	 */
695
-	public function createTableSQL(SugarBean $bean)
696
-	{
697
-		$tablename = $bean->getTableName();
698
-		$fieldDefs = $bean->getFieldDefinitions();
699
-		$indices   = $bean->getIndices();
700
-		$engine    = $this->getEngine($bean);
701
-		return $this->createTableSQLParams($tablename, $fieldDefs, $indices, $engine);
702
-	}
703
-
704
-	/**
705
-	 * Generates sql for create table statement for a bean.
706
-	 *
707
-	 * @param  string $tablename
708
-	 * @param  array  $fieldDefs
709
-	 * @param  array  $indices
710
-	 * @param  string $engine optional, MySQL engine to use
711
-	 * @return string SQL Create Table statement
712
-	*/
713
-	public function createTableSQLParams($tablename, $fieldDefs, $indices, $engine = null)
714
-	{
715
-		if ( empty($engine) && isset($fieldDefs['engine']))
716
-			$engine = $fieldDefs['engine'];
717
-		if ( !$this->isEngineEnabled($engine) )
718
-			$engine = '';
719
-
720
-		$columns = $this->columnSQLRep($fieldDefs, false, $tablename);
721
-		if (empty($columns))
722
-			return false;
723
-
724
-		$keys = $this->keysSQL($indices);
725
-		if (!empty($keys))
726
-			$keys = ",$keys";
727
-
728
-		// cn: bug 9873 - module tables do not get created in utf8 with assoc collation
729
-		$collation = $this->getOption('collation');
730
-		if(empty($collation)) {
731
-		    $collation = 'utf8_general_ci';
732
-		}
733
-		$sql = "CREATE TABLE $tablename ($columns $keys) CHARACTER SET utf8 COLLATE $collation";
734
-
735
-		if (!empty($engine))
736
-			$sql.= " ENGINE=$engine";
737
-
738
-		return $sql;
739
-	}
641
+        }
642
+
643
+        return $string;
644
+    }
645
+
646
+    /**
647
+     * (non-PHPdoc)
648
+     * @see DBManager::fromConvert()
649
+     */
650
+    public function fromConvert($string, $type)
651
+    {
652
+        return $string;
653
+    }
654
+
655
+    /**
656
+     * Returns the name of the engine to use or null if we are to use the default
657
+     *
658
+     * @param  object $bean SugarBean instance
659
+     * @return string
660
+     */
661
+    protected function getEngine($bean)
662
+    {
663
+        global $dictionary;
664
+        $engine = null;
665
+        if (isset($dictionary[$bean->getObjectName()]['engine'])) {
666
+            $engine = $dictionary[$bean->getObjectName()]['engine'];
667
+        }
668
+        return $engine;
669
+    }
670
+
671
+    /**
672
+     * Returns true if the engine given is enabled in the backend
673
+     *
674
+     * @param  string $engine
675
+     * @return bool
676
+     */
677
+    protected function isEngineEnabled($engine)
678
+    {
679
+        if(!is_string($engine)) return false;
680
+
681
+        $engine = strtoupper($engine);
682
+
683
+        $r = $this->query("SHOW ENGINES");
684
+
685
+        while ( $row = $this->fetchByAssoc($r) )
686
+            if ( strtoupper($row['Engine']) == $engine )
687
+                return ($row['Support']=='YES' || $row['Support']=='DEFAULT');
688
+
689
+        return false;
690
+    }
691
+
692
+    /**
693
+     * @see DBManager::createTableSQL()
694
+     */
695
+    public function createTableSQL(SugarBean $bean)
696
+    {
697
+        $tablename = $bean->getTableName();
698
+        $fieldDefs = $bean->getFieldDefinitions();
699
+        $indices   = $bean->getIndices();
700
+        $engine    = $this->getEngine($bean);
701
+        return $this->createTableSQLParams($tablename, $fieldDefs, $indices, $engine);
702
+    }
703
+
704
+    /**
705
+     * Generates sql for create table statement for a bean.
706
+     *
707
+     * @param  string $tablename
708
+     * @param  array  $fieldDefs
709
+     * @param  array  $indices
710
+     * @param  string $engine optional, MySQL engine to use
711
+     * @return string SQL Create Table statement
712
+     */
713
+    public function createTableSQLParams($tablename, $fieldDefs, $indices, $engine = null)
714
+    {
715
+        if ( empty($engine) && isset($fieldDefs['engine']))
716
+            $engine = $fieldDefs['engine'];
717
+        if ( !$this->isEngineEnabled($engine) )
718
+            $engine = '';
719
+
720
+        $columns = $this->columnSQLRep($fieldDefs, false, $tablename);
721
+        if (empty($columns))
722
+            return false;
723
+
724
+        $keys = $this->keysSQL($indices);
725
+        if (!empty($keys))
726
+            $keys = ",$keys";
727
+
728
+        // cn: bug 9873 - module tables do not get created in utf8 with assoc collation
729
+        $collation = $this->getOption('collation');
730
+        if(empty($collation)) {
731
+            $collation = 'utf8_general_ci';
732
+        }
733
+        $sql = "CREATE TABLE $tablename ($columns $keys) CHARACTER SET utf8 COLLATE $collation";
734
+
735
+        if (!empty($engine))
736
+            $sql.= " ENGINE=$engine";
737
+
738
+        return $sql;
739
+    }
740 740
 
741 741
     /**
742 742
      * Does this type represent text (i.e., non-varchar) value?
@@ -748,745 +748,745 @@  discard block
 block discarded – undo
748 748
         return in_array($type, array('blob','text','longblob', 'longtext'));
749 749
     }
750 750
 
751
-	/**
752
-	 * @see DBManager::oneColumnSQLRep()
753
-	 */
754
-	protected function oneColumnSQLRep($fieldDef, $ignoreRequired = false, $table = '', $return_as_array = false)
755
-	{
756
-		// always return as array for post-processing
757
-		$ref = parent::oneColumnSQLRep($fieldDef, $ignoreRequired, $table, true);
751
+    /**
752
+     * @see DBManager::oneColumnSQLRep()
753
+     */
754
+    protected function oneColumnSQLRep($fieldDef, $ignoreRequired = false, $table = '', $return_as_array = false)
755
+    {
756
+        // always return as array for post-processing
757
+        $ref = parent::oneColumnSQLRep($fieldDef, $ignoreRequired, $table, true);
758 758
 
759
-		if ( $ref['colType'] == 'int' && !empty($fieldDef['len']) ) {
760
-			$ref['colType'] .= "(".$fieldDef['len'].")";
761
-		}
759
+        if ( $ref['colType'] == 'int' && !empty($fieldDef['len']) ) {
760
+            $ref['colType'] .= "(".$fieldDef['len'].")";
761
+        }
762 762
 
763
-		// bug 22338 - don't set a default value on text or blob fields
764
-		if ( isset($ref['default']) &&
763
+        // bug 22338 - don't set a default value on text or blob fields
764
+        if ( isset($ref['default']) &&
765 765
             in_array($ref['colBaseType'], array('text', 'blob', 'longtext', 'longblob')))
766
-			    $ref['default'] = '';
767
-
768
-		if ( $return_as_array )
769
-			return $ref;
770
-		else
771
-			return "{$ref['name']} {$ref['colType']} {$ref['default']} {$ref['required']} {$ref['auto_increment']}";
772
-	}
773
-
774
-	/**
775
-	 * @see DBManager::changeColumnSQL()
776
-	 */
777
-	protected function changeColumnSQL($tablename, $fieldDefs, $action, $ignoreRequired = false)
778
-	{
779
-		$columns = array();
780
-		if ($this->isFieldArray($fieldDefs)){
781
-			foreach ($fieldDefs as $def){
782
-				if ($action == 'drop')
783
-					$columns[] = $def['name'];
784
-				else
785
-					$columns[] = $this->oneColumnSQLRep($def, $ignoreRequired);
786
-			}
787
-		} else {
788
-			if ($action == 'drop')
789
-				$columns[] = $fieldDefs['name'];
790
-		else
791
-			$columns[] = $this->oneColumnSQLRep($fieldDefs);
792
-		}
793
-
794
-		return "ALTER TABLE $tablename $action COLUMN ".implode(",$action column ", $columns);
795
-	}
796
-
797
-	/**
798
-	 * Generates SQL for key specification inside CREATE TABLE statement
799
-	 *
800
-	 * The passes array is an array of field definitions or a field definition
801
-	 * itself. The keys generated will be either primary, foreign, unique, index
802
-	 * or none at all depending on the setting of the "key" parameter of a field definition
803
-	 *
804
-	 * @param  array  $indices
805
-	 * @param  bool   $alter_table
806
-	 * @param  string $alter_action
807
-	 * @return string SQL Statement
808
-	 */
809
-	protected function keysSQL($indices, $alter_table = false, $alter_action = '')
810
-	{
811
-	// check if the passed value is an array of fields.
812
-	// if not, convert it into an array
813
-	if (!$this->isFieldArray($indices))
814
-		$indices[] = $indices;
815
-
816
-	$columns = array();
817
-	foreach ($indices as $index) {
818
-		if(!empty($index['db']) && $index['db'] != $this->dbType)
819
-			continue;
820
-		if (isset($index['source']) && $index['source'] != 'db')
821
-			continue;
822
-
823
-		$type = $index['type'];
824
-		$name = $index['name'];
825
-
826
-		if (is_array($index['fields']))
827
-			$fields = implode(", ", $index['fields']);
828
-		else
829
-			$fields = $index['fields'];
830
-
831
-		switch ($type) {
832
-		case 'unique':
833
-			$columns[] = " UNIQUE $name ($fields)";
834
-			break;
835
-		case 'primary':
836
-			$columns[] = " PRIMARY KEY ($fields)";
837
-			break;
838
-		case 'index':
839
-		case 'foreign':
840
-		case 'clustered':
841
-		case 'alternate_key':
842
-			/**
843
-				* @todo here it is assumed that the primary key of the foreign
844
-				* table will always be named 'id'. It must be noted though
845
-				* that this can easily be fixed by referring to db dictionary
846
-				* to find the correct primary field name
847
-				*/
848
-			if ( $alter_table )
849
-				$columns[] = " INDEX $name ($fields)";
850
-			else
851
-				$columns[] = " KEY $name ($fields)";
852
-			break;
853
-		case 'fulltext':
854
-			if ($this->full_text_indexing_installed())
855
-				$columns[] = " FULLTEXT ($fields)";
856
-			else
857
-				$GLOBALS['log']->debug('MYISAM engine is not available/enabled, full-text indexes will be skipped. Skipping:',$name);
858
-			break;
859
-		}
860
-	}
861
-	$columns = implode(", $alter_action ", $columns);
862
-	if(!empty($alter_action)){
863
-		$columns = $alter_action . ' '. $columns;
864
-	}
865
-	return $columns;
866
-	}
867
-
868
-	/**
869
-	 * @see DBManager::setAutoIncrement()
870
-	 */
871
-	protected function setAutoIncrement($table, $field_name)
872
-	{
873
-		return "auto_increment";
874
-	}
875
-
876
-	/**
877
-	 * Sets the next auto-increment value of a column to a specific value.
878
-	 *
879
-	 * @param  string $table tablename
880
-	 * @param  string $field_name
881
-	 */
882
-	public function setAutoIncrementStart($table, $field_name, $start_value)
883
-	{
884
-		$start_value = (int)$start_value;
885
-		return $this->query( "ALTER TABLE $table AUTO_INCREMENT = $start_value;");
886
-	}
887
-
888
-	/**
889
-	 * Returns the next value for an auto increment
890
-	 *
891
-	 * @param  string $table tablename
892
-	 * @param  string $field_name
893
-	 * @return string
894
-	 */
895
-	public function getAutoIncrement($table, $field_name)
896
-	{
897
-		$result = $this->query("SHOW TABLE STATUS LIKE '$table'");
898
-		$row = $this->fetchByAssoc($result);
899
-		if (!empty($row['Auto_increment']))
900
-			return $row['Auto_increment'];
901
-
902
-		return "";
903
-	}
904
-
905
-	/**
906
-	 * @see DBManager::get_indices()
907
-	 */
908
-	public function get_indices($tablename)
909
-	{
910
-		//find all unique indexes and primary keys.
911
-		$result = $this->query("SHOW INDEX FROM $tablename");
912
-
913
-		$indices = array();
914
-		while (($row=$this->fetchByAssoc($result)) !=null) {
915
-			$index_type='index';
916
-			if ($row['Key_name'] =='PRIMARY') {
917
-				$index_type='primary';
918
-			}
919
-			elseif ( $row['Non_unique'] == '0' ) {
920
-				$index_type='unique';
921
-			}
922
-			$name = strtolower($row['Key_name']);
923
-			$indices[$name]['name']=$name;
924
-			$indices[$name]['type']=$index_type;
925
-			$indices[$name]['fields'][]=strtolower($row['Column_name']);
926
-		}
927
-		return $indices;
928
-	}
929
-
930
-	/**
931
-	 * @see DBManager::add_drop_constraint()
932
-	 */
933
-	public function add_drop_constraint($table, $definition, $drop = false)
934
-	{
935
-		$type         = $definition['type'];
936
-		$fields       = implode(',',$definition['fields']);
937
-		$name         = $definition['name'];
938
-		$sql          = '';
939
-
940
-		switch ($type){
941
-		// generic indices
942
-		case 'index':
943
-		case 'alternate_key':
944
-		case 'clustered':
945
-			if ($drop)
946
-				$sql = "ALTER TABLE {$table} DROP INDEX {$name} ";
947
-			else
948
-				$sql = "ALTER TABLE {$table} ADD INDEX {$name} ({$fields})";
949
-			break;
950
-		// constraints as indices
951
-		case 'unique':
952
-			if ($drop)
953
-				$sql = "ALTER TABLE {$table} DROP INDEX $name";
954
-			else
955
-				$sql = "ALTER TABLE {$table} ADD CONSTRAINT UNIQUE {$name} ({$fields})";
956
-			break;
957
-		case 'primary':
958
-			if ($drop)
959
-				$sql = "ALTER TABLE {$table} DROP PRIMARY KEY";
960
-			else
961
-				$sql = "ALTER TABLE {$table} ADD CONSTRAINT PRIMARY KEY ({$fields})";
962
-			break;
963
-		case 'foreign':
964
-			if ($drop)
965
-				$sql = "ALTER TABLE {$table} DROP FOREIGN KEY ({$fields})";
966
-			else
967
-				$sql = "ALTER TABLE {$table} ADD CONSTRAINT FOREIGN KEY {$name} ({$fields}) REFERENCES {$definition['foreignTable']}({$definition['foreignField']})";
968
-			break;
969
-		}
970
-		return $sql;
971
-	}
972
-
973
-	/**
974
-	 * Runs a query and returns a single row
975
-	 *
976
-	 * @param  string   $sql        SQL Statement to execute
977
-	 * @param  bool     $dieOnError True if we want to call die if the query returns errors
978
-	 * @param  string   $msg        Message to log if error occurs
979
-	 * @param  bool     $suppress   Message to log if error occurs
980
-	 * @return array    single row from the query
981
-	 */
982
-	public function fetchOne($sql, $dieOnError = false, $msg = '', $suppress = false)
983
-	{
984
-		if(stripos($sql, ' LIMIT ') === false) {
985
-			// little optimization to just fetch one row
986
-			$sql .= " LIMIT 0,1";
987
-		}
988
-		return parent::fetchOne($sql, $dieOnError, $msg, $suppress);
989
-	}
990
-
991
-	/**
992
-	 * @see DBManager::full_text_indexing_installed()
993
-	 */
994
-	public function full_text_indexing_installed($dbname = null)
995
-	{
996
-		return $this->isEngineEnabled('MyISAM');
997
-	}
998
-
999
-	/**
1000
-	 * @see DBManager::massageFieldDef()
1001
-	 */
1002
-	public function massageFieldDef(&$fieldDef, $tablename)
1003
-	{
1004
-		parent::massageFieldDef($fieldDef,$tablename);
1005
-
1006
-		if ( isset($fieldDef['default']) &&
1007
-			($fieldDef['dbType'] == 'text'
1008
-				|| $fieldDef['dbType'] == 'blob'
1009
-				|| $fieldDef['dbType'] == 'longtext'
1010
-				|| $fieldDef['dbType'] == 'longblob' ))
1011
-			unset($fieldDef['default']);
1012
-		if ($fieldDef['dbType'] == 'uint')
1013
-			$fieldDef['len'] = '10';
1014
-		if ($fieldDef['dbType'] == 'ulong')
1015
-			$fieldDef['len'] = '20';
1016
-		if ($fieldDef['dbType'] == 'bool')
1017
-			$fieldDef['type'] = 'tinyint';
1018
-		if ($fieldDef['dbType'] == 'bool' && empty($fieldDef['default']) )
1019
-			$fieldDef['default'] = '0';
1020
-		if (($fieldDef['dbType'] == 'varchar' || $fieldDef['dbType'] == 'enum') && empty($fieldDef['len']) )
1021
-			$fieldDef['len'] = '255';
1022
-		if ($fieldDef['dbType'] == 'uint')
1023
-			$fieldDef['len'] = '10';
1024
-		if ($fieldDef['dbType'] == 'int' && empty($fieldDef['len']) )
1025
-			$fieldDef['len'] = '11';
1026
-
1027
-		if($fieldDef['dbType'] == 'decimal') {
1028
-			if(isset($fieldDef['len'])) {
1029
-				if(strstr($fieldDef['len'], ",") === false) {
1030
-					$fieldDef['len'] .= ",0";
1031
-				}
1032
-			} else {
1033
-				$fieldDef['len']  = '10,0';
1034
-			}
1035
-		}
1036
-	}
1037
-
1038
-	/**
1039
-	 * Generates SQL for dropping a table.
1040
-	 *
1041
-	 * @param  string $name table name
1042
-	 * @return string SQL statement
1043
-	 */
1044
-	public function dropTableNameSQL($name)
1045
-	{
1046
-		return "DROP TABLE IF EXISTS ".$name;
1047
-	}
1048
-
1049
-	public function dropIndexes($tablename, $indexes, $execute = true)
1050
-	{
1051
-		$sql = array();
1052
-		foreach ($indexes as $index) {
1053
-			$name =$index['name'];
1054
-			if($execute) {
1055
-			unset(self::$index_descriptions[$tablename][$name]);
1056
-			}
1057
-			if ($index['type'] == 'primary') {
1058
-				$sql[] = 'DROP PRIMARY KEY';
1059
-			} else {
1060
-				$sql[] = "DROP INDEX $name";
1061
-			}
1062
-		}
1063
-		if (!empty($sql)) {
766
+                $ref['default'] = '';
767
+
768
+        if ( $return_as_array )
769
+            return $ref;
770
+        else
771
+            return "{$ref['name']} {$ref['colType']} {$ref['default']} {$ref['required']} {$ref['auto_increment']}";
772
+    }
773
+
774
+    /**
775
+     * @see DBManager::changeColumnSQL()
776
+     */
777
+    protected function changeColumnSQL($tablename, $fieldDefs, $action, $ignoreRequired = false)
778
+    {
779
+        $columns = array();
780
+        if ($this->isFieldArray($fieldDefs)){
781
+            foreach ($fieldDefs as $def){
782
+                if ($action == 'drop')
783
+                    $columns[] = $def['name'];
784
+                else
785
+                    $columns[] = $this->oneColumnSQLRep($def, $ignoreRequired);
786
+            }
787
+        } else {
788
+            if ($action == 'drop')
789
+                $columns[] = $fieldDefs['name'];
790
+        else
791
+            $columns[] = $this->oneColumnSQLRep($fieldDefs);
792
+        }
793
+
794
+        return "ALTER TABLE $tablename $action COLUMN ".implode(",$action column ", $columns);
795
+    }
796
+
797
+    /**
798
+     * Generates SQL for key specification inside CREATE TABLE statement
799
+     *
800
+     * The passes array is an array of field definitions or a field definition
801
+     * itself. The keys generated will be either primary, foreign, unique, index
802
+     * or none at all depending on the setting of the "key" parameter of a field definition
803
+     *
804
+     * @param  array  $indices
805
+     * @param  bool   $alter_table
806
+     * @param  string $alter_action
807
+     * @return string SQL Statement
808
+     */
809
+    protected function keysSQL($indices, $alter_table = false, $alter_action = '')
810
+    {
811
+    // check if the passed value is an array of fields.
812
+    // if not, convert it into an array
813
+    if (!$this->isFieldArray($indices))
814
+        $indices[] = $indices;
815
+
816
+    $columns = array();
817
+    foreach ($indices as $index) {
818
+        if(!empty($index['db']) && $index['db'] != $this->dbType)
819
+            continue;
820
+        if (isset($index['source']) && $index['source'] != 'db')
821
+            continue;
822
+
823
+        $type = $index['type'];
824
+        $name = $index['name'];
825
+
826
+        if (is_array($index['fields']))
827
+            $fields = implode(", ", $index['fields']);
828
+        else
829
+            $fields = $index['fields'];
830
+
831
+        switch ($type) {
832
+        case 'unique':
833
+            $columns[] = " UNIQUE $name ($fields)";
834
+            break;
835
+        case 'primary':
836
+            $columns[] = " PRIMARY KEY ($fields)";
837
+            break;
838
+        case 'index':
839
+        case 'foreign':
840
+        case 'clustered':
841
+        case 'alternate_key':
842
+            /**
843
+             * @todo here it is assumed that the primary key of the foreign
844
+             * table will always be named 'id'. It must be noted though
845
+             * that this can easily be fixed by referring to db dictionary
846
+             * to find the correct primary field name
847
+             */
848
+            if ( $alter_table )
849
+                $columns[] = " INDEX $name ($fields)";
850
+            else
851
+                $columns[] = " KEY $name ($fields)";
852
+            break;
853
+        case 'fulltext':
854
+            if ($this->full_text_indexing_installed())
855
+                $columns[] = " FULLTEXT ($fields)";
856
+            else
857
+                $GLOBALS['log']->debug('MYISAM engine is not available/enabled, full-text indexes will be skipped. Skipping:',$name);
858
+            break;
859
+        }
860
+    }
861
+    $columns = implode(", $alter_action ", $columns);
862
+    if(!empty($alter_action)){
863
+        $columns = $alter_action . ' '. $columns;
864
+    }
865
+    return $columns;
866
+    }
867
+
868
+    /**
869
+     * @see DBManager::setAutoIncrement()
870
+     */
871
+    protected function setAutoIncrement($table, $field_name)
872
+    {
873
+        return "auto_increment";
874
+    }
875
+
876
+    /**
877
+     * Sets the next auto-increment value of a column to a specific value.
878
+     *
879
+     * @param  string $table tablename
880
+     * @param  string $field_name
881
+     */
882
+    public function setAutoIncrementStart($table, $field_name, $start_value)
883
+    {
884
+        $start_value = (int)$start_value;
885
+        return $this->query( "ALTER TABLE $table AUTO_INCREMENT = $start_value;");
886
+    }
887
+
888
+    /**
889
+     * Returns the next value for an auto increment
890
+     *
891
+     * @param  string $table tablename
892
+     * @param  string $field_name
893
+     * @return string
894
+     */
895
+    public function getAutoIncrement($table, $field_name)
896
+    {
897
+        $result = $this->query("SHOW TABLE STATUS LIKE '$table'");
898
+        $row = $this->fetchByAssoc($result);
899
+        if (!empty($row['Auto_increment']))
900
+            return $row['Auto_increment'];
901
+
902
+        return "";
903
+    }
904
+
905
+    /**
906
+     * @see DBManager::get_indices()
907
+     */
908
+    public function get_indices($tablename)
909
+    {
910
+        //find all unique indexes and primary keys.
911
+        $result = $this->query("SHOW INDEX FROM $tablename");
912
+
913
+        $indices = array();
914
+        while (($row=$this->fetchByAssoc($result)) !=null) {
915
+            $index_type='index';
916
+            if ($row['Key_name'] =='PRIMARY') {
917
+                $index_type='primary';
918
+            }
919
+            elseif ( $row['Non_unique'] == '0' ) {
920
+                $index_type='unique';
921
+            }
922
+            $name = strtolower($row['Key_name']);
923
+            $indices[$name]['name']=$name;
924
+            $indices[$name]['type']=$index_type;
925
+            $indices[$name]['fields'][]=strtolower($row['Column_name']);
926
+        }
927
+        return $indices;
928
+    }
929
+
930
+    /**
931
+     * @see DBManager::add_drop_constraint()
932
+     */
933
+    public function add_drop_constraint($table, $definition, $drop = false)
934
+    {
935
+        $type         = $definition['type'];
936
+        $fields       = implode(',',$definition['fields']);
937
+        $name         = $definition['name'];
938
+        $sql          = '';
939
+
940
+        switch ($type){
941
+        // generic indices
942
+        case 'index':
943
+        case 'alternate_key':
944
+        case 'clustered':
945
+            if ($drop)
946
+                $sql = "ALTER TABLE {$table} DROP INDEX {$name} ";
947
+            else
948
+                $sql = "ALTER TABLE {$table} ADD INDEX {$name} ({$fields})";
949
+            break;
950
+        // constraints as indices
951
+        case 'unique':
952
+            if ($drop)
953
+                $sql = "ALTER TABLE {$table} DROP INDEX $name";
954
+            else
955
+                $sql = "ALTER TABLE {$table} ADD CONSTRAINT UNIQUE {$name} ({$fields})";
956
+            break;
957
+        case 'primary':
958
+            if ($drop)
959
+                $sql = "ALTER TABLE {$table} DROP PRIMARY KEY";
960
+            else
961
+                $sql = "ALTER TABLE {$table} ADD CONSTRAINT PRIMARY KEY ({$fields})";
962
+            break;
963
+        case 'foreign':
964
+            if ($drop)
965
+                $sql = "ALTER TABLE {$table} DROP FOREIGN KEY ({$fields})";
966
+            else
967
+                $sql = "ALTER TABLE {$table} ADD CONSTRAINT FOREIGN KEY {$name} ({$fields}) REFERENCES {$definition['foreignTable']}({$definition['foreignField']})";
968
+            break;
969
+        }
970
+        return $sql;
971
+    }
972
+
973
+    /**
974
+     * Runs a query and returns a single row
975
+     *
976
+     * @param  string   $sql        SQL Statement to execute
977
+     * @param  bool     $dieOnError True if we want to call die if the query returns errors
978
+     * @param  string   $msg        Message to log if error occurs
979
+     * @param  bool     $suppress   Message to log if error occurs
980
+     * @return array    single row from the query
981
+     */
982
+    public function fetchOne($sql, $dieOnError = false, $msg = '', $suppress = false)
983
+    {
984
+        if(stripos($sql, ' LIMIT ') === false) {
985
+            // little optimization to just fetch one row
986
+            $sql .= " LIMIT 0,1";
987
+        }
988
+        return parent::fetchOne($sql, $dieOnError, $msg, $suppress);
989
+    }
990
+
991
+    /**
992
+     * @see DBManager::full_text_indexing_installed()
993
+     */
994
+    public function full_text_indexing_installed($dbname = null)
995
+    {
996
+        return $this->isEngineEnabled('MyISAM');
997
+    }
998
+
999
+    /**
1000
+     * @see DBManager::massageFieldDef()
1001
+     */
1002
+    public function massageFieldDef(&$fieldDef, $tablename)
1003
+    {
1004
+        parent::massageFieldDef($fieldDef,$tablename);
1005
+
1006
+        if ( isset($fieldDef['default']) &&
1007
+            ($fieldDef['dbType'] == 'text'
1008
+                || $fieldDef['dbType'] == 'blob'
1009
+                || $fieldDef['dbType'] == 'longtext'
1010
+                || $fieldDef['dbType'] == 'longblob' ))
1011
+            unset($fieldDef['default']);
1012
+        if ($fieldDef['dbType'] == 'uint')
1013
+            $fieldDef['len'] = '10';
1014
+        if ($fieldDef['dbType'] == 'ulong')
1015
+            $fieldDef['len'] = '20';
1016
+        if ($fieldDef['dbType'] == 'bool')
1017
+            $fieldDef['type'] = 'tinyint';
1018
+        if ($fieldDef['dbType'] == 'bool' && empty($fieldDef['default']) )
1019
+            $fieldDef['default'] = '0';
1020
+        if (($fieldDef['dbType'] == 'varchar' || $fieldDef['dbType'] == 'enum') && empty($fieldDef['len']) )
1021
+            $fieldDef['len'] = '255';
1022
+        if ($fieldDef['dbType'] == 'uint')
1023
+            $fieldDef['len'] = '10';
1024
+        if ($fieldDef['dbType'] == 'int' && empty($fieldDef['len']) )
1025
+            $fieldDef['len'] = '11';
1026
+
1027
+        if($fieldDef['dbType'] == 'decimal') {
1028
+            if(isset($fieldDef['len'])) {
1029
+                if(strstr($fieldDef['len'], ",") === false) {
1030
+                    $fieldDef['len'] .= ",0";
1031
+                }
1032
+            } else {
1033
+                $fieldDef['len']  = '10,0';
1034
+            }
1035
+        }
1036
+    }
1037
+
1038
+    /**
1039
+     * Generates SQL for dropping a table.
1040
+     *
1041
+     * @param  string $name table name
1042
+     * @return string SQL statement
1043
+     */
1044
+    public function dropTableNameSQL($name)
1045
+    {
1046
+        return "DROP TABLE IF EXISTS ".$name;
1047
+    }
1048
+
1049
+    public function dropIndexes($tablename, $indexes, $execute = true)
1050
+    {
1051
+        $sql = array();
1052
+        foreach ($indexes as $index) {
1053
+            $name =$index['name'];
1054
+            if($execute) {
1055
+            unset(self::$index_descriptions[$tablename][$name]);
1056
+            }
1057
+            if ($index['type'] == 'primary') {
1058
+                $sql[] = 'DROP PRIMARY KEY';
1059
+            } else {
1060
+                $sql[] = "DROP INDEX $name";
1061
+            }
1062
+        }
1063
+        if (!empty($sql)) {
1064 1064
             $sql = "ALTER TABLE $tablename " . join(",", $sql) . ";";
1065
-			if($execute)
1066
-				$this->query($sql);
1067
-		} else {
1068
-			$sql = '';
1069
-		}
1070
-		return $sql;
1071
-	}
1072
-
1073
-	/**
1074
-	 * List of available collation settings
1075
-	 * @return string
1076
-	 */
1077
-	public function getDefaultCollation()
1078
-	{
1079
-		return "utf8_general_ci";
1080
-	}
1081
-
1082
-	/**
1083
-	 * List of available collation settings
1084
-	 * @return array
1085
-	 */
1086
-	public function getCollationList()
1087
-	{
1088
-		$q = "SHOW COLLATION LIKE 'utf8%'";
1089
-		$r = $this->query($q);
1090
-		$res = array();
1091
-		while($a = $this->fetchByAssoc($r)) {
1092
-			$res[] = $a['Collation'];
1093
-		}
1094
-		return $res;
1095
-	}
1096
-
1097
-	/**
1098
-	 * (non-PHPdoc)
1099
-	 * @see DBManager::renameColumnSQL()
1100
-	 */
1101
-	public function renameColumnSQL($tablename, $column, $newname)
1102
-	{
1103
-		$field = $this->describeField($column, $tablename);
1104
-		$field['name'] = $newname;
1105
-		return "ALTER TABLE $tablename CHANGE COLUMN $column ".$this->oneColumnSQLRep($field);
1106
-	}
1107
-
1108
-	public function emptyValue($type)
1109
-	{
1110
-		$ctype = $this->getColumnType($type);
1111
-		if($ctype == "datetime") {
1112
-			return 'NULL';
1113
-		}
1114
-		if($ctype == "date") {
1115
-			return 'NULL';
1116
-		}
1117
-		if($ctype == "time") {
1118
-			return 'NULL';
1119
-		}
1120
-		return parent::emptyValue($type);
1121
-	}
1122
-
1123
-	/**
1124
-	 * (non-PHPdoc)
1125
-	 * @see DBManager::lastDbError()
1126
-	 */
1127
-	public function lastDbError()
1128
-	{
1129
-		if($this->database) {
1130
-		    if(mysql_errno($this->database)) {
1131
-			    return "MySQL error ".mysql_errno($this->database).": ".mysql_error($this->database);
1132
-		    }
1133
-		} else {
1134
-			$err =  mysql_error();
1135
-			if($err) {
1136
-			    return $err;
1137
-			}
1138
-		}
1065
+            if($execute)
1066
+                $this->query($sql);
1067
+        } else {
1068
+            $sql = '';
1069
+        }
1070
+        return $sql;
1071
+    }
1072
+
1073
+    /**
1074
+     * List of available collation settings
1075
+     * @return string
1076
+     */
1077
+    public function getDefaultCollation()
1078
+    {
1079
+        return "utf8_general_ci";
1080
+    }
1081
+
1082
+    /**
1083
+     * List of available collation settings
1084
+     * @return array
1085
+     */
1086
+    public function getCollationList()
1087
+    {
1088
+        $q = "SHOW COLLATION LIKE 'utf8%'";
1089
+        $r = $this->query($q);
1090
+        $res = array();
1091
+        while($a = $this->fetchByAssoc($r)) {
1092
+            $res[] = $a['Collation'];
1093
+        }
1094
+        return $res;
1095
+    }
1096
+
1097
+    /**
1098
+     * (non-PHPdoc)
1099
+     * @see DBManager::renameColumnSQL()
1100
+     */
1101
+    public function renameColumnSQL($tablename, $column, $newname)
1102
+    {
1103
+        $field = $this->describeField($column, $tablename);
1104
+        $field['name'] = $newname;
1105
+        return "ALTER TABLE $tablename CHANGE COLUMN $column ".$this->oneColumnSQLRep($field);
1106
+    }
1107
+
1108
+    public function emptyValue($type)
1109
+    {
1110
+        $ctype = $this->getColumnType($type);
1111
+        if($ctype == "datetime") {
1112
+            return 'NULL';
1113
+        }
1114
+        if($ctype == "date") {
1115
+            return 'NULL';
1116
+        }
1117
+        if($ctype == "time") {
1118
+            return 'NULL';
1119
+        }
1120
+        return parent::emptyValue($type);
1121
+    }
1122
+
1123
+    /**
1124
+     * (non-PHPdoc)
1125
+     * @see DBManager::lastDbError()
1126
+     */
1127
+    public function lastDbError()
1128
+    {
1129
+        if($this->database) {
1130
+            if(mysql_errno($this->database)) {
1131
+                return "MySQL error ".mysql_errno($this->database).": ".mysql_error($this->database);
1132
+            }
1133
+        } else {
1134
+            $err =  mysql_error();
1135
+            if($err) {
1136
+                return $err;
1137
+            }
1138
+        }
1139 1139
         return false;
1140 1140
     }
1141 1141
 
1142
-	/**
1143
-	 * Quote MySQL search term
1144
-	 * @param unknown_type $term
1145
-	 */
1146
-	protected function quoteTerm($term)
1147
-	{
1148
-		if(strpos($term, ' ') !== false) {
1149
-			return '"'.$term.'"';
1150
-		}
1151
-		return $term;
1152
-	}
1153
-
1154
-	/**
1155
-	 * Generate fulltext query from set of terms
1156
-	 * @param string $fields Field to search against
1157
-	 * @param array $terms Search terms that may be or not be in the result
1158
-	 * @param array $must_terms Search terms that have to be in the result
1159
-	 * @param array $exclude_terms Search terms that have to be not in the result
1160
-	 */
1161
-	public function getFulltextQuery($field, $terms, $must_terms = array(), $exclude_terms = array())
1162
-	{
1163
-		$condition = array();
1164
-		foreach($terms as $term) {
1165
-			$condition[] = $this->quoteTerm($term);
1166
-		}
1167
-		foreach($must_terms as $term) {
1168
-			$condition[] = "+".$this->quoteTerm($term);
1169
-		}
1170
-		foreach($exclude_terms as $term) {
1171
-			$condition[] = "-".$this->quoteTerm($term);
1172
-		}
1173
-		$condition = $this->quoted(join(" ",$condition));
1174
-		return "MATCH($field) AGAINST($condition IN BOOLEAN MODE)";
1175
-	}
1176
-
1177
-	/**
1178
-	 * Get list of all defined charsets
1179
-	 * @return array
1180
-	 */
1181
-	protected function getCharsetInfo()
1182
-	{
1183
-		$charsets = array();
1184
-		$res = $this->query("show variables like 'character\\_set\\_%'");
1185
-		while($row = $this->fetchByAssoc($res)) {
1186
-			$charsets[$row['Variable_name']] = $row['Value'];
1187
-		}
1188
-		return $charsets;
1189
-	}
1190
-
1191
-	public function getDbInfo()
1192
-	{
1193
-		$charsets = $this->getCharsetInfo();
1194
-		$charset_str = array();
1195
-		foreach($charsets as $name => $value) {
1196
-			$charset_str[] = "$name = $value";
1197
-		}
1198
-		return array(
1199
-			"MySQL Version" => @mysql_get_client_info(),
1200
-			"MySQL Host Info" => @mysql_get_host_info($this->database),
1201
-			"MySQL Server Info" => @mysql_get_server_info($this->database),
1202
-			"MySQL Client Encoding" =>  @mysql_client_encoding($this->database),
1203
-			"MySQL Character Set Settings" => join(", ", $charset_str),
1204
-		);
1205
-	}
1206
-
1207
-	public function validateQuery($query)
1208
-	{
1209
-		$res = $this->query("EXPLAIN $query");
1210
-		return !empty($res);
1211
-	}
1212
-
1213
-	protected function makeTempTableCopy($table)
1214
-	{
1215
-		$this->log->debug("creating temp table for [$table]...");
1216
-		$result = $this->query("SHOW CREATE TABLE {$table}");
1217
-		if(empty($result)) {
1218
-			return false;
1219
-		}
1220
-		$row = $this->fetchByAssoc($result);
1221
-		if(empty($row) || empty($row['Create Table'])) {
1222
-		    return false;
1223
-		}
1224
-		$create = $row['Create Table'];
1225
-		// rewrite DDL with _temp name
1226
-		$tempTableQuery = str_replace("CREATE TABLE `{$table}`", "CREATE TABLE `{$table}__uw_temp`", $create);
1227
-		$r2 = $this->query($tempTableQuery);
1228
-		if(empty($r2)) {
1229
-			return false;
1230
-		}
1231
-
1232
-		// get sample data into the temp table to test for data/constraint conflicts
1233
-		$this->log->debug('inserting temp dataset...');
1234
-		$q3 = "INSERT INTO `{$table}__uw_temp` SELECT * FROM `{$table}` LIMIT 10";
1235
-		$this->query($q3, false, "Preflight Failed for: {$q3}");
1236
-		return true;
1237
-	}
1238
-
1239
-	/**
1240
-	 * Tests an ALTER TABLE query
1241
-	 * @param string table The table name to get DDL
1242
-	 * @param string query The query to test.
1243
-	 * @return string Non-empty if error found
1244
-	 */
1245
-	protected function verifyAlterTable($table, $query)
1246
-	{
1247
-		$this->log->debug("verifying ALTER TABLE");
1248
-		// Skipping ALTER TABLE [table] DROP PRIMARY KEY because primary keys are not being copied
1249
-		// over to the temp tables
1250
-		if(strpos(strtoupper($query), 'DROP PRIMARY KEY') !== false) {
1251
-			$this->log->debug("Skipping DROP PRIMARY KEY");
1252
-			return '';
1253
-		}
1254
-		if(!$this->makeTempTableCopy($table)) {
1255
-			return 'Could not create temp table copy';
1256
-		}
1257
-
1258
-		// test the query on the test table
1259
-		$this->log->debug('testing query: ['.$query.']');
1260
-		$tempTableTestQuery = str_replace("ALTER TABLE `{$table}`", "ALTER TABLE `{$table}__uw_temp`", $query);
1261
-		if (strpos($tempTableTestQuery, 'idx') === false) {
1262
-			if(strpos($tempTableTestQuery, '__uw_temp') === false) {
1263
-				return 'Could not use a temp table to test query!';
1264
-			}
1265
-
1266
-			$this->log->debug('testing query on temp table: ['.$tempTableTestQuery.']');
1267
-			$this->query($tempTableTestQuery, false, "Preflight Failed for: {$query}");
1268
-		} else {
1269
-			// test insertion of an index on a table
1270
-			$tempTableTestQuery_idx = str_replace("ADD INDEX `idx_", "ADD INDEX `temp_idx_", $tempTableTestQuery);
1271
-			$this->log->debug('testing query on temp table: ['.$tempTableTestQuery_idx.']');
1272
-			$this->query($tempTableTestQuery_idx, false, "Preflight Failed for: {$query}");
1273
-		}
1274
-		$mysqlError = $this->getL();
1275
-		if(!empty($mysqlError)) {
1276
-			return $mysqlError;
1277
-		}
1278
-		$this->dropTableName("{$table}__uw_temp");
1279
-
1280
-		return '';
1281
-	}
1282
-
1283
-	protected function verifyGenericReplaceQuery($querytype, $table, $query)
1284
-	{
1285
-		$this->log->debug("verifying $querytype statement");
1286
-
1287
-		if(!$this->makeTempTableCopy($table)) {
1288
-			return 'Could not create temp table copy';
1289
-		}
1290
-		// test the query on the test table
1291
-		$this->log->debug('testing query: ['.$query.']');
1292
-		$tempTableTestQuery = str_replace("$querytype `{$table}`", "$querytype `{$table}__uw_temp`", $query);
1293
-		if(strpos($tempTableTestQuery, '__uw_temp') === false) {
1294
-			return 'Could not use a temp table to test query!';
1295
-		}
1296
-
1297
-		$this->query($tempTableTestQuery, false, "Preflight Failed for: {$query}");
1298
-		$error = $this->lastError(); // empty on no-errors
1299
-		$this->dropTableName("{$table}__uw_temp"); // just in case
1300
-		return $error;
1301
-	}
1302
-
1303
-	/**
1304
-	 * Tests a DROP TABLE query
1305
-	 * @param string table The table name to get DDL
1306
-	 * @param string query The query to test.
1307
-	 * @return string Non-empty if error found
1308
-	 */
1309
-	public function verifyDropTable($table, $query)
1310
-	{
1311
-		return $this->verifyGenericReplaceQuery("DROP TABLE", $table, $query);
1312
-	}
1313
-
1314
-	/**
1315
-	 * Tests an INSERT INTO query
1316
-	 * @param string table The table name to get DDL
1317
-	 * @param string query The query to test.
1318
-	 * @return string Non-empty if error found
1319
-	 */
1320
-	public function verifyInsertInto($table, $query)
1321
-	{
1322
-		return $this->verifyGenericReplaceQuery("INSERT INTO", $table, $query);
1323
-	}
1324
-
1325
-	/**
1326
-	 * Tests an UPDATE query
1327
-	 * @param string table The table name to get DDL
1328
-	 * @param string query The query to test.
1329
-	 * @return string Non-empty if error found
1330
-	 */
1331
-	public function verifyUpdate($table, $query)
1332
-	{
1333
-		return $this->verifyGenericReplaceQuery("UPDATE", $table, $query);
1334
-	}
1335
-
1336
-	/**
1337
-	 * Tests an DELETE FROM query
1338
-	 * @param string table The table name to get DDL
1339
-	 * @param string query The query to test.
1340
-	 * @return string Non-empty if error found
1341
-	 */
1342
-	public function verifyDeleteFrom($table, $query)
1343
-	{
1344
-		return $this->verifyGenericReplaceQuery("DELETE FROM", $table, $query);
1345
-	}
1346
-
1347
-	/**
1348
-	 * Check if certain database exists
1349
-	 * @param string $dbname
1350
-	 */
1351
-	public function dbExists($dbname)
1352
-	{
1353
-		$db = $this->getOne("SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = ".$this->quoted($dbname));
1354
-		return !empty($db);
1355
-	}
1356
-
1357
-	/**
1358
-	 * Select database
1359
-	 * @param string $dbname
1360
-	 */
1361
-	protected function selectDb($dbname)
1362
-	{
1363
-		return mysql_select_db($dbname);
1364
-	}
1365
-
1366
-	/**
1367
-	 * Check if certain DB user exists
1368
-	 * @param string $username
1369
-	 */
1370
-	public function userExists($username)
1371
-	{
1372
-		$db = $this->getOne("SELECT DATABASE()");
1373
-		if(!$this->selectDb("mysql")) {
1374
-			return false;
1375
-		}
1376
-		$user = $this->getOne("select count(*) from user where user = ".$this->quoted($username));
1377
-		if(!$this->selectDb($db)) {
1378
-			$this->checkError("Cannot select database $db", true);
1379
-		}
1380
-		return !empty($user);
1381
-	}
1382
-
1383
-	/**
1384
-	 * Create DB user
1385
-	 * @param string $database_name
1386
-	 * @param string $host_name
1387
-	 * @param string $user
1388
-	 * @param string $password
1389
-	 */
1390
-	public function createDbUser($database_name, $host_name, $user, $password)
1391
-	{
1392
-		$qpassword = $this->quote($password);
1393
-		$this->query("GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, INDEX
1142
+    /**
1143
+     * Quote MySQL search term
1144
+     * @param unknown_type $term
1145
+     */
1146
+    protected function quoteTerm($term)
1147
+    {
1148
+        if(strpos($term, ' ') !== false) {
1149
+            return '"'.$term.'"';
1150
+        }
1151
+        return $term;
1152
+    }
1153
+
1154
+    /**
1155
+     * Generate fulltext query from set of terms
1156
+     * @param string $fields Field to search against
1157
+     * @param array $terms Search terms that may be or not be in the result
1158
+     * @param array $must_terms Search terms that have to be in the result
1159
+     * @param array $exclude_terms Search terms that have to be not in the result
1160
+     */
1161
+    public function getFulltextQuery($field, $terms, $must_terms = array(), $exclude_terms = array())
1162
+    {
1163
+        $condition = array();
1164
+        foreach($terms as $term) {
1165
+            $condition[] = $this->quoteTerm($term);
1166
+        }
1167
+        foreach($must_terms as $term) {
1168
+            $condition[] = "+".$this->quoteTerm($term);
1169
+        }
1170
+        foreach($exclude_terms as $term) {
1171
+            $condition[] = "-".$this->quoteTerm($term);
1172
+        }
1173
+        $condition = $this->quoted(join(" ",$condition));
1174
+        return "MATCH($field) AGAINST($condition IN BOOLEAN MODE)";
1175
+    }
1176
+
1177
+    /**
1178
+     * Get list of all defined charsets
1179
+     * @return array
1180
+     */
1181
+    protected function getCharsetInfo()
1182
+    {
1183
+        $charsets = array();
1184
+        $res = $this->query("show variables like 'character\\_set\\_%'");
1185
+        while($row = $this->fetchByAssoc($res)) {
1186
+            $charsets[$row['Variable_name']] = $row['Value'];
1187
+        }
1188
+        return $charsets;
1189
+    }
1190
+
1191
+    public function getDbInfo()
1192
+    {
1193
+        $charsets = $this->getCharsetInfo();
1194
+        $charset_str = array();
1195
+        foreach($charsets as $name => $value) {
1196
+            $charset_str[] = "$name = $value";
1197
+        }
1198
+        return array(
1199
+            "MySQL Version" => @mysql_get_client_info(),
1200
+            "MySQL Host Info" => @mysql_get_host_info($this->database),
1201
+            "MySQL Server Info" => @mysql_get_server_info($this->database),
1202
+            "MySQL Client Encoding" =>  @mysql_client_encoding($this->database),
1203
+            "MySQL Character Set Settings" => join(", ", $charset_str),
1204
+        );
1205
+    }
1206
+
1207
+    public function validateQuery($query)
1208
+    {
1209
+        $res = $this->query("EXPLAIN $query");
1210
+        return !empty($res);
1211
+    }
1212
+
1213
+    protected function makeTempTableCopy($table)
1214
+    {
1215
+        $this->log->debug("creating temp table for [$table]...");
1216
+        $result = $this->query("SHOW CREATE TABLE {$table}");
1217
+        if(empty($result)) {
1218
+            return false;
1219
+        }
1220
+        $row = $this->fetchByAssoc($result);
1221
+        if(empty($row) || empty($row['Create Table'])) {
1222
+            return false;
1223
+        }
1224
+        $create = $row['Create Table'];
1225
+        // rewrite DDL with _temp name
1226
+        $tempTableQuery = str_replace("CREATE TABLE `{$table}`", "CREATE TABLE `{$table}__uw_temp`", $create);
1227
+        $r2 = $this->query($tempTableQuery);
1228
+        if(empty($r2)) {
1229
+            return false;
1230
+        }
1231
+
1232
+        // get sample data into the temp table to test for data/constraint conflicts
1233
+        $this->log->debug('inserting temp dataset...');
1234
+        $q3 = "INSERT INTO `{$table}__uw_temp` SELECT * FROM `{$table}` LIMIT 10";
1235
+        $this->query($q3, false, "Preflight Failed for: {$q3}");
1236
+        return true;
1237
+    }
1238
+
1239
+    /**
1240
+     * Tests an ALTER TABLE query
1241
+     * @param string table The table name to get DDL
1242
+     * @param string query The query to test.
1243
+     * @return string Non-empty if error found
1244
+     */
1245
+    protected function verifyAlterTable($table, $query)
1246
+    {
1247
+        $this->log->debug("verifying ALTER TABLE");
1248
+        // Skipping ALTER TABLE [table] DROP PRIMARY KEY because primary keys are not being copied
1249
+        // over to the temp tables
1250
+        if(strpos(strtoupper($query), 'DROP PRIMARY KEY') !== false) {
1251
+            $this->log->debug("Skipping DROP PRIMARY KEY");
1252
+            return '';
1253
+        }
1254
+        if(!$this->makeTempTableCopy($table)) {
1255
+            return 'Could not create temp table copy';
1256
+        }
1257
+
1258
+        // test the query on the test table
1259
+        $this->log->debug('testing query: ['.$query.']');
1260
+        $tempTableTestQuery = str_replace("ALTER TABLE `{$table}`", "ALTER TABLE `{$table}__uw_temp`", $query);
1261
+        if (strpos($tempTableTestQuery, 'idx') === false) {
1262
+            if(strpos($tempTableTestQuery, '__uw_temp') === false) {
1263
+                return 'Could not use a temp table to test query!';
1264
+            }
1265
+
1266
+            $this->log->debug('testing query on temp table: ['.$tempTableTestQuery.']');
1267
+            $this->query($tempTableTestQuery, false, "Preflight Failed for: {$query}");
1268
+        } else {
1269
+            // test insertion of an index on a table
1270
+            $tempTableTestQuery_idx = str_replace("ADD INDEX `idx_", "ADD INDEX `temp_idx_", $tempTableTestQuery);
1271
+            $this->log->debug('testing query on temp table: ['.$tempTableTestQuery_idx.']');
1272
+            $this->query($tempTableTestQuery_idx, false, "Preflight Failed for: {$query}");
1273
+        }
1274
+        $mysqlError = $this->getL();
1275
+        if(!empty($mysqlError)) {
1276
+            return $mysqlError;
1277
+        }
1278
+        $this->dropTableName("{$table}__uw_temp");
1279
+
1280
+        return '';
1281
+    }
1282
+
1283
+    protected function verifyGenericReplaceQuery($querytype, $table, $query)
1284
+    {
1285
+        $this->log->debug("verifying $querytype statement");
1286
+
1287
+        if(!$this->makeTempTableCopy($table)) {
1288
+            return 'Could not create temp table copy';
1289
+        }
1290
+        // test the query on the test table
1291
+        $this->log->debug('testing query: ['.$query.']');
1292
+        $tempTableTestQuery = str_replace("$querytype `{$table}`", "$querytype `{$table}__uw_temp`", $query);
1293
+        if(strpos($tempTableTestQuery, '__uw_temp') === false) {
1294
+            return 'Could not use a temp table to test query!';
1295
+        }
1296
+
1297
+        $this->query($tempTableTestQuery, false, "Preflight Failed for: {$query}");
1298
+        $error = $this->lastError(); // empty on no-errors
1299
+        $this->dropTableName("{$table}__uw_temp"); // just in case
1300
+        return $error;
1301
+    }
1302
+
1303
+    /**
1304
+     * Tests a DROP TABLE query
1305
+     * @param string table The table name to get DDL
1306
+     * @param string query The query to test.
1307
+     * @return string Non-empty if error found
1308
+     */
1309
+    public function verifyDropTable($table, $query)
1310
+    {
1311
+        return $this->verifyGenericReplaceQuery("DROP TABLE", $table, $query);
1312
+    }
1313
+
1314
+    /**
1315
+     * Tests an INSERT INTO query
1316
+     * @param string table The table name to get DDL
1317
+     * @param string query The query to test.
1318
+     * @return string Non-empty if error found
1319
+     */
1320
+    public function verifyInsertInto($table, $query)
1321
+    {
1322
+        return $this->verifyGenericReplaceQuery("INSERT INTO", $table, $query);
1323
+    }
1324
+
1325
+    /**
1326
+     * Tests an UPDATE query
1327
+     * @param string table The table name to get DDL
1328
+     * @param string query The query to test.
1329
+     * @return string Non-empty if error found
1330
+     */
1331
+    public function verifyUpdate($table, $query)
1332
+    {
1333
+        return $this->verifyGenericReplaceQuery("UPDATE", $table, $query);
1334
+    }
1335
+
1336
+    /**
1337
+     * Tests an DELETE FROM query
1338
+     * @param string table The table name to get DDL
1339
+     * @param string query The query to test.
1340
+     * @return string Non-empty if error found
1341
+     */
1342
+    public function verifyDeleteFrom($table, $query)
1343
+    {
1344
+        return $this->verifyGenericReplaceQuery("DELETE FROM", $table, $query);
1345
+    }
1346
+
1347
+    /**
1348
+     * Check if certain database exists
1349
+     * @param string $dbname
1350
+     */
1351
+    public function dbExists($dbname)
1352
+    {
1353
+        $db = $this->getOne("SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = ".$this->quoted($dbname));
1354
+        return !empty($db);
1355
+    }
1356
+
1357
+    /**
1358
+     * Select database
1359
+     * @param string $dbname
1360
+     */
1361
+    protected function selectDb($dbname)
1362
+    {
1363
+        return mysql_select_db($dbname);
1364
+    }
1365
+
1366
+    /**
1367
+     * Check if certain DB user exists
1368
+     * @param string $username
1369
+     */
1370
+    public function userExists($username)
1371
+    {
1372
+        $db = $this->getOne("SELECT DATABASE()");
1373
+        if(!$this->selectDb("mysql")) {
1374
+            return false;
1375
+        }
1376
+        $user = $this->getOne("select count(*) from user where user = ".$this->quoted($username));
1377
+        if(!$this->selectDb($db)) {
1378
+            $this->checkError("Cannot select database $db", true);
1379
+        }
1380
+        return !empty($user);
1381
+    }
1382
+
1383
+    /**
1384
+     * Create DB user
1385
+     * @param string $database_name
1386
+     * @param string $host_name
1387
+     * @param string $user
1388
+     * @param string $password
1389
+     */
1390
+    public function createDbUser($database_name, $host_name, $user, $password)
1391
+    {
1392
+        $qpassword = $this->quote($password);
1393
+        $this->query("GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, INDEX
1394 1394
 							ON `$database_name`.*
1395 1395
 							TO \"$user\"@\"$host_name\"
1396 1396
 							IDENTIFIED BY '{$qpassword}';", true);
1397 1397
 
1398
-		$this->query("SET PASSWORD FOR \"{$user}\"@\"{$host_name}\" = password('{$qpassword}');", true);
1399
-		if($host_name != 'localhost') {
1400
-			$this->createDbUser($database_name, "localhost", $user, $password);
1401
-		}
1402
-	}
1403
-
1404
-	/**
1405
-	 * Create a database
1406
-	 * @param string $dbname
1407
-	 */
1408
-	public function createDatabase($dbname)
1409
-	{
1410
-		$this->query("CREATE DATABASE `$dbname` CHARACTER SET utf8 COLLATE utf8_general_ci", true);
1411
-	}
1412
-
1413
-	public function preInstall()
1414
-	{
1415
-		$db->query("ALTER DATABASE `{$setup_db_database_name}` DEFAULT CHARACTER SET utf8", true);
1416
-		$db->query("ALTER DATABASE `{$setup_db_database_name}` DEFAULT COLLATE utf8_general_ci", true);
1417
-
1418
-	}
1419
-
1420
-	/**
1421
-	 * Drop a database
1422
-	 * @param string $dbname
1423
-	 */
1424
-	public function dropDatabase($dbname)
1425
-	{
1426
-		return $this->query("DROP DATABASE IF EXISTS `$dbname`", true);
1427
-	}
1428
-
1429
-	/**
1430
-	 * Check if this driver can be used
1431
-	 * @return bool
1432
-	 */
1433
-	public function valid()
1434
-	{
1435
-		return function_exists("mysql_connect");
1436
-	}
1437
-
1438
-	/**
1439
-	 * Check DB version
1440
-	 * @see DBManager::canInstall()
1441
-	 */
1442
-	public function canInstall()
1443
-	{
1444
-		$db_version = $this->version();
1445
-		if(empty($db_version)) {
1446
-			return array('ERR_DB_VERSION_FAILURE');
1447
-		}
1448
-		if(version_compare($db_version, '4.1.2') < 0) {
1449
-			return array('ERR_DB_MYSQL_VERSION', $db_version);
1450
-		}
1451
-		return true;
1452
-	}
1453
-
1454
-	public function installConfig()
1455
-	{
1456
-		return array(
1457
-			'LBL_DBCONFIG_MSG3' =>  array(
1458
-				"setup_db_database_name" => array("label" => 'LBL_DBCONF_DB_NAME', "required" => true),
1459
-			),
1460
-			'LBL_DBCONFIG_MSG2' =>  array(
1461
-				"setup_db_host_name" => array("label" => 'LBL_DBCONF_HOST_NAME', "required" => true),
1462
-			),
1463
-			'LBL_DBCONF_TITLE_USER_INFO' => array(),
1464
-			'LBL_DBCONFIG_B_MSG1' => array(
1465
-				"setup_db_admin_user_name" => array("label" => 'LBL_DBCONF_DB_ADMIN_USER', "required" => true),
1466
-				"setup_db_admin_password" => array("label" => 'LBL_DBCONF_DB_ADMIN_PASSWORD', "type" => "password"),
1467
-			)
1468
-		);
1469
-	}
1470
-
1471
-	/**
1472
-	 * Disable keys on the table
1473
-	 * @abstract
1474
-	 * @param string $tableName
1475
-	 */
1476
-	public function disableKeys($tableName)
1477
-	{
1478
-	    return $this->query('ALTER TABLE '.$tableName.' DISABLE KEYS');
1479
-	}
1480
-
1481
-	/**
1482
-	 * Re-enable keys on the table
1483
-	 * @abstract
1484
-	 * @param string $tableName
1485
-	 */
1486
-	public function enableKeys($tableName)
1487
-	{
1488
-	    return $this->query('ALTER TABLE '.$tableName.' ENABLE KEYS');
1489
-	}
1398
+        $this->query("SET PASSWORD FOR \"{$user}\"@\"{$host_name}\" = password('{$qpassword}');", true);
1399
+        if($host_name != 'localhost') {
1400
+            $this->createDbUser($database_name, "localhost", $user, $password);
1401
+        }
1402
+    }
1403
+
1404
+    /**
1405
+     * Create a database
1406
+     * @param string $dbname
1407
+     */
1408
+    public function createDatabase($dbname)
1409
+    {
1410
+        $this->query("CREATE DATABASE `$dbname` CHARACTER SET utf8 COLLATE utf8_general_ci", true);
1411
+    }
1412
+
1413
+    public function preInstall()
1414
+    {
1415
+        $db->query("ALTER DATABASE `{$setup_db_database_name}` DEFAULT CHARACTER SET utf8", true);
1416
+        $db->query("ALTER DATABASE `{$setup_db_database_name}` DEFAULT COLLATE utf8_general_ci", true);
1417
+
1418
+    }
1419
+
1420
+    /**
1421
+     * Drop a database
1422
+     * @param string $dbname
1423
+     */
1424
+    public function dropDatabase($dbname)
1425
+    {
1426
+        return $this->query("DROP DATABASE IF EXISTS `$dbname`", true);
1427
+    }
1428
+
1429
+    /**
1430
+     * Check if this driver can be used
1431
+     * @return bool
1432
+     */
1433
+    public function valid()
1434
+    {
1435
+        return function_exists("mysql_connect");
1436
+    }
1437
+
1438
+    /**
1439
+     * Check DB version
1440
+     * @see DBManager::canInstall()
1441
+     */
1442
+    public function canInstall()
1443
+    {
1444
+        $db_version = $this->version();
1445
+        if(empty($db_version)) {
1446
+            return array('ERR_DB_VERSION_FAILURE');
1447
+        }
1448
+        if(version_compare($db_version, '4.1.2') < 0) {
1449
+            return array('ERR_DB_MYSQL_VERSION', $db_version);
1450
+        }
1451
+        return true;
1452
+    }
1453
+
1454
+    public function installConfig()
1455
+    {
1456
+        return array(
1457
+            'LBL_DBCONFIG_MSG3' =>  array(
1458
+                "setup_db_database_name" => array("label" => 'LBL_DBCONF_DB_NAME', "required" => true),
1459
+            ),
1460
+            'LBL_DBCONFIG_MSG2' =>  array(
1461
+                "setup_db_host_name" => array("label" => 'LBL_DBCONF_HOST_NAME', "required" => true),
1462
+            ),
1463
+            'LBL_DBCONF_TITLE_USER_INFO' => array(),
1464
+            'LBL_DBCONFIG_B_MSG1' => array(
1465
+                "setup_db_admin_user_name" => array("label" => 'LBL_DBCONF_DB_ADMIN_USER', "required" => true),
1466
+                "setup_db_admin_password" => array("label" => 'LBL_DBCONF_DB_ADMIN_PASSWORD', "type" => "password"),
1467
+            )
1468
+        );
1469
+    }
1470
+
1471
+    /**
1472
+     * Disable keys on the table
1473
+     * @abstract
1474
+     * @param string $tableName
1475
+     */
1476
+    public function disableKeys($tableName)
1477
+    {
1478
+        return $this->query('ALTER TABLE '.$tableName.' DISABLE KEYS');
1479
+    }
1480
+
1481
+    /**
1482
+     * Re-enable keys on the table
1483
+     * @abstract
1484
+     * @param string $tableName
1485
+     */
1486
+    public function enableKeys($tableName)
1487
+    {
1488
+        return $this->query('ALTER TABLE '.$tableName.' ENABLE KEYS');
1489
+    }
1490 1490
 
1491 1491
     /**
1492 1492
      * Returns a DB specific FROM clause which can be used to select against functions.
@@ -1505,8 +1505,8 @@  discard block
 block discarded – undo
1505 1505
      * @return string
1506 1506
      */
1507 1507
 
1508
-	public function getGuidSQL()
1508
+    public function getGuidSQL()
1509 1509
     {
1510
-      	return 'UUID()';
1510
+            return 'UUID()';
1511 1511
     }
1512 1512
 }
Please login to merge, or discard this patch.
include/MVC/Controller/SugarController.php 1 patch
Indentation   +12 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@  discard block
 block discarded – undo
3 3
  *
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
6
-
7
-* * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
6
+ * * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
8 7
  * Copyright (C) 2011 - 2017 SalesAgility Ltd.
9 8
  *
10 9
  * This program is free software; you can redistribute it and/or modify it under
@@ -174,12 +173,12 @@  discard block
 block discarded – undo
174 173
      */
175 174
     protected $action_view_map = array();
176 175
 
177
-	/**
178
-	 * This can be set from the application to tell us whether we have authorization to
179
-	 * process the action. If this is set we will default to the noaccess view.
180
-	 *@var bool
176
+    /**
177
+     * This can be set from the application to tell us whether we have authorization to
178
+     * process the action. If this is set we will default to the noaccess view.
179
+     *@var bool
181 180
      */
182
-	public $hasAccess ;
181
+    public $hasAccess ;
183 182
 
184 183
     /**
185 184
      * Map case sensitive filenames to action.  This is used for linux/unix systems
@@ -191,12 +190,12 @@  discard block
 block discarded – undo
191 190
         'listview' => 'ListView'
192 191
     );
193 192
 
194
-	/**
195
-	 * Constructor. This ie meant to load up the module, action, record as well
196
-	 * as the mapping arrays.
197
-	 */
198
-	public function __construct()
199
-	{
193
+    /**
194
+     * Constructor. This ie meant to load up the module, action, record as well
195
+     * as the mapping arrays.
196
+     */
197
+    public function __construct()
198
+    {
200 199
         $this->hasAccess = true;}
201 200
 
202 201
     /**
Please login to merge, or discard this patch.
include/generic/DeleteRelationship.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -62,42 +62,42 @@
 block discarded – undo
62 62
 
63 63
 require_once('include/formbase.php');
64 64
 
65
- global $beanFiles,$beanList;
66
- $bean_name = $beanList[$_REQUEST['module']];
67
- require_once($beanFiles[$bean_name]);
68
- $focus = new $bean_name();
69
- if (  empty($_REQUEST['linked_id']) || empty($_REQUEST['linked_field'])  || empty($_REQUEST['record'])){
70
-
71
-	die("need linked_field, linked_id and record fields");
72
- }
73
- $linked_field = $_REQUEST['linked_field'];
74
- $record = $_REQUEST['record'];
75
- $linked_id = $_REQUEST['linked_id'];
76
- if ($linked_field === 'aclroles') {
65
+    global $beanFiles,$beanList;
66
+    $bean_name = $beanList[$_REQUEST['module']];
67
+    require_once($beanFiles[$bean_name]);
68
+    $focus = new $bean_name();
69
+    if (  empty($_REQUEST['linked_id']) || empty($_REQUEST['linked_field'])  || empty($_REQUEST['record'])){
70
+
71
+    die("need linked_field, linked_id and record fields");
72
+    }
73
+    $linked_field = $_REQUEST['linked_field'];
74
+    $record = $_REQUEST['record'];
75
+    $linked_id = $_REQUEST['linked_id'];
76
+    if ($linked_field === 'aclroles') {
77 77
     if (!ACLController::checkAccess($bean_name, 'edit', true)) {
78 78
         ACLController::displayNoAccess();
79 79
         sugar_cleanup(true);
80 80
     }
81 81
 }if($linked_field === 'aclroles') {
82 82
     if (!ACLController::checkAccess($bean_name , 'edit', true)) {
83
- ACLController::displayNoAccess();
83
+    ACLController::displayNoAccess();
84 84
         sugar_cleanup(true);
85 85
     }
86 86
 }
87 87
 
88 88
 if ($bean_name === 'Team'){
89
- 	$focus->retrieve($record);
90
- 	$focus->remove_user_from_team($linked_id);
91
- }
92
- else{
93
-
94
- 	// cut it off:
95
- 	$focus->load_relationship($linked_field);
96
- 	if($focus->$linked_field->_relationship->relationship_name === 'quotes_contacts_shipto'){
97
- 		unset($focus->$linked_field->_relationship->relationship_role_column);}
98
- 	$focus->$linked_field->delete($record,$linked_id);
99
- }
100
- if ($bean_name === 'Campaign' and $linked_field==='prospectlists' ) {
89
+        $focus->retrieve($record);
90
+        $focus->remove_user_from_team($linked_id);
91
+    }
92
+    else{
93
+
94
+        // cut it off:
95
+        $focus->load_relationship($linked_field);
96
+        if($focus->$linked_field->_relationship->relationship_name === 'quotes_contacts_shipto'){
97
+            unset($focus->$linked_field->_relationship->relationship_role_column);}
98
+        $focus->$linked_field->delete($record,$linked_id);
99
+    }
100
+    if ($bean_name === 'Campaign' and $linked_field==='prospectlists' ) {
101 101
 
102 102
     $query = "SELECT email_marketing_prospect_lists.id from email_marketing_prospect_lists ";
103 103
     $query .= " left join email_marketing on email_marketing.id=email_marketing_prospect_lists.email_marketing_id";
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelRemoveButton.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -60,50 +60,50 @@
 block discarded – undo
60 60
         $parent_record_id = $_REQUEST['record'];
61 61
         $parent_module = $_REQUEST['module'];
62 62
 
63
-		$action = 'DeleteRelationship';
64
-		$record = $layout_def['fields']['ID'];
65
-		$current_module=$layout_def['module'];
66
-		//in document revisions subpanel ,users are now allowed to 
67
-		//delete the latest revsion of a document. this will be tested here
68
-		//and if the condition is met delete button will be removed.
69
-		$hideremove=false;
70
-		if ($current_module==='DocumentRevisions') {
71
-			if ($layout_def['fields']['ID']===$layout_def['fields']['LATEST_REVISION_ID']) {
72
-				$hideremove=true;
73
-			}
74
-		}elseif ($_REQUEST['module'] === 'Teams' && $current_module === 'Users') {
75
-		// Implicit Team-memberships are not "removeable"
76
-
77
-			if($layout_def['fields']['UPLINE'] !== translate('LBL_TEAM_UPLINE_EXPLICIT', 'Users')) {
78
-				$hideremove = true;
79
-			}
80
-
81
-			//We also cannot remove the user whose private team is set to the parent_record_id value
82
-			$user = new User();
83
-			$user->retrieve($layout_def['fields']['ID']);
84
-			if($parent_record_id === $user->getPrivateTeamID()){
85
-
86
-			    $hideremove = true;
87
-			}} elseif ($current_module === 'ACLRoles' && (!ACLController::checkAccess($current_module, 'edit', true))) {
63
+        $action = 'DeleteRelationship';
64
+        $record = $layout_def['fields']['ID'];
65
+        $current_module=$layout_def['module'];
66
+        //in document revisions subpanel ,users are now allowed to 
67
+        //delete the latest revsion of a document. this will be tested here
68
+        //and if the condition is met delete button will be removed.
69
+        $hideremove=false;
70
+        if ($current_module==='DocumentRevisions') {
71
+            if ($layout_def['fields']['ID']===$layout_def['fields']['LATEST_REVISION_ID']) {
72
+                $hideremove=true;
73
+            }
74
+        }elseif ($_REQUEST['module'] === 'Teams' && $current_module === 'Users') {
75
+        // Implicit Team-memberships are not "removeable"
76
+
77
+            if($layout_def['fields']['UPLINE'] !== translate('LBL_TEAM_UPLINE_EXPLICIT', 'Users')) {
78
+                $hideremove = true;
79
+            }
80
+
81
+            //We also cannot remove the user whose private team is set to the parent_record_id value
82
+            $user = new User();
83
+            $user->retrieve($layout_def['fields']['ID']);
84
+            if($parent_record_id === $user->getPrivateTeamID()){
85
+
86
+                $hideremove = true;
87
+            }} elseif ($current_module === 'ACLRoles' && (!ACLController::checkAccess($current_module, 'edit', true))) {
88 88
             $hideremove = true;
89
-		}elseif ($current_module === 'ACLRoles' && (!ACLController::checkAccess($current_module, 'edit', true))) {
89
+        }elseif ($current_module === 'ACLRoles' && (!ACLController::checkAccess($current_module, 'edit', true))) {
90 90
             $hideremove = true;
91
-		}
91
+        }
92 92
 		
93
-		$return_module = $_REQUEST['module'];
94
-		$return_action = 'SubPanelViewer';
95
-		$subpanel = $layout_def['subpanel_id'];
96
-		$return_id = $_REQUEST['record'];
97
-		if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) {
98
-			$linked_field= $layout_def['linked_field_set'] ;
99
-		} else {
100
-			$linked_field = $layout_def['linked_field'];
101
-		}
102
-		$refresh_page = 0;
103
-		if(!empty($layout_def['refresh_page'])){
104
-			$refresh_page = 1;
105
-		}
106
-		$return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel&record=$return_id&sugar_body_only=1&inline=1";
93
+        $return_module = $_REQUEST['module'];
94
+        $return_action = 'SubPanelViewer';
95
+        $subpanel = $layout_def['subpanel_id'];
96
+        $return_id = $_REQUEST['record'];
97
+        if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) {
98
+            $linked_field= $layout_def['linked_field_set'] ;
99
+        } else {
100
+            $linked_field = $layout_def['linked_field'];
101
+        }
102
+        $refresh_page = 0;
103
+        if(!empty($layout_def['refresh_page'])){
104
+            $refresh_page = 1;
105
+        }
106
+        $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel&record=$return_id&sugar_body_only=1&inline=1";
107 107
 
108 108
         $icon_remove_text = $app_strings['LBL_ID_FF_REMOVE'];
109 109
 
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/relationships/ManyToOneRelationship.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -60,21 +60,21 @@  discard block
 block discarded – undo
60 60
     function __construct ($definition) 
61 61
     {
62 62
         
63
-    	parent::__construct ( $definition ) ;
64
-    	$onetomanyDef = array_merge($definition, array(
65
-	        'rhs_label'    => isset($definition['lhs_label'])    ? $definition['lhs_label']    : null,
66
-	        'lhs_label'    => isset($definition['rhs_label'])    ? $definition['rhs_label']    : null,
67
-	        'lhs_subpanel' => isset($definition['rhs_subpanel']) ? $definition['rhs_subpanel'] : null,
68
-	        'rhs_subpanel' => isset($definition['lhs_subpanel']) ? $definition['lhs_subpanel'] : null,
69
-	        'lhs_module'   => isset($definition['rhs_module'])   ? $definition['rhs_module']   : null,
70
-	        'lhs_table'    => isset($definition['rhs_table'])    ? $definition['rhs_table']    : null,
71
-	        'lhs_key'      => isset($definition['rhs_key'])      ? $definition['rhs_key']      : null,
72
-	        'rhs_module'   => isset($definition['lhs_module'])   ? $definition['lhs_module']   : null,
73
-	        'rhs_table'    => isset($definition['lhs_table'])    ? $definition['lhs_table']    : null,
74
-	        'rhs_key'      => isset($definition['lhs_key'])      ? $definition['lhs_key']      : null,
75
-	        'join_key_lhs' => isset($definition['join_key_rhs']) ? $definition['join_key_rhs'] : null,
76
-	        'join_key_rhs' => isset($definition['join_key_lhs']) ? $definition['join_key_lhs'] : null,
77
-	        'relationship_type' => MB_ONETOMANY,
63
+        parent::__construct ( $definition ) ;
64
+        $onetomanyDef = array_merge($definition, array(
65
+            'rhs_label'    => isset($definition['lhs_label'])    ? $definition['lhs_label']    : null,
66
+            'lhs_label'    => isset($definition['rhs_label'])    ? $definition['rhs_label']    : null,
67
+            'lhs_subpanel' => isset($definition['rhs_subpanel']) ? $definition['rhs_subpanel'] : null,
68
+            'rhs_subpanel' => isset($definition['lhs_subpanel']) ? $definition['lhs_subpanel'] : null,
69
+            'lhs_module'   => isset($definition['rhs_module'])   ? $definition['rhs_module']   : null,
70
+            'lhs_table'    => isset($definition['rhs_table'])    ? $definition['rhs_table']    : null,
71
+            'lhs_key'      => isset($definition['rhs_key'])      ? $definition['rhs_key']      : null,
72
+            'rhs_module'   => isset($definition['lhs_module'])   ? $definition['lhs_module']   : null,
73
+            'rhs_table'    => isset($definition['lhs_table'])    ? $definition['lhs_table']    : null,
74
+            'rhs_key'      => isset($definition['lhs_key'])      ? $definition['lhs_key']      : null,
75
+            'join_key_lhs' => isset($definition['join_key_rhs']) ? $definition['join_key_rhs'] : null,
76
+            'join_key_rhs' => isset($definition['join_key_lhs']) ? $definition['join_key_lhs'] : null,
77
+            'relationship_type' => MB_ONETOMANY,
78 78
         ));
79 79
         $this->one_to_many = new OneToManyRelationship($onetomanyDef);
80 80
     }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      * BUILD methods called during the build
84 84
      */
85 85
 	
86
-	function buildLabels($update = false)
86
+    function buildLabels($update = false)
87 87
     {
88 88
         return $this->one_to_many->buildLabels();
89 89
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     function buildVardefs ( )
106 106
     {
107
-       return $this->one_to_many->buildVardefs();
107
+        return $this->one_to_many->buildVardefs();
108 108
     }
109 109
     
110 110
     /*
@@ -130,19 +130,19 @@  discard block
 block discarded – undo
130 130
     public function setName ($relationshipName)
131 131
     {
132 132
         parent::setName($relationshipName);
133
-    	$this->one_to_many->setname($relationshipName);
133
+        $this->one_to_many->setname($relationshipName);
134 134
     }
135 135
     
136 136
     public function setReadonly ($set = true)
137 137
     {
138 138
         parent::setReadonly($set);
139
-    	$this->one_to_many->setReadonly();
139
+        $this->one_to_many->setReadonly();
140 140
     }
141 141
     
142 142
     public function delete ()
143 143
     {
144 144
         parent::delete();
145
-    	$this->one_to_many->delete();
145
+        $this->one_to_many->delete();
146 146
     }
147 147
     
148 148
     public function setRelationship_only ()
Please login to merge, or discard this patch.
modules/FP_events/language/en_us.lang.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -112,17 +112,17 @@
 block discarded – undo
112 112
     'LBL_FP_EVENTS_LEADS_1_FROM_LEADS_TITLE' => 'Leads',
113 113
     'LBL_FP_EVENTS_PROSPECTS_1_FROM_PROSPECTS_TITLE' => 'Targets',
114 114
     'LBL_FP_EVENTS_FP_EVENT_DELEGATES_1_FROM_FP_EVENT_DELEGATES_TITLE' => 'Delegates',
115
-	'LBL_HOURS_ABBREV' => 'h',
116
-	'LBL_MINSS_ABBREV' => 'm',
115
+    'LBL_HOURS_ABBREV' => 'h',
116
+    'LBL_MINSS_ABBREV' => 'm',
117 117
 
118
-	// Attendance report
119
-	'LBL_CONTACT_NAME' => 'Name',
120
-	'LBL_ACCOUNT_NAME' => 'Company',
121
-	'LBL_SIGNATURE' => 'Signature',
122
-	// contacts/leads/targets subpanels
123
-	'LBL_LIST_INVITE_STATUS_EVENT' => 'Invited',
124
-	'LBL_LIST_ACCEPT_STATUS_EVENT' => 'Status',
118
+    // Attendance report
119
+    'LBL_CONTACT_NAME' => 'Name',
120
+    'LBL_ACCOUNT_NAME' => 'Company',
121
+    'LBL_SIGNATURE' => 'Signature',
122
+    // contacts/leads/targets subpanels
123
+    'LBL_LIST_INVITE_STATUS_EVENT' => 'Invited',
124
+    'LBL_LIST_ACCEPT_STATUS_EVENT' => 'Status',
125 125
 
126
-	'LBL_ACTIVITY_STATUS' => 'Activity Status',
127
-	'LBL_FP_EVENT_LOCATIONS_FP_EVENTS_1_FROM_FP_EVENTS_TITLE' => 'Event Locations from Events Title',
126
+    'LBL_ACTIVITY_STATUS' => 'Activity Status',
127
+    'LBL_FP_EVENT_LOCATIONS_FP_EVENTS_1_FROM_FP_EVENTS_TITLE' => 'Event Locations from Events Title',
128 128
 );
Please login to merge, or discard this patch.
install/language/en_us.lang.php 1 patch
Indentation   +427 added lines, -427 removed lines patch added patch discarded remove patch
@@ -43,296 +43,296 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 $mod_strings = array(
46
-	'LBL_BASIC_SEARCH'					=> 'Quick Filter',
47
-	'LBL_ADVANCED_SEARCH'				=> 'Advanced Filter',
48
-	'LBL_BASIC_TYPE'					=> 'Basic Type',
49
-	'LBL_ADVANCED_TYPE'					=> 'Advanced Type',
50
-	'LBL_SYSOPTS_2'                     => 'What type of database will be used for the SuiteCRM instance you are about to install?',
51
-	'LBL_SYSOPTS_DB'					=> 'Specify Database Type',
52
-	'LBL_SYSOPTS_DB_TITLE'              => 'Database Type',
53
-	'LBL_SYSOPTS_ERRS_TITLE'			=> 'Please fix the following errors before proceeding:',
54
-	'ERR_DB_VERSION_FAILURE'			=> 'Unable to check database version.',
55
-	'DEFAULT_CHARSET'					=> 'UTF-8',
56
-	'ERR_ADMIN_USER_NAME_BLANK'         => 'Provide the user name for the SuiteCRM admin user. ',
57
-	'ERR_ADMIN_PASS_BLANK'				=> 'Provide the password for the SuiteCRM admin user. ',
58
-
59
-	'ERR_CHECKSYS'                      => 'Errors have been detected during compatibility check. In order for your SuiteCRM Installation to function properly, please take the proper steps to address the issues listed below and either press the recheck button, or try installing again.',
60
-	'ERR_CHECKSYS_CALL_TIME'            => 'Allow Call Time Pass Reference is On (this should be set to Off in php.ini)',
61
-	'ERR_CHECKSYS_CURL'					=> 'Not found: SuiteCRM Scheduler will run with limited functionality.',
62
-	'ERR_CHECKSYS_IMAP'					=> 'Not found: InboundEmail and Campaigns (Email) require the IMAP libraries. Neither will be functional.',
63
-	'ERR_CHECKSYS_MEM_LIMIT_1'			=> ' (Set this to ',
64
-	'ERR_CHECKSYS_MEM_LIMIT_2'			=> 'M or larger in your php.ini file)',
65
-	'ERR_CHECKSYS_NOT_WRITABLE'			=> 'Warning: Not Writable',
66
-	'ERR_CHECKSYS_PHP_INVALID_VER'		=> 'Your version of PHP is not supported by SuiteCRM. You will need to install a version that is compatible with the SuiteCRM application. Please consult the Compatibility Matrix in the Release Notes for supported PHP Versions. Your version is ',
67
-	'ERR_CHECKSYS_IIS_INVALID_VER'      => 'Your version of IIS is not supported by SuiteCRM. You will need to install a version that is compatible with the SuiteCRM application. Please consult the Compatibility Matrix in the Release Notes for supported IIS Versions. Your version is ',
68
-	'ERR_CHECKSYS_FASTCGI'              => 'We detect that you are not using a FastCGI handler mapping for PHP. You will need to install/configure a version that is compatible with the SuiteCRM application. Please consult the Compatibility Matrix in the Release Notes for supported Versions. Please see <a href="http://www.iis.net/php/" target="_blank">http://www.iis.net/php/</a> for details ',
69
-	'ERR_CHECKSYS_FASTCGI_LOGGING'      => 'For optimal experience using IIS/FastCGI sapi, set fastcgi.logging to 0 in your php.ini file.',
70
-	'LBL_DB_UNAVAILABLE'                => 'Database unavailable',
71
-	'LBL_CHECKSYS_DB_SUPPORT_NOT_AVAILABLE' => 'Database Support was not found. Please make sure you have the necessary drivers for one of the following supported Database Types: MySQL or MS SQLServer. You might need to uncomment the extension in the php.ini file, or recompile with the right binary file, depending on your version of PHP. Please refer to your PHP Manual for more information on how to enable Database Support.',
72
-	'LBL_CHECKSYS_XML_NOT_AVAILABLE'        => 'Functions associated with XML Parser Libraries that are needed by the SuiteCRM application were not found. You might need to uncomment the extension in the  php.ini file, or recompile with the right binary file, depending on your version of PHP. Please refer to your PHP Manual for more information.',
73
-	'ERR_CHECKSYS_MBSTRING'             => 'Functions associated with the Multibyte Strings PHP extension (mbstring) that are needed by the SuiteCRM application were not found. <br/><br/>Generally, the mbstring module is not enabled by default in PHP and must be activated with --enable-mbstring when the PHP binary is built. Please refer to your PHP Manual for more information on how to enable mbstring support.',
74
-	'ERR_CHECKSYS_CONFIG_NOT_WRITABLE'  => 'The config file exists but is not writeable. Please take the necessary steps to make the file writeable. Depending on your Operating system, this might require you to change the permissions by running chmod 766, or to right click on the filename to access the properties and uncheck the read only option.',
75
-	'ERR_CHECKSYS_CONFIG_OVERRIDE_NOT_WRITABLE'  => 'The config override file exists but is not writeable. Please take the necessary steps to make the file writeable. Depending on your Operating system, this might require you to change the permissions by running chmod 766, or to right click on the filename to access the properties and uncheck the read only option.',
76
-	'ERR_CHECKSYS_CUSTOM_NOT_WRITABLE'  => 'The Custom Directory exists but is not writeable. You may have to change permissions on it (chmod 766) or right click on it and uncheck the read only option, depending on your Operating System. Please take the needed steps to make the file writeable.',
77
-	'ERR_CHECKSYS_FILES_NOT_WRITABLE'   => "The files or directories listed below are not writeable or are missing and cannot be created. Depending on your Operating System, correcting this may require you to change permissions on the files or parent directory (chmod 755), or to right click on the parent directory and uncheck the 'read only' option and apply it to all subfolders.",
78
-	'LBL_CHECKSYS_OVERRIDE_CONFIG' => 'Config override',
79
-	'ERR_CHECKSYS_SAFE_MODE'			=> 'Safe Mode is On (you may wish to disable in php.ini)',
80
-	'ERR_CHECKSYS_ZLIB'					=> 'ZLib support not found: SuiteCRM reaps enormous performance benefits with zlib compression.',
81
-	'ERR_CHECKSYS_ZIP'					=> 'ZIP support not found: SuiteCRM needs ZIP support in order to process compressed files.',
82
-	'ERR_CHECKSYS_PCRE'					=> 'PCRE library not found: SuiteCRM needs PCRE library in order to process Perl style of regular expression pattern matching.',
83
-	'ERR_CHECKSYS_PCRE_VER'				=> 'PCRE library version: SuiteCRM needs PCRE library 7.0 or above to process Perl style of regular expression pattern matching.',
84
-	'ERR_DB_ADMIN'						=> 'The provided database administrator username and/or password is invalid, and a connection to the database could not be established. Please enter a valid user name and password. (Error: ',
85
-	'ERR_DB_ADMIN_MSSQL'                => 'The provided database administrator username and/or password is invalid, and a connection to the database could not be established. Please enter a valid user name and password.',
86
-	'ERR_DB_EXISTS_NOT'					=> 'The specified database does not exist.',
87
-	'ERR_DB_EXISTS_WITH_CONFIG'			=> 'Database already exists with config data. To run an install with the chosen database, please re-run the install and choose: "Drop and recreate existing SuiteCRM tables?"  To upgrade, use the Upgrade Wizard in the Admin Console. Please read the upgrade documentation located <a href="http://www.suitecrm.com" target="_new">here</a>.',
88
-	'ERR_DB_EXISTS'						=> 'The provided Database Name already exists -- cannot create another one with the same name.',
89
-	'ERR_DB_EXISTS_PROCEED'             => 'The provided Database Name already exists. You can<br>1. hit the back button and choose a new database name <br>2. click next and continue but all existing tables on this database will be dropped. <strong>This means your tables and data will be blown away.</strong>',
90
-	'ERR_DB_HOSTNAME'					=> 'Host name cannot be blank.',
91
-	'ERR_DB_INVALID'					=> 'Invalid database type selected.',
92
-	'ERR_DB_LOGIN_FAILURE'				=> 'The provided database host, username, and/or password is invalid, and a connection to the database could not be established. Please enter a valid host, username and password',
93
-	'ERR_DB_LOGIN_FAILURE_MYSQL'		=> 'The provided database host, username, and/or password is invalid, and a connection to the database could not be established. Please enter a valid host, username and password',
94
-	'ERR_DB_LOGIN_FAILURE_MSSQL'		=> 'The provided database host, username, and/or password is invalid, and a connection to the database could not be established. Please enter a valid host, username and password',
95
-	'ERR_DB_MYSQL_VERSION'				=> 'Your MySQL version (%s) is not supported by SuiteCRM. You will need to install a version that is compatible with the SuiteCRM application. Please consult the Compatibility Matrix in the Release Notes for supported MySQL versions.',
96
-	'ERR_DB_NAME'						=> 'Database name cannot be blank.',
97
-	'ERR_DB_MYSQL_DB_NAME_INVALID'      => "Database name cannot contain a '\\', '/', or '.'",
98
-	'ERR_DB_MSSQL_DB_NAME_INVALID'      => "Database name cannot begin with a number, '#', or '@' and cannot contain a space, '\"', \"'\", '*', '/', '\', '?', ':', '<', '>', '&', '!', or '-'",
99
-	'ERR_DB_OCI8_DB_NAME_INVALID'       => "Database name can only consist of alphanumeric characters and the symbols '#', '_' or '$'",
100
-	'ERR_DB_PASSWORD'					=> 'The passwords provided for the SuiteCRM database administrator do not match. Please re-enter the same passwords in the password fields.',
101
-	'ERR_DB_PRIV_USER'					=> 'Provide a database administrator user name. The user is required for the initial connection to the database.',
102
-	'ERR_DB_USER_EXISTS'				=> 'User name for SuiteCRM database user already exists -- cannot create another one with the same name. Please enter a new user name.',
103
-	'ERR_DB_USER'						=> 'Enter a user name for the SuiteCRM database administrator.',
104
-	'ERR_DBCONF_VALIDATION'				=> 'Please fix the following errors before proceeding:',
105
-	'ERR_DBCONF_PASSWORD_MISMATCH'      => 'The passwords provided for the SuiteCRM database user do not match. Please re-enter the same passwords in the password fields.',
106
-	'ERR_ERROR_GENERAL'					=> 'The following errors were encountered:',
107
-	'ERR_LANG_CANNOT_DELETE_FILE'		=> 'Cannot delete file: ',
108
-	'ERR_LANG_MISSING_FILE'				=> 'Cannot find file: ',
109
-	'ERR_LANG_NO_LANG_FILE'			 	=> 'No language pack file found at include/language inside: ',
110
-	'ERR_LANG_UPLOAD_1'					=> 'There was a problem with your upload. Please try again.',
111
-	'ERR_LANG_UPLOAD_2'					=> 'Language Packs must be ZIP archives.',
112
-	'ERR_LANG_UPLOAD_3'					=> 'PHP could not move the temp file to the upgrade directory.',
113
-	'ERR_LOG_DIRECTORY_NOT_EXISTS'		=> 'Log directory provided is not a valid directory.',
114
-	'ERR_LOG_DIRECTORY_NOT_WRITABLE'	=> 'Log directory provided is not a writable directory.',
115
-	'ERR_NO_DIRECT_SCRIPT'				=> 'Unable to process script directly.',
116
-	'ERR_NO_SINGLE_QUOTE'				=> 'Cannot use the single quotation mark for ',
117
-	'ERR_PASSWORD_MISMATCH'				=> 'The passwords provided for the SuiteCRM admin user do not match. Please re-enter the same passwords in the password fields.',
118
-	'ERR_PERFORM_CONFIG_PHP_1'			=> 'Cannot write to the <span class=stop>config.php</span> file.',
119
-	'ERR_PERFORM_CONFIG_PHP_2'			=> 'You can continue this installation by manually creating the config.php file and pasting the configuration information below into the config.php file. However, you <strong>must </strong>create the config.php file before you continue to the next step.',
120
-	'ERR_PERFORM_CONFIG_PHP_3'			=> 'Did you remember to create the config.php file?',
121
-	'ERR_PERFORM_CONFIG_PHP_4'			=> 'Warning: Could not write to config.php file. Please ensure it exists.',
122
-	'ERR_PERFORM_HTACCESS_1'			=> 'Cannot write to the ',
123
-	'ERR_PERFORM_HTACCESS_2'			=> ' file.',
124
-	'ERR_PERFORM_HTACCESS_3'			=> 'If you want to secure your log file from being accessible via browser, create an .htaccess file in your log directory with the line:',
125
-	'ERR_PERFORM_NO_TCPIP'				=> '<b>We could not detect an Internet connection.</b> When you do have a connection, please visit <a href="http://www.suitecrm.com/">http://www.suitecrm.com/</a> to register with SuiteCRM. By letting us know a little bit about how your company plans to use SuiteCRM, we can ensure we are always delivering the right application for your business needs.',
126
-	'ERR_SESSION_DIRECTORY_NOT_EXISTS'	=> 'Session directory provided is not a valid directory.',
127
-	'ERR_SESSION_DIRECTORY'				=> 'Session directory provided is not a writable directory.',
128
-	'ERR_SESSION_PATH'					=> 'Session path is required if you wish to specify your own.',
129
-	'ERR_SI_NO_CONFIG'					=> 'You did not include config_si.php in the document root, or you did not define $sugar_config_si in config.php',
130
-	'ERR_SITE_GUID'						=> 'Application ID is required if you wish to specify your own.',
131
-	'ERROR_SPRITE_SUPPORT'              => "Currently we are not able to locate the GD library, as a result you will not be able to use the CSS Sprite functionality.",
132
-	'ERR_UPLOAD_MAX_FILESIZE'			=> 'Warning: Your PHP configuration should be changed to allow files of at least 6MB to be uploaded.',
133
-	'LBL_UPLOAD_MAX_FILESIZE_TITLE'     => 'Upload File Size',
134
-	'ERR_URL_BLANK'						=> 'Provide the base URL for the SuiteCRM instance.',
135
-	'ERR_UW_NO_UPDATE_RECORD'			=> 'Could not locate installation record of',
136
-	'ERROR_FLAVOR_INCOMPATIBLE'			=> 'The uploaded file is not compatible with this flavor of SuiteCRM: ',
137
-	'ERROR_MANIFEST_TYPE'				=> 'Manifest file must specify the package type.',
138
-	'ERROR_PACKAGE_TYPE'				=> 'Manifest file specifies an unrecognized package type',
139
-	'ERROR_VERSION_INCOMPATIBLE'		=> 'The uploaded file is not compatible with this version of SuiteCRM: ',
140
-
141
-	'LBL_BACK'							=> 'Back',
142
-	'LBL_CANCEL'                        => 'Cancel',
143
-	'LBL_ACCEPT'                        => 'I Accept',
144
-	'LBL_CHECKSYS_CACHE'				=> 'Writable Cache Sub-Directories',
145
-	'LBL_DROP_DB_CONFIRM'               => 'The provided Database Name already exists.<br>You can either:<br>1. Click on the Cancel button and choose a new database name, or <br>2. Click the Accept button and continue. All existing tables in the database will be dropped. <strong>This means that all of the tables and pre-existing data will be blown away.</strong>',
146
-	'LBL_CHECKSYS_COMPONENT'			=> 'Component',
147
-	'LBL_CHECKSYS_CONFIG'				=> 'Writable SuiteCRM Configuration File (config.php)',
148
-	'LBL_CHECKSYS_CURL'					=> 'cURL Module',
149
-	'LBL_CHECKSYS_CUSTOM'				=> 'Writeable Custom Directory',
150
-	'LBL_CHECKSYS_DATA'					=> 'Writable Data Sub-Directories',
151
-	'LBL_CHECKSYS_IMAP'					=> 'IMAP Module',
152
-	'LBL_CHECKSYS_FASTCGI'             => 'FastCGI',
153
-	'LBL_CHECKSYS_MBSTRING'				=> 'MB Strings Module',
154
-	'LBL_CHECKSYS_MEM_OK'				=> 'OK (No Limit)',
155
-	'LBL_CHECKSYS_MEM_UNLIMITED'		=> 'OK (Unlimited)',
156
-	'LBL_CHECKSYS_MEM'					=> 'PHP Memory Limit',
157
-	'LBL_CHECKSYS_MODULE'				=> 'Writable Modules Sub-Directories and Files',
158
-	'LBL_CHECKSYS_NOT_AVAILABLE'		=> 'Not Available',
159
-	'LBL_CHECKSYS_OK'					=> 'OK',
160
-	'LBL_CHECKSYS_PHP_INI'				=> 'Location of your PHP configuration file (php.ini):',
161
-	'LBL_CHECKSYS_PHP_OK'				=> 'OK (ver ',
162
-	'LBL_CHECKSYS_PHPVER'				=> 'PHP Version',
163
-	'LBL_CHECKSYS_IISVER'               => 'IIS Version',
164
-	'LBL_CHECKSYS_RECHECK'				=> 'Re-check',
165
-	'LBL_CHECKSYS_STATUS'				=> 'Status',
166
-	'LBL_CHECKSYS_TITLE'				=> 'System Check Acceptance',
167
-	'LBL_CHECKSYS_XML'					=> 'XML Parsing',
168
-	'LBL_CHECKSYS_ZLIB'					=> 'ZLIB Compression Module',
169
-	'LBL_CHECKSYS_ZIP'					=> 'ZIP Handling Module',
170
-	'LBL_CHECKSYS_PCRE'					=> 'PCRE Library',
171
-	'LBL_CHECKSYS_FIX_FILES'            => 'Please fix the following files or directories before proceeding:',
172
-	'LBL_CHECKSYS_FIX_MODULE_FILES'     => 'Please fix the following module directories and the files under them before proceeding:',
173
-	'LBL_CHECKSYS_UPLOAD'               => 'Writable Upload Directory',
174
-	'LBL_CLOSE'							=> 'Close',
175
-	'LBL_THREE'                         => '3',
176
-	'LBL_CONFIRM_BE_CREATED'			=> 'be created',
177
-	'LBL_CONFIRM_DB_TYPE'				=> 'Database Type',
178
-	'LBL_CONFIRM_NOT'					=> 'not',
179
-	'LBL_CONFIRM_TITLE'					=> 'Confirm Settings',
180
-	'LBL_CONFIRM_WILL'					=> 'will',
181
-	'LBL_DBCONF_DB_DROP'                => 'Drop Tables',
182
-	'LBL_DBCONF_DB_NAME'				=> 'Database Name',
183
-	'LBL_DBCONF_DB_PASSWORD'			=> 'SuiteCRM Database User Password',
184
-	'LBL_DBCONF_DB_PASSWORD2'			=> 'Re-enter SuiteCRM Database User Password',
185
-	'LBL_DBCONF_DB_USER'				=> 'SuiteCRM Database User',
186
-	'LBL_DBCONF_SUGAR_DB_USER'          => 'SuiteCRM Database User',
187
-	'LBL_DBCONF_DB_ADMIN_USER'          => 'Database Administrator Username',
188
-	'LBL_DBCONF_DB_ADMIN_PASSWORD'      => 'Database Admin Password',
189
-	'LBL_DBCONF_DEMO_DATA'				=> 'Populate Database with Demo Data?',
190
-	'LBL_DBCONF_DEMO_DATA_TITLE'        => 'Choose Demo Data',
191
-	'LBL_DBCONF_HOST_NAME'				=> 'Host Name',
192
-	'LBL_DBCONF_HOST_INSTANCE'			=> 'Host Instance',
193
-	'LBL_DBCONFIG_SECURITY'             => 'For security purposes, you can specify an exclusive database user to connect to the SuiteCRM database. This user must be able to write, update and retrieve data on the SuiteCRM database that will be created for this instance. This user can be the database administrator specified above, or you can provide new or existing database user information.',
194
-	'LBL_DBCONFIG_PROVIDE_DD'           => 'Provide existing user',
195
-	'LBL_DBCONFIG_CREATE_DD'            => 'Define user to create',
196
-	'LBL_DBCONFIG_SAME_DD'              => 'Same as Admin User',
197
-	'LBL_DBCONF_TITLE'					=> 'Database Configuration',
198
-	'LBL_DBCONF_TITLE_NAME'             => 'Provide Database Name',
199
-	'LBL_DBCONF_TITLE_USER_INFO'        => 'Provide Database User Information',
200
-	'LBL_DBCONF_TITLE_PSWD_INFO_LABEL' => 'Password',
201
-	'LBL_DISABLED_DESCRIPTION_2'		=> 'After this change has been made, you may click the "Start" button below to begin your installation. <i>After the installation is complete, you will want to change the value for \'installer_locked\' to \'true\'.</i>',
202
-	'LBL_DISABLED_DESCRIPTION'			=> 'The installer has already been run once. As a safety measure, it has been disabled from running a second time. If you are absolutely sure you want to run it again, please go to your config.php file and locate (or add) a variable called \'installer_locked\' and set it to \'false\'. The line should look like this:',
203
-	'LBL_DISABLED_HELP_1'				=> 'For installation help, please visit the SuiteCRM',
204
-	'LBL_DISABLED_HELP_LNK'             => 'http://www.suitecrm.com/forum/index',
205
-	'LBL_DISABLED_HELP_2'				=> 'support forums',
206
-	'LBL_DISABLED_TITLE_2'				=> 'SuiteCRM Installation has been Disabled',
207
-	'LBL_HELP'							=> 'Help',
208
-	'LBL_INSTALL'                       => 'Install',
209
-	'LBL_INSTALL_TYPE_TITLE'            => 'Installation Options',
210
-	'LBL_INSTALL_TYPE_SUBTITLE'         => 'Choose Install Type',
211
-	'LBL_INSTALL_TYPE_TYPICAL'          => ' <b>Typical Install</b>',
212
-	'LBL_INSTALL_TYPE_CUSTOM'           => ' <b>Custom Install</b>',
213
-	'LBL_INSTALL_TYPE_MSG2'             => 'Requires minimum information for the installation. Recommended for new users.',
214
-	'LBL_INSTALL_TYPE_MSG3'             => 'Provides additional options to set during the installation. Most of these options are also available after installation in the admin screens. Recommended for advanced users.',
215
-	'LBL_LANG_1'						=> 'To use a language in SuiteCRM other than the default language (US-English), you can upload and install the language pack at this time. You will be able to upload and install language packs from within the SuiteCRM application as well. If you would like to skip this step, click Next.',
216
-	'LBL_LANG_BUTTON_COMMIT'			=> 'Install',
217
-	'LBL_LANG_BUTTON_REMOVE'			=> 'Remove',
218
-	'LBL_LANG_BUTTON_UNINSTALL'			=> 'Uninstall',
219
-	'LBL_LANG_BUTTON_UPLOAD'			=> 'Upload',
220
-	'LBL_LANG_NO_PACKS'					=> 'none',
221
-	'LBL_LANG_PACK_INSTALLED'			=> 'The following language packs have been installed: ',
222
-	'LBL_LANG_PACK_READY'				=> 'The following language packs are ready to be installed: ',
223
-	'LBL_LANG_SUCCESS'					=> 'The language pack was successfully uploaded.',
224
-	'LBL_LANG_TITLE'			   		=> 'Language Pack',
225
-	'LBL_LAUNCHING_SILENT_INSTALL'     => 'Installing SuiteCRM now. This may take up to a few minutes.',
226
-	'LBL_LANG_UPLOAD'					=> 'Upload a Language Pack',
227
-	'LBL_LICENSE_ACCEPTANCE'			=> 'License Acceptance',
228
-	'LBL_LICENSE_CHECKING'              => 'Checking system for compatibility.',
229
-	'LBL_LICENSE_CHKENV_HEADER'         => 'Checking Environment',
230
-	'LBL_LICENSE_CHKDB_HEADER'          => 'Verifying DB Credentials.',
231
-	'LBL_LICENSE_CHECK_PASSED'          => 'System passed check for compatibility.',
232
-	'LBL_CREATE_CACHE' => 'Preparing to Install...',
233
-	'LBL_LICENSE_REDIRECT'              => 'Redirecting in ',
234
-	'LBL_LICENSE_I_ACCEPT'				=> 'I Accept',
235
-	'LBL_LICENSE_PRINTABLE'				=> ' Printable View ',
236
-	'LBL_PRINT_SUMM'                    => 'Print Summary',
237
-	'LBL_LICENSE_TITLE_2'				=> 'SuiteCRM License',
238
-
239
-	'LBL_LOCALE_NAME_FIRST'				=> 'David',
240
-	'LBL_LOCALE_NAME_LAST'				=> 'Livingstone',
241
-	'LBL_LOCALE_NAME_SALUTATION'		=> 'Dr.',
242
-
243
-	'LBL_ML_ACTION'						=> 'Action',
244
-	'LBL_ML_DESCRIPTION'				=> 'Description',
245
-	'LBL_ML_INSTALLED'					=> 'Date Installed',
246
-	'LBL_ML_NAME'						=> 'Name',
247
-	'LBL_ML_PUBLISHED'					=> 'Date Published',
248
-	'LBL_ML_TYPE'						=> 'Type',
249
-	'LBL_ML_UNINSTALLABLE'				=> 'Uninstallable',
250
-	'LBL_ML_VERSION'					=> 'Version',
251
-	'LBL_MSSQL'							=> 'SQL Server',
252
-	'LBL_MSSQL2'                        => 'SQL Server (FreeTDS)',
253
-	'LBL_MSSQL_SQLSRV'				    => 'SQL Server (Microsoft SQL Server Driver for PHP)',
254
-	'LBL_MYSQL'							=> 'MySQL',
255
-	'LBL_MYSQLI'						=> 'MySQL (mysqli extension)',
256
-	'LBL_NEXT'							=> 'Next',
257
-	'LBL_NO'							=> 'No',
258
-	'LBL_PERFORM_ADMIN_PASSWORD'		=> 'Setting site admin password',
259
-	'LBL_PERFORM_CONFIG_PHP'			=> 'Creating SuiteCRM configuration file',
260
-	'LBL_PERFORM_CREATE_DB_1'			=> '<b>Creating the database</b> ',
261
-	'LBL_PERFORM_CREATE_DB_2'			=> ' <b>on</b> ',
262
-	'LBL_PERFORM_CREATE_DB_USER'		=> 'Creating the Database username and password...',
263
-	'LBL_PERFORM_CREATE_DEFAULT'		=> 'Creating default SuiteCRM data',
264
-	'LBL_PERFORM_DEFAULT_SCHEDULER'		=> 'Creating default scheduler jobs',
265
-	'LBL_PERFORM_DEFAULT_USERS'			=> 'Creating default users',
266
-	'LBL_PERFORM_DEMO_DATA'				=> 'Populating the database tables with demo data (this may take a little while)',
267
-	'LBL_PERFORM_DONE'					=> 'done<br>',
268
-	'LBL_PERFORM_FINISH'				=> 'Finish',
269
-	'LBL_PERFORM_OUTRO_1'				=> 'The setup of SuiteCRM ',
270
-	'LBL_PERFORM_OUTRO_2'				=> ' is now complete!',
271
-	'LBL_PERFORM_OUTRO_3'				=> 'Total time: ',
272
-	'LBL_PERFORM_OUTRO_4'				=> ' seconds.',
273
-	'LBL_PERFORM_OUTRO_5'				=> 'Approximate memory used: ',
274
-	'LBL_PERFORM_OUTRO_6'				=> ' bytes.',
275
-	'LBL_PERFORM_SUCCESS'				=> 'Success!',
276
-	'LBL_PERFORM_TABLES'				=> 'Creating SuiteCRM application tables, audit tables and relationship metadata',
277
-	'LBL_PERFORM_TITLE'					=> 'Perform Setup',
278
-	'LBL_PRINT'							=> 'Print',
279
-	'LBL_REG_CONF_1'					=> 'Please complete the short form below to receive product announcements, training news, special offers and special event invitations from SuiteCRM. We do not sell, rent, share or otherwise distribute the information collected here to third parties.',
280
-	'LBL_REG_CONF_3'					=> 'Thank you for registering. Click on the Finish button to login to SuiteCRM. You will need to log in for the first time using the username "admin" and the password you entered in step 2.',
281
-	'LBL_REG_TITLE'						=> 'Registration',
282
-	'LBL_REQUIRED'						=> '* Required field',
283
-
284
-	'LBL_SITECFG_ADMIN_Name'            => 'SuiteCRM Application Admin Name',
285
-	'LBL_SITECFG_ADMIN_PASS_2'			=> 'Re-enter SuiteCRM Admin User Password',
286
-	'LBL_SITECFG_ADMIN_PASS'			=> 'SuiteCRM Admin User Password',
287
-	'LBL_SITECFG_APP_ID'				=> 'Application ID',
288
-	'LBL_SITECFG_CUSTOM_ID_DIRECTIONS'	=> 'If selected, you must provide an application ID to override the auto-generated ID. The ID ensures that sessions of one SuiteCRM instance are not used by other instances. If you have a cluster of SuiteCRM installations, they all must share the same application ID.',
289
-	'LBL_SITECFG_CUSTOM_ID'				=> 'Provide Your Own Application ID',
290
-	'LBL_SITECFG_CUSTOM_LOG_DIRECTIONS'	=> 'If selected, you must specify a log directory to override the default directory for the SuiteCRM log. Regardless of where the log file is located, access to it through a web browser will be restricted via an .htaccess redirect.',
291
-	'LBL_SITECFG_CUSTOM_LOG'			=> 'Use a Custom Log Directory',
292
-	'LBL_SITECFG_CUSTOM_SESSION_DIRECTIONS'	=> 'If selected, you must provide a secure folder for storing SuiteCRM session information. This can be done to prevent session data from being vulnerable on shared servers.',
293
-	'LBL_SITECFG_CUSTOM_SESSION'		=> 'Use a Custom Session Directory for SuiteCRM',
294
-	'LBL_SITECFG_FIX_ERRORS'			=> '<b>Please fix the following errors before proceeding:</b>',
295
-	'LBL_SITECFG_LOG_DIR'				=> 'Log Directory',
296
-	'LBL_SITECFG_SESSION_PATH'			=> 'Path to Session Directory<br>(must be writable)',
297
-	'LBL_SITECFG_SITE_SECURITY'			=> 'Select Security Options',
298
-	'LBL_SITECFG_SUGAR_UP_DIRECTIONS'	=> 'If selected, the system will periodically check for updated versions of the application.',
299
-	'LBL_SITECFG_SUGAR_UP'				=> 'Automatically Check For Updates?',
300
-	'LBL_SITECFG_SUGAR_UPDATES'			=> 'SuiteCRM Updates Config',
301
-	'LBL_SITECFG_TITLE'					=> 'Site Configuration',
302
-	'LBL_SITECFG_TITLE2'                => 'Identify Administration User',
303
-	'LBL_SITECFG_SECURITY_TITLE'        => 'Site Security',
304
-	'LBL_SITECFG_URL'					=> 'URL of SuiteCRM Instance',
305
-	'LBL_SITECFG_ANONSTATS'             => 'Send Anonymous Usage Statistics?',
306
-	'LBL_SITECFG_ANONSTATS_DIRECTIONS'  => 'If selected, SuiteCRM will send <b>anonymous</b> statistics about your installation to SuiteCRM Inc. every time your system checks for new versions. This information will help us better understand how the application is used and guide improvements to the product.',
307
-	'LBL_SITECFG_URL_MSG'               => 'Enter the URL that will be used to access the SuiteCRM instance after installation. The URL will also be used as a base for the URLs in the SuiteCRM application pages. The URL should include the web server or machine name or IP address.',
308
-	'LBL_SITECFG_SYS_NAME_MSG'          => 'Enter a name for your system. This name will be displayed in the browser title bar when users visit the SuiteCRM application.',
309
-	'LBL_SITECFG_PASSWORD_MSG'          => 'After installation, you will need to use the SuiteCRM admin user (default username = admin) to log in to the SuiteCRM instance. Enter a password for this administrator user. This password can be changed after the initial login. You may also enter another admin username to use besides the default value provided.',
310
-	'LBL_SITECFG_COLLATION_MSG'         => 'Select collation (sorting) settings for your system. This settings will create the tables with the specific language you use. In case your language doesn\'t require special settings please use default value.',
311
-	'LBL_SPRITE_SUPPORT'                => 'Sprite Support',
312
-	'LBL_SYSTEM_CREDS'                  => 'System Credentials',
313
-	'LBL_SYSTEM_ENV'                    => 'System Environment',
314
-	'LBL_START'							=> 'Start',
315
-	'LBL_SHOW_PASS'                     => 'Show Passwords',
316
-	'LBL_HIDE_PASS'                     => 'Hide Passwords',
317
-	'LBL_HIDDEN'                        => '<i>(hidden)</i>',
318
-	'LBL_STEP1' => 'Step 1 of 2 - Pre-Installation requirements',
319
-	'LBL_STEP2' => 'Step 2 of 2 - Configuration',
320
-	'LBL_STEP'							=> 'Step',
321
-	'LBL_TITLE_WELCOME'					=> 'Welcome to the SuiteCRM ',
322
-	//welcome page variables
323
-	'LBL_TITLE_ARE_YOU_READY'            => 'Are you ready to install?',
324
-	'REQUIRED_SYS_COMP' => 'Required System Components',
325
-	'REQUIRED_SYS_COMP_MSG' =>
326
-		'Before you begin, please be sure that you have the supported versions of the following system components:<br>
46
+    'LBL_BASIC_SEARCH'					=> 'Quick Filter',
47
+    'LBL_ADVANCED_SEARCH'				=> 'Advanced Filter',
48
+    'LBL_BASIC_TYPE'					=> 'Basic Type',
49
+    'LBL_ADVANCED_TYPE'					=> 'Advanced Type',
50
+    'LBL_SYSOPTS_2'                     => 'What type of database will be used for the SuiteCRM instance you are about to install?',
51
+    'LBL_SYSOPTS_DB'					=> 'Specify Database Type',
52
+    'LBL_SYSOPTS_DB_TITLE'              => 'Database Type',
53
+    'LBL_SYSOPTS_ERRS_TITLE'			=> 'Please fix the following errors before proceeding:',
54
+    'ERR_DB_VERSION_FAILURE'			=> 'Unable to check database version.',
55
+    'DEFAULT_CHARSET'					=> 'UTF-8',
56
+    'ERR_ADMIN_USER_NAME_BLANK'         => 'Provide the user name for the SuiteCRM admin user. ',
57
+    'ERR_ADMIN_PASS_BLANK'				=> 'Provide the password for the SuiteCRM admin user. ',
58
+
59
+    'ERR_CHECKSYS'                      => 'Errors have been detected during compatibility check. In order for your SuiteCRM Installation to function properly, please take the proper steps to address the issues listed below and either press the recheck button, or try installing again.',
60
+    'ERR_CHECKSYS_CALL_TIME'            => 'Allow Call Time Pass Reference is On (this should be set to Off in php.ini)',
61
+    'ERR_CHECKSYS_CURL'					=> 'Not found: SuiteCRM Scheduler will run with limited functionality.',
62
+    'ERR_CHECKSYS_IMAP'					=> 'Not found: InboundEmail and Campaigns (Email) require the IMAP libraries. Neither will be functional.',
63
+    'ERR_CHECKSYS_MEM_LIMIT_1'			=> ' (Set this to ',
64
+    'ERR_CHECKSYS_MEM_LIMIT_2'			=> 'M or larger in your php.ini file)',
65
+    'ERR_CHECKSYS_NOT_WRITABLE'			=> 'Warning: Not Writable',
66
+    'ERR_CHECKSYS_PHP_INVALID_VER'		=> 'Your version of PHP is not supported by SuiteCRM. You will need to install a version that is compatible with the SuiteCRM application. Please consult the Compatibility Matrix in the Release Notes for supported PHP Versions. Your version is ',
67
+    'ERR_CHECKSYS_IIS_INVALID_VER'      => 'Your version of IIS is not supported by SuiteCRM. You will need to install a version that is compatible with the SuiteCRM application. Please consult the Compatibility Matrix in the Release Notes for supported IIS Versions. Your version is ',
68
+    'ERR_CHECKSYS_FASTCGI'              => 'We detect that you are not using a FastCGI handler mapping for PHP. You will need to install/configure a version that is compatible with the SuiteCRM application. Please consult the Compatibility Matrix in the Release Notes for supported Versions. Please see <a href="http://www.iis.net/php/" target="_blank">http://www.iis.net/php/</a> for details ',
69
+    'ERR_CHECKSYS_FASTCGI_LOGGING'      => 'For optimal experience using IIS/FastCGI sapi, set fastcgi.logging to 0 in your php.ini file.',
70
+    'LBL_DB_UNAVAILABLE'                => 'Database unavailable',
71
+    'LBL_CHECKSYS_DB_SUPPORT_NOT_AVAILABLE' => 'Database Support was not found. Please make sure you have the necessary drivers for one of the following supported Database Types: MySQL or MS SQLServer. You might need to uncomment the extension in the php.ini file, or recompile with the right binary file, depending on your version of PHP. Please refer to your PHP Manual for more information on how to enable Database Support.',
72
+    'LBL_CHECKSYS_XML_NOT_AVAILABLE'        => 'Functions associated with XML Parser Libraries that are needed by the SuiteCRM application were not found. You might need to uncomment the extension in the  php.ini file, or recompile with the right binary file, depending on your version of PHP. Please refer to your PHP Manual for more information.',
73
+    'ERR_CHECKSYS_MBSTRING'             => 'Functions associated with the Multibyte Strings PHP extension (mbstring) that are needed by the SuiteCRM application were not found. <br/><br/>Generally, the mbstring module is not enabled by default in PHP and must be activated with --enable-mbstring when the PHP binary is built. Please refer to your PHP Manual for more information on how to enable mbstring support.',
74
+    'ERR_CHECKSYS_CONFIG_NOT_WRITABLE'  => 'The config file exists but is not writeable. Please take the necessary steps to make the file writeable. Depending on your Operating system, this might require you to change the permissions by running chmod 766, or to right click on the filename to access the properties and uncheck the read only option.',
75
+    'ERR_CHECKSYS_CONFIG_OVERRIDE_NOT_WRITABLE'  => 'The config override file exists but is not writeable. Please take the necessary steps to make the file writeable. Depending on your Operating system, this might require you to change the permissions by running chmod 766, or to right click on the filename to access the properties and uncheck the read only option.',
76
+    'ERR_CHECKSYS_CUSTOM_NOT_WRITABLE'  => 'The Custom Directory exists but is not writeable. You may have to change permissions on it (chmod 766) or right click on it and uncheck the read only option, depending on your Operating System. Please take the needed steps to make the file writeable.',
77
+    'ERR_CHECKSYS_FILES_NOT_WRITABLE'   => "The files or directories listed below are not writeable or are missing and cannot be created. Depending on your Operating System, correcting this may require you to change permissions on the files or parent directory (chmod 755), or to right click on the parent directory and uncheck the 'read only' option and apply it to all subfolders.",
78
+    'LBL_CHECKSYS_OVERRIDE_CONFIG' => 'Config override',
79
+    'ERR_CHECKSYS_SAFE_MODE'			=> 'Safe Mode is On (you may wish to disable in php.ini)',
80
+    'ERR_CHECKSYS_ZLIB'					=> 'ZLib support not found: SuiteCRM reaps enormous performance benefits with zlib compression.',
81
+    'ERR_CHECKSYS_ZIP'					=> 'ZIP support not found: SuiteCRM needs ZIP support in order to process compressed files.',
82
+    'ERR_CHECKSYS_PCRE'					=> 'PCRE library not found: SuiteCRM needs PCRE library in order to process Perl style of regular expression pattern matching.',
83
+    'ERR_CHECKSYS_PCRE_VER'				=> 'PCRE library version: SuiteCRM needs PCRE library 7.0 or above to process Perl style of regular expression pattern matching.',
84
+    'ERR_DB_ADMIN'						=> 'The provided database administrator username and/or password is invalid, and a connection to the database could not be established. Please enter a valid user name and password. (Error: ',
85
+    'ERR_DB_ADMIN_MSSQL'                => 'The provided database administrator username and/or password is invalid, and a connection to the database could not be established. Please enter a valid user name and password.',
86
+    'ERR_DB_EXISTS_NOT'					=> 'The specified database does not exist.',
87
+    'ERR_DB_EXISTS_WITH_CONFIG'			=> 'Database already exists with config data. To run an install with the chosen database, please re-run the install and choose: "Drop and recreate existing SuiteCRM tables?"  To upgrade, use the Upgrade Wizard in the Admin Console. Please read the upgrade documentation located <a href="http://www.suitecrm.com" target="_new">here</a>.',
88
+    'ERR_DB_EXISTS'						=> 'The provided Database Name already exists -- cannot create another one with the same name.',
89
+    'ERR_DB_EXISTS_PROCEED'             => 'The provided Database Name already exists. You can<br>1. hit the back button and choose a new database name <br>2. click next and continue but all existing tables on this database will be dropped. <strong>This means your tables and data will be blown away.</strong>',
90
+    'ERR_DB_HOSTNAME'					=> 'Host name cannot be blank.',
91
+    'ERR_DB_INVALID'					=> 'Invalid database type selected.',
92
+    'ERR_DB_LOGIN_FAILURE'				=> 'The provided database host, username, and/or password is invalid, and a connection to the database could not be established. Please enter a valid host, username and password',
93
+    'ERR_DB_LOGIN_FAILURE_MYSQL'		=> 'The provided database host, username, and/or password is invalid, and a connection to the database could not be established. Please enter a valid host, username and password',
94
+    'ERR_DB_LOGIN_FAILURE_MSSQL'		=> 'The provided database host, username, and/or password is invalid, and a connection to the database could not be established. Please enter a valid host, username and password',
95
+    'ERR_DB_MYSQL_VERSION'				=> 'Your MySQL version (%s) is not supported by SuiteCRM. You will need to install a version that is compatible with the SuiteCRM application. Please consult the Compatibility Matrix in the Release Notes for supported MySQL versions.',
96
+    'ERR_DB_NAME'						=> 'Database name cannot be blank.',
97
+    'ERR_DB_MYSQL_DB_NAME_INVALID'      => "Database name cannot contain a '\\', '/', or '.'",
98
+    'ERR_DB_MSSQL_DB_NAME_INVALID'      => "Database name cannot begin with a number, '#', or '@' and cannot contain a space, '\"', \"'\", '*', '/', '\', '?', ':', '<', '>', '&', '!', or '-'",
99
+    'ERR_DB_OCI8_DB_NAME_INVALID'       => "Database name can only consist of alphanumeric characters and the symbols '#', '_' or '$'",
100
+    'ERR_DB_PASSWORD'					=> 'The passwords provided for the SuiteCRM database administrator do not match. Please re-enter the same passwords in the password fields.',
101
+    'ERR_DB_PRIV_USER'					=> 'Provide a database administrator user name. The user is required for the initial connection to the database.',
102
+    'ERR_DB_USER_EXISTS'				=> 'User name for SuiteCRM database user already exists -- cannot create another one with the same name. Please enter a new user name.',
103
+    'ERR_DB_USER'						=> 'Enter a user name for the SuiteCRM database administrator.',
104
+    'ERR_DBCONF_VALIDATION'				=> 'Please fix the following errors before proceeding:',
105
+    'ERR_DBCONF_PASSWORD_MISMATCH'      => 'The passwords provided for the SuiteCRM database user do not match. Please re-enter the same passwords in the password fields.',
106
+    'ERR_ERROR_GENERAL'					=> 'The following errors were encountered:',
107
+    'ERR_LANG_CANNOT_DELETE_FILE'		=> 'Cannot delete file: ',
108
+    'ERR_LANG_MISSING_FILE'				=> 'Cannot find file: ',
109
+    'ERR_LANG_NO_LANG_FILE'			 	=> 'No language pack file found at include/language inside: ',
110
+    'ERR_LANG_UPLOAD_1'					=> 'There was a problem with your upload. Please try again.',
111
+    'ERR_LANG_UPLOAD_2'					=> 'Language Packs must be ZIP archives.',
112
+    'ERR_LANG_UPLOAD_3'					=> 'PHP could not move the temp file to the upgrade directory.',
113
+    'ERR_LOG_DIRECTORY_NOT_EXISTS'		=> 'Log directory provided is not a valid directory.',
114
+    'ERR_LOG_DIRECTORY_NOT_WRITABLE'	=> 'Log directory provided is not a writable directory.',
115
+    'ERR_NO_DIRECT_SCRIPT'				=> 'Unable to process script directly.',
116
+    'ERR_NO_SINGLE_QUOTE'				=> 'Cannot use the single quotation mark for ',
117
+    'ERR_PASSWORD_MISMATCH'				=> 'The passwords provided for the SuiteCRM admin user do not match. Please re-enter the same passwords in the password fields.',
118
+    'ERR_PERFORM_CONFIG_PHP_1'			=> 'Cannot write to the <span class=stop>config.php</span> file.',
119
+    'ERR_PERFORM_CONFIG_PHP_2'			=> 'You can continue this installation by manually creating the config.php file and pasting the configuration information below into the config.php file. However, you <strong>must </strong>create the config.php file before you continue to the next step.',
120
+    'ERR_PERFORM_CONFIG_PHP_3'			=> 'Did you remember to create the config.php file?',
121
+    'ERR_PERFORM_CONFIG_PHP_4'			=> 'Warning: Could not write to config.php file. Please ensure it exists.',
122
+    'ERR_PERFORM_HTACCESS_1'			=> 'Cannot write to the ',
123
+    'ERR_PERFORM_HTACCESS_2'			=> ' file.',
124
+    'ERR_PERFORM_HTACCESS_3'			=> 'If you want to secure your log file from being accessible via browser, create an .htaccess file in your log directory with the line:',
125
+    'ERR_PERFORM_NO_TCPIP'				=> '<b>We could not detect an Internet connection.</b> When you do have a connection, please visit <a href="http://www.suitecrm.com/">http://www.suitecrm.com/</a> to register with SuiteCRM. By letting us know a little bit about how your company plans to use SuiteCRM, we can ensure we are always delivering the right application for your business needs.',
126
+    'ERR_SESSION_DIRECTORY_NOT_EXISTS'	=> 'Session directory provided is not a valid directory.',
127
+    'ERR_SESSION_DIRECTORY'				=> 'Session directory provided is not a writable directory.',
128
+    'ERR_SESSION_PATH'					=> 'Session path is required if you wish to specify your own.',
129
+    'ERR_SI_NO_CONFIG'					=> 'You did not include config_si.php in the document root, or you did not define $sugar_config_si in config.php',
130
+    'ERR_SITE_GUID'						=> 'Application ID is required if you wish to specify your own.',
131
+    'ERROR_SPRITE_SUPPORT'              => "Currently we are not able to locate the GD library, as a result you will not be able to use the CSS Sprite functionality.",
132
+    'ERR_UPLOAD_MAX_FILESIZE'			=> 'Warning: Your PHP configuration should be changed to allow files of at least 6MB to be uploaded.',
133
+    'LBL_UPLOAD_MAX_FILESIZE_TITLE'     => 'Upload File Size',
134
+    'ERR_URL_BLANK'						=> 'Provide the base URL for the SuiteCRM instance.',
135
+    'ERR_UW_NO_UPDATE_RECORD'			=> 'Could not locate installation record of',
136
+    'ERROR_FLAVOR_INCOMPATIBLE'			=> 'The uploaded file is not compatible with this flavor of SuiteCRM: ',
137
+    'ERROR_MANIFEST_TYPE'				=> 'Manifest file must specify the package type.',
138
+    'ERROR_PACKAGE_TYPE'				=> 'Manifest file specifies an unrecognized package type',
139
+    'ERROR_VERSION_INCOMPATIBLE'		=> 'The uploaded file is not compatible with this version of SuiteCRM: ',
140
+
141
+    'LBL_BACK'							=> 'Back',
142
+    'LBL_CANCEL'                        => 'Cancel',
143
+    'LBL_ACCEPT'                        => 'I Accept',
144
+    'LBL_CHECKSYS_CACHE'				=> 'Writable Cache Sub-Directories',
145
+    'LBL_DROP_DB_CONFIRM'               => 'The provided Database Name already exists.<br>You can either:<br>1. Click on the Cancel button and choose a new database name, or <br>2. Click the Accept button and continue. All existing tables in the database will be dropped. <strong>This means that all of the tables and pre-existing data will be blown away.</strong>',
146
+    'LBL_CHECKSYS_COMPONENT'			=> 'Component',
147
+    'LBL_CHECKSYS_CONFIG'				=> 'Writable SuiteCRM Configuration File (config.php)',
148
+    'LBL_CHECKSYS_CURL'					=> 'cURL Module',
149
+    'LBL_CHECKSYS_CUSTOM'				=> 'Writeable Custom Directory',
150
+    'LBL_CHECKSYS_DATA'					=> 'Writable Data Sub-Directories',
151
+    'LBL_CHECKSYS_IMAP'					=> 'IMAP Module',
152
+    'LBL_CHECKSYS_FASTCGI'             => 'FastCGI',
153
+    'LBL_CHECKSYS_MBSTRING'				=> 'MB Strings Module',
154
+    'LBL_CHECKSYS_MEM_OK'				=> 'OK (No Limit)',
155
+    'LBL_CHECKSYS_MEM_UNLIMITED'		=> 'OK (Unlimited)',
156
+    'LBL_CHECKSYS_MEM'					=> 'PHP Memory Limit',
157
+    'LBL_CHECKSYS_MODULE'				=> 'Writable Modules Sub-Directories and Files',
158
+    'LBL_CHECKSYS_NOT_AVAILABLE'		=> 'Not Available',
159
+    'LBL_CHECKSYS_OK'					=> 'OK',
160
+    'LBL_CHECKSYS_PHP_INI'				=> 'Location of your PHP configuration file (php.ini):',
161
+    'LBL_CHECKSYS_PHP_OK'				=> 'OK (ver ',
162
+    'LBL_CHECKSYS_PHPVER'				=> 'PHP Version',
163
+    'LBL_CHECKSYS_IISVER'               => 'IIS Version',
164
+    'LBL_CHECKSYS_RECHECK'				=> 'Re-check',
165
+    'LBL_CHECKSYS_STATUS'				=> 'Status',
166
+    'LBL_CHECKSYS_TITLE'				=> 'System Check Acceptance',
167
+    'LBL_CHECKSYS_XML'					=> 'XML Parsing',
168
+    'LBL_CHECKSYS_ZLIB'					=> 'ZLIB Compression Module',
169
+    'LBL_CHECKSYS_ZIP'					=> 'ZIP Handling Module',
170
+    'LBL_CHECKSYS_PCRE'					=> 'PCRE Library',
171
+    'LBL_CHECKSYS_FIX_FILES'            => 'Please fix the following files or directories before proceeding:',
172
+    'LBL_CHECKSYS_FIX_MODULE_FILES'     => 'Please fix the following module directories and the files under them before proceeding:',
173
+    'LBL_CHECKSYS_UPLOAD'               => 'Writable Upload Directory',
174
+    'LBL_CLOSE'							=> 'Close',
175
+    'LBL_THREE'                         => '3',
176
+    'LBL_CONFIRM_BE_CREATED'			=> 'be created',
177
+    'LBL_CONFIRM_DB_TYPE'				=> 'Database Type',
178
+    'LBL_CONFIRM_NOT'					=> 'not',
179
+    'LBL_CONFIRM_TITLE'					=> 'Confirm Settings',
180
+    'LBL_CONFIRM_WILL'					=> 'will',
181
+    'LBL_DBCONF_DB_DROP'                => 'Drop Tables',
182
+    'LBL_DBCONF_DB_NAME'				=> 'Database Name',
183
+    'LBL_DBCONF_DB_PASSWORD'			=> 'SuiteCRM Database User Password',
184
+    'LBL_DBCONF_DB_PASSWORD2'			=> 'Re-enter SuiteCRM Database User Password',
185
+    'LBL_DBCONF_DB_USER'				=> 'SuiteCRM Database User',
186
+    'LBL_DBCONF_SUGAR_DB_USER'          => 'SuiteCRM Database User',
187
+    'LBL_DBCONF_DB_ADMIN_USER'          => 'Database Administrator Username',
188
+    'LBL_DBCONF_DB_ADMIN_PASSWORD'      => 'Database Admin Password',
189
+    'LBL_DBCONF_DEMO_DATA'				=> 'Populate Database with Demo Data?',
190
+    'LBL_DBCONF_DEMO_DATA_TITLE'        => 'Choose Demo Data',
191
+    'LBL_DBCONF_HOST_NAME'				=> 'Host Name',
192
+    'LBL_DBCONF_HOST_INSTANCE'			=> 'Host Instance',
193
+    'LBL_DBCONFIG_SECURITY'             => 'For security purposes, you can specify an exclusive database user to connect to the SuiteCRM database. This user must be able to write, update and retrieve data on the SuiteCRM database that will be created for this instance. This user can be the database administrator specified above, or you can provide new or existing database user information.',
194
+    'LBL_DBCONFIG_PROVIDE_DD'           => 'Provide existing user',
195
+    'LBL_DBCONFIG_CREATE_DD'            => 'Define user to create',
196
+    'LBL_DBCONFIG_SAME_DD'              => 'Same as Admin User',
197
+    'LBL_DBCONF_TITLE'					=> 'Database Configuration',
198
+    'LBL_DBCONF_TITLE_NAME'             => 'Provide Database Name',
199
+    'LBL_DBCONF_TITLE_USER_INFO'        => 'Provide Database User Information',
200
+    'LBL_DBCONF_TITLE_PSWD_INFO_LABEL' => 'Password',
201
+    'LBL_DISABLED_DESCRIPTION_2'		=> 'After this change has been made, you may click the "Start" button below to begin your installation. <i>After the installation is complete, you will want to change the value for \'installer_locked\' to \'true\'.</i>',
202
+    'LBL_DISABLED_DESCRIPTION'			=> 'The installer has already been run once. As a safety measure, it has been disabled from running a second time. If you are absolutely sure you want to run it again, please go to your config.php file and locate (or add) a variable called \'installer_locked\' and set it to \'false\'. The line should look like this:',
203
+    'LBL_DISABLED_HELP_1'				=> 'For installation help, please visit the SuiteCRM',
204
+    'LBL_DISABLED_HELP_LNK'             => 'http://www.suitecrm.com/forum/index',
205
+    'LBL_DISABLED_HELP_2'				=> 'support forums',
206
+    'LBL_DISABLED_TITLE_2'				=> 'SuiteCRM Installation has been Disabled',
207
+    'LBL_HELP'							=> 'Help',
208
+    'LBL_INSTALL'                       => 'Install',
209
+    'LBL_INSTALL_TYPE_TITLE'            => 'Installation Options',
210
+    'LBL_INSTALL_TYPE_SUBTITLE'         => 'Choose Install Type',
211
+    'LBL_INSTALL_TYPE_TYPICAL'          => ' <b>Typical Install</b>',
212
+    'LBL_INSTALL_TYPE_CUSTOM'           => ' <b>Custom Install</b>',
213
+    'LBL_INSTALL_TYPE_MSG2'             => 'Requires minimum information for the installation. Recommended for new users.',
214
+    'LBL_INSTALL_TYPE_MSG3'             => 'Provides additional options to set during the installation. Most of these options are also available after installation in the admin screens. Recommended for advanced users.',
215
+    'LBL_LANG_1'						=> 'To use a language in SuiteCRM other than the default language (US-English), you can upload and install the language pack at this time. You will be able to upload and install language packs from within the SuiteCRM application as well. If you would like to skip this step, click Next.',
216
+    'LBL_LANG_BUTTON_COMMIT'			=> 'Install',
217
+    'LBL_LANG_BUTTON_REMOVE'			=> 'Remove',
218
+    'LBL_LANG_BUTTON_UNINSTALL'			=> 'Uninstall',
219
+    'LBL_LANG_BUTTON_UPLOAD'			=> 'Upload',
220
+    'LBL_LANG_NO_PACKS'					=> 'none',
221
+    'LBL_LANG_PACK_INSTALLED'			=> 'The following language packs have been installed: ',
222
+    'LBL_LANG_PACK_READY'				=> 'The following language packs are ready to be installed: ',
223
+    'LBL_LANG_SUCCESS'					=> 'The language pack was successfully uploaded.',
224
+    'LBL_LANG_TITLE'			   		=> 'Language Pack',
225
+    'LBL_LAUNCHING_SILENT_INSTALL'     => 'Installing SuiteCRM now. This may take up to a few minutes.',
226
+    'LBL_LANG_UPLOAD'					=> 'Upload a Language Pack',
227
+    'LBL_LICENSE_ACCEPTANCE'			=> 'License Acceptance',
228
+    'LBL_LICENSE_CHECKING'              => 'Checking system for compatibility.',
229
+    'LBL_LICENSE_CHKENV_HEADER'         => 'Checking Environment',
230
+    'LBL_LICENSE_CHKDB_HEADER'          => 'Verifying DB Credentials.',
231
+    'LBL_LICENSE_CHECK_PASSED'          => 'System passed check for compatibility.',
232
+    'LBL_CREATE_CACHE' => 'Preparing to Install...',
233
+    'LBL_LICENSE_REDIRECT'              => 'Redirecting in ',
234
+    'LBL_LICENSE_I_ACCEPT'				=> 'I Accept',
235
+    'LBL_LICENSE_PRINTABLE'				=> ' Printable View ',
236
+    'LBL_PRINT_SUMM'                    => 'Print Summary',
237
+    'LBL_LICENSE_TITLE_2'				=> 'SuiteCRM License',
238
+
239
+    'LBL_LOCALE_NAME_FIRST'				=> 'David',
240
+    'LBL_LOCALE_NAME_LAST'				=> 'Livingstone',
241
+    'LBL_LOCALE_NAME_SALUTATION'		=> 'Dr.',
242
+
243
+    'LBL_ML_ACTION'						=> 'Action',
244
+    'LBL_ML_DESCRIPTION'				=> 'Description',
245
+    'LBL_ML_INSTALLED'					=> 'Date Installed',
246
+    'LBL_ML_NAME'						=> 'Name',
247
+    'LBL_ML_PUBLISHED'					=> 'Date Published',
248
+    'LBL_ML_TYPE'						=> 'Type',
249
+    'LBL_ML_UNINSTALLABLE'				=> 'Uninstallable',
250
+    'LBL_ML_VERSION'					=> 'Version',
251
+    'LBL_MSSQL'							=> 'SQL Server',
252
+    'LBL_MSSQL2'                        => 'SQL Server (FreeTDS)',
253
+    'LBL_MSSQL_SQLSRV'				    => 'SQL Server (Microsoft SQL Server Driver for PHP)',
254
+    'LBL_MYSQL'							=> 'MySQL',
255
+    'LBL_MYSQLI'						=> 'MySQL (mysqli extension)',
256
+    'LBL_NEXT'							=> 'Next',
257
+    'LBL_NO'							=> 'No',
258
+    'LBL_PERFORM_ADMIN_PASSWORD'		=> 'Setting site admin password',
259
+    'LBL_PERFORM_CONFIG_PHP'			=> 'Creating SuiteCRM configuration file',
260
+    'LBL_PERFORM_CREATE_DB_1'			=> '<b>Creating the database</b> ',
261
+    'LBL_PERFORM_CREATE_DB_2'			=> ' <b>on</b> ',
262
+    'LBL_PERFORM_CREATE_DB_USER'		=> 'Creating the Database username and password...',
263
+    'LBL_PERFORM_CREATE_DEFAULT'		=> 'Creating default SuiteCRM data',
264
+    'LBL_PERFORM_DEFAULT_SCHEDULER'		=> 'Creating default scheduler jobs',
265
+    'LBL_PERFORM_DEFAULT_USERS'			=> 'Creating default users',
266
+    'LBL_PERFORM_DEMO_DATA'				=> 'Populating the database tables with demo data (this may take a little while)',
267
+    'LBL_PERFORM_DONE'					=> 'done<br>',
268
+    'LBL_PERFORM_FINISH'				=> 'Finish',
269
+    'LBL_PERFORM_OUTRO_1'				=> 'The setup of SuiteCRM ',
270
+    'LBL_PERFORM_OUTRO_2'				=> ' is now complete!',
271
+    'LBL_PERFORM_OUTRO_3'				=> 'Total time: ',
272
+    'LBL_PERFORM_OUTRO_4'				=> ' seconds.',
273
+    'LBL_PERFORM_OUTRO_5'				=> 'Approximate memory used: ',
274
+    'LBL_PERFORM_OUTRO_6'				=> ' bytes.',
275
+    'LBL_PERFORM_SUCCESS'				=> 'Success!',
276
+    'LBL_PERFORM_TABLES'				=> 'Creating SuiteCRM application tables, audit tables and relationship metadata',
277
+    'LBL_PERFORM_TITLE'					=> 'Perform Setup',
278
+    'LBL_PRINT'							=> 'Print',
279
+    'LBL_REG_CONF_1'					=> 'Please complete the short form below to receive product announcements, training news, special offers and special event invitations from SuiteCRM. We do not sell, rent, share or otherwise distribute the information collected here to third parties.',
280
+    'LBL_REG_CONF_3'					=> 'Thank you for registering. Click on the Finish button to login to SuiteCRM. You will need to log in for the first time using the username "admin" and the password you entered in step 2.',
281
+    'LBL_REG_TITLE'						=> 'Registration',
282
+    'LBL_REQUIRED'						=> '* Required field',
283
+
284
+    'LBL_SITECFG_ADMIN_Name'            => 'SuiteCRM Application Admin Name',
285
+    'LBL_SITECFG_ADMIN_PASS_2'			=> 'Re-enter SuiteCRM Admin User Password',
286
+    'LBL_SITECFG_ADMIN_PASS'			=> 'SuiteCRM Admin User Password',
287
+    'LBL_SITECFG_APP_ID'				=> 'Application ID',
288
+    'LBL_SITECFG_CUSTOM_ID_DIRECTIONS'	=> 'If selected, you must provide an application ID to override the auto-generated ID. The ID ensures that sessions of one SuiteCRM instance are not used by other instances. If you have a cluster of SuiteCRM installations, they all must share the same application ID.',
289
+    'LBL_SITECFG_CUSTOM_ID'				=> 'Provide Your Own Application ID',
290
+    'LBL_SITECFG_CUSTOM_LOG_DIRECTIONS'	=> 'If selected, you must specify a log directory to override the default directory for the SuiteCRM log. Regardless of where the log file is located, access to it through a web browser will be restricted via an .htaccess redirect.',
291
+    'LBL_SITECFG_CUSTOM_LOG'			=> 'Use a Custom Log Directory',
292
+    'LBL_SITECFG_CUSTOM_SESSION_DIRECTIONS'	=> 'If selected, you must provide a secure folder for storing SuiteCRM session information. This can be done to prevent session data from being vulnerable on shared servers.',
293
+    'LBL_SITECFG_CUSTOM_SESSION'		=> 'Use a Custom Session Directory for SuiteCRM',
294
+    'LBL_SITECFG_FIX_ERRORS'			=> '<b>Please fix the following errors before proceeding:</b>',
295
+    'LBL_SITECFG_LOG_DIR'				=> 'Log Directory',
296
+    'LBL_SITECFG_SESSION_PATH'			=> 'Path to Session Directory<br>(must be writable)',
297
+    'LBL_SITECFG_SITE_SECURITY'			=> 'Select Security Options',
298
+    'LBL_SITECFG_SUGAR_UP_DIRECTIONS'	=> 'If selected, the system will periodically check for updated versions of the application.',
299
+    'LBL_SITECFG_SUGAR_UP'				=> 'Automatically Check For Updates?',
300
+    'LBL_SITECFG_SUGAR_UPDATES'			=> 'SuiteCRM Updates Config',
301
+    'LBL_SITECFG_TITLE'					=> 'Site Configuration',
302
+    'LBL_SITECFG_TITLE2'                => 'Identify Administration User',
303
+    'LBL_SITECFG_SECURITY_TITLE'        => 'Site Security',
304
+    'LBL_SITECFG_URL'					=> 'URL of SuiteCRM Instance',
305
+    'LBL_SITECFG_ANONSTATS'             => 'Send Anonymous Usage Statistics?',
306
+    'LBL_SITECFG_ANONSTATS_DIRECTIONS'  => 'If selected, SuiteCRM will send <b>anonymous</b> statistics about your installation to SuiteCRM Inc. every time your system checks for new versions. This information will help us better understand how the application is used and guide improvements to the product.',
307
+    'LBL_SITECFG_URL_MSG'               => 'Enter the URL that will be used to access the SuiteCRM instance after installation. The URL will also be used as a base for the URLs in the SuiteCRM application pages. The URL should include the web server or machine name or IP address.',
308
+    'LBL_SITECFG_SYS_NAME_MSG'          => 'Enter a name for your system. This name will be displayed in the browser title bar when users visit the SuiteCRM application.',
309
+    'LBL_SITECFG_PASSWORD_MSG'          => 'After installation, you will need to use the SuiteCRM admin user (default username = admin) to log in to the SuiteCRM instance. Enter a password for this administrator user. This password can be changed after the initial login. You may also enter another admin username to use besides the default value provided.',
310
+    'LBL_SITECFG_COLLATION_MSG'         => 'Select collation (sorting) settings for your system. This settings will create the tables with the specific language you use. In case your language doesn\'t require special settings please use default value.',
311
+    'LBL_SPRITE_SUPPORT'                => 'Sprite Support',
312
+    'LBL_SYSTEM_CREDS'                  => 'System Credentials',
313
+    'LBL_SYSTEM_ENV'                    => 'System Environment',
314
+    'LBL_START'							=> 'Start',
315
+    'LBL_SHOW_PASS'                     => 'Show Passwords',
316
+    'LBL_HIDE_PASS'                     => 'Hide Passwords',
317
+    'LBL_HIDDEN'                        => '<i>(hidden)</i>',
318
+    'LBL_STEP1' => 'Step 1 of 2 - Pre-Installation requirements',
319
+    'LBL_STEP2' => 'Step 2 of 2 - Configuration',
320
+    'LBL_STEP'							=> 'Step',
321
+    'LBL_TITLE_WELCOME'					=> 'Welcome to the SuiteCRM ',
322
+    //welcome page variables
323
+    'LBL_TITLE_ARE_YOU_READY'            => 'Are you ready to install?',
324
+    'REQUIRED_SYS_COMP' => 'Required System Components',
325
+    'REQUIRED_SYS_COMP_MSG' =>
326
+        'Before you begin, please be sure that you have the supported versions of the following system components:<br>
327 327
                       <ul>
328 328
                       <li> Database/Database Management System (Examples: MariaDB, MySQL or SQL Server)</li>
329 329
                       <li> Web Server (Apache, IIS)</li>
330 330
                       </ul>
331 331
                       Consult the Compatibility Matrix in the Release Notes for
332 332
                       compatible system components for the SuiteCRM version that you are installing.<br>',
333
-	'REQUIRED_SYS_CHK' => 'Initial System Check',
334
-	'REQUIRED_SYS_CHK_MSG' =>
335
-		'When you begin the installation process, a system check will be performed on the web server on which the SuiteCRM files are located in order to
333
+    'REQUIRED_SYS_CHK' => 'Initial System Check',
334
+    'REQUIRED_SYS_CHK_MSG' =>
335
+        'When you begin the installation process, a system check will be performed on the web server on which the SuiteCRM files are located in order to
336 336
                       make sure the system is configured properly and has all of the necessary components
337 337
                       to successfully complete the installation. <br><br>
338 338
                       The system checks all of the following:<br>
@@ -354,9 +354,9 @@  discard block
 block discarded – undo
354 354
 
355 355
 
356 356
 
357
-	'REQUIRED_INSTALLTYPE' => 'Typical or Custom install',
358
-	'REQUIRED_INSTALLTYPE_MSG' =>
359
-		'After the system check is performed, you can choose either
357
+    'REQUIRED_INSTALLTYPE' => 'Typical or Custom install',
358
+    'REQUIRED_INSTALLTYPE_MSG' =>
359
+        'After the system check is performed, you can choose either
360 360
                       the Typical or the Custom installation.<br><br>
361 361
                       For both <b>Typical</b> and <b>Custom</b> installations, you will need to know the following:<br>
362 362
                       <ul>
@@ -398,40 +398,40 @@  discard block
 block discarded – undo
398 398
                                   <li><b>Character Set</b> most commonly used in your locale.<br><br></li></ul>
399 399
                                   For more detailed information, please consult the Installation Guide.
400 400
                                 ',
401
-	'LBL_WELCOME_PLEASE_READ_BELOW' => 'Please read the following important information before proceeding with the installation. The information will help you determine whether or not you are ready to install the application at this time.',
402
-
403
-	'LBL_WELCOME_CHOOSE_LANGUAGE'		=> '<b>Choose your language</b>',
404
-	'LBL_WELCOME_SETUP_WIZARD'			=> 'Setup Wizard',
405
-	'LBL_WIZARD_TITLE'					=> 'SuiteCRM Setup Wizard: ',
406
-	'LBL_YES'							=> 'Yes',
407
-
408
-	'LBL_PATCHES_TITLE'     => 'Install Latest Patches',
409
-	'LBL_MODULE_TITLE'      => 'Install Language Packs',
410
-	'LBL_PATCH_1'           => 'If you would like to skip this step, click Next.',
411
-	'LBL_PATCH_TITLE'       => 'System Patch',
412
-	'LBL_PATCH_READY'       => 'The following patch(es) are ready to be installed:',
413
-	'LBL_SESSION_ERR_DESCRIPTION'		=> "SuiteCRM relies upon PHP sessions to store important information while connected to this web server. Your PHP installation does not have the Session information correctly configured.
401
+    'LBL_WELCOME_PLEASE_READ_BELOW' => 'Please read the following important information before proceeding with the installation. The information will help you determine whether or not you are ready to install the application at this time.',
402
+
403
+    'LBL_WELCOME_CHOOSE_LANGUAGE'		=> '<b>Choose your language</b>',
404
+    'LBL_WELCOME_SETUP_WIZARD'			=> 'Setup Wizard',
405
+    'LBL_WIZARD_TITLE'					=> 'SuiteCRM Setup Wizard: ',
406
+    'LBL_YES'							=> 'Yes',
407
+
408
+    'LBL_PATCHES_TITLE'     => 'Install Latest Patches',
409
+    'LBL_MODULE_TITLE'      => 'Install Language Packs',
410
+    'LBL_PATCH_1'           => 'If you would like to skip this step, click Next.',
411
+    'LBL_PATCH_TITLE'       => 'System Patch',
412
+    'LBL_PATCH_READY'       => 'The following patch(es) are ready to be installed:',
413
+    'LBL_SESSION_ERR_DESCRIPTION'		=> "SuiteCRM relies upon PHP sessions to store important information while connected to this web server. Your PHP installation does not have the Session information correctly configured.
414 414
 											<br><br>A common misconfiguration is that the <b>'session.save_path'</b> directive is not pointing to a valid directory. <br>
415 415
 											<br> Please correct your <a target=_new href='http://us2.php.net/manual/en/ref.session.php'>PHP configuration</a> in the php.ini file located here below.",
416
-	'LBL_SESSION_ERR_TITLE'				=> 'PHP Sessions Configuration Error',
417
-	'LBL_SYSTEM_NAME'=>'System Name',
418
-	'LBL_COLLATION' => 'Collation Settings',
419
-	'LBL_REQUIRED_SYSTEM_NAME'=>'Provide a System Name for the SuiteCRM instance.',
420
-	'LBL_PATCH_UPLOAD' => 'Select a patch file from your local computer',
421
-	'LBL_INCOMPATIBLE_PHP_VERSION' => 'Php version 5 or above is required.',
422
-	'LBL_MINIMUM_PHP_VERSION' => 'Minimum Php version required is 5.1.0. Recommended Php version is 5.2.x.',
423
-	'LBL_YOUR_PHP_VERSION' => '(Your current php version is ',
424
-	'LBL_RECOMMENDED_PHP_VERSION' =>' Recommended php version is 5.2.x)',
425
-	'LBL_BACKWARD_COMPATIBILITY_ON' => 'Php Backward Compatibility mode is turned on. Set zend.ze1_compatibility_mode to Off for proceeding further',
426
-	'LBL_STREAM' => 'PHP allows to use stream',
427
-
428
-	'advanced_password_new_account_email' => array(
429
-		'subject' => 'New account information',
430
-		'type' => 'system',
431
-		'description' => 'This template is used when the System Administrator sends a new password to a user.',
432
-		'body' => '<div><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width="550" align=\"\&quot;\&quot;center\&quot;\&quot;\"><tbody><tr><td colspan=\"2\"><p>Here is your account username and temporary password:</p><p>Username : $contact_user_user_name </p><p>Password : $contact_user_user_hash </p><br><p>$config_site_url</p><br><p>After you log in using the above password, you may be required to reset the password to one of your own choice.</p>   </td>         </tr><tr><td colspan=\"2\"></td>         </tr> </tbody></table> </div>',
433
-		'txt_body' =>
434
-			'
416
+    'LBL_SESSION_ERR_TITLE'				=> 'PHP Sessions Configuration Error',
417
+    'LBL_SYSTEM_NAME'=>'System Name',
418
+    'LBL_COLLATION' => 'Collation Settings',
419
+    'LBL_REQUIRED_SYSTEM_NAME'=>'Provide a System Name for the SuiteCRM instance.',
420
+    'LBL_PATCH_UPLOAD' => 'Select a patch file from your local computer',
421
+    'LBL_INCOMPATIBLE_PHP_VERSION' => 'Php version 5 or above is required.',
422
+    'LBL_MINIMUM_PHP_VERSION' => 'Minimum Php version required is 5.1.0. Recommended Php version is 5.2.x.',
423
+    'LBL_YOUR_PHP_VERSION' => '(Your current php version is ',
424
+    'LBL_RECOMMENDED_PHP_VERSION' =>' Recommended php version is 5.2.x)',
425
+    'LBL_BACKWARD_COMPATIBILITY_ON' => 'Php Backward Compatibility mode is turned on. Set zend.ze1_compatibility_mode to Off for proceeding further',
426
+    'LBL_STREAM' => 'PHP allows to use stream',
427
+
428
+    'advanced_password_new_account_email' => array(
429
+        'subject' => 'New account information',
430
+        'type' => 'system',
431
+        'description' => 'This template is used when the System Administrator sends a new password to a user.',
432
+        'body' => '<div><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width="550" align=\"\&quot;\&quot;center\&quot;\&quot;\"><tbody><tr><td colspan=\"2\"><p>Here is your account username and temporary password:</p><p>Username : $contact_user_user_name </p><p>Password : $contact_user_user_hash </p><br><p>$config_site_url</p><br><p>After you log in using the above password, you may be required to reset the password to one of your own choice.</p>   </td>         </tr><tr><td colspan=\"2\"></td>         </tr> </tbody></table> </div>',
433
+        'txt_body' =>
434
+            '
435 435
 Here is your account username and temporary password:
436 436
 Username : $contact_user_user_name
437 437
 Password : $contact_user_user_hash
@@ -439,120 +439,120 @@  discard block
 block discarded – undo
439 439
 $config_site_url
440 440
 
441 441
 After you log in using the above password, you may be required to reset the password to one of your own choice.',
442
-		'name' => 'System-generated password email',
443
-	),
444
-	'advanced_password_forgot_password_email' => array(
445
-		'subject' => 'Reset your account password',
446
-		'type' => 'system',
442
+        'name' => 'System-generated password email',
443
+    ),
444
+    'advanced_password_forgot_password_email' => array(
445
+        'subject' => 'Reset your account password',
446
+        'type' => 'system',
447 447
         'description' => "This template is used to send a user a link to click to reset the user's account password.",
448
-		'body' => '<div><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width="550" align=\"\&quot;\&quot;center\&quot;\&quot;\"><tbody><tr><td colspan=\"2\"><p>You recently requested on $contact_user_pwd_last_changed to be able to reset your account password. </p><p>Click on the link below to reset your password:</p><p> $contact_user_link_guid </p>  </td>         </tr><tr><td colspan=\"2\"></td>         </tr> </tbody></table> </div>',
449
-		'txt_body' =>
450
-			'
448
+        'body' => '<div><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width="550" align=\"\&quot;\&quot;center\&quot;\&quot;\"><tbody><tr><td colspan=\"2\"><p>You recently requested on $contact_user_pwd_last_changed to be able to reset your account password. </p><p>Click on the link below to reset your password:</p><p> $contact_user_link_guid </p>  </td>         </tr><tr><td colspan=\"2\"></td>         </tr> </tbody></table> </div>',
449
+        'txt_body' =>
450
+            '
451 451
 You recently requested on $contact_user_pwd_last_changed to be able to reset your account password.
452 452
 
453 453
 Click on the link below to reset your password:
454 454
 
455 455
 $contact_user_link_guid',
456
-		'name' => 'Forgot Password email',
457
-	),
458
-
459
-	// SMTP settings
460
-
461
-	'LBL_WIZARD_SMTP_DESC' => 'Provide the email account that will be used to send emails, such as the assignment notifications and new user passwords. Users will receive emails from SuiteCRM, as sent from the specified email account.',
462
-	'LBL_CHOOSE_EMAIL_PROVIDER'        => 'Choose your Email provider:',
463
-
464
-	'LBL_SMTPTYPE_GMAIL'                    => 'Gmail',
465
-	'LBL_SMTPTYPE_YAHOO'                    => 'Yahoo! Mail',
466
-	'LBL_SMTPTYPE_EXCHANGE'                 => 'Microsoft Exchange',
467
-	'LBL_SMTPTYPE_OTHER'                  => 'Other',
468
-	'LBL_MAIL_SMTP_SETTINGS'           => 'SMTP Server Specification',
469
-	'LBL_MAIL_SMTPSERVER'				=> 'SMTP Server:',
470
-	'LBL_MAIL_SMTPPORT'					=> 'SMTP Port:',
471
-	'LBL_MAIL_SMTPAUTH_REQ'				=> 'Use SMTP Authentication?',
472
-	'LBL_EMAIL_SMTP_SSL_OR_TLS'         => 'Enable SMTP over SSL or TLS?',
473
-	'LBL_GMAIL_SMTPUSER'					=> 'Gmail Email Address:',
474
-	'LBL_GMAIL_SMTPPASS'					=> 'Gmail Password:',
475
-	'LBL_ALLOW_DEFAULT_SELECTION'           => 'Allow users to use this account for outgoing email:',
476
-	'LBL_ALLOW_DEFAULT_SELECTION_HELP'          => 'When this option is selected, all users will be able to send emails using the same outgoing mail account used to send system notifications and alerts. If the option is not selected, users can still use the outgoing mail server after providing their own account information.',
477
-
478
-	'LBL_YAHOOMAIL_SMTPPASS'					=> 'Yahoo! Mail Password:',
479
-	'LBL_YAHOOMAIL_SMTPUSER'					=> 'Yahoo! Mail ID:',
480
-
481
-	'LBL_EXCHANGE_SMTPPASS'					=> 'Exchange Password:',
482
-	'LBL_EXCHANGE_SMTPUSER'					=> 'Exchange Username:',
483
-	'LBL_EXCHANGE_SMTPPORT'					=> 'Exchange Server Port:',
484
-	'LBL_EXCHANGE_SMTPSERVER'				=> 'Exchange Server:',
485
-
486
-
487
-	'LBL_MAIL_SMTPUSER'					=> 'SMTP Username:',
488
-	'LBL_MAIL_SMTPPASS'					=> 'SMTP Password:',
489
-
490
-	// Branding
491
-
492
-	'LBL_WIZARD_SYSTEM_TITLE' => 'Branding',
493
-	'LBL_WIZARD_SYSTEM_DESC' => 'Provide your organization\'s name and logo in order to brand your SuiteCRM.',
494
-	'SYSTEM_NAME_WIZARD'=>'Name:',
495
-	'SYSTEM_NAME_HELP'=>'This is the name that displays in the title bar of your browser.',
496
-	'NEW_LOGO'=>'Select Logo:',
497
-	'NEW_LOGO_HELP'=>'The image file format can be either .png or .jpg. The maximum height is 170px, and the maximum width is 450px. Any image uploaded that is larger in any direction will be scaled to these max dimensions.',
498
-	'COMPANY_LOGO_UPLOAD_BTN' => 'Upload',
499
-	'CURRENT_LOGO'=>'Current Logo:',
500
-	'CURRENT_LOGO_HELP'=>'This logo is displayed in the left-hand corner of the footer of the SuiteCRM application.',
501
-
502
-
503
-	//Scenario selection of modules
504
-	'LBL_WIZARD_SCENARIO_TITLE' => 'Scenario Selection',
505
-	'LBL_WIZARD_SCENARIO_DESC' => 'This is to allow tailoring of the displayed modules based on your requirements. Each of the modules can be enabled after install using the administration page.',
506
-	'LBL_WIZARD_SCENARIO_EMPTY'=> 'There are no scenarios currently set in the configuration file (config.php)',
507
-
508
-
509
-
510
-	// System Local Settings
511
-
512
-
513
-	'LBL_LOCALE_TITLE' => 'System Locale Settings',
514
-	'LBL_WIZARD_LOCALE_DESC' => 'Specify how you would like data in SuiteCRM to be displayed, based on your geographical location. The settings you provide here will be the default settings. Users will be able set their own preferences.',
515
-	'LBL_DATE_FORMAT' => 'Date Format:',
516
-	'LBL_TIME_FORMAT' => 'Time Format:',
517
-	'LBL_TIMEZONE' => 'Time Zone:',
518
-	'LBL_LANGUAGE'=>'Language:',
519
-	'LBL_CURRENCY'=>'Currency:',
520
-	'LBL_CURRENCY_SYMBOL'=>'Currency Symbol:',
521
-	'LBL_CURRENCY_ISO4217' => 'ISO 4217 Currency Code:',
522
-	'LBL_NUMBER_GROUPING_SEP' => '1000s separator:',
523
-	'LBL_DECIMAL_SEP' => 'Decimal symbol:',
524
-	'LBL_NAME_FORMAT' => 'Name Format:',
525
-	'UPLOAD_LOGO' => 'Please wait, logo uploading..',
526
-	'ERR_UPLOAD_FILETYPE' => 'File type do not allowed, please upload a jpeg or png.',
527
-	'ERR_LANG_UPLOAD_UNKNOWN' => 'Unknown file upload error occured.',
528
-	'ERR_UPLOAD_FILE_UPLOAD_ERR_INI_SIZE' => 'The uploaded file exceeds the upload_max_filesize directive in php.ini.',
529
-	'ERR_UPLOAD_FILE_UPLOAD_ERR_FORM_SIZE' => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.',
530
-	'ERR_UPLOAD_FILE_UPLOAD_ERR_PARTIAL' => 'The uploaded file was only partially uploaded.',
531
-	'ERR_UPLOAD_FILE_UPLOAD_ERR_NO_FILE' => 'No file was uploaded.',
532
-	'ERR_UPLOAD_FILE_UPLOAD_ERR_NO_TMP_DIR' => 'Missing a temporary folder.',
533
-	'ERR_UPLOAD_FILE_UPLOAD_ERR_CANT_WRITE' => 'Failed to write file to disk.',
534
-	'ERR_UPLOAD_FILE_UPLOAD_ERR_EXTENSION' => 'A PHP extension stopped the file upload. PHP does not provide a way to ascertain which extension caused the file upload to stop.',
535
-
536
-	'LBL_INSTALL_PROCESS' => 'Install...',
537
-
538
-	'LBL_EMAIL_ADDRESS' => 'Email Address:',
539
-	'ERR_ADMIN_EMAIL' => 'Administrator Email Address is incorrect.',
540
-	'ERR_SITE_URL' => 'Site URL is required.',
541
-
542
-	'STAT_CONFIGURATION' => 'Configuration relationships...',
543
-	'STAT_CREATE_DB' => 'Create database...',
544
-	//'STAT_CREATE_DB_TABLE' => 'Create database... (table: %s)',
545
-	'STAT_CREATE_DEFAULT_SETTINGS' => 'Create default settings...',
546
-	'STAT_INSTALL_FINISH' => 'Install finish...',
547
-	'STAT_INSTALL_FINISH_LOGIN' => 'Installation process finished, <a href="%s">please log in...</a>',
548
-	'LBL_LICENCE_TOOLTIP' => 'Please accept license first',
549
-
550
-	'LBL_MORE_OPTIONS_TITLE' => 'More options',
551
-	'LBL_START' => '',
552
-	'LBL_DB_CONN_ERR' => 'Database error',
553
-	'LBL_OLD_PHP' => 'Old PHP Version Detected!',
554
-	'LBL_OLD_PHP_MSG' => 'The recommended PHP version to install SuiteCRM is %s <br />Although the minimum PHP version required is %s, is not recommended due to the large number of fixed bugs, including security fixes, released in the more modern versions.<br />You are using PHP version %s, which is EOL: <a href="http://php.net/eol.php">http://php.net/eol.php</a>.<br />Please consider upgrading your PHP version. Instructions on <a href="http://php.net/migration70">http://php.net/migration70</a>. ',
555
-	'LBL_OLD_PHP_OK' => 'I\'m aware of the risks and wish to continue.',
456
+        'name' => 'Forgot Password email',
457
+    ),
458
+
459
+    // SMTP settings
460
+
461
+    'LBL_WIZARD_SMTP_DESC' => 'Provide the email account that will be used to send emails, such as the assignment notifications and new user passwords. Users will receive emails from SuiteCRM, as sent from the specified email account.',
462
+    'LBL_CHOOSE_EMAIL_PROVIDER'        => 'Choose your Email provider:',
463
+
464
+    'LBL_SMTPTYPE_GMAIL'                    => 'Gmail',
465
+    'LBL_SMTPTYPE_YAHOO'                    => 'Yahoo! Mail',
466
+    'LBL_SMTPTYPE_EXCHANGE'                 => 'Microsoft Exchange',
467
+    'LBL_SMTPTYPE_OTHER'                  => 'Other',
468
+    'LBL_MAIL_SMTP_SETTINGS'           => 'SMTP Server Specification',
469
+    'LBL_MAIL_SMTPSERVER'				=> 'SMTP Server:',
470
+    'LBL_MAIL_SMTPPORT'					=> 'SMTP Port:',
471
+    'LBL_MAIL_SMTPAUTH_REQ'				=> 'Use SMTP Authentication?',
472
+    'LBL_EMAIL_SMTP_SSL_OR_TLS'         => 'Enable SMTP over SSL or TLS?',
473
+    'LBL_GMAIL_SMTPUSER'					=> 'Gmail Email Address:',
474
+    'LBL_GMAIL_SMTPPASS'					=> 'Gmail Password:',
475
+    'LBL_ALLOW_DEFAULT_SELECTION'           => 'Allow users to use this account for outgoing email:',
476
+    'LBL_ALLOW_DEFAULT_SELECTION_HELP'          => 'When this option is selected, all users will be able to send emails using the same outgoing mail account used to send system notifications and alerts. If the option is not selected, users can still use the outgoing mail server after providing their own account information.',
477
+
478
+    'LBL_YAHOOMAIL_SMTPPASS'					=> 'Yahoo! Mail Password:',
479
+    'LBL_YAHOOMAIL_SMTPUSER'					=> 'Yahoo! Mail ID:',
480
+
481
+    'LBL_EXCHANGE_SMTPPASS'					=> 'Exchange Password:',
482
+    'LBL_EXCHANGE_SMTPUSER'					=> 'Exchange Username:',
483
+    'LBL_EXCHANGE_SMTPPORT'					=> 'Exchange Server Port:',
484
+    'LBL_EXCHANGE_SMTPSERVER'				=> 'Exchange Server:',
485
+
486
+
487
+    'LBL_MAIL_SMTPUSER'					=> 'SMTP Username:',
488
+    'LBL_MAIL_SMTPPASS'					=> 'SMTP Password:',
489
+
490
+    // Branding
491
+
492
+    'LBL_WIZARD_SYSTEM_TITLE' => 'Branding',
493
+    'LBL_WIZARD_SYSTEM_DESC' => 'Provide your organization\'s name and logo in order to brand your SuiteCRM.',
494
+    'SYSTEM_NAME_WIZARD'=>'Name:',
495
+    'SYSTEM_NAME_HELP'=>'This is the name that displays in the title bar of your browser.',
496
+    'NEW_LOGO'=>'Select Logo:',
497
+    'NEW_LOGO_HELP'=>'The image file format can be either .png or .jpg. The maximum height is 170px, and the maximum width is 450px. Any image uploaded that is larger in any direction will be scaled to these max dimensions.',
498
+    'COMPANY_LOGO_UPLOAD_BTN' => 'Upload',
499
+    'CURRENT_LOGO'=>'Current Logo:',
500
+    'CURRENT_LOGO_HELP'=>'This logo is displayed in the left-hand corner of the footer of the SuiteCRM application.',
501
+
502
+
503
+    //Scenario selection of modules
504
+    'LBL_WIZARD_SCENARIO_TITLE' => 'Scenario Selection',
505
+    'LBL_WIZARD_SCENARIO_DESC' => 'This is to allow tailoring of the displayed modules based on your requirements. Each of the modules can be enabled after install using the administration page.',
506
+    'LBL_WIZARD_SCENARIO_EMPTY'=> 'There are no scenarios currently set in the configuration file (config.php)',
507
+
508
+
509
+
510
+    // System Local Settings
511
+
512
+
513
+    'LBL_LOCALE_TITLE' => 'System Locale Settings',
514
+    'LBL_WIZARD_LOCALE_DESC' => 'Specify how you would like data in SuiteCRM to be displayed, based on your geographical location. The settings you provide here will be the default settings. Users will be able set their own preferences.',
515
+    'LBL_DATE_FORMAT' => 'Date Format:',
516
+    'LBL_TIME_FORMAT' => 'Time Format:',
517
+    'LBL_TIMEZONE' => 'Time Zone:',
518
+    'LBL_LANGUAGE'=>'Language:',
519
+    'LBL_CURRENCY'=>'Currency:',
520
+    'LBL_CURRENCY_SYMBOL'=>'Currency Symbol:',
521
+    'LBL_CURRENCY_ISO4217' => 'ISO 4217 Currency Code:',
522
+    'LBL_NUMBER_GROUPING_SEP' => '1000s separator:',
523
+    'LBL_DECIMAL_SEP' => 'Decimal symbol:',
524
+    'LBL_NAME_FORMAT' => 'Name Format:',
525
+    'UPLOAD_LOGO' => 'Please wait, logo uploading..',
526
+    'ERR_UPLOAD_FILETYPE' => 'File type do not allowed, please upload a jpeg or png.',
527
+    'ERR_LANG_UPLOAD_UNKNOWN' => 'Unknown file upload error occured.',
528
+    'ERR_UPLOAD_FILE_UPLOAD_ERR_INI_SIZE' => 'The uploaded file exceeds the upload_max_filesize directive in php.ini.',
529
+    'ERR_UPLOAD_FILE_UPLOAD_ERR_FORM_SIZE' => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.',
530
+    'ERR_UPLOAD_FILE_UPLOAD_ERR_PARTIAL' => 'The uploaded file was only partially uploaded.',
531
+    'ERR_UPLOAD_FILE_UPLOAD_ERR_NO_FILE' => 'No file was uploaded.',
532
+    'ERR_UPLOAD_FILE_UPLOAD_ERR_NO_TMP_DIR' => 'Missing a temporary folder.',
533
+    'ERR_UPLOAD_FILE_UPLOAD_ERR_CANT_WRITE' => 'Failed to write file to disk.',
534
+    'ERR_UPLOAD_FILE_UPLOAD_ERR_EXTENSION' => 'A PHP extension stopped the file upload. PHP does not provide a way to ascertain which extension caused the file upload to stop.',
535
+
536
+    'LBL_INSTALL_PROCESS' => 'Install...',
537
+
538
+    'LBL_EMAIL_ADDRESS' => 'Email Address:',
539
+    'ERR_ADMIN_EMAIL' => 'Administrator Email Address is incorrect.',
540
+    'ERR_SITE_URL' => 'Site URL is required.',
541
+
542
+    'STAT_CONFIGURATION' => 'Configuration relationships...',
543
+    'STAT_CREATE_DB' => 'Create database...',
544
+    //'STAT_CREATE_DB_TABLE' => 'Create database... (table: %s)',
545
+    'STAT_CREATE_DEFAULT_SETTINGS' => 'Create default settings...',
546
+    'STAT_INSTALL_FINISH' => 'Install finish...',
547
+    'STAT_INSTALL_FINISH_LOGIN' => 'Installation process finished, <a href="%s">please log in...</a>',
548
+    'LBL_LICENCE_TOOLTIP' => 'Please accept license first',
549
+
550
+    'LBL_MORE_OPTIONS_TITLE' => 'More options',
551
+    'LBL_START' => '',
552
+    'LBL_DB_CONN_ERR' => 'Database error',
553
+    'LBL_OLD_PHP' => 'Old PHP Version Detected!',
554
+    'LBL_OLD_PHP_MSG' => 'The recommended PHP version to install SuiteCRM is %s <br />Although the minimum PHP version required is %s, is not recommended due to the large number of fixed bugs, including security fixes, released in the more modern versions.<br />You are using PHP version %s, which is EOL: <a href="http://php.net/eol.php">http://php.net/eol.php</a>.<br />Please consider upgrading your PHP version. Instructions on <a href="http://php.net/migration70">http://php.net/migration70</a>. ',
555
+    'LBL_OLD_PHP_OK' => 'I\'m aware of the risks and wish to continue.',
556 556
 
557 557
     'LBL_DBCONF_TITLE_USER_INFO_LABEL' => 'User',
558 558
     'LBL_DBCONFIG_MSG3_LABEL' => 'Database Name',
Please login to merge, or discard this patch.
install.php 1 patch
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -1,43 +1,43 @@  discard block
 block discarded – undo
1 1
 <?php
2
- /**
2
+    /**
3 3
 *
4
- * SugarCRM Community Edition is a customer relationship management program developed by
5
- * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
4
+     * SugarCRM Community Edition is a customer relationship management program developed by
5
+     * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
6 6
 *
7
- * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
8
- * Copyright (C) 2011 - 2017 SalesAgility Ltd.
9
- *
10
- * This program is free software; you can redistribute it and/or modify it under
11
- * the terms of the GNU Affero General Public License version 3 as published by the
12
- * Free Software Foundation with the addition of the following permission added
13
- * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
14
- * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
15
- * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
16
- *
17
- * This program is distributed in the hope that it will be useful, but WITHOUT
18
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19
- * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
20
- * details.
21
- *
22
- * You should have received a copy of the GNU Affero General Public License along with
23
- * this program; if not, see http://www.gnu.org/licenses or write to the Free
24
- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25
- * 02110-1301 USA.
26
- *
27
- * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
28
- * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected].
29
- *
30
- * The interactive user interfaces in modified source and object code versions
31
- * of this program must display Appropriate Legal Notices, as required under
32
- * Section 5 of the GNU Affero General Public License version 3.
33
- *
34
- * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
35
- * these Appropriate Legal Notices must retain the display of the "Powered by
36
- * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
37
- * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
38
- * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
39
- */
40
- if(!defined('sugarEntry')) {
7
+     * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
8
+     * Copyright (C) 2011 - 2017 SalesAgility Ltd.
9
+     *
10
+     * This program is free software; you can redistribute it and/or modify it under
11
+     * the terms of the GNU Affero General Public License version 3 as published by the
12
+     * Free Software Foundation with the addition of the following permission added
13
+     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
14
+     * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
15
+     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
16
+     *
17
+     * This program is distributed in the hope that it will be useful, but WITHOUT
18
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19
+     * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
20
+     * details.
21
+     *
22
+     * You should have received a copy of the GNU Affero General Public License along with
23
+     * this program; if not, see http://www.gnu.org/licenses or write to the Free
24
+     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25
+     * 02110-1301 USA.
26
+     *
27
+     * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
28
+     * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected].
29
+     *
30
+     * The interactive user interfaces in modified source and object code versions
31
+     * of this program must display Appropriate Legal Notices, as required under
32
+     * Section 5 of the GNU Affero General Public License version 3.
33
+     *
34
+     * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
35
+     * these Appropriate Legal Notices must retain the display of the "Powered by
36
+     * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
37
+     * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
38
+     * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
39
+     */
40
+    if(!defined('sugarEntry')) {
41 41
     define('sugarEntry', true);
42 42
 }
43 43
 
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
  * If less than minimum we refuse to install.
62 62
  */
63 63
 if (check_php_version() === -1) {
64
-	$msg = 'The recommended PHP version to install SuiteCRM is ';
65
-	$msg .= constant('SUITECRM_PHP_REC_VERSION').'<br />';
66
-	$msg .= 'Although the minimum PHP version required is ';
67
-	$msg .= constant('SUITECRM_PHP_MIN_VERSION').', ';
68
-	$msg .= 'is not recommended due to the large number of fixed bugs, including security fixes, ';
69
-	$msg .= 'released in the more modern versions.<br />';
70
- 	$msg .= 'You are using PHP version  '. constant('PHP_VERSION').', which is EOL: <a href="http://php.net/eol.php">http://php.net/eol.php</a>.<br />';
71
-	$msg .= 'Please consider upgrading your PHP version. Instructions on <a href="http://php.net/migration70">http://php.net/migration70</a>. ';
64
+    $msg = 'The recommended PHP version to install SuiteCRM is ';
65
+    $msg .= constant('SUITECRM_PHP_REC_VERSION').'<br />';
66
+    $msg .= 'Although the minimum PHP version required is ';
67
+    $msg .= constant('SUITECRM_PHP_MIN_VERSION').', ';
68
+    $msg .= 'is not recommended due to the large number of fixed bugs, including security fixes, ';
69
+    $msg .= 'released in the more modern versions.<br />';
70
+        $msg .= 'You are using PHP version  '. constant('PHP_VERSION').', which is EOL: <a href="http://php.net/eol.php">http://php.net/eol.php</a>.<br />';
71
+    $msg .= 'Please consider upgrading your PHP version. Instructions on <a href="http://php.net/migration70">http://php.net/migration70</a>. ';
72 72
     die($msg);
73 73
 }
74 74
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 $workflow = array() ;
351 351
 // If less then recommended PHP version, insert old_php.pho into workflow.
352 352
 if (check_php_version() === 0) {
353
-	$workflow[] = 'old_php.php';
353
+    $workflow[] = 'old_php.php';
354 354
 }
355 355
 // use a simple array to map out the steps of the installer page flow
356 356
 $workflow[] = 'welcome.php';
@@ -518,16 +518,16 @@  discard block
 block discarded – undo
518 518
     $validation_errors = array();
519 519
 // process the data posted
520 520
 if($next_clicked) {
521
-	// store the submitted data because the 'Next' button was clicked
521
+    // store the submitted data because the 'Next' button was clicked
522 522
     switch($workflow[trim($_REQUEST['current_step'])]) {
523 523
         case 'old_php.php':
524
-		$_SESSION['language'] = $_REQUEST['language'];
525
-		$_SESSION['setup_old_php'] = get_boolean_from_request('setup_old_php');
526
-		break;
524
+        $_SESSION['language'] = $_REQUEST['language'];
525
+        $_SESSION['setup_old_php'] = get_boolean_from_request('setup_old_php');
526
+        break;
527 527
 
528
-	case 'welcome.php':
529
-        	$_SESSION['language'] = $_REQUEST['language'];
530
-   			$_SESSION['setup_site_admin_user_name'] = 'admin';
528
+    case 'welcome.php':
529
+            $_SESSION['language'] = $_REQUEST['language'];
530
+                $_SESSION['setup_site_admin_user_name'] = 'admin';
531 531
 //        break;
532 532
 //      case 'license.php':
533 533
                 $_SESSION['setup_license_accept']   = get_boolean_from_request('setup_license_accept');
@@ -655,12 +655,12 @@  discard block
 block discarded – undo
655 655
     case 'old_php.php':
656 656
     case 'welcome.php':
657 657
     case 'license.php':
658
-			//
659
-			// Check to see if session variables are working properly
660
-			//
661
-			$_SESSION['test_session'] = 'sessions are available';
658
+            //
659
+            // Check to see if session variables are working properly
660
+            //
661
+            $_SESSION['test_session'] = 'sessions are available';
662 662
         @session_write_close();
663
-			unset($_SESSION['test_session']);
663
+            unset($_SESSION['test_session']);
664 664
         @session_start();
665 665
 
666 666
             if(!isset($_SESSION['test_session']))
Please login to merge, or discard this patch.