-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from TwistPHP/development
Release of v3.1.0
- Loading branch information
Showing
88 changed files
with
4,488 additions
and
7,570 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
.idea | ||
node_modules | ||
# --- OS --- # | ||
.DS_Store | ||
|
||
# --- JETBRAINS --- # | ||
.idea | ||
|
||
# --- VAGRANT --- # | ||
.vagrant | ||
|
||
# --- LOGS --- # | ||
*.log | ||
docs/resources | ||
|
||
# --- DEMO --- # | ||
demo/public/app/Assets/* | ||
!demo/public/app/Assets/.htaccess | ||
demo/public/app/Cache | ||
demo/public/app/Controllers/* | ||
!demo/public/app/Controllers/DEMO_* | ||
demo/public/app/Logs | ||
demo/public/app/Models/* | ||
!demo/public/app/Models/DEMO_* | ||
demo/public/app/Packages | ||
demo/public/app/Resources/* | ||
!demo/public/app/Resources/.htaccess | ||
demo/public/app/Views/* | ||
!demo/public/app/Views/DEMO_* | ||
|
||
# --- JS DOC RESOURCES --- # | ||
docs/resources | ||
|
||
# --- NODE MODULES --- # | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
VAGRANTFILE_API_VERSION = "2" | ||
|
||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
config.vm.box = "ubuntu/trusty64" | ||
config.vm.synced_folder ".", "/vagrant" | ||
config.vm.provision :shell, path: "demo/setup.sh" | ||
config.vm.network "private_network", ip: "192.168.33.10" | ||
config.vm.network :forwarded_port, guest: 80, host: 8080 | ||
config.vm.network :forwarded_port, guest: 3306, host: 3306, host_ip: "127.0.0.1" | ||
|
||
config.vm.provider "virtualbox" do |v| | ||
v.memory = 1024 | ||
end | ||
end |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# TWISTPHP | ||
# ================================================================================ | ||
# TwistPHP - Default .htaccess | ||
# | ||
# All the options in this .htaccess can be edited within the farmework manager | ||
# | ||
# DO NOT REMOVE! | ||
# -------------------------------------------------------------------------------- | ||
# Author: Shadow Technologies Ltd. | ||
# Licence: https://www.gnu.org/licenses/gpl.html GPL License | ||
# Documentation: https://twistphp.com/docs | ||
# Note: Do not edit information inside the '# TWISTPHP' tags | ||
# ================================================================================ | ||
|
||
# An index.html will supersede Twist (if it exists) | ||
DirectoryIndex index.php index.html index.htm | ||
|
||
RewriteEngine on | ||
|
||
# Custom HTAccess rules that have been setup in the manager | ||
|
||
|
||
# www redirect when enabled in the settings | ||
#RewriteCond %{HTTP_HOST} ^www\. | ||
#RewriteRule ^(.*)$ http://%{REQUEST_URI} [L,R=301] | ||
|
||
# HTTPS redirect when enabled in the settings | ||
#RewriteCond %{HTTPS} on | ||
#RewriteRule ^(.*)$ http://%{REQUEST_URI} [L,R=301] | ||
|
||
# Rewrite rules that have been setup in the manager | ||
|
||
|
||
# Disable directory browsing | ||
Options All -Indexes | ||
|
||
# Disable access to HTaccess and HTpass filesincluding any other files that might end in hta or htp | ||
<Files ~ "^.*\.([Hh][Tt][AaPp])"> | ||
order allow,deny | ||
deny from all | ||
satisfy all | ||
</Files> | ||
|
||
# Disallow a list of file extensions form being served | ||
<Files ~ "^.*\.(bash|git|hg|log|svn|swp|cvs)"> | ||
order allow,deny | ||
deny from all | ||
satisfy all | ||
</Files> | ||
|
||
# Disable hotlinking of images with extensions (jpg|jpeg|png|gif|svg) | ||
#RewriteCond %{HTTP_REFERER} !^$ | ||
#RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?/.*$ [NC] | ||
#RewriteRule \.(jpg|jpeg|png|gif|svg)$ http:///hotlink.gif [R,L] | ||
|
||
# Disable PHP files from being run within the Uploads directory | ||
RewriteRule ^uploads/.*\.(?:php[1-6]?|pht|phtml?)$ - [NC,F] | ||
|
||
# Filter suspicious query strings in the URL | ||
RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR] | ||
RewriteCond %{QUERY_STRING} etc/passwd [NC,OR] | ||
RewriteCond %{QUERY_STRING} boot\.ini [NC,OR] | ||
RewriteCond %{QUERY_STRING} ftp\: [NC,OR] | ||
RewriteCond %{QUERY_STRING} http\: [NC,OR] | ||
RewriteCond %{QUERY_STRING} https\: [NC,OR] | ||
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] | ||
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR] | ||
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR] | ||
RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR] | ||
RewriteCond %{QUERY_STRING} ^.*(127\.0).* [NC] | ||
RewriteRule ^.* - [F] | ||
|
||
# Rewrite rules to allow routing | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule ^(.*)$ index.php [L,QSA] | ||
|
||
# Set the cache-control max-age | ||
#<FilesMatch "\.(html|htm)$"> | ||
# Header set Cache-Control "max-age=0, must-revalidate" | ||
# Header unset Last-Modified | ||
#</FilesMatch> | ||
|
||
#<FilesMatch "\.(css|map)$"> | ||
# Header set Cache-Control "max-age=0, public, must-revalidate" | ||
# Header unset Last-Modified | ||
#</FilesMatch> | ||
|
||
#<FilesMatch "\.(js)$"> | ||
# Header set Cache-Control "max-age=0, public, must-revalidate" | ||
# Header unset Last-Modified | ||
#</FilesMatch> | ||
|
||
#<FilesMatch "\.(ico|pdf|flv|jpg|png|gif|swf|svg)$"> | ||
# Header set Cache-Control "max-age=0, public, must-revalidate" | ||
# Header unset Last-Modified | ||
#</FilesMatch> | ||
|
||
# Turn off the ETags | ||
#Header unset ETag | ||
#FileETag None | ||
|
||
# Deflate diffrent files by content type | ||
#AddOutputFilterByType DEFLATE text/html | ||
#AddOutputFilterByType DEFLATE text/css | ||
#AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript | ||
#AddOutputFilterByType DEFLATE image/jpg image/png image/svg image/svg+xml | ||
|
||
# /TWISTPHP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Refuse direct access to all files and folders | ||
Order deny,allow | ||
Deny from all | ||
Allow from 127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Allow direct access to Assets | ||
Allow from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/** | ||
* TwistPHP - An open source PHP MVC framework built from the ground up. | ||
* Copyright (C) 2016 Shadow Technologies Ltd. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* @author Shadow Technologies Ltd. <contact@shadow-technologies.co.uk> | ||
* @license https://www.gnu.org/licenses/gpl.html GPL License | ||
* @link https://twistphp.com | ||
*/ | ||
|
||
/** | ||
* Database Configuration Settings | ||
* TWIST_DATABASE_NAME - The name of your primary database | ||
* TWIST_DATABASE_HOST - Host IP / Name of the database server | ||
* TWIST_DATABASE_USERNAME - Username to use whilst connecting to the database | ||
* TWIST_DATABASE_PASSWORD - Password to use whilst connecting to the database | ||
* TWIST_DATABASE_PROTOCOL - Select the protocol to use (mysql,mysqli) default: mysqli | ||
* TWIST_DATABASE_TABLE_PREFIX - Prefix that will be applied to all tables installed by Twist | ||
*/ | ||
Twist::define('TWIST_DATABASE_NAME','twistphp'); | ||
Twist::define('TWIST_DATABASE_HOST','localhost'); | ||
Twist::define('TWIST_DATABASE_USERNAME','root'); | ||
Twist::define('TWIST_DATABASE_PASSWORD','twistphp'); | ||
Twist::define('TWIST_DATABASE_PROTOCOL','mysqli'); | ||
Twist::define('TWIST_DATABASE_TABLE_PREFIX','twist_'); |
12 changes: 12 additions & 0 deletions
12
demo/public/app/Controllers/DEMO_HelloWorld.controller.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App\Controllers; | ||
use \Twist\Core\Controllers\Base; | ||
|
||
class DEMO_HelloWorld extends Base { | ||
|
||
public function _index() { | ||
return $this -> _view( 'DEMO_welcome.tpl' ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
class Books { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Allow direct access to Resources | ||
Allow from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Welcome! What a beautiful {date:l} it is :)</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/* ================================================================================ | ||
* TwistPHP Demo | ||
* -------------------------------------------------------------------------------- | ||
* Author: Shadow Technologies Ltd. | ||
* Licence: https://www.gnu.org/licenses/gpl.html GPL License | ||
* Documentation: https://twistphp.com/docs | ||
* ================================================================================ | ||
*/ | ||
|
||
//Define the globals required | ||
define( 'TWIST_PUBLIC_ROOT', '/vagrant/demo/public' ); | ||
define( 'TWIST_APP', './app' ); | ||
|
||
//Include TwistPHP | ||
require_once '../../dist/twist/framework.php'; | ||
|
||
//Define a controller | ||
Twist::Route()->controller( '/%', 'DEMO_HelloWorld' ); | ||
|
||
//Register the framework manager | ||
Twist::Route()->manager( '/manager' ); | ||
|
||
//Serve all registered routes | ||
Twist::ServeRoutes(); |
Oops, something went wrong.