Skip to content

Instantly share code, notes, and snippets.

View jp1987's full-sized avatar
🎯
Focusing

Jesper Paardekooper jp1987

🎯
Focusing
View GitHub Profile
@jp1987
jp1987 / handlers.yml
Created January 11, 2017 13:43
TYPO3 solr ansible playbook
---
- name: restart-solr
service:
name: solr
state: restarted
become: yes
@jp1987
jp1987 / gist:cb57994d117bde1018ca
Created June 15, 2015 09:04
Update single file in TYPO3 FAL
<?php
$storageUid = 0;
$storage = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getStorageObject($storageUid);
$storage->setEvaluatePermissions(FALSE);
/** @var \TYPO3\CMS\Core\Resource\Index\Indexer $indexer */
$indexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Index\\Indexer', $storage);
$file = $storage->getFile('/uploads/tx_extension/images/image.jpg');
<?php
/** @var $extbaseObjectManager \TYPO3\CMS\Extbase\Object\ObjectManager */
$extbaseObjectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
/** @var $newsRepository \Tx_News_Domain_Repository_NewsRepository */
$newsRepository = $extbaseObjectManager->get('Tx_News_Domain_Repository_NewsRepository');
/** @var $newsRecord \Tx_News_Domain_Model_News */
$newsRecord = $newsRepository->findByUid($newsParams['news']);
Uncaught exception #1233058294 in line 54 of /var/www/vhosts/app.development/httpdocs/Data/Temporary/Development/SubContextBehat/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Cache_Frontend_CacheEntryIterator.php: ".6l7HXX7MRdJFuJLAeH0cZMTShW962HOf.1398770834.6916-8690.tmp" is not a valid cache entry identifier.
15 TYPO3\Flow\Cache\Frontend\VariableFrontend::get(".6l7HXX7MRdJFuJLAeH0cZMTShW962HOf.1398770834.6916-8690.tmp")
14 TYPO3\Flow\Cache\Frontend\CacheEntryIterator_Original::current()
13 TYPO3\Flow\Session\Session_Original::collectGarbage()
12 TYPO3\Flow\Session\Session::collectGarbage()
11 call_user_func_array(array|2|, array|0|)
10 TYPO3\Flow\Session\Session::Flow_Aop_Proxy_invokeJoinPoint(TYPO3\Flow\Aop\JoinPoint)
9 TYPO3\Flow\Session\Session::collectGarbage()
8 TYPO3\Flow\Session\Session_Original::shutdownObject()
protected function buildUnifiedArguments(array $getArguments, array $postArguments, array $uploadArguments) {
$arguments = $getArguments;
$contentArguments = NULL;
if ($this->method === 'POST') {
$contentArguments = ($postArguments !== array()) ? $postArguments : $this->decodeBodyArguments($this->getContent(), $this->headers->get('Content-Type'));
} elseif ($this->method === 'PUT') {
$contentArguments = $this->decodeBodyArguments($this->getContent(), $this->headers->get('Content-Type'));
}
{
"name": "typo3/flow-base-distribution",
"description" : "TYPO3 Flow Base Distribution",
"license": "LGPL-3.0+",
"config": {
"vendor-dir": "Packages/Libraries",
"bin-dir": "bin"
},
"require": {
"typo3/flow": "2.0.*",
/**
* @ORM\PreUpdate
* @return void
*/
public function preUpdate() {
$this->setChangedDate(new \DateTime());
}
/**
* @ORM\PrePersist
Uncaught Exception
Found an invalid element type declaration in class
"My\App\Domain\Model\Company\Branch" for property "children".
Type
"Doctrine\Common\Collections\ArrayCollection" must not have an element
type hint (My\App\Domain\Model\Company\Branch).
{
"name": "typo3/flow-base-distribution",
"description" : "TYPO3 Flow Base Distribution",
"license": "LGPL-3.0+",
"config": {
"vendor-dir": "Packages/Libraries",
"bin-dir": "bin"
},
"require": {
"typo3/flow": "2.0.*",
<?php
namespace My\App\Validation\Validator;
use TYPO3\Flow\Annotations as Flow;
/**
* Checks if the specified password matches the current user's password
*
* @Flow\Scope("singleton")
*/