定制 modxcms/teleport 二次开发

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

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

modxcms/teleport

Composer 安装命令:

composer require modxcms/teleport

包简介

An extensible scripting and packaging toolkit for MODX Revolution

README 文档

README

Teleport is an extensible scripting toolkit for working with one or more local MODX Revolution installations.

Teleport currently functions primarily as a packaging toolkit which extends the MODX Transport APIs and provides commands for extracting and injecting customizable snapshots of MODX deployments. But it can be extended easily to perform an infinite variety of actions related to MODX.

MODX Revolution 3.x

Please use the 2.x branch and releases for MODX 3.x support.

Requirements

In order to use Teleport, your environment must at least meet the following requirements:

  • PHP >= 5.4
  • MODX Revolution >= 2.1 (MySQL)

You must also be able to run PHP using the CLI SAPI.

NOTE: At the current time, various Teleport Extract tpls only support MySQL deployments of MODX Revolution.

Usage on Linux environments with the PHP posix extension can take advantage of advanced user-switching features.

Teleport strives to be a multi-platform tool, and currently works equally well in Linux and OS X environments. Windows support is unknown at this time; Windows contributors wanted.

Installation

There are several methods for installing Teleport. The easiest way to get started is by installing the Teleport Phar distribution.

IMPORTANT: Using any of the installation methods, make sure you are running Teleport as the same user PHP runs as when executed by the web server. Failure to do so can corrupt your MODX site by injecting and/or caching files with incorrect file ownership.

Download and Install Phar

Create a working directory for Teleport and cd to that directory, e.g.

mkdir ~/teleport/ && cd ~/teleport/

Download the latest teleport.phar distribution of Teleport into your Teleport working directory.

Create a Profile of a MODX site:

php teleport.phar --action=Profile --name="MyMODXSite" --code=mymodxsite --core_path=/path/to/mysite/modx/core/ --config_key=config

Extract a Snapshot from the MODX site you just profiled:

php teleport.phar --action=Extract --profile=profile/mymodxsite.profile.json --tpl=phar://teleport.phar/tpl/develop.tpl.json

Other Installation Methods

Alternatively, you can install Teleport using the source and Composer. Learn more about using git clone or a release archive.

IMPORTANT: If you want to use the Teleport HTTP Server you cannot use the Phar distribution. You MUST use one of the other installation methods.

Teleport in your PATH

With any of the installation methods you can create an executable symlink called teleport pointing to bin/teleport, or directly to the teleport.phar. You can then simply type teleport instead of bin/teleport or php teleport.phar to execute the teleport application.

Basic Usage

In all of the usage examples that follow, call teleport based on how you have installed the application. For example, if you installed from source, substitute bin/teleport for php teleport.phar; if you have created an executable symlink to the teleport.phar, substitute teleport for php teleport.phar in the sample commands. The following examples assume you have installed the teleport.phar distribution.

NOTE: Before using Teleport with a MODX site, you will need to create a Teleport Profile from the installed site.

Create a MODX Site Profile

You can create a Teleport Profile of an existing MODX site using the following command:

php teleport.phar --action=Profile --name="MySite" --code=mysite --core_path=/path/to/mysite/modx/core/ --config_key=config

The resulting file would be located at profile/mysite.profile.json and could then be used for Extract or Inject commands to be run against the site represented in the profile.

Learn more about Teleport Profiles.

Extract a Snapshot of a MODX Site

You can Extract a Teleport snapshot from a MODX site using the following command:

php teleport.phar --action=Extract --profile=profile/mysite.profile.json --tpl=phar://teleport.phar/tpl/develop.tpl.json

The snapshot will be located in the workspace/ directory if it is created successfully.

You can also Extract a Teleport snapshot and push it to any valid stream target using the following command:

php teleport.phar --action=Extract --profile=profile/mysite.profile.json --tpl=phar://teleport.phar/tpl/develop.tpl.json --target=s3://mybucket/snapshots/ --push

In either case, the absolute path to the snapshot is returned by the process as the final output. You can use this as the path for an Inject source.

NOTE: The workspace copy is removed after it is pushed unless you pass --preserveWorkspace to the CLI command.

Learn more about the Teleport Extract Action.

Inject a Snapshot into a MODX Site

You can Inject a Teleport snapshot from any valid stream source into a MODX site using the following command:

php teleport.phar --action=Inject --profile=profile/mysite.profile.json --source=workspace/mysite_develop-120315.1106.30-2.2.1-dev.transport.zip

NOTE: If the source is not within the workspace/ directory a copy will be pulled to that location and then removed after the Inject completes unless --preserveWorkspace is passed.

Learn more about the Teleport Inject Action.

UserCreate

You can create a user in a profiled MODX site using the following command:

php teleport.phar --action=UserCreate --profile=profile/mysite.profile.json --username=superuser --password=password --sudo --active --fullname="Test User" --email=testuser@example.com

NOTE: This uses the security/user/create processor from the site in the specified profile to create a user, and the action accepts any properties the processor does.

Learn more about the Teleport UserCreate Action.

Get Started

Learn more about Teleport in the documentation.

License

Teleport is Copyright (c) MODX, LLC

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

modxcms/teleport 适用场景与选型建议

modxcms/teleport 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 115 次下载、GitHub Stars 达 57, 最近一次更新时间为 2013 年 11 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 modxcms/teleport 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 modxcms/teleport 我们能提供哪些服务?
定制开发 / 二次开发

基于 modxcms/teleport 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 57
  • Watchers: 16
  • Forks: 22
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-11-05