Skip to content

Commit

Permalink
Remove doctrine storage adapters, resolves #538 (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
christeredvartsen committed Apr 26, 2017
1 parent 76eb78f commit 000765b
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 755 deletions.
48 changes: 0 additions & 48 deletions docs/installation/configuration.rst
Expand Up @@ -472,54 +472,6 @@ Examples
// ...
];
Doctrine
++++++++

This adapter uses the `Doctrine Database Abstraction Layer <http://www.doctrine-project.org/projects/dbal.html>`_. The options you pass to the constructor of this adapter is passed to the underlying classes, so have a look at the Doctrine DBAL documentation over at `doctrine-project.org <http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/index.html>`_. When using this adapter you need to create the required tables in the RDBMS first, as specified in the :ref:`database-setup` section.

Examples
^^^^^^^^

Here are some examples on how to use the Doctrine adapter in the configuration file:

1) Use a PDO instance to connect to a SQLite database:

.. code-block:: php
<?php
return [
// ...
'storage' => function() {
return new Imbo\Storage\Doctrine([
'pdo' => new PDO('sqlite:/path/to/database'),
]);
},
// ...
];
2) Connect to a MySQL database using PDO:

.. code-block:: php
<?php
return [
// ...
'storage' => function() {
return new Imbo\Storage\Doctrine([
'dbname' => 'database',
'user' => 'username',
'password' => 'password',
'host' => 'hostname',
'driver' => 'pdo_mysql',
]);
},
// ...
];
.. _filesystem-storage-adapter:

Filesystem
Expand Down
14 changes: 5 additions & 9 deletions docs/installation/event_listeners.rst
Expand Up @@ -345,7 +345,7 @@ The event listener has two roles, one is to generate the variations when new ima

Imbo ships with MongoDB and Doctrine adapters for storing metadata about these variations. If you want to use a different database, you can implement the ``Imbo\EventListener\ImageVariations\Database\DatabaseInterface`` interface and set the name of the class in the configuration of the event listener.

In the same way, Imbo ships three different adapters for storing the actual image variation data (the downscaled images): GridFS, Doctrine and Filesystem. See examples of their configuration below.
In the same way, Imbo ships two different adapters for storing the actual image variation data (the downscaled images): GridFS and Filesystem. See examples of their configuration below.

The event listener supports for following configuration parameters:

Expand Down Expand Up @@ -494,7 +494,7 @@ The event listener supports for following configuration parameters:
// ...
];
The Doctrine adapter is an alternative for storing both metadata and variation data. This adapter uses the `Doctrine Database Abstraction Layer <http://www.doctrine-project.org/projects/dbal.html>`_. When using this adapter you need to create the required tables in the RDBMS first, as specified in the :ref:`database-setup` section. Note that you can either pass a PDO instance (as the ``pdo`` parameter) or specify connection details. Example usage:
The Doctrine adapter is an alternative for storing metadata. This adapter uses the `Doctrine Database Abstraction Layer <http://www.doctrine-project.org/projects/dbal.html>`_. When using this adapter you need to create the required tables in the RDBMS first, as specified in the :ref:`database-setup` section. Example usage:

.. code-block:: php
Expand All @@ -513,15 +513,11 @@ The event listener supports for following configuration parameters:
'password' => 'imbo_password',
'host' => 'localhost',
'driver' => 'mysql',
'tableName' => 'imagevariations',
// OR, pass a PDO instance
'pdo' => null,
'tableName' => 'imagevariations', // Default value, can be omitted
]
],
'storage' => [
'adapter' => 'Imbo\EventListener\ImageVariations\Storage\Doctrine',
'params' => [] // Same as above
'adapter' => 'Imbo\EventListener\ImageVariations\Storage\GridFS',
],
],
],
Expand All @@ -530,7 +526,7 @@ The event listener supports for following configuration parameters:
// ...
];
The third option for the storage adapter is the Filesystem adapter. It's fairly straightforward and uses a similar algorithm when generating file names as the :ref:`filesystem-storage-adapter` storage adapter. Example usage:
The other option for the storage adapter is the Filesystem adapter. It's fairly straightforward and uses a similar algorithm when generating file names as the :ref:`filesystem-storage-adapter` storage adapter. Example usage:

