Navigation Menu

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: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
class Entity
{
protected $model;
protected function initModel() {
$this->model = [];
}
@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
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: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:

@auroraeosrose
auroraeosrose / gist:b17c03728ccda9162d2b
Created September 24, 2014 18:14
That pcntl patch I've been sitting on
Index: config.w32
===================================================================
--- config.w32 (revision 0)
+++ config.w32 (revision 0)
@@ -0,0 +1,8 @@
+// $Id: config.w32 264053 2008-08-01 21:20:08Z pajoye $
+// vim:ft=javascript
+
+ARG_ENABLE("pcntl", "process control support", "no");
+
PHP7 is coming
And it's breaking all of our extensions
There are currently more changes to the internal apis than there are to things that users will see (and there are enough of those)
In fact not even all the extensions in php source proper are all the way PHP7'd - most of PECL and extensions hosted elsewhere haven't even started! Heck half don't have maintainers!
Extensions are also notorious for poor api design, poor testing, and non-existent docs
But they're also powerful, useful, and fast and more people should use them
PHP7 is coming - fast - and we have a chance to "break" things and to get the community interested and involved
@auroraeosrose
auroraeosrose / gist:d038ec0f9fc82985fe06
Created February 26, 2015 16:36
Go PHP7(ext) - What we're doing

A quick snapshot of what is going on with the project - for the tl;dr see "what can I do?"

What is complete

  1. A name- GoPHP7 is a project (not yet really started) to motivate people to migrate to PHP7 when it's released. This echoes the GoPHP5 project of the past
  2. An irc channel - registered on freenode - owner auroraeosrose, ops lornajane, ircmaxell and joepferguson
  3. A set of goals - see http://goo.gl/BJ3s8D

What is in process

  1. Getting "adminy" stuff set up (lornajane is in charge) - This will include website, wikis, twitter, whatever, and other tools
<?php
// Basically a strict object with no methods
class Struct {
public $foo;
public $bar;
}
$struct = new Struct(['foo' => 'something']); // constructor args would get pushed to properties ???
$struct->foo = 'whatever';
@auroraeosrose
auroraeosrose / gist:1951282
Created March 1, 2012 16:47
Why PHP doesn't allow $class->property()
<?php
class Test {
public function foo() {
echo 'I am happy and called';
}
}
$test = new Test();
$test->foo = function() { echo 'dynamic'; };