https://github.com/vovayatsyuk/codemorph
Script that generates multiple versions on one file according to replacement rules inside of it
https://github.com/vovayatsyuk/codemorph
Last synced: 7 months ago
JSON representation
Script that generates multiple versions on one file according to replacement rules inside of it
- Host: GitHub
- URL: https://github.com/vovayatsyuk/codemorph
- Owner: vovayatsyuk
- Created: 2014-06-03T13:44:48.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-03T19:25:26.000Z (about 12 years ago)
- Last Synced: 2024-12-29T06:21:54.593Z (over 1 year ago)
- Language: PHP
- Size: 152 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
CodeMorph
=========
Script that generates multiple versions on one file according to replacement rules inside of it.
### How to use
1. Prepare morph rules in source files
```php
...
// {{morph}}
// {{demo}}:{{'lifetime' => 3600}}
// {{trial}}:{{'lifetime' => $this->getTrialLifetime()}}
'lifetime' => $this->getLifetime()
// {{morph}}
...
```
```xml
...
Full Version
...
```
2. Run the command:
```
php -f path/to/morph.php "/source/folder" "/destination/folder" demo,trial
```
### Morph rules
1. Code to morph, should be wrapped into {{morph}} placeholders:
```
{{morph}}
original code
{{morph}}
```
2. Specify replacement rules
```
{{morph}}
{{demo}}:{{demo code}}
{{trial}}:{{
trial code
}}
original code
{{morph}}
```
3. Supported comments around the morph rules: #, /*, //,