Database abstraction broken up into controller, connector, query builder, and schema manager, each independently configurable via YAML / Injector
Creation of new DBQueryGenerator for database specific generation of SQL
Support for parameterised queries, move of code base to use these over escaped conditions
Refactor of SQLQuery into separate query classes for each of INSERT UPDATE DELETE and SELECT
Support for PDO
Installation process upgraded to use new ORM
SS_DatabaseException created to handle database errors, maintaining details of raw sql and parameter details for user code designed interested in that data.
Renamed DB static methods to conform correctly to naming conventions (e.g. DB::getConn -> DB::get_conn)
3.2 upgrade docs
Performance Optimisation and simplification of code to use more concise API
API Ability for database adapters to register extensions to ConfigureFromEnv.php
Adding warning, took me a couple hours to figure this out...
The file does not get moved because of this line:
https://github.com/silverstripe/silverstripe-framework/blob/3.1/filesystem/File.php#L515
Maybe add to the method doc, telling people to set ParentId and Name instead if they want to change the location of a file (if that's the correct method).
NOTE: This change should be reviewed to make sure it does not cause any side effects.
Example use case:
An admin porting user images from an old website.
The script would put the images in the assets folder,
and then insert them into the database using Image::write()
and data from the old database.
public function insertImage($data) {
$image = new Image();
$image->ParentID = $data->parentId;
$image->Title = $data->title;
$image->FileName = $data->filename;
$image->OwnerID = $data->ownerId;
$image->write();
// In the current version, this results in all images
// being owned by Member::currentUser() instead of
// the expected $data->ownerId;
}
I've changed the variables to use the absolute path as the path is unhelpful for debugging and this is more consistent with the other lines of code below
This is a measure to support form fields and controllers
interacting with files in different contexts,
for example an UploadField used in a ModelAdmin,
or a website frontend. The check for 'CMS_ACCESS_AssetAdmin'
was too restricting. This wasn't a problem in 2.x simply because
the old FileField/Upload classes didn't respect File->can*()
permissions.
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit. This is in preparation for the enforcement of this rule with PHP_CodeSniffer.