View CropVariantUtility.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace Derhansen\Typo3Dev\Utility; | |
use TYPO3\CMS\Core\Imaging\ImageManipulation\Area; | |
use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection; | |
use TYPO3\CMS\Core\Imaging\ImageManipulation\InvalidConfigurationException; | |
use TYPO3\CMS\Core\Resource\File; |
View phpinfo.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
phpinfo(); |
View SwitchableControllerActionsPluginUpdater.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
/* | |
* This file is part of the Extension "plain_faq" for TYPO3 CMS. | |
* | |
* For the full copyright and license information, please read the | |
* LICENSE.txt file that was distributed with this source code. | |
*/ |
View gist:c56ff4df72d6b83121bea99bd83271cd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function downloadAction() | |
{ | |
$storage = $this->resourceFactory->getDefaultStorage(); | |
$file = $storage->getFile('test.jpg'); | |
$response = $storage->streamFile($file, true, 'test-filename.jpg'); | |
$this->sendResponse($response); | |
exit(); | |
} | |
protected function sendResponse($response) |
View InlineReadOnly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Vendor\Extension\Backend\Form\FormDataProvider; | |
use TYPO3\CMS\Backend\Form\FormDataProviderInterface; | |
/** | |
* Disables all IRRE Controls and sets fields of IRRE records to readonly | |
* | |
* Note: Depending on the TYPO3 backend user permissions, a user may still be able to edit record content | |
* (e.g. if table is available in record list and user has sufficient rights to edit data). But for inline integration, |
View gist:1eee357e472be595692bf655a28a1557
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Vendor\Namespace\Utility; | |
use TYPO3\CMS\Extbase\Utility\LocalizationUtility as LocalizationUtilityExtbase; | |
/** | |
* Class LocalizationUtility | |
*/ | |
class LocalizationUtility extends LocalizationUtilityExtbase | |
{ |
View gist:735520628bc2a2e103d9d0dfa8ca3723
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am derhansen on github. | |
* I am derhansen (https://keybase.io/derhansen) on keybase. | |
* I have a public key ASC1s3gh8BEHLu7mPaudKjFkQNCPbDlV4u0ty5tpMyf9lwo | |
To claim this, I am signing this object: |
View rootpage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function getRootPage($uid) | |
{ | |
/** @var PageRepository $pageRepository */ | |
$pageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(PageRepository::class); | |
$rootLinePages = $pageRepository->getRootLine($uid); | |
$rootPage = null; | |
foreach ($rootLinePages as $page) { | |
if ($page['is_siteroot'] === '1') { | |
$rootPage = $page; | |
break; |
View ExtbaseMySQLOrderFunction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The use statements for the fileheader | |
use MyVendor\MyExtension\Domain\Model\Mymodel; | |
use TYPO3\CMS\Core\Database\ConnectionPool; | |
use TYPO3\CMS\Core\Database\Query\QueryBuilder; | |
use TYPO3\CMS\Core\Utility\GeneralUtility; | |
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper; | |
/** | |
* Returns all matching records for the given list of uids and applies the uidList sorting for the result | |
* |
View setup.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin.tx_myext_myplugin { | |
persistence { | |
storagePid = {$plugin.tx_myext_myplugin.persistence.storagePid} | |
} | |
} |
NewerOlder