我一直试图让djoudi/Laravel-H5P在不使用任何Drupal/Moodle/Wordpress插件的情况下为H5P内容实现编辑器。
我基本上停留在本期中描述的与H5PFrameworkInterface不兼容的问题上(这是应该解决的)。我所做的是:
composer create-project laravel/laravel="5.5.*" my-projectcomposer require djoudi/laravel-h5p{}替换为[] (可能取决于PHP ):- `/vendor/h5p/h5p-core/h5p.classes.php`, line 2747
- `/vendor/h5p/h5p-core/h5p-development.class.php`, line 70php artisan vendor:publishphp artisan migrateautoload/classmap中的composer.json中:
"vendor/h5p/h5p-core/h5p-default-storage.class.php","vendor/h5p/h5p-core/h5p-development.class.php","vendor/h5p/h5p-core/h5p-event-base.class.php","vendor/h5p/h5p-core/h5p-file-storage.interface.php",“供应商/h5p/h5p-core/h5p.classes.php”,"vendor/h5p/h5p-editor/h5peditor-ajax.class.php","vendor/h5p/h5p-editor/h5peditor-ajax.interface.php","vendor/h5p/h5p-editor/h5peditor-file.class.php","vendor/h5p/h5p-editor/h5peditor-storage.interface.php",“供应商/h5p/h5p-编辑器/h5peditor.class.php”providers in config/app.php:
Djoudi\LaravelH5p\LaravelH5pServiceProvider::class中php artisan make:auth我还尝试在composer.json中指定软件包的2.0版(这需要使用Laravel5.8)。从技术角度看,这似乎更好一些,但我也没有安装任何库,也没有创建任何H5P内容。基本上,我上传的任何H5P库似乎都被认为是一个有效的H5P文件,并且解压缩该zip文件是有效的,但是没有找到/安装任何库。
我怎样才能把这个项目和Laravel结合起来呢?
发布于 2020-07-10 15:51:42
您应该确保在https://h5p.org/installation/configure-php中列出了php配置。您需要安装PHP的这个扩展:
在文件"C:\laragon\www\h5pintegration\vendor\djoudi\laravel-h5p\src\LaravelH5p\Storages\LaravelH5pStorage.php“中,函数"saveFileFromZip($path,$file,$stream)”应该得到以下代码:
/**
* Store the given stream into the given file.
*
* @param string $path
* @param string $file
* @param resource $stream
* @return bool
*/
public function saveFileFromZip($path, $file, $stream){
// Add filename to path
$absolutePath = $path.'/'.$file;
$newDirPath = preg_replace("/\/[^\/]+\/?$/", '', $absolutePath);
if (!self::dirReady($newDirPath)) {
throw new \Exception('unabletocopy');
}
if ($stream) {
file_put_contents($absolutePath, $stream);
}
return true;
}(我应该提出一个拉的请求,我不知道是怎么回事)
当您有此功能时,您可以看到正在运行的包http://localhost/h5p
现在您可以加载库了。
您可以从h5p获得https://h5p.org/content-types-and-applications库。
当您上载一个内容表单.h5p文件时,它会加载所有依赖的库。
这就是我到目前为止..。
我发现https://github.com/exatech-group/Laravel-H5P是djoudi/Laravel-H5P2.0的一个分支,但它已经更新了。
希望能帮上忙!
https://stackoverflow.com/questions/62792486
复制相似问题