This file contains hidden or 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
<?php | |
public function getRenderVars() { | |
$requestMethod = strtolower($this->getRequestMethod()); | |
$isVars = array(); | |
foreach(array('post', 'get', 'head', 'delete', 'put') as $method) { | |
$isVars[$method] = $requestMethod === $method; | |
} | |
$isVars['ajax'] = $this->is('ajax'); | |
$isVars['https'] = $isVars['ssl'] = $this->is('https'); | |
return array( |
This file contains hidden or 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
<?php | |
/** | |
* The Environment Options for the PPI Application | |
* | |
* @var array | |
*/ | |
protected $_envOptions = array( | |
'siteMode' => 'development', // This determines how PPI handles things like exceptions | |
'configBlock' => 'development' // The block in the config file to get the config data from | |
); |
This file contains hidden or 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
<?php | |
$this->_config = new PPI_Config(array( | |
'configBlock' => $this->getEnv('configBlock'), | |
'configFile' => $this->getEnv('configFile'), | |
'cacheConfig' => $this->getEnv('cacheConfig', false), | |
'cacheConfigPath' => $this->getEnv('cacheConfigPath', '') | |
)); |
This file contains hidden or 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
<?php | |
require_once '../ppi-framework/init.php'; | |
$app = new PPI_App(); | |
$app->boot()->dispatch(); |
This file contains hidden or 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
<?php | |
require_once '../ppi-framework/init.php'; | |
$app = new PPI_App(); | |
$app->siteMode = 'production'; | |
$app->cacheConfig = true; | |
$app->configCachePath = APPFOLDER . 'Cache/Config/'; | |
$app->setRouter(new APP_General_Router()); | |
$app->boot()->dispatch(); |
This file contains hidden or 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
<?php | |
$this->charset = strtolower($bIsCharsetOverride ? $oConfig->db->charset : 'utf8'); | |
if(version_compare(PHP_VERSION, '5.3.6', '<')) { | |
$connectParams[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES ' . $this->charset; | |
} | |
$this->rHandler = new PDO($this->makeDSN(), $this->sUserName, $this->sPassword, $connectParams); | |
public function makeDSN() { |
This file contains hidden or 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
SELECT p.*, u.first_name, u.last_name, | |
(SELECT count(*) from ppi_blog_comment WHERE post_id = ppi_blog.id) num_comments | |
FROM ppi_blog p | |
LEFT JOIN users u ON u.id = p.user_id | |
WHERE (published = 1) | |
ORDER BY created DESC |
This file contains hidden or 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
<?php | |
require_once '../ppi-framework/init.php'; | |
$app = new PPI_App(); | |
$app->siteMode = 'development'; | |
$app->configBlock = 'development'; | |
$app->router = new PPI_Router(); | |
$app->boot(); | |
var_dump(new Solar_View()); exit; |
This file contains hidden or 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
<?php | |
/** | |
* Unit test for PPI Session | |
* | |
* @package Core | |
* @author Paul Dragoonis <[email protected]> | |
* @license http://opensource.org/licenses/mit-license.php MIT | |
* @link http://www.ppiframework.com | |
*/ | |
class PPI_SessionTest extends PHPUnit_Framework_TestCase { |
This file contains hidden or 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
<?php | |
Environment::is(function($request) { | |
if ($request->env('HTTP_HOST') == 'localhost') { | |
return 'development'; | |
} | |
if ($request->env('HTTP_HOST') == 'staging.server') { | |
return 'test'; | |
} | |
return 'production'; | |
}); |