Skip to content

Instantly share code, notes, and snippets.

View Tyrael's full-sized avatar

Ferenc Kovacs Tyrael

View GitHub Profile
@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 / 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 / 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 / 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 / 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:1051901
Created June 28, 2011 18:56
bugs temp patch
Index: www/bug.php
===================================================================
--- www/bug.php (revision 312577)
+++ www/bug.php (working copy)
@@ -37,6 +37,14 @@
// Set edit mode
$edit = isset($_REQUEST['edit']) ? (int) $_REQUEST['edit'] : 0;
+if ($edit && $bug_id < 60000 ) {
+ $errors[] = 'Editing old bugs is temporary unavailable!';
@Tyrael
Tyrael / gist:1024786
Created June 14, 2011 12:12
associative arrays from php.net karma system
<?php
$url = 'http://svn.php.net/viewvc/SVNROOT/global_avail?revision=HEAD&view=co';
$file = file_get_contents($url);
$avail_lines = array();
$pattern = '/^avail\|(.*?)\|(.*?)$/sm';
$repos = array();
$users = array();
@Tyrael
Tyrael / gist:1020915
Created June 11, 2011 20:21
peclweb sql/data.php problem
Index: data.php
===================================================================
--- data.php (revision 312067)
+++ data.php (working copy)
@@ -1,5 +1,6 @@
<?php
+require_once "../include/pear-prepend.php";
require_once "DB.php";
require_once "../include/pear-database.php";
@Tyrael
Tyrael / gist:1020037
Created June 10, 2011 23:49
peclweb-22756-bugfix
Index: include/pear-format-html.php
===================================================================
--- include/pear-format-html.php (revision 312027)
+++ include/pear-format-html.php (working copy)
@@ -160,8 +160,8 @@
<option value="packages">Packages</option>
<option value="site">This site (using Google)</option>
<option value="developers">Developers</option>
- <option value="pear-dev">Developer mailing list</option>
- <option value="pear-cvs">CVS commits mailing list</option>
@Tyrael
Tyrael / gist:1020004
Created June 10, 2011 23:19
pecl.php.net install
# install some PEAR dependencies
pear install Html_Form Net_Url Net_URL2-beta Pager HTML_Table HTTP HTML_TreeMenu DB
# check out the code
svn co https://svn.php.net/repository/web/pecl/trunk pecl.php.net
# create and configure the vhost
# add the following line to the sql/data.php
# require_once "../include/pear-prepend.php";