Merge branch 'atomic-dev-mode'

namespaces
Svein-Tore Griff With 2015-01-08 11:20:49 +01:00
commit 1420a96a2c
2 changed files with 13 additions and 0 deletions

View File

@ -93,6 +93,7 @@ class H5PDevelopment {
// TODO: Should we remove libraries without files? Not really needed, but must be cleaned up some time, right? // TODO: Should we remove libraries without files? Not really needed, but must be cleaned up some time, right?
// Go trough libraries and insert dependencies. Missing deps. will just be ignored and not available. (I guess?!) // Go trough libraries and insert dependencies. Missing deps. will just be ignored and not available. (I guess?!)
$this->h5pF->lockDependencyStorage();
foreach ($this->libraries as $library) { foreach ($this->libraries as $library) {
$this->h5pF->deleteLibraryDependencies($library['libraryId']); $this->h5pF->deleteLibraryDependencies($library['libraryId']);
// This isn't optimal, but without it we would get duplicate warnings. // This isn't optimal, but without it we would get duplicate warnings.
@ -104,6 +105,7 @@ class H5PDevelopment {
} }
} }
} }
$this->h5pF->unlockDependencyStorage();
// TODO: Deps must be inserted into h5p_nodes_libraries as well... ? But only if they are used?! // TODO: Deps must be inserted into h5p_nodes_libraries as well... ? But only if they are used?!
} }

View File

@ -408,6 +408,17 @@ interface H5PFrameworkInterface {
*/ */
public function deleteLibraryDependencies($libraryId); public function deleteLibraryDependencies($libraryId);
/**
* Start an atomic operation against the dependency storage
*/
public function lockDependencyStorage();
/**
* Stops an atomic operation against the dependency storage
*/
public function unlockDependencyStorage();
/** /**
* Delete a library from database and file system * Delete a library from database and file system
* *