PHP code example of ichhabrecht / filefill

1. Go to this page and download the library: Download ichhabrecht/filefill library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ichhabrecht / filefill example snippets


$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['filefill']['storages'][1] = [
    [
        'identifier' => 'domain',
        'configuration' => 'https://example.com',
    ],
    [
        'identifier' => 'domain',
        'configuration' => 'https://another-example.com',
    ],
    [
        'identifier' => 'sys_domain',
    ],
    [
        'identifier' => 'placeholder',
    ],
    [
        'identifier' => 'imagebuilder',
        'configuration' => [
            'backgroundColor' => '#FFFFFF',
            'textColor' => '#000000',
        ],
    ],
    [
        'identifier' => 'static',
        'configuration' => [
            'path/to/example/file.txt' => 'Hello world!',
            'another' => [
                'path' => [
                    'to' => [
                        'anotherFile.txt' => 'Lorem ipsum',
                        '*.youtube' => 'yiJjpKzCVE4',
                    ],
                    '*' => 'This file was found in /another/path folder.',
                ],
            ],
            '*.vimeo' => '143018597',
            '*' => 'This is some static text for all other files.',
        ],
    ],
];

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['filefill']['resourceHandler']['identifierName'] = [
    'title' => 'Name of the resource',
    'handler' => \Vendor\Extension\Resource\ResourceHandler::class,
    'config' => [
        'label' => 'Name of the resource',
        'config' => [
            'type' => 'check',
            'default' => 1,
        ],
    ],
];

namespace Vendor\Extension\Resource;
class ResourceHandler implements \IchHabRecht\Filefill\Resource\RemoteResourceInterface
{
    public function hasFile($fileIdentifier, $filePath, FileInterface $fileObject = null)
    {
        return true;
    }

    public function getFile($fileIdentifier, $filePath, FileInterface $fileObject = null)
    {
        return 'file content';
    }
}

$GLOBALS['TYPO3_CONF_VARS']['LOG']['IchHabRecht']['Filefill'] = [
    'writerConfiguration' => [
        \TYPO3\CMS\Core\Log\LogLevel::DEBUG => [
            \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [
                'logFileInfix' => 'filefill',
            ],
        ],
    ],
];