Restructed project and added docker support.
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
.git
|
||||
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
/html/head-custom.php
|
||||
/config.local.php
|
||||
/.htaccess
|
||||
/.idea
|
||||
12
Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM php:7.0-apache
|
||||
|
||||
COPY . /srv/app
|
||||
|
||||
RUN chown -R www-data:www-data /srv/app
|
||||
|
||||
ENV APACHE_DOCUMENT_ROOT /srv/app/src
|
||||
|
||||
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
|
||||
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
|
||||
|
||||
EXPOSE 80
|
||||
0
Saved/.gitkeep
Normal file
@@ -1,4 +0,0 @@
|
||||
Order deny,allow
|
||||
Deny From All
|
||||
Allow From home.xnet.tk
|
||||
Options +Indexes
|
||||
32
includer.php
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
define('BASE_PATH', dirname(__FILE__));
|
||||
chdir(BASE_PATH);
|
||||
|
||||
ini_set('display_errors', True);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function sys_autoload($class)
|
||||
{
|
||||
if (strpos($class, '_') !== False)
|
||||
{
|
||||
$path = 'Classes/'.str_replace('_', '/', $class);
|
||||
if (is_file($path.'.php'))
|
||||
include_once($path.'.php');
|
||||
}
|
||||
|
||||
if (is_file("Classes/$class/$class.php"))
|
||||
include_once("Classes/$class/$class.php");
|
||||
|
||||
if (is_file("Classes/$class.php"))
|
||||
include_once("Classes/$class.php");
|
||||
}
|
||||
spl_autoload_register('sys_autoload');
|
||||
|
||||
require('config.php');
|
||||
require('functions.php');
|
||||
|
||||
System::Init($config);
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class HtRule_List
|
||||
$this->id = uniqid();
|
||||
|
||||
$ds = DIRECTORY_SEPARATOR;
|
||||
$dir = BASE_PATH.$ds.'Saved'.$ds;
|
||||
$dir = SAVED_PATH.$ds;
|
||||
$dir .= substr($this->id, 0,2).$ds;
|
||||
$dir .= substr($this->id, 2,2).$ds;
|
||||
|
||||
@@ -20,7 +20,9 @@ class System
|
||||
header('Cache-Control: no-cache, no-store, must-revalidate');
|
||||
header('Pragma: no-cache');
|
||||
|
||||
session_set_cookie_params(60*60*24, self::$config->BasePath, $_SERVER['HTTP_HOST'], False, True);
|
||||
$path = parse_url(self::$config->BasePath, PHP_URL_PATH);
|
||||
|
||||
session_set_cookie_params(60*60*24, $path, $_SERVER['HTTP_HOST'], False, True);
|
||||
session_start();
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 980 B After Width: | Height: | Size: 980 B |
|
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 536 B |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 415 B After Width: | Height: | Size: 415 B |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
$config = array();
|
||||
|
||||
$config['BasePath'] = (@$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].'/';
|
||||
|
||||
$config['Debug'] = False;
|
||||
|
||||
if (is_file('config.local.php'))
|
||||
<?php
|
||||
|
||||
$config = array();
|
||||
|
||||
$config['BasePath'] = (@$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].'/';
|
||||
|
||||
$config['Debug'] = False;
|
||||
|
||||
if (is_file('config.local.php'))
|
||||
include('config.local.php');
|
||||
@@ -1,21 +1,21 @@
|
||||
<div style="clear: both;"> </div>
|
||||
</div> <!-- / content -->
|
||||
|
||||
|
||||
<?php if (isset($sidebar) && $sidebar == True) include('sidebar.php'); ?>
|
||||
</div><!-- / page-content -->
|
||||
</div><!-- / page-bgbtm -->
|
||||
</div><!-- / page-bgtop -->
|
||||
</div><!-- / page -->
|
||||
</div><!-- / wrapper -->
|
||||
<?php include('footer.php'); ?>
|
||||
<div style="clear: both;"> </div>
|
||||
<?php
|
||||
if (is_file(dirname(__FILE__).'/bottom-custom.php'))
|
||||
include(dirname(__FILE__).'/bottom-custom.php');
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<!--
|
||||
GentleBreeze Design by Free CSS Templates
|
||||
<div style="clear: both;"> </div>
|
||||
</div> <!-- / content -->
|
||||
|
||||
|
||||
<?php if (isset($sidebar) && $sidebar == True) include('sidebar.php'); ?>
|
||||
</div><!-- / page-content -->
|
||||
</div><!-- / page-bgbtm -->
|
||||
</div><!-- / page-bgtop -->
|
||||
</div><!-- / page -->
|
||||
</div><!-- / wrapper -->
|
||||
<?php include('footer.php'); ?>
|
||||
<div style="clear: both;"> </div>
|
||||
<?php
|
||||
if (is_file(dirname(__FILE__).'/bottom-custom.php'))
|
||||
include(dirname(__FILE__).'/bottom-custom.php');
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<!--
|
||||
GentleBreeze Design by Free CSS Templates
|
||||
-->
|
||||
@@ -1,74 +1,74 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="keywords" content="htaccess, htaccess builder, htaccess generator, apache, apache rewrite, rewrite" />
|
||||
<meta name="description" content="Build htaccess rules for apache 2 easily." />
|
||||
<title>Htaccess Builder</title>
|
||||
<base href="<?php echo System::Config()->BasePath; ?>"/>
|
||||
<link href="Media/style.css" rel="stylesheet" type="text/css"/>
|
||||
<link href='http://fonts.googleapis.com/css?family=Oswald|Arvo|Telex' rel='stylesheet' type='text/css'/>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
if(typeof jQuery == 'undefined'){document.write("<scr"+"ipt src=\"Media/jquery.min.js\" type=\"text/javascript\"><\/scr"+"ipt>");}
|
||||
</script>
|
||||
<?php if (defined('CREATOR')): ?>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js" type="text/javascript"></script>
|
||||
<link href="Media/impromptu.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="Media/jquery-impromptu.3.2.min.js" type="text/javascript"></script>
|
||||
<link href="Media/tooltipster-1.2/css/tooltipster.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="Media/tooltipster-1.2/js/jquery.tooltipster.min.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="Media/index.js" type="text/javascript"></script>
|
||||
<script src="Media/rules.js" type="text/javascript"></script>
|
||||
<?php endif; ?>
|
||||
<?php if (System::Config()->Debug): ?>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-color: #700000;
|
||||
}
|
||||
</style>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if (is_file(dirname(__FILE__).'/head-custom.php'))
|
||||
include(dirname(__FILE__).'/head-custom.php');
|
||||
?>
|
||||
<?php if (isset($head)) echo $head; ?>
|
||||
</head>
|
||||
<body id="<?php if (isset($pageid)) echo $pageid; ?>">
|
||||
<a href="https://github.com/sam159/HtaccessBuilder"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png" alt="Fork me on GitHub"></a>
|
||||
<div id="wrapper">
|
||||
<div id="header-wrapper">
|
||||
<div id="header">
|
||||
<div id="logo">
|
||||
<h1><a href="#">Htaccess Builder</a></h1>
|
||||
<p>
|
||||
Beta!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="menu-wrapper">
|
||||
<div id="menu">
|
||||
<ul>
|
||||
<li class="page-builder"><a href="">Builder</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php $class = ''; if (!isset($sidebar) || $sidebar == False) $class = 'class="fullwidth"'?>
|
||||
<div id="page" <?=$class?>>
|
||||
<div id="page-bgtop" <?=$class?>>
|
||||
<div id="page-bgbtm" <?=$class?>>
|
||||
<div id="page-content" <?=$class?>>
|
||||
<?php if (isset($sidebar) && $sidebar == True): ?>
|
||||
<div id="content">
|
||||
<?php else: ?>
|
||||
<div id="content-fullwidth">
|
||||
<?php endif; ?>
|
||||
|
||||
<noscript>
|
||||
<div id="js-notice">
|
||||
Javascript is required to use this website :(
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="keywords" content="htaccess, htaccess builder, htaccess generator, apache, apache rewrite, rewrite" />
|
||||
<meta name="description" content="Build htaccess rules for apache 2 easily." />
|
||||
<title>Htaccess Builder</title>
|
||||
<base href="<?php echo System::Config()->BasePath; ?>"/>
|
||||
<link href="Media/style.css" rel="stylesheet" type="text/css"/>
|
||||
<link href='http://fonts.googleapis.com/css?family=Oswald|Arvo|Telex' rel='stylesheet' type='text/css'/>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
if(typeof jQuery == 'undefined'){document.write("<scr"+"ipt src=\"Media/jquery.min.js\" type=\"text/javascript\"><\/scr"+"ipt>");}
|
||||
</script>
|
||||
<?php if (defined('CREATOR')): ?>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js" type="text/javascript"></script>
|
||||
<link href="Media/impromptu.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="Media/jquery-impromptu.3.2.min.js" type="text/javascript"></script>
|
||||
<link href="Media/tooltipster-1.2/css/tooltipster.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="Media/tooltipster-1.2/js/jquery.tooltipster.min.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="Media/index.js" type="text/javascript"></script>
|
||||
<script src="Media/rules.js" type="text/javascript"></script>
|
||||
<?php endif; ?>
|
||||
<?php if (System::Config()->Debug): ?>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-color: #700000;
|
||||
}
|
||||
</style>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if (is_file(dirname(__FILE__).'/head-custom.php'))
|
||||
include(dirname(__FILE__).'/head-custom.php');
|
||||
?>
|
||||
<?php if (isset($head)) echo $head; ?>
|
||||
</head>
|
||||
<body id="<?php if (isset($pageid)) echo $pageid; ?>">
|
||||
<a href="https://github.com/sam159/HtaccessBuilder"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png" alt="Fork me on GitHub"></a>
|
||||
<div id="wrapper">
|
||||
<div id="header-wrapper">
|
||||
<div id="header">
|
||||
<div id="logo">
|
||||
<h1><a href="#">Htaccess Builder</a></h1>
|
||||
<p>
|
||||
Beta!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="menu-wrapper">
|
||||
<div id="menu">
|
||||
<ul>
|
||||
<li class="page-builder"><a href="">Builder</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php $class = ''; if (!isset($sidebar) || $sidebar == False) $class = 'class="fullwidth"'?>
|
||||
<div id="page" <?=$class?>>
|
||||
<div id="page-bgtop" <?=$class?>>
|
||||
<div id="page-bgbtm" <?=$class?>>
|
||||
<div id="page-content" <?=$class?>>
|
||||
<?php if (isset($sidebar) && $sidebar == True): ?>
|
||||
<div id="content">
|
||||
<?php else: ?>
|
||||
<div id="content-fullwidth">
|
||||
<?php endif; ?>
|
||||
|
||||
<noscript>
|
||||
<div id="js-notice">
|
||||
Javascript is required to use this website :(
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<img id="loading" src="Media/Images/loading.gif" alt="[*]" style="display: none;"/>
|
||||
35
src/includer.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
define('BASE_PATH', dirname(__FILE__));
|
||||
chdir(BASE_PATH);
|
||||
|
||||
if (array_key_exists('SAVED_PATH', $_ENV)) {
|
||||
define('SAVED_PATH', $_ENV['SAVED_PATH']);
|
||||
} else {
|
||||
define('SAVED_PATH', realpath(BASE_PATH . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Saved'));
|
||||
}
|
||||
|
||||
function sys_autoload($class)
|
||||
{
|
||||
if (strpos($class, '_') !== False) {
|
||||
$path = 'Classes/' . str_replace('_', '/', $class);
|
||||
if (is_file($path . '.php'))
|
||||
include_once($path . '.php');
|
||||
}
|
||||
|
||||
if (is_file("Classes/$class/$class.php"))
|
||||
include_once("Classes/$class/$class.php");
|
||||
|
||||
if (is_file("Classes/$class.php"))
|
||||
include_once("Classes/$class.php");
|
||||
}
|
||||
|
||||
spl_autoload_register('sys_autoload');
|
||||
|
||||
require('config.php');
|
||||
require('functions.php');
|
||||
|
||||
System::Init($config);
|
||||
|
||||
|
||||
|
||||