Skip to content

Instantly share code, notes, and snippets.

View kdambekalns's full-sized avatar

Karsten Dambekalns kdambekalns

View GitHub Profile
@kdambekalns
kdambekalns / README.rst
Created February 12, 2014 11:51
Fetch changes from Gerrit automatically (from review.typo3.org)

How to use

This script reads changes from the file gerrit.json. The description is just for the humans working with the file, the important bits are the project name and the numeric change id. If the change id is amended with a command and number that means "fetch that specific patch set" instread of the latest one.

If you have gerrit.json ready just run php gerrit_update.php and watch the magic. :)

@kdambekalns
kdambekalns / README.md
Last active August 29, 2015 14:20
Using injected properties of Flow functional test in @dataProvider

PHPUnit collects the data from a dataProvider early during test execution, so the PersistenceManager instance is NULL, if used directly in the provider. Returning a closure that is re-bound during the the test makes this work.

@kdambekalns
kdambekalns / gist:186f2c5237ab1bfd7c8e
Last active August 29, 2015 14:22
Solving issues with Neos 1.x or Flow 2.x and doctrine/migrations

Flow has always used doctrine/migrations as dev-master. Now a 1.0 release of the migrations package is approaching and some breaking changes spoil the fun. See these issues for some details:

The typo3/flow package has been updated and new 2.x releases have been tagged. But you need to make sure your root manifest (composer.json) is requiring the correct version of doctrine/migrations as well. It should be pinned to the last version that is known not to conflict with the other dependencies of Flow.

Below is what you must require instead of anything else (like @dev or dev-master).

@kdambekalns
kdambekalns / composer.json
Created August 19, 2015 15:02
Minimum composer.json for a Neos 2.0.* project
{
"name": "amce/site-distribution",
"description" : "Acme Neos Distribution",
"license": "proprietary",
"config": {
"vendor-dir": "Packages/Libraries",
"bin-dir": "bin"
},
"require": {
"typo3/neos": "^2.0.0",
@kdambekalns
kdambekalns / TwitterBackend.php
Created May 21, 2010 21:43
A (useless) twitter logging backend for FLOW3
<?php
declare(ENCODING = 'utf-8');
namespace F3\FLOW3\Log\Backend;
/* *
* This script belongs to the FLOW3 framework. *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License, or (at your *
@kdambekalns
kdambekalns / siege -c 5 -t 1m welcome
Created December 22, 2010 10:00
compares prodcution context a13 vs a14
* PHP 5.3.3, APC 3.1.5-dev, igbinary 1.0.2
* All data shown is from the second run.
* Apache has been restarted for each sequence
* Caches were cleared and primed for each sequence
sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart
sudo rm -rf Data/Temporary/*
curl http://flow3.kmac/flow3/welcome
siege -c 5 -t 1m http://flow3.kmac/flow3/welcome > /dev/null
siege -c 5 -t 1m http://flow3.kmac/flow3/welcome
@kdambekalns
kdambekalns / README.md
Last active September 24, 2015 15:12
How to update an existing PR to the new PSR-2 standard
@kdambekalns
kdambekalns / AnnotatedClass
Created October 3, 2011 10:35
Annotations "the Doctrine way"
<?php
namespace TYPO3\FLOW3\Tests\Functional\Reflection\Fixtures;
/* *
* This script belongs to the FLOW3 framework. *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
@kdambekalns
kdambekalns / README.rst
Created October 12, 2011 12:21
Converting Doctrine annotations back to strings

When creating proxy classes, we do not copy the docblock, but generate one, using the parsed annotations of the original class. Thus we need to render them out to string form. This is what we currently use for that purpose...

@kdambekalns
kdambekalns / WTF.txt
Created October 17, 2011 08:39
Correct(?) test for PHP bug #55156 (ReflectionClass->getDocComment() returns something though it shouldn't)
karsten@kmac:apc $ php -v
PHP 5.3.8 (cli) (built: Oct 15 2011 19:48:39)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.2.0-dev, Copyright (c) 2002-2011, by Derick Rethans
karsten@kmac:apc $ php ~/phpt55156.php
string(11) "/** test */"
string(12) "/** test1 */"
string(12) "/** test2 */"
bool(false)