mirror of
https://github.com/xevidos/codiad.git
synced 2024-11-10 21:26:35 +01:00
Merge pull request #1 from milton-alvarenga/development
First stable release of Codiad Install supporting PostgreSQL
This commit is contained in:
commit
b200d119e7
@ -96,7 +96,7 @@ if ( ! ( defined( 'DBHOST' ) && defined( 'DBNAME' ) && defined( 'DBUSER' ) && de
|
||||
//Valid databases Codiad is able to use
|
||||
$db_types = [
|
||||
'mysql',
|
||||
'postgresql',
|
||||
'pgsql',
|
||||
//'sqlite',
|
||||
];
|
||||
|
||||
|
@ -49,6 +49,14 @@ $autocomplete = array(
|
||||
'dbtype' => 'mysql',
|
||||
);
|
||||
|
||||
//Valid databases Codiad is able to use
|
||||
$aValidDBType = [
|
||||
'MySQL'=>'mysql'
|
||||
,'PostgreSQL'=>'pgsql'
|
||||
,'SQLite'=>'sqlite'
|
||||
];
|
||||
|
||||
|
||||
if (!empty($query)) {
|
||||
$params = explode('&', $query);
|
||||
foreach ($params as $param) {
|
||||
@ -111,12 +119,21 @@ if ($newrelic) {
|
||||
|
||||
<label><?php i18n("Dependencies"); ?></label>
|
||||
<div id="dependencies">
|
||||
<?php foreach (array("ZIP", "OpenSSL", "MBString") as $dep) {
|
||||
<?php foreach ([
|
||||
"ZIP"=>"required",
|
||||
"OpenSSL"=>"required",
|
||||
"MBString"=>"required",
|
||||
"MySQL"=>"",
|
||||
"PGSQL"=>"",
|
||||
"SQLite3"=>""
|
||||
] as $dep=>$status) {
|
||||
if (extension_loaded(strtolower($dep))) { ?>
|
||||
<div class="success"><span class="icon-check"></span> <?=$dep?></div>
|
||||
<?php
|
||||
} else { ?>
|
||||
<div class="error"><span class="icon-cancel"></span> <?=$dep?></div>
|
||||
} else {
|
||||
$class_name = ($status == 'required') ? 'error' : 'warning';
|
||||
?>
|
||||
<div class="<?php echo $class_name; ?>"><span class="icon-cancel"></span> <?=$dep?></div>
|
||||
<?php
|
||||
}
|
||||
} ?>
|
||||
@ -167,8 +184,17 @@ if ($newrelic) {
|
||||
<input type="text" name="dbpass" value="<?php echo($autocomplete['dbpass']); ?>">
|
||||
<label><?php i18n("Database Type"); ?></label>
|
||||
<select name="dbtype">
|
||||
<option value="mysql">MySQL</option>
|
||||
<option value="postgresql">PostgreSQL</option>
|
||||
<?php
|
||||
foreach ($aValidDBType as $db_name => $key) {
|
||||
if ($autocomplete['dbtype'] == $key) {
|
||||
$select_dbtypes .= '<option selected="selected" value="' . $key . '">' . $db_name . '</option>';
|
||||
} else {
|
||||
$select_dbtypes .= '<option value="' . $key . '">' . $db_name . '</option>';
|
||||
}
|
||||
}
|
||||
echo($select_dbtypes);
|
||||
unset($select_dbtypes);
|
||||
?>
|
||||
</select>
|
||||
<hr>
|
||||
<?php
|
||||
@ -269,6 +295,7 @@ if ($newrelic) {
|
||||
<label><?php i18n("Timezone"); ?></label>
|
||||
<select name="timezone">
|
||||
<?php
|
||||
$timezones = "";
|
||||
foreach ($location as $key => $city) {
|
||||
if ($autocomplete['timezone'] == $key) {
|
||||
$timezones .= '<option selected="selected" value="' . $key . '">' . $city . '</option>';
|
||||
@ -277,6 +304,7 @@ if ($newrelic) {
|
||||
}
|
||||
}
|
||||
echo($timezones);
|
||||
unset($timezones);
|
||||
?>
|
||||
</select>
|
||||
<button><?php i18n("Install"); ?></button>
|
||||
|
@ -169,6 +169,10 @@ label .icon {
|
||||
color: green;
|
||||
}
|
||||
|
||||
#dependencies .warning {
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
select option { background: #242424; }
|
||||
|
||||
textarea {
|
||||
|
Loading…
Reference in New Issue
Block a user