mirror of
https://gitnet.fr/deblan/gist.git
synced 2021-08-14 08:30:49 +02:00
25 lines
624 B
PHP
25 lines
624 B
PHP
<?php
|
|
|
|
use GitWrapper\GitWrapper;
|
|
use Gist\Service\Gist;
|
|
|
|
$dataPath = $app['settings']['data']['path'];
|
|
|
|
if ($dataPath[0] !== '/') {
|
|
$app['gist_path'] = $app['root_path'].'/'.$dataPath;
|
|
} else {
|
|
$app['gist_path'] = $dataPath;
|
|
}
|
|
|
|
$app['git_wrapper'] = $app->share(function ($app) {
|
|
return new GitWrapper($app['settings']['git']['path']);
|
|
});
|
|
|
|
$app['git_working_copy'] = $app->share(function ($app) {
|
|
return $app['git_wrapper']->init($app['gist_path']);
|
|
});
|
|
|
|
$app['gist'] = $app->share(function ($app) {
|
|
return new Gist($app['gist_path'], $app['git_wrapper'], $app['git_working_copy'], $app['geshi']);
|
|
});
|