Skip to content

Instantly share code, notes, and snippets.

View Tyrael's full-sized avatar

Ferenc Kovacs Tyrael

View GitHub Profile
[13:17] <@Catahract> he says it's a form so supposedly you have some feedback on whether you exceeded max_input_vars
[13:17] <@Catahract> I mean you can put the legit variables on the end and check whether you have form errors
[13:19] <@Catahract> in that case I think you can send a variable with a[2^31-1]=foo, then add many variables a[]=bar and finally the legitimate ones
[13:19] <@Catahract> if you get no form errors, it's 32 bit because the a[]=bar variables were ignored
[13:19] <@Catahract> "Cannot add element to the array as the next element is already occupied'
[13:20] <@Catahract> (end speculatoion)
@Tyrael
Tyrael / gist:1739501
Created February 4, 2012 19:01
perl vertical space
$s = "The \n\n\nquick brown fox \n\n\n jumps over the lazy
\n\n\ndog.";
$s =~ s/\v{3,}//mg;
print $s;
@Tyrael
Tyrael / build.bat
Created December 19, 2011 23:01
php windows build
@ECHO OFF
REM ## This is needed for setenv.cmd later
setlocal EnableDelayedExpansion
REM ## STORE OLD DIR
set olddir=%cd%
REM ## DETERMINE SDK DIR
SET SDKREG=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.1
SET SDKDIRQUERY=reg query "%SDKREG%" /v InstallationFolder
FOR /F "tokens=2* delims= " %%A IN ('%SDKDIRQUERY%') DO SET SDKDIR=%%B
@Tyrael
Tyrael / gist:1424907
Created December 2, 2011 21:29
till vs libsqlite
[14:26:42] <till> https://bugs.php.net/bug.php?id=48614 < can anyone check if this could make it into 5.4 and 5.3-branch?
[14:33:36] <johannes_> till: it's complicated to do right for all cases ... simplest would be to unbundle libsqlite and depend on the system one :-)
[15:33:58] <till> johannes_: that's fine too, imho. is there a reason not to?
[15:54:48] <johannes_> till: for 5.3 it's a change of feature in the release; in general, well, there's the argument of having defined behavior on all installations, and maybe we "improved" it a bit, not sure
[16:36:39] <till> johannes_: i have to install libsqlite3-dev anyway when i build it
[16:36:48] <till> it seems like it's not only debian and ubuntu, but also centos
[16:47:38] <johannes_> till: I'm full in support of kicking out everything which has not to be a part of the core distribution ...
[16:48:23] <johannes_> 5 or 6 extensions (without really counting, maybe it are 10 in the end) is enough
[16:48:51] <philip_> put them all in pecl, bundle at release
[16
@Tyrael
Tyrael / notes.txt
Created November 17, 2011 00:57
how to build the hungarian php manual
php doc-base/configure.php --with-lang=hu --disable-segfault-error --enable-force-dom-save
phd --docbook ./doc-base/.manual.xml --package PHP --format xhtml --output mydocs
@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);}'
@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 / 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 / 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 / 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