Skip to content

Instantly share code, notes, and snippets.

View albe's full-sized avatar
:octocat:

Alexander Berl albe

:octocat:
View GitHub Profile
@albe
albe / LocalizationService.php
Last active July 25, 2017 14:06
A LocalizationService Utility class for Neos Flow 4.x that fetches localization data from the CLDR
<?php
namespace Acme\Foo\Service;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\I18n\Cldr\CldrModel;
/**
* A service for localization purposes
*
* @Flow\Scope("singleton")
/* @var $collectionElement CollectionElementType */
foreach ($this->getCollectionPropert() as $collectionElement) {
... // Have proper $collectionElement type hinting in IDE
}
17:31:00: compiletime: Check if site locked.
17:31:00: compiletime: Site not locked.
17:31:00: compiletime: Try to lock site.
17:31:00: locked site.
17:31:00: compiletime: Locked site.
17:31:09: compile command started.
17:31:12: compile command finished.
17:31:19: released flock.
17:31:19: unlocked site.
$lockfile = fopen('lock', 'w+');
if (flock($lockfile, LOCK_EX | LOCK_NB)) {
unlink('lock');
echo 'locked...';
sleep(10);
flock($lockfile, LOCK_UN);
} else {
echo 'already locked...';
}
/**
* Unlocks the site if this request has locked it.
*
* @return void
* @api
*/
public function unlockSite() {
if (is_resource($this->lockResource)) {
flock($this->lockResource, LOCK_UN);
/**
* Delete a forum post
*
* @param \Examples\Forum\Domain\Model\Post $post
* @logged
* @return void
*/
public function deletePost(Post $post) {
$this->posts->remove($post);
}
[!!!][BUGFIX] Make bidirectional OneToOne relations work correctly
This change fixes bidirectional OneToOne relations, which previously
resulted in foreign keys being created on both sides. Therefore the
related entities could no longer be deleted.
The problem was that the joinColum mapping was created in every case,
which doctrine interprets as a secondary hint for the owning side.
The joinColumn should only be created for the owning side, i.e. only
for unidirectional OneToOne and for the inversedBy side of a
<?php
namespace TYPO3\Flow\Persistence\Doctrine\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your need!
*/
class Version20150407145620 extends AbstractMigration {
<f:for each="{results}" as="result">
<f:cycle values="{0: 'odd', 1: 'even'}" as="zebraClass">
<tr class="content_row result">
<tmr:table.column each="{columns}" as="column" value="val" iteration="it" result="{result}" partialPath="Results/Column/">
<td valign="middle" class="{zebraClass} {column.className}{f:if(condition:it.isFirst,then:' first')}">
15-03-20 18:28:57 CRITICAL Flow Uncaught exception #1416244515 in line 35 of C:\Users\Alex\workspace\TYPO3.Flow\Data\Temporary\Testing\Cache\Code\Flow_Object_Classes\TYPO3_Flow_Resource_Target_FileSystemSymlinkTarget.php: Could not publish "C:/Users/Alex/workspace/TYPO3.Flow/Packages/Framework/TYPO3.Fluid/Resources/Public" into resource publishing target "localWebDirectoryStaticResourcesTarget" because the source directory could not be symlinked at target location. - See also: 201503201828568d6805.txt
previousException => Uncaught exception #1: Warning: rename(C:/Users/Alex/workspace/TYPO3.Flow/Web/_Resources/Testing/Static/Packages/TYPO3.Fluid.550c58d9c3686.tmp,C:/Users/Alex/workspace/TYPO3.Flow/Web/_Resources/Testing/Static/Packages/TYPO3.Fluid): Zugriff verweigert (code: 5) in C:\Users\Alex\workspace\TYPO3.Flow\Data\Temporary\Testing\Cache\Code\Flow_Object_Classes\TYPO3_Flow_Resource_Target_FileSystemSymlinkTarget.php line 103