setPath() публичный Метод

Set a resource path.
public setPath ( string $name, string $value ) : Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface
$name string
$value string
Результат Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface
Пример #1
0
 protected function initializeResponder($request)
 {
     $config = new ResourceManager(__DIR__);
     $config->setPath('cache', 'tmp/cache');
     $config->setPath('files', 'images');
     $config->compat();
     $app = new Application(array('resources' => $config));
     $app->register(new \Bolt\Provider\CacheServiceProvider());
     $responder = new ThumbnailResponder($app, $request);
     $responder->initialize();
     return $responder;
 }
Пример #2
0
 protected function initializeResponder($request)
 {
     $container = new Pimple(array('rootpath' => __DIR__, 'pathmanager' => new PlatformFileSystemPathFactory()));
     $config = new ResourceManager($container);
     $config->setPath('cache', 'tmp/cache');
     $config->setPath('files', 'images');
     $config->compat();
     $app = new Application(array('resources' => $config));
     $app->register(new CacheServiceProvider());
     $responder = new ThumbnailResponder($app, $request);
     $responder->initialize();
     return $responder;
 }
 /**
  * @param string          $locale
  * @param string          $fileContent
  * @param ResourceManager $resources
  */
 protected function initializeFakeTranslationFiles($locale, $fileContent, ResourceManager $resources)
 {
     $fakeAppRoot = $resources->getPath('cache');
     $fakeTranslationDir = "{$fakeAppRoot}/app/resources/translations/{$locale}";
     (new Filesystem())->mkdir($fakeTranslationDir);
     file_put_contents("{$fakeTranslationDir}/messages.{$locale}.yml", $fileContent);
     $resources->setPath('root', $fakeAppRoot);
 }
Пример #4
0
 /**
  * @param Config\ResourceManager $config
  */
 protected function setAppPaths($config)
 {
     $config->setPath('app', PHPUNIT_WEBROOT . '/app');
     $config->setPath('config', PHPUNIT_WEBROOT . '/app/config');
     $config->setPath('cache', PHPUNIT_WEBROOT . '/app/cache');
     $config->setPath('web', PHPUNIT_WEBROOT . '/');
     $config->setPath('files', PHPUNIT_WEBROOT . '/files');
     $config->setPath('themebase', PHPUNIT_WEBROOT . '/theme/');
     $config->setPath('extensionsconfig', PHPUNIT_WEBROOT . '/config/extensions');
     $config->setPath('extensions', PHPUNIT_WEBROOT . '/extensions');
 }