Skip to content

Instantly share code, notes, and snippets.

View auroraeosrose's full-sized avatar

Elizabeth M Smith auroraeosrose

View GitHub Profile
@auroraeosrose
auroraeosrose / common.inc
Created November 15, 2012 17:54
Fix for issues in windows_acls tests - changes . to __DIR__ in fix_acls call
<?php
error_reporting(E_ALL);
define('PHPT_ACL_READ', 1 << 1);
define('PHPT_ACL_WRITE', 1 << 2);
define('PHPT_ACL_EXEC', 1 << 3);
define('PHPT_ACL_NONE', 1 << 4);
define('PHPT_ACL_FULL', 1 << 5);
define('PHPT_ACL_GRANT', 1);
define('PHPT_ACL_DENY', 2);
@auroraeosrose
auroraeosrose / gist:4079381
Created November 15, 2012 16:00
Run tests.php from 5.5 alpha fixed for spaces in executable path
#!/usr/bin/env php
<?php
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@auroraeosrose
auroraeosrose / http_parse_query
Created November 14, 2012 19:55
http_parse_query is parse_str with non-stupid api (and fits http_build_query better as well)
/* {{{ proto array http_parse_query(string encoded_string)
parses query string into array */
PHP_FUNCTION(http_parse_query)
{
char *arg;
int arglen;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arglen) == FAILURE) {
return;
}
@auroraeosrose
auroraeosrose / fix for libxml2 php configure
Created August 24, 2012 17:09
support libxml PHP extension shared and against shared dll on windows
// $Id$
// vim:ft=javascript
ARG_WITH("libxml", "LibXML support", "yes");
ARG_WITH("libxmlshared", "LibXML support", "no");
if (PHP_LIBXMLSHARED == "yes") {
PHP_LIBXML = PHP_LIBXMLSHARED;
PHP_LIBXML_SHARED = PHP_LIBXMLSHARED_SHARED;
if (CHECK_LIB("libxml2.lib", "libxml") &&
@auroraeosrose
auroraeosrose / gist:3388410
Created August 18, 2012 17:03
Enum Wrapper class - what do YOU think it outputs ;)
use G\Enum as Enum;
<?php
class Fruit extends Enum {
const Apple = 1;
const Pear = 2;
const Banana = 3;
}
$fruit = new Fruit(Fruit::Apple);
@auroraeosrose
auroraeosrose / gist:3285787
Created August 7, 2012 14:25
How to use an alpha channel image on a gtk window to do a pixmap
/**
* public function set_image
*
* sets a background image for the splash screen
*
* @param string $image absolute path to splash background
* @return void
*/
public function set_image($image)
{
@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'; };