public function register(DiInterface $di)
 {
     $config = $di->get('config');
     $di->set(self::SERVICE_NAME, function () use($config) {
         $uploaderAdapter = new Uploader(new \Foo\Models\Fake());
         $uploaderAdapter->setExtensions(['jpg', 'png']);
         $uploaderAdapter->setMimeTypes(['image/jpeg', 'image/png']);
         $uploaderAdapter->setMaxFileSize('10MB');
         $uploaderAdapter->setTempDestination(\Vegas\Utils\Path::getRootPath() . '/public/temp');
         $uploaderAdapter->setOriginalDestination(\Vegas\Utils\Path::getRootPath() . '/public/uploads');
         return $uploaderAdapter;
     }, true);
 }
示例#2
0
 public function testRootPath()
 {
     $this->assertEquals('/', Path::getRelativePath(Path::getRootPath()));
 }