定制 xmlsquad/xmlauthor-example-command 二次开发

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

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

xmlsquad/xmlauthor-example-command

Composer 安装命令:

composer require xmlsquad/xmlauthor-example-command

包简介

Example command for managing xml files.

README 文档

README

A git project that acts as an example of an xmlauthor command.

Prerequisites

Install

  • Install dependencies

    composer install
  • Try hello-world command:

    bin/hello-world --configFilename=XmlAuthoringProjectSettings.yaml.dist

Building own command

  • New commands should:

    • be written to run in a Symfony 3.4 console application. See Symfony's documentation on creating commands.have their own git repository project
    • have tests (one or more of PHPUnit/Behat/etc) stored within the project repository
    • be compatible with Symfony 3.4, and
    • make good use of the symfony/console project. i.e. $ composer require symfony/console:~3.4
    • adhere to the convention that allows the command to be automatically registered.
    • be installed by end users as a composer package
    • reuse existing libraries where possible. Such as;
    • use PSR-4 autoloading where possible.
    • be cross-platform compatible; Run on the command line on Windows 10, MacOS High Sierra and Linux.
    • provide README.md instructions on how to install and use the command from .
  • Example command:

    # src/Command/NewCommand.php
    namespace XmlSquad\PackageName\Command;
    
    use XmlSquad\Library\Command\AbstractCommand;
    
    class NewCommand extends AbstractCommand
    {
        public function __construct()
        {
            # Specify command's name
            parent::__construct('new-command');
        }
    
        /**
         * {@inheritdoc}
         */
        protected function execute(InputInterface $input, OutputInterface $output)
        {
            try {
                $configFilename = $input->getOption('configFilename');
                $configOptions = $this->getConfigOptions($configFilename);
    
                dump($configOptions);
            } catch (FileNotFoundException $e) {
                $output->writeln(
                    $e->getMessage(), OutputInterface::VERBOSITY_NORMAL
                );
            }
        }
    }

Test

vendor/bin/phpunit

TODO

[ ] Tests with virtual filesystem

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固