A collection of Phing tasks for string casing, namespaces, path conversion, and random string generation. Useful for manipulating and transforming strings within your Phing build process.
Install via Composer:
composer require seworqs/phing-stringImport the SEworqs task library in your build.xml:
<import file="vendor/seworqs/phing-string/resources/phing/import.xml"/>This will register all available tasks so you can use them directly:
<camelcase input="convert me to camel" />
<snakecase input="ConvertMeToSnake" />
<namespace input="src/Helper/StringHelper.php" />
<path input="App\Helper\StringHelper" />
<random length="16" />Prefer to manage task registration yourself?
You can also define tasks individually using<taskdef>. Seeexamples/example.xml.
For more examples, see examples.xml
- Convert strings to multiple casing formats
- Normalize namespaces from file paths
- Generate PSR-4 style file paths from namespaces
- Generate secure random strings
- Easy integration via
import.xml, or define tasks manually
| Namespace | Task Class | Purpose |
|---|---|---|
| Seworqs\Phing\Task\Casing | LowerCaseTask | Converts to lowercase |
| UpperCaseTask | Converts to uppercase | |
| CamelCaseTask | Converts to camelCase |
|
| PascalCaseTask | Converts to PascalCase |
|
| SnakeCaseTask | Converts to snake_case |
|
| KebabCaseTask | Converts to kebab-case |
|
| ScreamingSnakeCaseTask | Converts to SCREAMING_SNAKE_CASE |
|
| ScreamingKebabCaseTask | Converts to SCREAMING-SNAKE-CASE |
|
| TitleCaseTask | Converts to Title Case |
|
| Seworqs\Phing\Task\Namespace | NamespaceTask | Extracts namespace from file path |
| Seworqs\Phing\Task\Path | PathTask | Converts namespace to PSR-4 file path |
| Seworqs\Phing\Task\Random | RandomTask | Generates a random string |
Apache-2.0 — see LICENSE
SEworqs builds clean, reusable modules for PHP and Mendix developers.
Learn more at github.com/seworqs