Skip to content

Instantly share code, notes, and snippets.

@gander
Last active February 2, 2024 12:41
Show Gist options
  • Save gander/281c0a1c6ba18651db5575d7a47916da to your computer and use it in GitHub Desktop.
Save gander/281c0a1c6ba18651db5575d7a47916da to your computer and use it in GitHub Desktop.

Tinkerwell Driver for Pimcore

Put file PimcoreTinkerwellDriver.php in .tinkerwell directory

TinkerwellDriver

services:
php:
user: 'dev:dev'
build:
dockerfile: .tinkerwell/Dockerfile
FROM pimcore/pimcore:php8.2-debug-latest
RUN adduser --disabled-password --gecos '' --uid 1000 dev
<?php
class PimcoreTinkerwellDriver extends TinkerwellDriver
{
public function canBootstrap($projectPath): bool
{
return true;
}
public function bootstrap($projectPath): void
{
require_once $projectPath . '/vendor/autoload.php';
\Pimcore\Bootstrap::setProjectRoot();
\Pimcore\Bootstrap::bootstrap();
\Pimcore\Bootstrap::kernel();
}
public function appVersion(): string
{
return 'Pimcore ' . \Composer\InstalledVersions::getPrettyVersion('pimcore/pimcore');
}
public function getAvailableVariables(): array
{
return [
'kernel' => \Pimcore::getKernel(),
'container' => \Pimcore::getKernel()?->getContainer(),
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment