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 | |
function cacheGet($key) { | |
$cache = new PPI\Cache\Redis(); | |
if($cache->exists($cacheKey)) { | |
$someData = $cache->get($cacheKey); | |
} else { | |
$cacheData = array('my_cache' => 'data'); | |
$someData = $cache->set($cacheKey, $cacheData, 86400); | |
} |
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
/* {{{ proto bool SplHeap::clear() U | |
Clear the datastructure of all its elements */ | |
SPL_METHOD(SplHeap, clear) | |
{ | |
int i; | |
spl_heap_object *intern; | |
if (zend_parse_parameters_none() == FAILURE) { | |
return; | |
} |
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
# PAM authentication, then enable this but set PasswordAuthentication | |
# and ChallengeResponseAuthentication to 'no'. | |
UsePAM no | |
root@Bestbuys:~# cat /etc/ssh/sshd_config | more | |
# Package generated configuration file | |
# See the sshd_config(5) manpage for details | |
# What ports, IPs and protocols we listen for |
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 | |
namespace App\Model\Blog; | |
class Comment extends \PPI\DataSource\ActiveQuery { | |
protected $_meta = array( | |
'conn' => 'mysql', | |
'primary' => 'id', | |
'fetchmode' => \PDO::FETCH_ASSOC, | |
'table' => 'ppi_blog_comment' | |
); |
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 | |
namespace App\Mashup\Supplier\Product; | |
use App\Mashup\Supplier\OfferInterface; | |
class DefaultOffer implements OfferInterface | |
{ | |
private $_id; |
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 | |
namespace App\Data\Gifts; | |
class Recipient extends \PPI\DataSource\ActiveQuery { | |
protected $_meta = array( | |
'conn' => 'main', | |
'table' => 'giftsdotcom_meta', | |
'primary' => 'id', | |
); | |
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 | |
$connections = array(); | |
$connections['main'] = array( | |
'type' => 'pdo_mysql', | |
'hostname' => 'localhost', | |
'database' => 'gifts', | |
'username' => 'root', | |
'password' => '' | |
); |
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
$params['helper'] = new \App\Helper\View(array( | |
'baseUrl' => $this->getConfig()->system->base_url | |
)); |
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
function makeLink(array $options) { | |
$url = $this->_baseUrl . 'finder/index/'; | |
if(isset($options['location'])) { | |
$location = str_replace(' ', '-', $options['location']); | |
$url .= 'location/' . $location . '/'; | |
} | |
if(isset($options['category'])) { | |
$category = str_replace(' ', '-', $options['category']); | |
$url .= 'category/' . $category . '/'; | |
} |
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 foreach($categories as $c): ?> | |
<?php | |
$title = $helper->escape($c->getTitle()); | |
$link = $helper->makeLink(array( | |
'category' => $c->getCode() | |
)); | |
?> | |
<li><a href="<?= $link; ?>" title="<?= $title; ?>"><?= $title; ?></a></li> | |
<?php endforeach; ?> |