{"id":15735061,"url":"https://github.com/icanhazstring/tempa-php","last_synced_at":"2025-03-13T06:31:54.374Z","repository":{"id":43270345,"uuid":"77690100","full_name":"icanhazstring/tempa-php","owner":"icanhazstring","description":"Template file parsing library","archived":false,"fork":false,"pushed_at":"2023-02-21T10:27:28.000Z","size":86,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-25T21:38:28.878Z","etag":null,"topics":["php","substitute","tempa-php","template"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icanhazstring.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-30T14:13:50.000Z","updated_at":"2023-02-21T08:50:46.000Z","dependencies_parsed_at":"2024-10-25T00:15:25.597Z","dependency_job_id":"7816f7f6-50a3-4589-a637-7bb3e0ff91e9","html_url":"https://github.com/icanhazstring/tempa-php","commit_stats":{"total_commits":34,"total_committers":4,"mean_commits":8.5,"dds":0.2647058823529411,"last_synced_commit":"83878c25d2ac5156bfa4deb0dd357132df5400ee"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Ftempa-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Ftempa-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Ftempa-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Ftempa-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icanhazstring","download_url":"https://codeload.github.com/icanhazstring/tempa-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243357648,"owners_count":20277988,"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":["php","substitute","tempa-php","template"],"created_at":"2024-10-04T01:08:15.477Z","updated_at":"2025-03-13T06:31:53.694Z","avatar_url":"https://github.com/icanhazstring.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# icanhazstring/tempa-php\n\n[![Build Status](https://api.travis-ci.org/icanhazstring/tempa-php.svg?branch=master)](https://travis-ci.org/icanhazstring/tempa-php)\n\n## What for?\nYou all came across some `*.dist` or `*.skel` files of some sort. This library can be used to replace every existing substitute in those files as well as simply list them.\n\n## Install\nTo install this library simply use composer.\n```bash\n$ composer require icanhazstring/tempa-php\n```\n\nAfter you have done this you need to create a `tempa.json` file inside you project. This file holds some basic information about the template files.\n\nHere is an example\n```json\n{\n  \"fileExtensions\": [\"dist\", \"skel\"],\n  \"prefix\": \"{$\",\n  \"suffix\": \"}\"\n}\n```\n\n## Usage\n\n### Scan\nYou can scan a directory or single file using the scan command.\n\n```bash\n$ vendor/bin/tempa file:scan \u003cdir\u003e [\u003cconfig\u003e]\n```\n\nYou can deliver every other config you want. By default the script will take the `tempa.json` from the location you executed the script.\n\n```bash\n$ vendor/bin/tempa file:scan test/Demo\n$ vendor/bin/tempa file:scan test/Demo test/Demo/tempa.json\n\nScanning for template files in: /home/icanhazstring/tempa-php/test/Demo\n=======================================================================\n\n 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%\n\n\n/home/ando/tempa-php/test/Demo/Sub/test.php.dist\n------------------------------------------------\n\nLine 3 : 'database' =\u003e '{$database}',\nLine 4 : 'username' =\u003e '{$user}'\n\n/home/ando/tempa-php/test/Demo/test.php.dist\n--------------------------------------------\n\nLine 3 : 'placeholder' =\u003e '{$superAwesome}'\n```\n\n### Substitute\n\nTo replace stuff run the following:\n\n```bash\n$ vendor/bin/tempa file:substitute [-f|--mapfile [MAPFILE]] [--] \u003cdir\u003e [\u003cconfig\u003e] [\u003cmap\u003e]... \n```\n\n```bash\n$ vendor/bin/tempa file:substitute test/Demo/\n$ vendor/bin/tempa file:substitute test/Demo/ --mapfile=test/Demo/maps/map.[json|php]\n$ vendor/bin/tempa file:substitute test/Demo/ test/Demo/tempa.json database=localhost user=icanhazstring superAwesome=mega \n\nProcessing template files in: /home/icanhazstring/tempa-php/test/Demo\n=====================================================================\n\n 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%\n```\n\n### Interactive\n\nYou can replace every with an interactive mode:\n\n```bash\n$ vendor/bin/tempa file:interactive test/Demo\n$ vendor/bin/tempa file:interactive test/Demo test/Demo/tempa.json\n\n\nInteractive substitution for template files in: /home/icanhazstring/tempa-php/test/Demo\n=======================================================================================\n\nFound 3 substitutes\n-------------------\n\ndatabase:\n\u003e\n\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficanhazstring%2Ftempa-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficanhazstring%2Ftempa-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficanhazstring%2Ftempa-php/lists"}