Skip to content

Instantly share code, notes, and snippets.

View patrickallaert's full-sized avatar

Patrick Allaert patrickallaert

View GitHub Profile
@patrickallaert
patrickallaert / array-to-string-notice-tests.patch.txt
Created June 2, 2011 10:07
Notice on array to string conversion (tests)
diff --git a/Zend/tests/cast_to_string.phpt b/Zend/tests/cast_to_string.phpt
index d06daa2..76576de 100644
Binary files a/Zend/tests/cast_to_string.phpt and b/Zend/tests/cast_to_string.phpt differ
diff --git a/Zend/tests/concat_001.phpt b/Zend/tests/concat_001.phpt
index be12976..1773add 100644
--- a/Zend/tests/concat_001.phpt
+++ b/Zend/tests/concat_001.phpt
@@ -50,26 +50,46 @@ var_dump($d.$d);
echo "Done\n";
?>
@patrickallaert
patrickallaert / array_notice.patch
Created June 20, 2011 18:01
Notice on array to string conversion (combined)
commit 6ab2b746cc6b2d2f51c096e5ae672c051abd6230
Author: Patrick Allaert <pa@ez.no>
Date: Fri Jun 17 22:18:21 2011 +0200
Changed silent conversion of array to string to produce a notice.
diff --git a/NEWS b/NEWS
index 284dd85..507fc03 100644
--- a/NEWS
+++ b/NEWS
@patrickallaert
patrickallaert / function_definition.php
Created April 5, 2012 19:03
function_definition.php with alignment
<?php
/**
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
*/
$FunctionList = array();
$FunctionList['locale_list'] = array( 'name' => 'locale_list',
'operationTypes' => array( 'read' ),
@patrickallaert
patrickallaert / function_definition.php
Created April 5, 2012 19:03
function_definition.php without alignment
<?php
/**
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
*/
$FunctionList = array();
$FunctionList['locale_list'] = array(
'name' => 'locale_list',
@patrickallaert
patrickallaert / function_definition.php.diff
Created April 5, 2012 19:13
Diff on function_definition.php with alignment
diff --git function_definition.php function_definition.php
index 6e3fc12..cf96158 100644
--- function_definition.php
+++ function_definition.php
@@ -6,58 +6,58 @@
$FunctionList = array();
-$FunctionList['locale_list'] = array( 'name' => 'locale_list',
- 'operation_types' => array( 'read' ),
@patrickallaert
patrickallaert / function_definition.php.diff
Created April 5, 2012 19:15
Diff on function_definition.php without alignment
diff --git function_definition.php function_definition.php
index a19b12a..ae42490 100644
--- function_definition.php
+++ function_definition.php
@@ -8,12 +8,12 @@ $FunctionList = array();
$FunctionList['locale_list'] = array(
'name' => 'locale_list',
- 'operation_types' => array( 'read' ),
- 'call_method' => array(
@patrickallaert
patrickallaert / compareEnvironments.sh
Last active December 2, 2015 13:55
Utility to compare eZ Publish Content Types from multiple environments (e.g. dev / staging / production). -- https://twitter.com/patrick_allaert
vim -d \
<(echo 'CALL display_classes();' | mysql -h devHost database --skip_column_names) \
<(echo 'CALL display_classes();' | mysql -h stagingHost database --skip_column_names) \
<(echo 'CALL display_classes();' | mysql -h productionHost database --skip_column_names)
@patrickallaert
patrickallaert / Results.txt
Last active December 14, 2015 02:39
Comparing CPU time and memory usage between classes and arrays.
PHP 5.4:
========
$ php54 bench1.php
0.36937880516052
292432712
$ php54 bench2.php
0.47057294845581
193929016
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/" xmlns:image="http://ez.no/namespaces/ezpublish3/image/" exclude-result-prefixes="xhtml custom image">
<xsl:import href="eZXml2Html5_core.xsl" />
<xsl:import href="eZXml2Html5_custom.xsl" />
<xsl:output method="html" indent="yes" encoding="UTF-8" />
<!-- begin: very custom tags -->
<!-- support the <youtube> custom tag -->
<xsl:template match="custom[@name='youtube']">
$ php test.php
Array
(
[a] => 1
[b] => 1
)
Array
(
[a] => 1
[b] => 1