承接 fpoirotte/php_parsergenerator_installer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

fpoirotte/php_parsergenerator_installer

Composer 安装命令:

composer require fpoirotte/php_parsergenerator_installer

包简介

Automatically compiles parsers upon a package's installation

README 文档

README

This repository contains a custom Composer installer meant for projects that use parsers written using the fpoirotte/php_parsergenerator Composer package.

When a package relying on this installer is installed or updated, its parsers will automatically be rebuilt if necessary, based on their source grammar. Likewise, those parsers are automatically erased when the package is uninstalled.

Usage

To use this installer, edit your project's composer.json file:

  • Set the type to php-parsers
  • Add a requirement on fpoirotte/php_parsergenerator_installer
  • Declare your parsers using the php-parsers extra option

The extra option may contain either:

  • A list of relative paths to grammars: for each such grammar, a parser will be generated in the same folder with the same base name (eg. src/Foo.y gets compiled into src/Foo.php)
  • A mapping between the expected parsers and their source grammar (see below)

For example, the erebot/intl Composer package uses the following configuration to build a parser in src/PluralParser.php based on the contents of the grammar located in data/PluralParser.y, relative to the package's root directory:

{
     "name": "erebot/intl",
     "type": "php-parsers",
     "require": {
         "fpoirotte/php_parsergenerator_installer": "^0.1.0"
     },
     "extra": {
         "php-parsers": {
             "src/PluralParser.php": "data/PluralParser.y"
         }
     }
 }

Now, when installing/updating a package that uses this installer, you will see output similar to this one:

clicky@localhost:~/git/Erebot/Styling$ composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 34 installs, 0 updates, 0 removals
  - Installing fpoirotte/php_parsergenerator (0.2.3): Loading from cache
  - Installing fpoirotte/php_parsergenerator_installer (0.1.4): Loading from cache
  ...
Generating autoload files
Compiling '.../vendor/erebot/intl/src/PluralParser.php' from '.../vendor/erebot/intl/data/PluralParser.y'
Parser statistics: 28 terminals, 3 nonterminals, 27 rules
                   55 states, 0 parser table entries, 20 conflicts
20 parsing conflicts.
Compiling 'src/Styling/Parser.php' from 'data/Styling.y'
Parser statistics: 8 terminals, 3 nonterminals, 9 rules
                   17 states, 0 parser table entries, 0 conflicts

Copyright and license

Copyright (c) 2018, François Poirotte. This installer is licensed under the 3-clause BSD License, see the LICENSE file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-05-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固