{"id":18766222,"url":"https://github.com/vovayatsyuk/codemorph","last_synced_at":"2025-12-08T22:30:12.895Z","repository":{"id":17639904,"uuid":"20444319","full_name":"vovayatsyuk/codemorph","owner":"vovayatsyuk","description":"Script that generates multiple versions on one file according to replacement rules inside of it","archived":false,"fork":false,"pushed_at":"2014-06-03T19:25:26.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T06:21:54.593Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vovayatsyuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-03T13:44:48.000Z","updated_at":"2014-06-10T11:53:25.000Z","dependencies_parsed_at":"2022-09-24T17:57:06.660Z","dependency_job_id":null,"html_url":"https://github.com/vovayatsyuk/codemorph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vovayatsyuk%2Fcodemorph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vovayatsyuk%2Fcodemorph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vovayatsyuk%2Fcodemorph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vovayatsyuk%2Fcodemorph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vovayatsyuk","download_url":"https://codeload.github.com/vovayatsyuk/codemorph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239668898,"owners_count":19677630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T18:39:33.995Z","updated_at":"2025-12-08T22:30:12.837Z","avatar_url":"https://github.com/vovayatsyuk.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"CodeMorph\n=========\n\nScript that generates multiple versions on one file according to replacement rules inside of it.\n\n### How to use\n1. Prepare morph rules in source files\n ```php\n ...\n // {{morph}}\n // {{demo}}:{{'lifetime' =\u003e 3600}}\n // {{trial}}:{{'lifetime' =\u003e $this-\u003egetTrialLifetime()}}\n 'lifetime' =\u003e $this-\u003egetLifetime()\n // {{morph}}\n ...\n ```\n\n ```xml\n ...\n \u003c!-- {{morph}}\n {{demo}}:{{\n \u003ccomment\u003eDemo Version\u003c/comment\u003e\n }} --\u003e\n \u003ccomment\u003eFull Version\u003c/comment\u003e\n \u003c!-- {{morph}} --\u003e\n ...\n ```\n\n2. Run the command:\n ```\n php -f path/to/morph.php \"/source/folder\" \"/destination/folder\" demo,trial\n ```\n\n### Morph rules\n1. Code to morph, should be wrapped into {{morph}} placeholders:\n ```\n{{morph}}\noriginal code\n{{morph}}\n ```\n\n2. Specify replacement rules\n ```\n{{morph}}\n{{demo}}:{{demo code}}\n{{trial}}:{{\ntrial code\n}}\noriginal code\n{{morph}}\n ```\n\n3. Supported comments around the morph rules: #, /*, //, \u003c!--\n ```\n// {{morph}}\n/* {{demo}}:{{demo code}}\n{{trial}}:{{\ntrial code\n}} */\noriginal code\n// {{morph}}\n ```\n\n### Speed\nTo speedup the file parsing, you may create the morph.ini file inside your project root\nand specify the rules for CodeMorph.\n```ini\n# files to parse\n[morph_files]\ninclude[] = \"path/to/file1.php\"\ninclude[] = \"path/to/file2.xml\"\nexclude[] = \"*\"\n\n# folders to exclude by iterator\n[iterator]\nexclude[] = \"build\"\nexclude[] = \"node_modules\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvovayatsyuk%2Fcodemorph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvovayatsyuk%2Fcodemorph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvovayatsyuk%2Fcodemorph/lists"}