Skip to content

Commit 2d5cd08

Browse files
committed
Check for config.inc at installation
1 parent ea2000f commit 2d5cd08

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
config.inc
2+
data

index.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
// Include library of functions
1818
//
1919
include 'lib/config.inc';
20-
include 'config.inc';
2120
include 'lib/onlyblog.php';
21+
22+
check_config_inc();
23+
24+
include 'config.inc';
2225
include $__config['theme_dir'] . "/theme.php";
2326

2427
blog_init();

lib/onlyblog.php

+20
Original file line numberDiff line numberDiff line change
@@ -643,4 +643,24 @@ function search_stub () {
643643

644644
return $output;
645645
}
646+
647+
//
648+
// Check for existence of config.inc file in installation directory
649+
//
650+
function check_config_inc () {
651+
if (!file_exists ('config.inc')) {
652+
?>
653+
<html>
654+
<head>
655+
<title>OnlyBlog Setup</title>
656+
</head>
657+
<body>
658+
<h1>OnlyBlog Setup</h1>
659+
<b><code>config.inc</code></b> file does not exist. This is a required file. Use <code>sample-config.inc</code> as a reference to create one.<br>
660+
</body>
661+
</html>
662+
<?php
663+
exit();
664+
}
665+
}
646666
?>

0 commit comments

Comments
 (0)