定制 roipoussiere/miprem-php 二次开发

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

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

roipoussiere/miprem-php

Composer 安装命令:

composer require roipoussiere/miprem-php

包简介

A merit profile renderer for majority judgment.

README 文档

README

The PHP implementation of Miprem.

Installation

Prerequisites

You must install PHP and Composer (ie. sudo apt install php composer).

Clone repository

git clone --recurse-submodules https://framagit.org/roipoussiere/miprem-php.git
cd miprem-php

Notice the --recurse-submodules that clones the submodules (miprem and miprem-client-demo).

At any moment you can update the submodules with:

git submodule update --init --recursive

Or:

cd miprem && git pull && cd ..

Bind templates folder

To update templates folder, mount it from the miprem submodule:

./bin/mount-templates.sh

Templates are added to git because Composer can not clone a git repo with its submodules.

Install dependencies

composer install

Then you may want to install optional PHP extensions:

  • ext-yaml: Needed by Poll and svgConfig to instantiate classes from Yaml;
  • ext-simplexml(*): Needed by PngGDRenderer to read xml files;
  • ext-gd(*): Needed by PngGDRenderer to rasterize svg images;
  • ext-imagick(*): Needed by PngIMRenderer to rasterize svg images.

On Debian-based systems, they can be installed via packages php-yaml, php-xml, php-gd, php-imagick, respectively.

(*) To generate png, you have the choice between two renderers:

  • PngIMRenderer (recommended), that use the extension ext-imagick;
  • PngGDRenderer, that use the package php-svg, which require ext-simplexml and ext-gd extensions.

The first one is recommended as it produce better results, the second one is lighter and faster but generated images can be glitched.

Test with demo client

Now Miprem PHP is installed, you can test it by running the demo web client:

./bin/serve.sh

Then open http://127.0.0.1:8000/demo.php.

Building the library

If you work on miprem.php, you must run build.sh from the miprem-js root folder after your edit.

./build.sh

It generates php files based on a template and values:

  • src/Template.php: based on TemplateEmpty.php, with the {{ TEMPLATE_NAME }} occurences replaced by their corresponding file content.
  • src/DefaultData.php: based on DefaultDataEmpty.php, with the {{ DEFAULT_DATA }} occurences replaced by their corresponding file content.

Licence & authorship

This project is developed by the MieuxVoter non-profit organization and published under MIT licence.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固