move config file to data
This commit is contained in:
parent
bf39c8f09f
commit
fd094050fc
9 changed files with 18 additions and 16 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,6 +1,5 @@
|
|||
.svn
|
||||
backup
|
||||
config.php
|
||||
data
|
||||
images
|
||||
imgdump-*.zip
|
||||
|
|
|
@ -42,6 +42,8 @@ Installation
|
|||
|
||||
Upgrade from 2.3.X
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
config.php has been moved from /config.php to /data/config/shimmie.conf.php
|
||||
|
||||
The database connection setting in config.php has changed; now using
|
||||
PDO DSN format rather than ADODB URI:
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ class Update extends Extension {
|
|||
reset($objects);
|
||||
$html .= "<br>data folder emptied!";
|
||||
}
|
||||
copy ("./config.php", "./backup/config.php");//Although this stays the same, will keep backup just incase.
|
||||
copy ("./data/config/shimmie.conf.php", "./backup/shimmie.conf.php");//Although this stays the same, will keep backup just incase.
|
||||
$folders = array("./core", "./lib", "./themes", "./.htaccess", "./doxygen.conf", "./index.php", "./install.php", "./ext", "./contrib");
|
||||
foreach($folders as $folder){
|
||||
//TODO: Check MD5 of each file, don't rename if same.
|
||||
|
|
|
@ -273,7 +273,7 @@ class Database {
|
|||
|
||||
/**
|
||||
* Create a new database object using connection info
|
||||
* stored in config.php in the root shimmie folder
|
||||
* stored in the config file
|
||||
*/
|
||||
public function Database() {
|
||||
# FIXME: detect ADODB URI, automatically translate PDO DSN
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* These are the default configuration options for Shimmie.
|
||||
*
|
||||
* All of these can be over-ridden by placing a 'define' in config.php
|
||||
* All of these can be over-ridden by placing a 'define' in data/config/shimmie.conf.php
|
||||
*
|
||||
* Do NOT change them in this file. These are the defaults only!
|
||||
*
|
||||
|
|
|
@ -40,7 +40,7 @@ class UserClass {
|
|||
// object = image / user / tag / setting
|
||||
new UserClass("base", null, array(
|
||||
"change_setting" => False, # modify web-level settings, eg the config table
|
||||
"override_config" => False, # modify sys-level settings, eg config.php
|
||||
"override_config" => False, # modify sys-level settings, eg shimmie.conf.php
|
||||
"big_search" => False, # search for more than 3 tags at once (speed mode only)
|
||||
|
||||
"manage_extension_list" => False,
|
||||
|
|
|
@ -640,11 +640,11 @@ RECURSIVE = YES
|
|||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE = config.php \
|
||||
install.php \
|
||||
EXCLUDE = install.php \
|
||||
phpinfo.php \
|
||||
contrib/simpletest/simpletest \
|
||||
lib \
|
||||
data \
|
||||
images \
|
||||
thumbs \
|
||||
.git \
|
||||
|
|
|
@ -43,11 +43,11 @@
|
|||
* Each of these can be imported at the start of a function with eg "global $page, $user;"
|
||||
*/
|
||||
|
||||
if(!file_exists("config.php")) {
|
||||
if(!file_exists("data/config/shimmie.conf.php")) {
|
||||
header("Location: install.php");
|
||||
exit;
|
||||
}
|
||||
require_once "config.php";
|
||||
require_once "data/config/shimmie.conf.php";
|
||||
require_once "core/default_config.inc.php";
|
||||
require_once "core/util.inc.php";
|
||||
require_once "lib/context.php";
|
||||
|
|
15
install.php
15
install.php
|
@ -64,13 +64,13 @@ require_once __SHIMMIE_ROOT__."core/database.class.php";
|
|||
* This file lets anyone destroy the database -- disable it
|
||||
* as soon as the admin is done installing for the first time
|
||||
*/
|
||||
if(is_readable("config.php")) {
|
||||
if(is_readable("data/config/shimmie.conf.php")) {
|
||||
session_start();
|
||||
echo '<div id="iblock">';
|
||||
echo '<h1>Shimmie Repair Console</h1>';
|
||||
|
||||
// Load the config
|
||||
require_once __SHIMMIE_ROOT__."config.php"; // Load user/site specifics First
|
||||
require_once __SHIMMIE_ROOT__."data/config/shimmie.conf.php"; // Load user/site specifics First
|
||||
require_once __SHIMMIE_ROOT__."core/default_config.inc.php"; // Defaults for the rest.
|
||||
|
||||
if(
|
||||
|
@ -120,7 +120,7 @@ if(is_readable("config.php")) {
|
|||
else {
|
||||
echo "
|
||||
<h3>Login</h3>
|
||||
<p>Enter the database DSN exactly as in config.php (ie, as originally installed) to access advanced recovery tools:</p>
|
||||
<p>Enter the database DSN exactly as in shimmie.conf.php (ie, as originally installed) to access advanced recovery tools:</p>
|
||||
|
||||
<form action='install.php' method='POST'>
|
||||
<center>
|
||||
|
@ -403,14 +403,15 @@ function write_config() { // {{{
|
|||
"define('DATABASE_DSN', '".DATABASE_DSN."');\n" .
|
||||
'?' . '>';
|
||||
|
||||
if(is_writable("./") && file_put_contents("config.php", $file_content)) {
|
||||
assert(file_exists("config.php"));
|
||||
if(!file_exists("data/config")) {
|
||||
mkdir("data/config", 0755, true);
|
||||
}
|
||||
else {
|
||||
|
||||
if(!file_put_contents("data/config/shimmie.conf.php", $file_content)) {
|
||||
$h_file_content = htmlentities($file_content);
|
||||
print <<<EOD
|
||||
The web server isn't allowed to write to the config file; please copy
|
||||
the text below, save it as 'config.php', and upload it into the shimmie
|
||||
the text below, save it as 'data/config/shimmie.conf.php', and upload it into the shimmie
|
||||
folder manually. Make sure that when you save it, there is no whitespace
|
||||
before the "<?php" or after the "?>"
|
||||
|
||||
|
|
Reference in a new issue