-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eric Jennings
committed
Dec 3, 2012
1 parent
1d44391
commit e946ef4
Showing
1,275 changed files
with
319,703 additions
and
222 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
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
|
||
|
||
// BUILD SETTINGS | ||
define('PF_VERSION','4.0'); | ||
define('PF_VERSION','4.1'); | ||
define('PF_ENVIRONMENT', 'development'); | ||
|
||
|
||
|
@@ -60,14 +60,10 @@ | |
|
||
|
||
// TEMPLATE/FORM SETTINGS | ||
define('PF_TEMPLATE_FORCE_RECOMPILE', true); | ||
define('PF_TEMPLATE_FORCE_RECOMPILE', false); | ||
define('PF_FORM_FIELD_ERROR_HIGHLIGHTING', true); | ||
|
||
|
||
// CMS SETTINGS | ||
define('PF_CMS_ENABLED', false); | ||
|
||
|
||
// SESSION SETTINGS | ||
define('PF_SESSION_NAME', 'id'); | ||
define('PF_SESSION_PERSIST_NAME', 'persist'); | ||
|
@@ -83,12 +79,21 @@ | |
define('PF_CACHE_ENABLED', true); | ||
define('PF_CACHE_USER_TTL', 3600); | ||
define('PF_CACHE_CONTROLLER_MAP', false); | ||
define('PF_CACHE_TEMPLATES', false); | ||
|
||
define('PF_CACHE_MEMCACHE_SERVER_HOST_1', false); | ||
define('PF_CACHE_MEMCACHE_SERVER_HOST_2', false); | ||
define('PF_CACHE_MEMCACHE_SERVER_HOST_3', false); | ||
define('PF_CACHE_MEMCACHE_SERVER_HOST_4', false); | ||
|
||
define('PF_CDN_URL', '%%PHING_PROTEAN_URL%%'); | ||
|
||
|
||
// JOB QUEUE SETTINGS | ||
define('PF_JOBQUEUE_HOST', '127.0.0.1'); | ||
define('PF_JOBQUEUE_PORT', 11300); | ||
define('PF_JOBQUEUE_CONN_TIMEOUT', null); | ||
|
||
|
||
// MAILER SETTINGS | ||
define('PF_EMAIL_USE_SMTP', false); | ||
|
@@ -127,8 +132,7 @@ | |
define('PF_SHOP_EMAIL_ADMINS', false); | ||
|
||
define('PF_SHOP_GATEWAY_DEBUG', true); | ||
define('PF_SHOP_GATEWAY_LOG', '%%PHING_PROTEAN_BASEDIR%%/logs/pf_authnet_gateway.log'); | ||
define('PF_SHOP_CIM_LOG', '%%PHING_PROTEAN_BASEDIR%%/logs/pf_authnet_cim.log'); | ||
define('PF_SHOP_GATEWAY_LOG', '%%PHING_PROTEAN_BASEDIR%%/logs/pf_gateway.log'); | ||
|
||
define('PF_SHOP_GATEWAY_AUTHNET_TEST_REQUEST', true); | ||
define('PF_SHOP_GATEWAY_AUTHNET_LOGIN', 'abc'); | ||
|
@@ -140,6 +144,23 @@ | |
define('PF_SHOP_GATEWAY_AUTHNET_CIM_PORT', '443'); | ||
define('PF_SHOP_GATEWAY_AUTHNET_CIM_PATH', '/xml/v1/request.api'); | ||
|
||
define('PF_SHOP_GATEWAY_STRIPE_TEST_REQUEST', true); | ||
define('PF_SHOP_GATEWAY_STRIPE_TEST_SECRET_KEY', 'D7bES9biF1eeGhBENJrnQO6tDVMrnt5o'); | ||
define('PF_SHOP_GATEWAY_STRIPE_TEST_PUBLISH_KEY', 'pk_3GALjNFDV4KXTd4QPkLBibsHpXkar'); | ||
define('PF_SHOP_GATEWAY_STRIPE_LIVE_SECRET_KEY', 'sTHNScUGnEXIhVcmiibWrSPYCevHlx1Y'); | ||
define('PF_SHOP_GATEWAY_STRIPE_LIVE_PUBLISH_KEY', 'pk_sn1AJYs7zVjkWG6ubFBj2rpMFy9Ko'); | ||
define('PF_SHOP_GATEWAY_STRIPE_SCRIPT', 'https://js.stripe.com/v1/'); | ||
|
||
define('PF_SHOP_GATEWAY_PAYPAL_TEST_REQUEST', true); | ||
define('PF_SHOP_GATEWAY_PAYPAL_LOG', '/www/standard/www.missouriquiltco.com/logs/pf_paypal.log'); | ||
define('PF_SHOP_GATEWAY_PAYPAL_SELLER_EMAIL', '[email protected]'); | ||
|
||
define('PF_USPS_RATECALCULATOR_USERNAME', '493MISSO0374'); | ||
|
||
define('PF_ES_HOST_1', 'localhost'); | ||
define('PF_ES_HOST_2', false); | ||
define('PF_ES_HOST_3', false); | ||
define('PF_ES_HOST_4', false); | ||
|
||
// SITE SPECIFIC DEFINES | ||
|
||
|
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,25 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> | ||
<cross-domain-policy> | ||
|
||
|
||
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html --> | ||
|
||
<!-- Most restrictive policy: --> | ||
<site-control permitted-cross-domain-policies="none"/> | ||
|
||
|
||
|
||
<!-- Least restrictive policy: --> | ||
<!-- | ||
<site-control permitted-cross-domain-policies="all"/> | ||
<allow-access-from domain="*" to-ports="*" secure="false"/> | ||
<allow-http-request-headers-from domain="*" headers="*" secure="false"/> | ||
--> | ||
<!-- | ||
If you host a crossdomain.xml file with allow-access-from domain=“*” | ||
and don’t understand all of the points described here, you probably | ||
have a nasty security vulnerability. ~ simon willison | ||
--> | ||
|
||
</cross-domain-policy> |
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,81 @@ | ||
<?php | ||
/**************************************************************************\ | ||
* Protean Framework * | ||
* https://github.com/erictj/protean * | ||
* Copyright (c) 2006-2012, Eric Jennings. All rights reserved. * | ||
* ------------------------------------------------------------------------ * | ||
* This program is free software; you can redistribute it and/or modify it * | ||
* under the terms of the BSD License as described in license.txt. * | ||
\**************************************************************************/ | ||
/** | ||
@package api | ||
*/ | ||
class PFHttpRequest { | ||
|
||
public function get($url, $credentials, $status=null, $wait=3) { | ||
return $this->request('get', $url, $credentials, null, $status, $wait); | ||
} | ||
|
||
public function post($url, $credentials, $data, $status=null, $wait=3) { | ||
return $this->request('post', $url, $credentials, $data, $status, $wait); | ||
} | ||
|
||
public function put($url, $credentials, $data, $status=null, $wait=3) { | ||
return $this->request('put', $url, $credentials, $data, $status, $wait); | ||
} | ||
|
||
public function delete($url, $credentials, $status=null, $wait=3) { | ||
return $this->request('delete', $url, $credentials, null, $status, $wait); | ||
} | ||
|
||
protected function request($verb, $url, $credentials, $fields=null, $status=null) { | ||
$time = microtime(true); | ||
|
||
//$fields = (is_array($fields)) ? http_build_query($fields) : $fields; | ||
printr($verb); | ||
printr($url); | ||
printr($credentials); | ||
printr($fields); | ||
|
||
$ch = curl_init(); | ||
curl_setopt($ch, CURLOPT_URL, $url); | ||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $verb); | ||
//curl_setopt($ch, CURLOPT_HEADER, TRUE); | ||
if ($credentials) { | ||
curl_setopt($ch, CURLOPT_USERPWD, $credentials); | ||
} | ||
if ($verb == 'post' || $verb == 'put') { | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, array($fields)); | ||
curl_setopt($ch, CURLOPT_POST, 1); | ||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8')); | ||
} | ||
//curl_setopt($ch, CURLOPT_NOBODY, TRUE); // remove body | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); | ||
$head = curl_exec($ch); | ||
if (!$head) { | ||
printr(curl_error($ch)); | ||
return false; | ||
} | ||
|
||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); | ||
curl_close($ch); | ||
|
||
printr('CURL VERB:'); | ||
printr($verb); | ||
printr('CURL OUTPUT:'); | ||
printr($head); | ||
|
||
if ($status === null) { | ||
if ($httpCode < 400) { | ||
return $head; | ||
} else { | ||
return false; | ||
} | ||
} elseif ($status == $httpCode) { | ||
return $head; | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
?> |
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,63 @@ | ||
<?php | ||
/**************************************************************************\ | ||
* Protean Framework * | ||
* https://github.com/erictj/protean * | ||
* Copyright (c) 2006-2012, Eric Jennings. All rights reserved. * | ||
* ------------------------------------------------------------------------ * | ||
* This program is free software; you can redistribute it and/or modify it * | ||
* under the terms of the BSD License as described in license.txt. * | ||
\**************************************************************************/ | ||
/** | ||
@package api | ||
*/ | ||
require_once('modules/thirdparty/pheanstalk/pheanstalk_init.php'); | ||
|
||
class PFJobQueue { | ||
|
||
protected $bs; | ||
|
||
public function __construct() { | ||
$this->bs = new Pheanstalk(PF_JOBQUEUE_HOST, PF_JOBQUEUE_PORT, PF_JOBQUEUE_CONN_TIMEOUT); | ||
} | ||
|
||
public function put($tube, $payload) { | ||
return $this->bs->putInTube($tube, $payload); | ||
} | ||
|
||
public function reserve($tube) { | ||
return $this->bs->reserveFromTube($tube); | ||
} | ||
|
||
public function bury($job) { | ||
return $this->bs->bury($job); | ||
} | ||
|
||
public function delete($job) { | ||
return $this->bs->delete($job); | ||
} | ||
|
||
public function statsTube($tube) { | ||
return $this->bs->statsTube($tube); | ||
} | ||
|
||
public function peekReady($tube) { | ||
return $this->bs->peekReady($tube); | ||
} | ||
|
||
public function clearTube($tube) { | ||
try { | ||
$stats = $this->statsTube($tube); | ||
} catch (Exception $e) { | ||
if ($e->getMessage() == 'Server reported NOT_FOUND') { | ||
return false; | ||
} | ||
} | ||
|
||
while ($stats->{'current-jobs-ready'} > 0) { | ||
$this->delete($this->peekReady($tube)); | ||
$stats = $this->statsTube($tube); | ||
} | ||
} | ||
} | ||
|
||
?> |
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,81 @@ | ||
<?php | ||
/**************************************************************************\ | ||
* Protean Framework * | ||
* https://github.com/erictj/protean * | ||
* Copyright (c) 2006-2012, Eric Jennings. All rights reserved. * | ||
* ------------------------------------------------------------------------ * | ||
* This program is free software; you can redistribute it and/or modify it * | ||
* under the terms of the BSD License as described in license.txt. * | ||
\**************************************************************************/ | ||
/** | ||
@package api | ||
*/ | ||
class PFHttpRequest { | ||
|
||
public function get($url, $credentials, $status=null, $wait=3) { | ||
return $this->request('get', $url, $credentials, null, $status, $wait); | ||
} | ||
|
||
public function post($url, $credentials, $data, $status=null, $wait=3) { | ||
return $this->request('post', $url, $credentials, $data, $status, $wait); | ||
} | ||
|
||
public function put($url, $credentials, $data, $status=null, $wait=3) { | ||
return $this->request('put', $url, $credentials, $data, $status, $wait); | ||
} | ||
|
||
public function delete($url, $credentials, $status=null, $wait=3) { | ||
return $this->request('delete', $url, $credentials, null, $status, $wait); | ||
} | ||
|
||
protected function request($verb, $url, $credentials, $fields=null, $status=null) { | ||
$time = microtime(true); | ||
|
||
//$fields = (is_array($fields)) ? http_build_query($fields) : $fields; | ||
printr($verb); | ||
printr($url); | ||
printr($credentials); | ||
printr($fields); | ||
|
||
$ch = curl_init(); | ||
curl_setopt($ch, CURLOPT_URL, $url); | ||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $verb); | ||
//curl_setopt($ch, CURLOPT_HEADER, TRUE); | ||
if ($credentials) { | ||
curl_setopt($ch, CURLOPT_USERPWD, $credentials); | ||
} | ||
if ($verb == 'post' || $verb == 'put') { | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, array($fields)); | ||
curl_setopt($ch, CURLOPT_POST, 1); | ||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8')); | ||
} | ||
//curl_setopt($ch, CURLOPT_NOBODY, TRUE); // remove body | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); | ||
$head = curl_exec($ch); | ||
if (!$head) { | ||
printr(curl_error($ch)); | ||
return false; | ||
} | ||
|
||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); | ||
curl_close($ch); | ||
|
||
printr('CURL VERB:'); | ||
printr($verb); | ||
printr('CURL OUTPUT:'); | ||
printr($head); | ||
|
||
if ($status === null) { | ||
if ($httpCode < 400) { | ||
return $head; | ||
} else { | ||
return false; | ||
} | ||
} elseif ($status == $httpCode) { | ||
return $head; | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
?> |
Oops, something went wrong.