Skip to content

Instantly share code, notes, and snippets.

@mwillbanks
mwillbanks / ZF3Sessions.md
Last active August 29, 2015 14:02
Some ideas around sessions

Sessions

Zend Framework 3 (ZF3) will provide a new session management layer that will decouple it from ext/session. In doing this we will allow you to run multiple sessions at the same time in an application, utilize sessions in long-running applications, compatibility/convertibility with other applications, languages, etc.

With decoupling ext/session we will also provide a compatibility layer that will allow you to continue to utilize ext/session and the super global $_SESSION thus allowing you to continue with like behavior as you would have come to expect with generic session management in PHP.

In Zend Framework 2 (ZF2), we encountered numerous issues throughout the session management layer. Certain compatibility issues with ext/session specifically relating to session uploads. Session uploads caused corruption to the internal handing of sessions generally due to it's attempt to rewrite the session data. We also encountered several issues with PHP itself specifically regarding the usage

@mtdowling
mtdowling / gist:47da5eab54337cdc7ecc
Last active August 29, 2015 14:06
React and Guzzle experiment
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Stream\BufferStream;
use GuzzleHttp\Stream\AsyncReadStream;
use GuzzleHttp\Ring\Future;
$loop = React\EventLoop\Factory::create();
$dnsResolverFactory = new React\Dns\Resolver\Factory();
$dnsResolver = $dnsResolverFactory->createCached('8.8.8.8', $loop);
<?php
error_reporting(E_ALL | E_STRICT);
/**
* To runs this example you will need the UUID PHP Extension http://pecl.php.net/package/uuid
*/
/**
* DomainModel Aggregate root for a Tweet
*
* The Aggregate root tracks all uncommitted events and can have old
* events replayed to it.
@ha1t
ha1t / phppro_quote_count.php
Created April 20, 2012 09:54
PHPプロ!のnewsが何回他のニュースサイトから引用しているかチェックするスクリプトとか書いたなー
<?php
/**
* PHPプロ!のnewsで何回他のニュースサイトから
* 引用しているかチェックするスクリプト
*
*/
require_once 'HTTP/Client.php';
$g_target_url = 'http://www.phppro.jp/news/';
$g_start = 215;
@b-durand
b-durand / MockDbAdapter.php
Created August 20, 2012 21:58
PHPUnit Mock API with Zend\Db
<?php
$date = new DateTime();
$mockStatement = $this->getMock('Zend\Db\Adapter\Driver\Pdo\Statement');
$mockStatement->expects($this->once())->method('execute')->with($this->equalTo(array(
'timestamp' => $date->format(FormatterInterface::DEFAULT_DATETIME_FORMAT)
)));
$mockDbDriver = $this->getMockBuilder('Zend\Db\Adapter\Driver\Pdo\Pdo')
->disableOriginalConstructor()
@rsky
rsky / gist:3529774
Created August 30, 2012 14:36
rep2用 Nginx設定サンプル
server {
listen 443;
server_name rep2.example.com;
access_log /path/to/p2-php/data/logs/access.log main;
error_log /path/to/p2-php/data/logs/error.log;
ssl on;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers HIGH:!ADH:!MD5;
diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4
index cdfa1f7..9a1b98d 100644
--- a/sapi/cli/config.m4
+++ b/sapi/cli/config.m4
@@ -6,6 +6,23 @@ PHP_ARG_ENABLE(cli,,
[ --disable-cli Disable building CLI version of PHP
(this forces --without-pear)], yes, no)
+AC_CHECK_FUNCS(setproctitle)
+
@ircmaxell
ircmaxell / README.md
Last active December 18, 2015 12:19
Compare Modified GC

To set this up, have 2 builds of PHP, one using the "master" branch, and one using my refactor branch. Configure the paths to the SAPI at the top of benchmark.php.

Note that it's hard-coded to look for php-src/Zend/bench.php, php-src/Zend/micro_bench.php and gc_test.php.

@DaSourcerer
DaSourcerer / httpget
Last active December 27, 2015 09:29
A simple stream-based http client. Good for experimentation.
#!/usr/bin/php
<?php
$scheme='tcp';
$host='www.kernel.org';
$port=80;
$path='/';
if(isset($argv[1])) {
$parsedUrl=parse_url($argv[1]);
@cspray
cspray / cv-ring-description.md
Created January 27, 2012 15:55
A brief description of cv-ring and cv-pls

What is 'cv-ring', 'cv-pls' and 'delv-pls'

In the Stack Overflow PHP chat you may notice the regulars using tags like cv-pls, cv-ring and delv-pls. These tags are used only in the chat room to communicate with other users that a question or answer may need more votes to be closed or deleted. The PHP tag has a lot of inferior quality and duplicative information on Stack Overflow. We feel that inferior quality questions bring down the site and make it harder to find good information, particularly about PHP. By closing and merging these questions as appropriate you'll find the information you need quicker.

  • cv-ring is just a 'funny name' we give to the group of regulars who use the tags
  • cv-pls is an in-chat tag that communicates "Hey, this question may be of inferior quality. Check it out and, if you feel appropriate, cast a close vote."
  • delv-pls is an in-chat tag that communicates "Hey, this question has alr