Skip to content

Instantly share code, notes, and snippets.

View Tyrael's full-sized avatar

Ferenc Kovacs Tyrael

View GitHub Profile
@Tyrael
Tyrael / wiki.php.net.patch
Created July 11, 2011 15:01
wiki.php.net vote group fix
Index: /home/tyrael/checkouts/php-wiki/dokuwiki/lib/plugins/doodle/syntax.php
===================================================================
--- /home/tyrael/checkouts/php-wiki/dokuwiki/lib/plugins/doodle/syntax.php (revision 313127)
+++ /home/tyrael/checkouts/php-wiki/dokuwiki/lib/plugins/doodle/syntax.php (working copy)
@@ -199,9 +199,14 @@
}
//FIXME: count($choices) may be different from number of choices in $doodle data!
+ $can_vote = false;
+ if (count(array_intersect(array('admin', 'phpcvs', 'voting'), $INFO['userinfo']['grps'])) > 0) {
@Tyrael
Tyrael / gist:1098769
Created July 22, 2011 02:36
pecl.php.net svn auth
Index: public_html/release-upload.php
===================================================================
--- public_html/release-upload.php (revision 313395)
+++ public_html/release-upload.php (working copy)
@@ -122,8 +122,8 @@
$errors[] = $pacid->getMessage();
break;
}
- if (!user::isAdmin($_COOKIE['PEAR_USER']) &&
- !user::maintains($_COOKIE['PEAR_USER'], $pacid, 'lead')) {
@Tyrael
Tyrael / reproduce_pyrus_make.sh
Created August 7, 2011 13:58
reproduce pyrus make
#!/bin/bash
DIR=`pwd`'/reproduce_pyrus_make'
mkdir $DIR;
cd $DIR;
git clone 'git://github.com/pyrus/Pyrus.git';
git clone 'git://github.com/pyrus/Pyrus_Developer.git';
git clone 'git://github.com/pear2/PEAR2_Autoload.git';
git clone 'git://github.com/Tyrael/suhosin.git';
ln -s "$DIR/Pyrus_Developer/customcommand/commands.xml" "$DIR/Pyrus/data/local-developer-commands.xml"
cd 'Pyrus';
@Tyrael
Tyrael / autoload.php
Created August 7, 2011 14:04
autoloader for pyrus
<?php
/**
* @author Brett Bieber
* @desc autoload.php
*/
// load PEAR2\Autoload first
require_once __DIR__ . '/../PEAR2_Autoload/src/PEAR2/Autoload.php';
// Setup the local source dir
@Tyrael
Tyrael / run-tests.php
Created September 26, 2011 20:23
run-tests test redirects
Index: run-tests.php
===================================================================
--- run-tests.php (revision 317341)
+++ run-tests.php (working copy)
@@ -2415,24 +2415,34 @@
function show_redirect_start($tests, $tested, $tested_file)
{
- global $html_output, $html_file;
+ global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;
@Tyrael
Tyrael / test.log
Created September 26, 2011 20:26
phpize amd64
tyrael@phpize:~/checkouts/php-src/trunk$ SHOW_ONLY_GROUPS='FAIL' make test;
Build complete.
Don't forget to run 'make test'.
=====================================================================
PHP : /home/tyrael/checkouts/php-src/trunk/sapi/cli/php
PHP_SAPI : cli
PHP_VERSION : 5.5.0-dev
@Tyrael
Tyrael / test.log
Created September 26, 2011 20:27
phpize i386
tyrael@phpize32:~/checkouts/php-src/trunk$ SHOW_ONLY_GROUPS='FAIL' make test;
Build complete.
Don't forget to run 'make test'.
=====================================================================
PHP : /home/tyrael/checkouts/php-src/trunk/sapi/cli/php
PHP_SAPI : cli
PHP_VERSION : 5.5.0-dev
@Tyrael
Tyrael / is_really_int.php
Created September 27, 2011 12:52
is really int. O RLY?
<?php
function is_really_int(&$val) {
$num = (int)$val;
if ($val==$num) {
$val=$num;
return true;
}
return false;
}
@Tyrael
Tyrael / run-tests.php
Created October 13, 2011 08:11
run-tests.php with junit xml output
#!/usr/bin/php
<?php
/*
+----------------------------------------------------------------------+
| PHP Version 5, 6 |
+----------------------------------------------------------------------+
| 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 |
@Tyrael
Tyrael / revert-newline.sh
Created November 14, 2011 14:09
svn revert files in current directory having newline changes only
svn st|grep ^M|awk '{cmd = "svn diff -x --ignore-eol-style "$2;if ((cmd | getline result) <= 0) system("svn revert "$2);}'