Merge pull request #50 from tsivert/max_score

Max score
pull/52/head
Thomas 2018-06-19 09:17:12 +02:00 committed by GitHub
commit 30cb2aec45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -451,6 +451,19 @@ class H5PDefaultStorage implements \H5PFileStorage {
return self::dirReady($this->path);
}
/**
* Check if the file presave.js exists in the root of the library
*
* @param string $libraryFolder
* @param string $developmentPath
* @return bool
*/
public function hasPresave($libraryFolder, $developmentPath = null) {
$path = is_null($developmentPath) ? 'libraries' . DIRECTORY_SEPARATOR . $libraryFolder : $developmentPath;
$filePath = realpath($this->path . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . 'presave.js');
return file_exists($filePath);
}
/**
* Recursive function for copying directories.
*

View File

@ -190,4 +190,13 @@ interface H5PFileStorage {
* @return bool True if server has the proper write access
*/
public function hasWriteAccess();
/**
* Check if the library has a presave.js in the root folder
*
* @param string $libraryName
* @param string $developmentPath
* @return bool
*/
public function hasPresave($libraryName, $developmentPath = null);
}