-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I should probably just start an entirely new repo with actual good co…
…mmit practices.
- Loading branch information
Showing
55 changed files
with
1,271 additions
and
407 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,3 +1,2 @@ | ||
conf.php | ||
.htaccess | ||
scrapers/* | ||
rake/scrapers/* |
This file was deleted.
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 |
---|---|---|
@@ -1,23 +1,22 @@ | ||
== INSTALL == | ||
cp conf-default.php conf.php | ||
edit conf.php | ||
cp .htaccess-default .htaccess | ||
edit .htaccess | ||
php install.php | ||
php datarake.php | ||
|
||
vi conf.php | ||
php rake/db_rake.php | ||
php rake/data_rake.php | ||
|
||
== UPDATE == | ||
php install.php | ||
|
||
php rake/db_rake.php | ||
|
||
== DATA REFRESH == | ||
// CAUTION: this may delete data you wanted to keep -- be sure to backup the schema if you want to retain your information | ||
php datarake.php | ||
php rake/data_rake.php | ||
|
||
|
||
==Fake lightweight "Framework"== | ||
Models are in the models folder | ||
No controllers, but instead actions are autorouted to the proper page | ||
URL style is "something.com/?p=[page]&a=[action] | ||
DIR style is /pages/[page]/[action].php | ||
URL style is "something.com/[page]/[action] | ||
DIR style is /pages/[page]/[action].php | ||
|
||
API URL style is "something.com/api/[page]/[action] | ||
API DIR style is /api/[page]/[method]_[action].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
This file was deleted.
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
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,20 +1,34 @@ | ||
<?php | ||
// Time settings | ||
date_default_timezone_set("America/New_York"); | ||
// Set Time Zone | ||
|
||
|
||
// DB Settings | ||
// ReCaptcha Settings | ||
global $RECAPTCHA_PUBLIC_KEY, $RECAPTCHA_PRIVATE_KEY; | ||
$RECAPTCHA_PUBLIC_KEY = ""; | ||
$RECAPTCHA_PRIVATE_KEY = ""; | ||
|
||
// DB Connection Settings | ||
global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASS, $MYSQL_DB; | ||
$MYSQL_HOST = ""; | ||
$MYSQL_USER = ""; | ||
$MYSQL_PASS = ""; | ||
$MYSQL_DB = ""; | ||
|
||
// Site Settings | ||
global $SITE_ROOT, $SITE_DOMAIN; | ||
$SITE_ROOT = ""; | ||
$SITE_DOMAIN = "127.0.0.1"; | ||
// Memcache Connection Settings | ||
global $MEMCACHE_HOST, $MEMCACHE_PORT | ||
$MEMCACHE_HOST = ""; | ||
$MEMCACHE_PORT = 11211; | ||
|
||
// Bootstrap Settings | ||
global $BASE_DIRECTORY; | ||
# If you are hosting Truth Goggles in your base directory | ||
$BASE_DIRECTORY = "/"; | ||
|
||
# If you are hosting Truth Goggles in a subdirectory (replace [subdirectory path] with the appropriate path) | ||
# $ROOT = "/[subdirectory path]/"; | ||
|
||
// Thermonuclear Disaster Prevention | ||
global $ALLOW_THERMONUCLEAR_DISASTER; | ||
$ALLOW_THERMONUCLEAR_DISASTER = false; | ||
|
||
// API Settings | ||
global $API_RELATED_CLAIMS; | ||
$API_RELATED_CLAIMS = ""; | ||
?> |
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,28 +1,25 @@ | ||
<?PHP | ||
set_include_path($_SERVER['DOCUMENT_ROOT']); | ||
|
||
require_once("conf.php"); | ||
set_include_path($_SERVER['DOCUMENT_ROOT'].$BASE_DIRECTORY."../"); | ||
header('Content-type: text/javascript'); | ||
header('Access-Control-Allow-Origin: *'); | ||
header('Access-Control-Allow-Methods: POST, GET, OPTIONS'); | ||
header('Access-Control-Max-Age: 1000'); | ||
header('Access-Control-Allow-Headers: Content-Type'); | ||
|
||
$params = explode('/',(isset($_GET['q'])?$_GET['q']:"")); | ||
$resourceType = preg_replace('[^A-Za-z0-9_]',"",isset($params[0])?$params[0]:""); | ||
|
||
$parsed_url = parse_url($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); | ||
$path_items = array_splice(explode("/", $parsed_url['path']), substr_count($BASE_DIRECTORY, "/") + 1); | ||
|
||
$resourceType = preg_replace('[^A-Za-z0-9_]',"",isset($path_items[0])?$path_items[0]:""); | ||
$requestMethod = preg_replace('[^A-Za-z0-9_]',"",strtolower($_SERVER['REQUEST_METHOD'])); | ||
|
||
$resourceIdentifier = isset($params[1])?$params[1]:""; | ||
$resourceIdentifier = isset($path_items[1])?$path_items[1]:""; | ||
|
||
$jsonp = isset($_GET['jsonp'])?true:false; | ||
$callback = isset($_GET['callback'])?$_GET['callback']:"goggles_".$requestMethod."_".$resourceType."_callback"; | ||
$resourceIdentifier = isset($_GET['r'])?$_GET['r']:null|$resourceIdentifier|null; | ||
|
||
$path = "api/".$resourceType."/".$requestMethod."_".$resourceType.".php"; | ||
|
||
if(file_exists($path)) | ||
include_once($path); | ||
else { | ||
echo("ERR: Invalid API Call"); | ||
} | ||
include_once($path); | ||
?> |
Oops, something went wrong.