定制 pixnyb/silverstripe-picsum 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pixnyb/silverstripe-picsum

Composer 安装命令:

composer require pixnyb/silverstripe-picsum

包简介

A module that downloads sample images for each image in the database if the file does not exist. Useful for development when a database dump is provided.

README 文档

README

This module provides a simple way to load images for an existing database dump. It uses the Lorem Picsum API to fetch images.

Installation

composer require pixnyb/silverstripe-picsum --dev

Usage

After importing your database dump, you can run the following task to fetch images for all instances of the image class. It will store the images in the assets directory in local storage.

sake dev/tasks/download-sample-images

Configuration

You can configure the assets directory in order to comply with custom configurations, use prefetching and set the prefetching limit.

Below are the default configuration values:

PixNyb\Picsum\Tasks\DownloadSampleImageTask:
  assets_directory: 'assets'
  prefetch: true
  prefetch_limit: 10

Note

The prefetching feature will remove the need to download a new image for each instance of the image class. It will download a set number of images and reuse them for all instances. This does mean that the images won't be unique, but it will speed up the task significantly.

统计信息

  • 总下载量: 204
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-07-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固