.. code-block:: php
Expand Down
4 changes: 0 additions & 4 deletions docs/installation/installation.rst
Expand Up @@ -173,12 +173,8 @@ MySQL
.. literalinclude:: ../../setup/doctrine.mysql.sql
:language: sql

The ``storage_images`` table is only needed if you plan on storing the actual images in the database as well.

SQLite
~~~~~~

.. literalinclude:: ../../setup/doctrine.sqlite.sql
:language: sql

The ``storage_images`` table is only needed if you plan on storing the actual images in the database as well.
8 changes: 8 additions & 0 deletions docs/installation/upgrading.rst
Expand Up @@ -18,6 +18,14 @@ Below are the changes you need to be aware of when upgrading to Imbo-3.0.0.
:local:
:depth: 2

Doctrine-based storage adapters have been removed
+++++++++++++++++++++++++++++++++++++++++++++++++

The following storage adapters have been removed:

- ``Imbo\Storage\Doctrine``
- ``Imbo\EventListener\ImageVariations\Storage\Doctrine``

XML-support has been removed
++++++++++++++++++++++++++++

Expand Down
1 change: 1 addition & 0 deletions docs/spelling_wordlist.txt
Expand Up @@ -41,3 +41,4 @@ gaussian
Mongo
callables
Backblaze
rethrow
16 changes: 0 additions & 16 deletions setup/doctrine.mysql.sql
Expand Up @@ -34,22 +34,6 @@ CREATE TABLE IF NOT EXISTS `shorturl` (
KEY `params` (`user`,`imageIdentifier`,`extension`,`query`(255))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci;

CREATE TABLE IF NOT EXISTS `storage_images` (
`user` varchar(255) COLLATE utf8_danish_ci NOT NULL,
`imageIdentifier` varchar(255) COLLATE utf8_danish_ci NOT NULL,
`data` blob NOT NULL,
`updated` int(10) unsigned NOT NULL,
PRIMARY KEY (`user`,`imageIdentifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci;

CREATE TABLE IF NOT EXISTS `storage_image_variations` (
`user` varchar(255) COLLATE utf8_danish_ci NOT NULL,
`imageIdentifier` varchar(255) COLLATE utf8_danish_ci NOT NULL,
`width` int(10) unsigned NOT NULL,
`data` blob NOT NULL,
PRIMARY KEY (`user`,`imageIdentifier`,`width`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci;

CREATE TABLE IF NOT EXISTS `imagevariations` (
`user` varchar(255) COLLATE utf8_danish_ci NOT NULL,
`imageIdentifier` varchar(255) COLLATE utf8_danish_ci NOT NULL,
Expand Down
16 changes: 0 additions & 16 deletions setup/doctrine.sqlite.sql
Expand Up @@ -36,22 +36,6 @@ CREATE INDEX shorturlparams ON shorturl (
query
);

CREATE TABLE IF NOT EXISTS storage_images (
user TEXT NOT NULL,
imageIdentifier TEXT NOT NULL,
data BLOB NOT NULL,
updated INTEGER NOT NULL,
PRIMARY KEY (user,imageIdentifier)
);

CREATE TABLE IF NOT EXISTS storage_image_variations (
user TEXT NOT NULL,
imageIdentifier TEXT NOT NULL,
width INTEGER NOT NULL,
data BLOB NOT NULL,
PRIMARY KEY (user,imageIdentifier,width)
);

CREATE TABLE IF NOT EXISTS imagevariations (
user TEXT NOT NULL,
imageIdentifier TEXT NOT NULL,
Expand Down
161 changes: 0 additions & 161 deletions src/EventListener/ImageVariations/Storage/Doctrine.php

This file was deleted.

0 comments on commit 000765b

Please sign in to comment.