robo47/php-manipulator
Composer 安装命令:
composer require robo47/php-manipulator
包简介
Manipulation of php code, automated refactoring based on phps tokenizer
关键字:
README 文档
README
Table of Contents
- About PHP\Manipulator
- Requirements
- Installation
- License
- Usage
- Project directory/file structure
About PHP\Manipulator
A command-line tool for manipulating php code.
PHP\Manipulator is build to be easily extendable with your own Actions and Actionsets [for example for configure multiple Actions forming a Coding-Standard or a special task for you project] and configurable via a simple xml-file allowing to choose which files should be changed and which action(set)s should be used on those files.
Code ist hosted at http://www.github.com/robo47/php-manipulator and directly installable via my PEAR-server pear.robo47.net.
Requirements
PHP\Manipulator requires PHP 5.3+ using features like namespaces and Closures.
extensions:
- spl
- tokenizer
- pcre
- dom
libraries:
- Symfony 2.0
- Console
- Finder
- PHPUnit 3.6 (unittests only)
configuration:
(both only if the code you want to manipulate contains them!) short_open_tag = On asp_tags = On
Installation
Create a composer.json
{
"require": {
"robo47/php-manipulator": "*"
}
}
Download and run composer
curl -s http://getcomposer.org/installer | php
php composer.phar install
License
MIT
See file LICENSE.MIT
Usage
Running phpmanipulator:
bin/phpmanipulator
Run actions from a config:
bin/phpmanipulator runActions ./config.xml
Show tokens of a script
bin/phpmanipulator showTokens /path/to/script.php
Project directory/file structure
+-bin/phpmanipulator.php # the phpmanipulator binary +-helper/ # Directory with templates for creating new Classes +-src/ | +-PHP/ # Here the actual PHP\Manipulators Code is located +-tests/ | +-Baa/ # Directory with Dummy-Files for testing Components, the Config and Loading | +-Foo/ # Directory with Dummy-Files for testing Components, the Config and Loading | +-Tests | | +-Constraint/ # Tests for special Constraints used in the tests | | +-Stub/ # Tests for Stub-Objects used in the tests | | +-PHP/ # HERE are the actual unittests for PHP\Manipulator | | +-TestCase.php # The base-TestCase Class with additional asserts using the new Constraints and some other methods | | +-Util.php # Helper-Methods used in the Constraints and for Debugging while riding new Code | +-_fixtures/ # Containing all the php/xml-files used in the unittests ordered in subdirectories for each namespace below \PHP\Manipulator | +- TestHelper.php # Bootstrap-File for unittests setting include-path and setting up the Symfony-Autoloader | +-phpunit.xml # Default config only Running Tests in /tests/Tests/PHP | +-phpunitTests.xml # Config only running tests of "testing-components" like the Constraints, the Stubs, the TestCase and the Util-class. +-LICENSE # File containing the used New BSD-License for PHP\Manipulator +-README # The file you are currently reading +-TODO # List of todos, whishes, ideas and plans +-build.xml # ant-build-script used mainly by hudson for running all tools around a build (phpunit, phpcpd, phpcs, phplint, phpunit, ... ) +-helper.php # Simple cli-script to create new Classes + unitests + empty fixture-files +-phpmanipulator.xml # Default configuration for running phpManipulator for enforcing coding-standard for itself by formatting/indenting code the right way (formatting not like expected yet!)
helper script
The helper.php is only meant for development, it allows an easy and fast creation of new empty dummys for Actions, TokenConstraints, TokenManipulators, ContainerConstraints and TokenFinders including a unittest-file-dummy and empty fixture-files via the command line.
robo47/php-manipulator 适用场景与选型建议
robo47/php-manipulator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 4, 最近一次更新时间为 2012 年 03 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「manipulator」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 robo47/php-manipulator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 robo47/php-manipulator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 robo47/php-manipulator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Business Day Manipulator
Library for Analyzing or Manipulating PHP files using the TokenStream, AST, or both
Date manipulator for laravel
Create flexible picture elements
Simple folder manipulation. Create, delete, rename folder
Alfabank REST API integration
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-03-10