Skip to content

Instantly share code, notes, and snippets.

View kdambekalns's full-sized avatar

Karsten Dambekalns kdambekalns

View GitHub Profile
<?php
namespace TYPO3\Fluid\ViewHelpers\Format;
/* *
* This script belongs to the TYPO3 Flow package "Fluid". *
* *
* 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 / gist:5239005
Created March 25, 2013 17:41
Example for a possible syntax of validation rules in YAML files
validation:
-
type: 'NotEmpty'
-
type: 'RegularExpression'
options:
regularExpression: '(0?[1-9]|[12][0-9]|3[01])'
@kdambekalns
kdambekalns / gist:5111134
Created March 7, 2013 19:43
SQL to update the table used for storing Role instances (with https://review.typo3.org/13868) - this is needed when switching to patch set 23 or higher.
ALTER TABLE typo3_flow_security_policy_role ADD new_sourcehint VARCHAR(6) NOT NULL;
UPDATE typo3_flow_security_policy_role SET new_sourcehint='system' where sourcehint=0;
UPDATE typo3_flow_security_policy_role SET new_sourcehint='policy' where sourcehint=1;
UPDATE typo3_flow_security_policy_role SET new_sourcehint='user' where sourcehint=2;
ALTER TABLE typo3_flow_security_policy_role DROP sourcehint;
ALTER TABLE typo3_flow_security_policy_role CHANGE new_sourcehint sourcehint VARCHAR(6) NOT NULL;
@kdambekalns
kdambekalns / FrontendUser.php
Created February 14, 2013 10:07
Example for mapping the TYPO3 CMS fe_users table to a TYPO3 Flow domain model
<?php
namespace Acme\Demo\Domain\Model;
/* *
* This script belongs to the TYPO3 Flow package "Acme.Demo". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
use Doctrine\ORM\Mapping as ORM;
@kdambekalns
kdambekalns / DefaultViewHelper.php
Created February 14, 2013 08:48
A Fluid ViewHelper to fall back to a default value in case a variable is empty.
<?php
namespace Api\Core\ViewHelpers;
/* *
* This script belongs to the TYPO3 Flow package "Api.Core". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
@kdambekalns
kdambekalns / composer.json
Created September 25, 2012 18:57 — forked from christianjul/composer.json
FLOW3 Barebone manifest
{
"name": "christianjul/barebone-flow3",
"description" : "Barebone FLOW3 project",
"license": "LGPL-3.0+",
"authors": [
{
"name": "Christian Jul Jensen",
"email": "julle@typo3.org"
}
],
@kdambekalns
kdambekalns / DoctrineCommandController.php.patch
Created August 29, 2012 09:09
Add --dump-mapping-data to doctrine:entitystatus
diff --git a/Classes/Command/DoctrineCommandController.php b/Classes/Command/DoctrineCommandController.php
index 9ce9c72..7b2e599 100644
--- a/Classes/Command/DoctrineCommandController.php
+++ b/Classes/Command/DoctrineCommandController.php
@@ -132,13 +132,15 @@ class DoctrineCommandController extends \TYPO3\FLOW3\MVC\Controller\CommandContr
* Show the current status of entities and mappings
*
* Shows basic information about which entities exist and possibly if their
- * mapping information contains errors or not. To run a full validation, use
- * the validate command.
@kdambekalns
kdambekalns / substr.php
Created July 12, 2012 15:35
Comparison of substr and substr_compare
<?php
$className = 'FLOW3_Foo_Bar_Original';
for ($i = 0 ; $i < 1000000; $i++) {
substr($className, -9) === '_Original';
}
class AddGroupsSignedCla < ActiveRecord::Migration
def self.up
add_column :groups, :signed_cla, :boolean
end
def self.down
remove_column :groups, :signed_cla
end
end
@kdambekalns
kdambekalns / 0001-TASK-Apply-migration-TYPO3.FLOW3-201201261636.patch
Created May 3, 2012 14:16
Updating TYPO3.Blog to work with FLOW3 1.1
From cf0a2c479c8da4cc039215299dfe6fdf2a68432a Mon Sep 17 00:00:00 2001
From: Karsten Dambekalns <karsten@typo3.org>
Date: Thu, 3 May 2012 16:07:42 +0200
Subject: [PATCH 1/3] [TASK] Apply migration TYPO3.FLOW3-201201261636
This commit contains the result of applying migration
TYPO3.FLOW3-201201261636.
to this package.
Change-Id: I6db86b7c776208907079a43218991619fe9d097b