Added option to disable clean urls through config file for servers that cannot do url rewriting.
This commit is contained in:
parent
1fbb0ca29c
commit
e207d427d7
@ -167,6 +167,13 @@ Set custom files and entire folders to ignore within your `/docs` folder. For fi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###Disabling clean URLs
|
||||||
|
By default, Daux.io will create clean url's that do not include index.php. On servers running Apache, uploading the included .htaccess file should be enough for them to work properly. On servers that are not running Apache or that do not allow custom .htaccess files, you may need to disable clean_urls:
|
||||||
|
|
||||||
|
{
|
||||||
|
"clean_urls": false
|
||||||
|
}
|
||||||
|
|
||||||
## Running Remotely
|
## Running Remotely
|
||||||
|
|
||||||
Copy the files from the repo to a web server that can run PHP 5.3 or greater.
|
Copy the files from the repo to a web server that can run PHP 5.3 or greater.
|
||||||
|
@ -167,6 +167,13 @@ Set custom files and entire folders to ignore within your `/docs` folder. For fi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###Disabling clean URLs
|
||||||
|
By default, Daux.io will create clean url's that do not include index.php. On servers running Apache, uploading the included .htaccess file should be enough for them to work properly. On servers that are not running Apache or that do not allow custom .htaccess files, you may need to disable clean_urls:
|
||||||
|
|
||||||
|
{
|
||||||
|
"clean_urls": false
|
||||||
|
}
|
||||||
|
|
||||||
## Running Remotely
|
## Running Remotely
|
||||||
|
|
||||||
Copy the files from the repo to a web server that can run PHP 5.3 or greater.
|
Copy the files from the repo to a web server that can run PHP 5.3 or greater.
|
||||||
|
@ -39,6 +39,7 @@ function get_options() {
|
|||||||
'twitter' => array(),
|
'twitter' => array(),
|
||||||
'links' => array(),
|
'links' => array(),
|
||||||
'colors' => false,
|
'colors' => false,
|
||||||
|
'clean_urls' => true,
|
||||||
'google_analytics' => false,
|
'google_analytics' => false,
|
||||||
'piwik_analytics' => false,
|
'piwik_analytics' => false,
|
||||||
'ignore' => array()
|
'ignore' => array()
|
||||||
@ -228,7 +229,8 @@ function get_ignored() {
|
|||||||
return $all_ignored;
|
return $all_ignored;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_tree($path = '.', $clean_path = '', $title = ''){
|
function get_tree($path = '.', $clean_path = '', $title = '', $first = true){
|
||||||
|
$options = get_options();
|
||||||
$tree = array();
|
$tree = array();
|
||||||
$ignore = get_ignored();
|
$ignore = get_ignored();
|
||||||
$dh = @opendir($path);
|
$dh = @opendir($path);
|
||||||
@ -254,7 +256,27 @@ function get_tree($path = '.', $clean_path = '', $title = ''){
|
|||||||
if(!in_array($file, $ignore)) {
|
if(!in_array($file, $ignore)) {
|
||||||
$full_path = "$path/$file";
|
$full_path = "$path/$file";
|
||||||
$clean_sort = clean_sort($file);
|
$clean_sort = clean_sort($file);
|
||||||
|
|
||||||
|
// If clean_urls is set to false and this is the first branch of the tree, append index.php to the clean_path.
|
||||||
|
|
||||||
|
print_r($options['clean_urls']);
|
||||||
|
|
||||||
|
if($options['clean_urls'] == false)
|
||||||
|
{
|
||||||
|
if($first)
|
||||||
|
{
|
||||||
|
$url = $clean_path . '/index.php/' . $clean_sort;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$url = $clean_path . '/' . $clean_sort;
|
$url = $clean_path . '/' . $clean_sort;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$url = $clean_path . '/' . $clean_sort;
|
||||||
|
}
|
||||||
|
|
||||||
$clean_name = clean_name($clean_sort);
|
$clean_name = clean_name($clean_sort);
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
@ -273,7 +295,7 @@ function get_tree($path = '.', $clean_path = '', $title = ''){
|
|||||||
'path' => $full_path,
|
'path' => $full_path,
|
||||||
'clean' => $clean_sort,
|
'clean' => $clean_sort,
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
'tree'=> get_tree($full_path, $url, $full_title)
|
'tree'=> get_tree($full_path, $url, $full_title, false)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// File
|
// File
|
||||||
|
Loading…
Reference in New Issue
Block a user