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
$viewModel = new ViewModel(); | |
$viewModel->setVariables( | |
array( | |
'reset_url' => $core->getCurrentSite() . "/reset/" . $reset_hash, | |
'ip_address' => $core::getIP(), | |
'promo_name' => $core->getPromotionName(), | |
) | |
); |
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
<?php | |
set_time_limit( 0 ); | |
$searchText = 'Page and Brin originally nicknamed THEIR new search engine "BackRub", because the system checked backlinks to estimate the importance of a site.'; | |
$start = microtime_float(); | |
for( $i = 0 ; $i < 1000000 ; $i++ ) | |
{ | |
preg_match_all("/[A-Z]{1}[a-zA-z]*/", $searchText, $matches ); |
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
public function fetchAllWithVotes() | |
{ | |
$resultset = $this->select( function( Select $select ){ | |
$sub = new Select( 'votes' ); | |
$sub->columns( array( 'total' => new Expression('COUNT(*)') ) ) | |
->where( 'songs.id = votes.song_id' ); | |
$select->columns( | |
array( |
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
<?php | |
class Foo | |
{ | |
const COOKIE_KEY = '839914B48AE583605F004C784FEF155B39A2C142AD7A747582160E6C14E7EF16'; | |
const COOKIE_IV = '864C9BB8032792391B88C76CF73276F2'; | |
public function encrypt( $what ) | |
{ |
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
namespace Application\Factory\Controller; | |
use Zend\ServiceManager\AbstractFactoryInterface; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
class AbstractControllerFactory implements AbstractFactoryInterface | |
{ | |
/** | |
* Determine if we can create a service with name |
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
<?php | |
class LazyControllerFactory implements AbstractFactoryInterface | |
{ | |
/** | |
* Determine if we can create a service with name | |
* | |
* @param ServiceLocatorInterface $serviceLocator | |
* @param $name |
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
Homebrew build logs for josegonzalez/php/php70 on macOS 10.11.6 | |
Build date: 2016-09-26 21:45:45 |
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
<?php | |
/* | |
* Typical database config | |
*/ | |
// .... | |
'doctrine' => [ |
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
<?php | |
namespace Spec\Application\Controller; | |
use Application\Controller\Plugin\JsonWrapper; | |
use Application\Entity\User; | |
use Application\Mapper\ConfigurationMapper; | |
use Application\Mapper\CouponMapper; | |
use Application\Mapper\UserServerPlanMapper; | |
use Application\Service\CartService; |
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
<?php | |
namespace LDP\Form\Filter; | |
class MultibyteGuard implements \Zend\Filter\FilterInterface | |
{ | |
public function filter($value) | |
{ | |
if (!mb_check_encoding($value, 'utf-8')) { | |
$value = ''; |