Skip to content

Instantly share code, notes, and snippets.

View auroraeosrose's full-sized avatar

Elizabeth M Smith auroraeosrose

View GitHub Profile
@auroraeosrose
auroraeosrose / gist:2e90ace602224e00494d
Last active August 29, 2015 14:05
Fixing PHP streams
  1. Interfaces for streams wrappers (clean up apis) - primarily userland, small to no BC
  2. Resources -> objects (engine storage and attachment) - primarily core, some BC issues
  3. finish implementations for callbacks - primarily feature addition
  4. async IO features (see: jpauli) - feature addition with core implications and some BC issues
  5. curl:// stream wrapper - feature addition (functionality of --with-curl-wrappers but with curl:// as prefix)
  6. filtering api - buckets hard to use, user_filter class is api possessed - userland and BC
  7. factory registration for wrapper creation - feature addition
  8. ability to plug into transports from php land instead of requiring C extensions

Streams Interfaces:

cairo.c
cairo_context.c
cairo_error.c
cairo_font.c
cairo_font_face.c
cairo_font_options.c
cairo_ft_font.c
cairo_image_surface.c
ext\cairo\cairo.c(618) : warning C4090: 'initializing' : different 'const' qualifiers
ext\cairo\cairo_font_options.c(77) : warning C4101: 'temp' : unreferenced local variable
@auroraeosrose
auroraeosrose / gist:ba4a1d00c93bb3910b5c
Last active August 29, 2015 14:04
Braindump - Things I'd like to fix or see fixed in PHP $NEXT (6 or 7)
  1. Streams: PHP streams have some major issues - notifications not finished, the horrid http layer (can we PLEASE use a library?), object/class integration, filters and the filter api make people cry, horrific error handling - noise for noise sake and no way to retrieve useful errors and warnings, no curl wrapper anymore, internal api for the implementation is sad
  2. Extensions: some pecl <-> php swaps, all internal extensions MUST have ACTIVE maintainers or get punted, some OO apis for older extensions and killing some non useful (looking at you odbc) functionality, better test coverage of extensions
  3. Enums: either in spl or in core, an enum object for C style enums (or enums as a zval type, either works for me) - this is highly difficult to implement in userland, in ext/core you can make it act like an int with Moar features
  4. Unicode: a unicode string class - yes yes ugly in some ways, but could hold a wchar_t and char * cached of utf8, always act in utf8 when used a string in the majority of PHP cases
@auroraeosrose
auroraeosrose / InitialIdeas.md
Created June 19, 2014 23:22
Ideas for merged extension generator

An initial dump of ideas for a php generator

  1. use composer and symfony console tools for cli manipulation
  2. pluggable architecture

components needed - configuration parsing scanning? (helper for generating definitions) templating

--- libmemcached-1.0.18/Makefile.am 2014-02-09 20:52:42.000000000 +0900
+++ libmemcached-1.0.18/Makefile.am 2014-02-16 23:42:32.265163300 +0900
@@ -2,6 +2,7 @@
ACLOCAL_AMFLAGS= -I m4 -I libtest/m4
AM_YFLAGS= -d
+AM_LDFLAGS = -no-undefined
# includes append to these:
SUFFIXES =
class Entity
{
protected $model;
protected function initModel() {
$this->model = [];
}
@auroraeosrose
auroraeosrose / gist:8927888
Last active August 29, 2015 13:56
Stuff I want to fix in PHP
My bugs:
https://bugs.php.net/bug.php?id=54169 - I have a big patch for pdo_odbc in general
streams related issues: -
https://bugs.php.net/bug.php?id=54156
https://bugs.php.net/bug.php?id=52811 - there are a ton more notification callback related issues - need MAJOR testing for that
https://bugs.php.net/bug.php?id=42387 - yes, this is also on my todo, could use most of the plumbing already in place for the notification callbacks
<?php
$url = 'https://verifier.login.persona.org/verify';
$data = 'assertion='.$_POST['assertion'].'&audience=http://persona.localhost:80';
$params = array('http' => array(
'method' => 'POST',
'content' => $data
),
'ssl' => array('verify_peer' => true
'verify_host' => true));
@auroraeosrose
auroraeosrose / a
Created February 22, 2013 19:16
How to do arrayobject with multidimensional fun
<?php
$obj1 = new ArrayObject([new ArrayObject([1,2,3]), 1]);
unset($obj1[0][0]);
@auroraeosrose
auroraeosrose / php_cli_server.inc
Created November 15, 2012 18:13
Spaces happen folks - a lot
<?php
define ("PHP_CLI_SERVER_HOSTNAME", "localhost");
define ("PHP_CLI_SERVER_PORT", 8964);
define ("PHP_CLI_SERVER_ADDRESS", PHP_CLI_SERVER_HOSTNAME.":".PHP_CLI_SERVER_PORT);
function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE) {
$php_executable = getenv('TEST_PHP_EXECUTABLE');
$doc_root = __DIR__;
$router = "index.php";