File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 55use TweakPHP \Client \Loaders \ComposerLoader ;
66use TweakPHP \Client \Loaders \LaravelLoader ;
77use TweakPHP \Client \Loaders \LoaderInterface ;
8+ use TweakPHP \Client \Loaders \PimcoreLoader ;
89use TweakPHP \Client \Loaders \SymfonyLoader ;
910use TweakPHP \Client \Loaders \WordPressLoader ;
1011
@@ -28,10 +29,14 @@ public static function load(string $path)
2829 return new WordPressLoader ($ path );
2930 }
3031
32+ if (file_exists ($ path . '/vendor/autoload.php ' ) && file_exists ($ path . '/vendor/pimcore/pimcore ' )) {
33+ return new PimcoreLoader ($ path );
34+ }
35+
3136 if (file_exists ($ path . '/vendor/autoload.php ' )) {
3237 return new ComposerLoader ($ path );
3338 }
3439
3540 return null ;
3641 }
37- }
42+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace TweakPHP \Client \Loaders ;
6+
7+ class PimcoreLoader extends BaseLoader
8+ {
9+ public function __construct (string $ path )
10+ {
11+ // Include the Composer autoloader
12+ require_once $ path . '/vendor/autoload.php ' ;
13+
14+ \Pimcore \Bootstrap::setProjectRoot ();
15+ \Pimcore \Bootstrap::bootstrap ();
16+ \Pimcore \Bootstrap::kernel ();
17+ }
18+
19+
20+ public function name (): string
21+ {
22+ return 'Pimcore ' ;
23+ }
24+
25+ public function version (): string
26+ {
27+ return \Composer \InstalledVersions::getPrettyVersion ('pimcore/pimcore ' );
28+ }
29+
30+ }
You can’t perform that action at this time.
0 commit comments