/** * @param CoreInterface $core */ protected function register(CoreInterface $core) { $config = $core->make('Surume\\Config\\ConfigInterface'); $factory = new FilesystemAdapterFactory(); $fsCloud = new FilesystemManager(); $fsDisk = new Filesystem($factory->create('Local', [['path' => $core->basePath()]])); $disks = $config->get('filesystem.cloud'); foreach ($disks as $disk => $config) { $fsCloud->mountFilesystem($disk, new Filesystem($factory->create($config['factory'], [$config['config']]))); } $core->instance('Surume\\Filesystem\\FilesystemInterface', $fsDisk); $core->instance('Surume\\Filesystem\\FilesystemManagerInterface', $fsCloud); }
/** * @param CoreInterface $core * @param CoreInputContextInterface $context * @return string[] */ private function getDefaultVariables(CoreInterface $core, CoreInputContextInterface $context) { return ['runtime' => $context->type(), 'parent' => $context->parent(), 'alias' => $context->alias(), 'name' => $context->name(), 'basepath' => $core->basePath(), 'datapath' => $core->dataPath(), 'host.main' => '127.0.0.1']; }