This Gist provides a small wrapper script to run PHP inside Docker from WSL, without installing PHP locally.
- WSL installed
- Docker Desktop installed and enabled for your WSL distro
- Bash
| <?php | |
| namespace Vendor\Project\EventListeners; | |
| use TYPO3\CMS\Backend\Search\Event\ModifyResultItemInLiveSearchEvent; | |
| use TYPO3\CMS\Backend\Search\LiveSearch\ResultItemAction; | |
| use TYPO3\CMS\Core\Attribute\AsEventListener; | |
| #[AsEventListener(identifier: 'ext-project/edit-record-as-default-in-live-search-event-listener')] | |
| class EditRecordAsDefaultActionInLiveSearchEventListener |
| <?php | |
| /** | |
| * Converts given array to TypoScript | |
| * | |
| * @param array $typoScriptArray The array to convert to string | |
| * @param string $addKey Prefix given values with given key (eg. lib.whatever = {...}) | |
| * @param integer $tab Internal | |
| * @param boolean $init Internal | |
| * @return string TypoScript |
| <?php declare(strict_types=1); | |
| namespace Armin\Vieweg\ViewHelpers; | |
| use TYPO3\CMS\Core\Core\Environment; | |
| use TYPO3\CMS\Core\Utility\GeneralUtility; | |
| use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; | |
| use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; | |
| /** | |
| * Font Awesome SVG ViewHelper |
| global { | |
| languageLabels { | |
| current = Deutsch | |
| availableSysLanguageUids = 0,1 | |
| additionalParams = &L=0 || &L=1 | |
| availableLabels = Deutsch || English | |
| } | |
| } |
| <?php | |
| // Adjust database credentials in lines 37-40 | |
| // And just run on CLI | |
| // On very fast devices the amount of time for each test, should be less than 1 second | |
| $start = microtime(true); | |
| for ($i = 0; $i < 100000000; $i++) { | |
| sqrt($i); |
| #!/usr/bin/env php | |
| <?php | |
| use App\Entity\User; | |
| use App\Kernel; | |
| use Doctrine\Bundle\DoctrineBundle\Registry; | |
| if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) { | |
| throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".'); | |
| } |
| header { | |
| width:100%; | |
| position:relative; | |
| top:0; | |
| left:0; | |
| background-color:#006ec0; | |
| color:white; | |
| font-size:50px; | |
| text-align:center; | |
| font-family:Arial; |
| <?php | |
| use TYPO3\CMS\Core\Utility\GeneralUtility; | |
| use TYPO3\CMS\Core\Utility\StringUtility; | |
| use TYPO3\CMS\Extbase\Object\ObjectManager; | |
| trait CreateInstanceTrait | |
| { | |
| /** @return parent */ | |
| public static function createInstance() |
$ ddev start
$ ddev composer install
$ ddev composer run typo3
adminpassword (same for install tool)