You've already forked OpenShorte.old
Website refactored
Prepared the website structure for the new layout
This commit is contained in:
@@ -1,24 +1,8 @@
|
||||
<?php
|
||||
require_once ( 'lib/php/classes/Database.php' );
|
||||
function split_uri_array ( ) : Array {
|
||||
$uri = substr ( $_SERVER [ 'REQUEST_URI' ], strlen ( substr ( $_SERVER [ 'REQUEST_URI' ], 0, strrpos ( $_SERVER [ 'REQUEST_URI' ], 'index.php' ) ) ), strlen ( $_SERVER [ 'REQUEST_URI' ] ) - strlen ( substr ( $_SERVER [ 'REQUEST_URI' ], 0, strrpos ( $_SERVER [ 'REQUEST_URI' ], 'index.php' ) ) ) );
|
||||
$arr = Array ( );
|
||||
$last_arg_pos = 0;
|
||||
if ( substr ( $uri, strlen ( $uri ) - 1, 1 ) == "/" ) {
|
||||
$uri = substr ( $uri, 0, strlen ( $uri ) - 1 );
|
||||
}
|
||||
for ( $i = 1; $i < ( strlen ( $uri ) ) - 1; $i ++ ) {
|
||||
if ( substr ( $uri, $i, 1 ) == "/" && substr ( $uri, $i + 1, 1 ) != "/" && substr ( $uri, $i - 1, 1 ) != "/" ) {
|
||||
$arr [ ] = substr ( $uri, $last_arg_pos, $i - $last_arg_pos);
|
||||
$last_arg_pos = $i + 1;
|
||||
}
|
||||
}
|
||||
$arr [ ] = substr ( $uri, $last_arg_pos, $i - $last_arg_pos + 1);
|
||||
return $arr;
|
||||
}
|
||||
function load_config ( ) : array {
|
||||
$config = file_get_contents ( 'config.json' );
|
||||
$config = json_decode ( $config, true );
|
||||
$config [ 'installation_path' ] = $_SERVER [ 'DOCUMENT_ROOT' ] . $config [ 'installation_path' ];
|
||||
$config [ 'installation_path' ] = substr ( $_SERVER [ 'SCRIPT_NAME' ], 0, -10 );
|
||||
return $config;
|
||||
}
|
||||
|
Reference in New Issue
Block a user