Platform.sh Legacy CLI 使用教程

Platform.sh Legacy CLI 使用教程

legacy-cliThis is the legacy version of Platform.sh's command-line interface. The new version is at: https://github.com/platformsh/cli项目地址:https://gitcode.com/gh_mirrors/leg/legacy-cli

1. 项目的目录结构及介绍

Platform.sh Legacy CLI 项目的目录结构如下:

legacy-cli/
├── bin/
│   └── platform
├── src/
│   ├── Commands/
│   ├── Config/
│   ├── Exceptions/
│   ├── Local/
│   ├── Model/
│   ├── Response/
│   ├── Shell/
│   ├── Utils/
│   └── Client.php
├── templates/
│   └── project/
├── tests/
│   ├── bootstrap.php
│   ├── Commands/
│   ├── Config/
│   ├── Exceptions/
│   ├── Local/
│   ├── Model/
│   ├── Response/
│   ├── Shell/
│   ├── Utils/
│   └── ClientTest.php
├── .gitignore
├── .travis.yml
├── composer.json
├── LICENSE
├── README.md
└── phpunit.xml.dist

目录结构介绍

  • bin/: 包含可执行文件 platform,用于启动 CLI。
  • src/: 包含项目的核心代码,分为多个子目录,如 CommandsConfigExceptions 等。
  • templates/: 包含项目模板文件。
  • tests/: 包含项目的测试代码。
  • .gitignore: 指定 Git 忽略的文件和目录。
  • .travis.yml: Travis CI 配置文件。
  • composer.json: Composer 依赖管理文件。
  • LICENSE: 项目许可证。
  • README.md: 项目说明文档。
  • phpunit.xml.dist: PHPUnit 测试配置文件。

2. 项目的启动文件介绍

项目的启动文件位于 bin/ 目录下的 platform 文件。这个文件是一个可执行的 PHP 脚本,用于启动 Platform.sh Legacy CLI。

启动文件内容概述

#!/usr/bin/env php
<?php

// 引入必要的文件和初始化代码
require __DIR__.'/../src/bootstrap.php';

// 创建应用程序实例并运行
$application = new Platformsh\Cli\Application();
$application->run();

启动文件功能

  • 引入必要的文件和初始化代码。
  • 创建应用程序实例并运行。

3. 项目的配置文件介绍

项目的配置文件主要包括 composer.jsonphpunit.xml.dist

composer.json

composer.json 文件定义了项目的依赖关系、脚本和其他元数据。

{
    "name": "platformsh/legacy-cli",
    "description": "Platform.sh CLI",
    "license": "MIT",
    "require": {
        "php": ">=5.5.9",
        "symfony/console": "^3.4 || ^4.0",
        "symfony/yaml": "^3.4 || ^4.0",
        "guzzlehttp/guzzle": "^6.2",
        "psr/log": "^1.0",
        "monolog/monolog": "^1.22",
        "platformsh/config-reader": "^2.1"
    },
    "autoload": {
        "psr-4": {
            "Platformsh\\Cli\\": "src/"
        }
    },
    "bin": ["bin/platform"],
    "scripts": {
        "post-install-cmd": [
            "Platformsh\\Cli\\Composer\\ScriptHandler::install"
        ],
        "post-update-cmd": [
            "Platformsh\\Cli\\Composer\\ScriptHandler::install"
        ]
    }
}

phpunit.xml.dist

phpunit.xml.dist 文件是 PHPUnit 的配置文件,用于定义测试环境和测试套件。

<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/bootstrap.php" colors="true">
    <testsuites>
        <testsuite name="Platform.sh CLI Test Suite">
            <directory>tests</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">src</directory>
        </whitelist>
    </filter>
</phpunit

legacy-cliThis is the legacy version of Platform.sh's command-line interface. The new version is at: https://github.com/platformsh/cli项目地址:https://gitcode.com/gh_mirrors/leg/legacy-cli

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

申子琪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值