Skip to content

Instantly share code, notes, and snippets.

/**
* Upload files.
*
* @return void
*/
public function uploadAction() {
$overwriteExistingFiles = TRUE;
$data = array();
$namespace = key($_FILES);
<?php
namespace Tx\Myutils\Utility;
/* *
* This script belongs to the TYPO3 Extension "myutils". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU General Public License, either version 3 of the *
* License, or (at your option) any later version. *
* *
@astehlik
astehlik / page.ts
Created February 6, 2015 09:23
TYPO3 TypoScript snippet for testing JumpURL
config.jumpurl_enable = 1
page = PAGE
page {
// Old configuration
10 = TEXT
10.value = fileadmin/myfile.txt
10.noTrimWrap = |<p>filelink: |</p>|
10.filelink {
@astehlik
astehlik / gist:ab9fdc00b17c964ec5d1
Created July 4, 2015 14:27
ReadOnlyDirectoryStorage example configuration
TYPO3:
Flow:
resource:
storages:
libraryStorage:
storage: 'De\SWebhosting\Bootstrap\Resource\ReadOnlyDirectoryStorage'
storageOptions:
paths:
bootstrap: '%FLOW_PATH_ROOT%Packages/Libraries/twbs/bootstrap'
@astehlik
astehlik / gist:3986cbae9d2a87055981
Created July 27, 2015 13:20
Regex for replacing unterscored class names with namespaces
# Moves Tx_Mynamespace_Subname_Classname classes to the Tx\Mynamespace\Subname namespace.
<\?php([\s\S]*class) Tx_Mynamespace_(.+?)_
<?php\nnamespace Tx\\\\Mynamespace\\\\$2;$1
# Moves Tx_Mynamespace_Classname classes to the Tx\Mynamespace namespace.
<\?php([\s\S]*class) Tx_Mynamespace_(.+?)
<?php\nnamespace Tx\\\\Mynamespace;$1 $2
@astehlik
astehlik / typo3_systemcheck.sh
Created January 15, 2016 17:30
Cronjob for checking TYPO3 Scheduler task disabled state and database triggers
#!/bin/bash
mysql_user="xxx"
mysql_pass="xxx"
mysql_db="xxx"
mysql="mysql --skip-column-names -u $mysql_user -p$mysql_pass -D $mysql_db"
messages=""
# Appends an error message to the output
@astehlik
astehlik / typo3-git-subsplit-research.md
Last active January 30, 2016 18:47
TYPO3 git-subsplit research
diff --git a/src/main/resources/META-INF/resources/jsp/application/app_form.jsp b/src/main/resources/META-INF/resources/jsp/application/app_form.jsp
index ba2fbff..d5730f7 100644
--- a/src/main/resources/META-INF/resources/jsp/application/app_form.jsp
+++ b/src/main/resources/META-INF/resources/jsp/application/app_form.jsp
@@ -14,6 +14,41 @@
<head>
<uv:head/>
+
+ <script type="text/javascript">
@astehlik
astehlik / UrlDisplayFormElement.php
Created April 8, 2016 09:37
Custom TYPO3 form field
<?php
namespace Tx\Tinyurls\Hooks;
class UrlDisplayFormElement extends \TYPO3\CMS\Backend\Form\AbstractNode implements \TYPO3\CMS\Backend\Form\NodeInterface
{
/**
* Main render method
*
before_script:
- curl -sS https://getcomposer.org/installer | php
- if [ "$GITHUB_COMPOSER_AUTH" ]; then php composer.phar config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH; fi
test:phpcs:
script:
- php composer.phar require typo3/cms="^7.6.0"
- .Build/bin/phpcs --config-set installed_paths Tests/CodeSniffer
- .Build/bin/phpcs --standard=PSRDefault Classes Tests/Unit ext_localconf.php ext_tables.php