Skip to content

Instantly share code, notes, and snippets.

View realityking's full-sized avatar

Rouven Weßling realityking

View GitHub Profile
@realityking
realityking / gist:9315991
Last active August 29, 2015 13:56
en/appendices/migrations56.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 332728 $ -->
<!--
Based on UPGRADING from PHP-5.6 circa alpha 1. Work in progress!
As we're still in alpha at the moment, I've only included relatively minimal
information here, and haven't updated the rest of the manual for 5.6 features
yet. Once we're well into betas/RCs and features are frozen, the information
in this appendix should be expanded and the new functionality integrated into
the rest of the manual.
/* {{{ proto void register_shutdown_function(callback function) U
Register a user-level function to be called on request termination */
PHP_FUNCTION(register_shutdown_function)
{
php_shutdown_function_entry shutdown_function_entry;
int i;
zval ***args = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &shutdown_function_entry.arg_count) == FAILURE) {
<?php
$utf8_s = 'Iñtërnâtiônàlizætiøn';
$ascii_s = 'Internationalisation';
$utf8_m = 'Geocaching, auch GPS-Schnitzeljagd genannt, ist eine Art elektronische Schatzsuche oder Schnitzeljagd. Die Verstecke („Geocaches“, kurz „Caches“) werden anhand geografischer Koordinaten im World Wide Web veröffentlicht und können anschließend mit Hilfe eines GPS-Empfängers gesucht werden. Mit genauen Landkarten ist auch die Suche ohne GPS-Empfänger möglich. Ein Geocache ist in der Regel ein wasserdichter Behälter, in dem sich ein Logbuch sowie verschiedene kleine Tauschgegenstände befinden. Jeder Besucher trägt sich in das Logbuch ein, um seine erfolgreiche Suche zu dokumentieren. Anschließend wird der Geocache wieder an der Stelle versteckt, an der er zuvor gefunden wurde. Der Fund wird im Internet auf der zugehörigen Seite vermerkt und gegebenenfalls durch Fotos ergänzt. So können auch andere Personen – insbesondere der Verstecker oder „Owner“ – die Geschehnisse rund um den Geocache verfolgen. Weltweit existieren über 2
Accept the following values:
-Any callable, i.e. 'my_callback_function'
-A string containing either
-just the class (is ControllerInterface is implemented) - behaves like it does right now
-or in the Syntax Class:Method - will create an instance of class and call method

The decoupled Symfony components have been a great help but there are a few things in FrameworkBundle that could be moved to the components with some small refactoring making them more useable for people like me who have to use the components without the full framework.

There's a pretty good chance I'm overlooking something with some of these and there are certainly backwards compatibility concerns to be adressed.

Let's dig in:

Router and RouterCacheWarmer

The warmUp() method from the Router class could be dropped (also the WarmableInterface), the code would move RouterCacheWarmer. With this change RouterCacheWarmer only depends on HttpKernel and Routing and could go into either of these components. (My favorite would be Routing)

@realityking
realityking / gist:3571325
Created September 1, 2012 12:06
PHP fix for no admin template
$template = $db->loadObject();
if ($template !== null)
{
$template->template = JFilterInput::getInstance()->clean($template->template, 'cmd');
$template->params = new JRegistry($template->params);
}
else
{
$template = new stdClass;
@realityking
realityking / gist:3490578
Created August 27, 2012 17:25
Fast ZIP extraction for Joomla
$zip = new ZipArchive;
$return = $zip->open($archive);
if ($return === true)
{
// Make sure the destination folder exists
if (!JFolder::create($destination))
{
if (class_exists('JError'))
{
return JError::raiseWarning(100, 'Unable to create destination');
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="1.3.4">
<file name="/Users/rouven/Sites/joomla-cms/administrator/components/com_admin/views/profile/tmpl/edit.php">
<error line="36" column="1" severity="error" message="Tabs must be used to indent lines; spaces are not allowed" source="Joomla.WhiteSpace.DisallowSpaceIndent.SpaceUsed"/>
<error line="37" column="1" severity="error" message="Tabs must be used to indent lines; spaces are not allowed" source="Joomla.WhiteSpace.DisallowSpaceIndent.SpaceUsed"/>
<error line="38" column="1" severity="error" message="Tabs must be used to indent lines; spaces are not allowed" source="Joomla.WhiteSpace.DisallowSpaceIndent.SpaceUsed"/>
<error line="39" column="1" severity="error" message="Tabs must be used to indent lines; spaces are not allowed" source="Joomla.WhiteSpace.DisallowSpaceIndent.SpaceUsed"/>
<error line="40" column="1" severity="error" message="Tabs must be used to indent lines; spaces are not allowed" source="Joomla.WhiteSpace.DisallowSp
@realityking
realityking / JHtmlBatchTest.php
Created July 2, 2012 12:58
Unit tests to be moved to the CMS
<?php
/**
* @package Joomla.UnitTest
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
require_once JPATH_PLATFORM . '/legacy/html/batch.php';
@realityking
realityking / gist:3025255
Created June 30, 2012 19:48
Things in Joomla 2.5 that should go
-JGithub API
-plg_authentican_gmail
-plg_content_geshi
-plg_user_profile
-com_banners
-com_newsfeeds
-com_weblinks
-mod_version (inline into the templates again)
-mod_stats
-mod_feed (both)