Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Refactor media to be framework agnostic #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
616 changes: 0 additions & 616 deletions Adapter/Gaufrette/AbstractCmfMediaDoctrine.php

This file was deleted.

24 changes: 0 additions & 24 deletions Adapter/Gaufrette/PhpcrCmfMediaDoctrine.php

This file was deleted.

10 changes: 5 additions & 5 deletions Adapter/LiipImagine/CmfMediaDoctrineLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
use Doctrine\Common\Persistence\ManagerRegistry;
use Imagine\Image\ImagineInterface;
use Liip\ImagineBundle\Imagine\Data\Loader\AbstractDoctrineLoader;
use Symfony\Cmf\Bundle\MediaBundle\BinaryInterface;
use Symfony\Cmf\Bundle\MediaBundle\FileSystemInterface;
use Symfony\Cmf\Bundle\MediaBundle\ImageInterface;
use Symfony\Cmf\Bundle\MediaBundle\MediaManagerInterface;
use Media\BinaryInterface;
use Media\FileSystemInterface;
use Media\ImageInterface;
use Media\MediaManagerInterface;
use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;

/**
Expand Down Expand Up @@ -61,7 +61,7 @@ protected function getStreamFromImage($image)
throw new UnsupportedMediaTypeHttpException(
sprintf('Source image of type "%s" does not implement "%s"',
$type,
'Symfony\Cmf\Bundle\MediaBundle\ImageInterface'
'Media\ImageInterface'
)
);
}
Expand Down
24 changes: 0 additions & 24 deletions BinaryInterface.php

This file was deleted.

2 changes: 1 addition & 1 deletion CmfMediaBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function build(ContainerBuilder $container)
$container->addCompilerPass(
DoctrinePhpcrMappingsPass::createXmlMappingDriver(
array(
realpath(__DIR__ . '/Resources/config/doctrine-phpcr') => 'Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr',
realpath(__DIR__ . '/Resources/config/doctrine-phpcr') => 'Media\Model\Doctrine\Phpcr',
),
array('cmf_media.persistence.phpcr.manager_name'),
'cmf_media.backend_type_phpcr'
Expand Down
10 changes: 5 additions & 5 deletions Controller/FileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Cmf\Bundle\MediaBundle\BinaryInterface;
use Media\BinaryInterface;
use Media\FileInterface;
use Media\FileSystemInterface;
use Media\MediaManagerInterface;
use Symfony\Cmf\Bundle\MediaBundle\File\UploadFileHelper;
use Symfony\Cmf\Bundle\MediaBundle\FileInterface;
use Symfony\Cmf\Bundle\MediaBundle\FileSystemInterface;
use Symfony\Cmf\Bundle\MediaBundle\MediaManagerInterface;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand Down Expand Up @@ -119,7 +119,7 @@ public function downloadAction($path)

if (! $contentDocument || ! $contentDocument instanceof FileInterface) {
throw new NotFoundHttpException(sprintf(
'Object with identifier %s cannot be resolved to a valid instance of Symfony\Cmf\Bundle\MediaBundle\FileInterface',
'Object with identifier %s cannot be resolved to a valid instance of Media\FileInterface',
$path
));
}
Expand Down
6 changes: 3 additions & 3 deletions Controller/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Symfony\Cmf\Bundle\MediaBundle\Controller;

use Symfony\Cmf\Bundle\MediaBundle\FileInterface;
use Symfony\Cmf\Bundle\MediaBundle\ImageInterface;
use Media\FileInterface;
use Media\ImageInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
Expand Down Expand Up @@ -31,7 +31,7 @@ public function displayAction($path)

if (! $contentObject || ! $contentObject instanceof ImageInterface) {
throw new NotFoundHttpException(sprintf(
'Object with identifier %s cannot be resolved to a valid instance of Symfony\Cmf\Bundle\MediaBundle\ImageInterface',
'Object with identifier %s cannot be resolved to a valid instance of Media\ImageInterface',
$path
));
}
Expand Down
8 changes: 4 additions & 4 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public function getConfigTreeBuilder()
->scalarNode('enabled')->defaultNull()->end()
->scalarNode('media_basepath')->defaultValue('/cms/media')->end()
->scalarNode('manager_name')->defaultNull()->end()
->scalarNode('media_class')->defaultValue('Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr\Media')->end()
->scalarNode('file_class')->defaultValue('Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr\File')->end()
->scalarNode('directory_class')->defaultValue('Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr\Directory')->end()
->scalarNode('image_class')->defaultValue('Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr\Image')->end()
->scalarNode('media_class')->defaultValue('Media\Model\Doctrine\Phpcr\Media')->end()
->scalarNode('file_class')->defaultValue('Media\Model\Doctrine\Phpcr\File')->end()
->scalarNode('directory_class')->defaultValue('Media\Model\Doctrine\Phpcr\Directory')->end()
->scalarNode('image_class')->defaultValue('Media\ModelDoctrine\Phpcr\Image')->end()
->end()
->end()
->end()
Expand Down
23 changes: 0 additions & 23 deletions DirectoryInterface.php

This file was deleted.

66 changes: 0 additions & 66 deletions Doctrine/Phpcr/Directory.php

This file was deleted.

Loading