I hereby claim:
- I am AndrewCarterUK on github.
- I am andrewcarteruk (https://keybase.io/andrewcarteruk) on keybase.
- I have a public key whose fingerprint is 816F E758 8C26 645F DEC6 AEC3 7A29 1B28 6F00 60B0
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Efficient and performant applications are fantastic; they keep server load, costs and response times low. We can make our web applications more efficient by removing the repetitive bootstrapping process from the request-response cycle.
"How?" I hear you ask!
By using FastCGI we can keep our application alive between requests and vastly improve their performance. The best news is that if you're using a Request-Response framework (such as Symfony) you can probably do this to your application by adding one line to your composer dependencies file.
Let us not get too excited, however! When using PHP in this way we have to be very careful about the design and configuration of our application! This talk will explain how to use FastCGI with our applications safely, providing an overview of the process and highlighting the danger areas that we must be cautious of.
<?php | |
class MyClass | |
{ | |
private $pool; | |
public function __construct(CacheItemPoolInterface $pool) { $this->pool = $pool; } | |
public function getDataA($param) | |
{ | |
return $this->pool->resolveItem( |
<?php | |
/** | |
* What an async proxy server might look like in PHP with a PSR for event loops | |
*/ | |
use EventLoopImplementation\EventLoop; | |
use HttpClientImplementation\HttpClient; | |
use HttpServerImplementation\HttpServer; | |
use PromiseImplementation\Promise; |
<?php | |
/* | |
This should work because composer registers a callback using | |
'spl_autoload_register' for when a class is used that has not | |
already been loaded. Loading the class before hand will | |
prevent that callback being triggered by PHP. | |
*/ | |
/u/dracony Based on the previous comments I updated the base auth project to include separate user and admin logins (totaly separate auth domains), added a .gif demo for the lazy ( http://i.imgur.com/WznceCf.gif ) and the ability to impersonate users.
/u/phpgeek Wow, that's actually something I could use.
/u/underdogging10 >>> Just gonna throw this out there... but you seem to always post positively on any PHPixie post shortly after it is posted. Pretty sure this is just /u/dracony. In fact, basically everything you have posted over the last 3 months is just praise of PHPixie.
<?php | |
function getJsonPage($url) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$result = curl_exec($ch); |
<?php | |
// https://raw.githubusercontent.com/sitepoint-editors/php-fw-survey-2015/master/dump/survey.csv | |
$stream = fopen('survey.csv', 'r'); | |
$headers = fgetcsv($stream); | |
$count = 0; | |
$phpixieCount = 0; | |
$nonPhpixieErrorCount = 0; |
<?php | |
class GPS | |
{ | |
private $serialFile; | |
public function __construct($serialFile) | |
{ | |
$this->serialFile = $serialFile; | |
} |
/** | |
* Programming solution to the GCHQ puzzle on BBC Radio 4, Mon 3rd July 2017 | |
* http://www.bbc.co.uk/programmes/articles/5wkxjTtqRvq8Cyrrjxtk7tc/puzzle-for-today | |
* | |
* Output: | |
* 4 -> 123+45-67+8-9 | |
* 4 -> 123+4-5+67-89 | |
* 3 -> 123-45-67+89 | |
* 6 -> 123-4-5-6-7+8-9 | |
* 6 -> 12+3+4+5-6-7+89 |