{"id":22797746,"url":"https://github.com/vatesfr/tequila","last_synced_at":"2025-03-30T18:40:34.932Z","repository":{"id":5388120,"uuid":"6576473","full_name":"vatesfr/tequila","owner":"vatesfr","description":null,"archived":false,"fork":false,"pushed_at":"2013-05-15T07:36:01.000Z","size":296,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-05T21:01:16.781Z","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/vatesfr.png","metadata":{"files":{"readme":"README.markdown","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":"2012-11-07T09:04:48.000Z","updated_at":"2014-02-02T17:36:06.000Z","dependencies_parsed_at":"2022-07-08T00:10:28.596Z","dependency_job_id":null,"html_url":"https://github.com/vatesfr/tequila","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vatesfr%2Ftequila","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vatesfr%2Ftequila/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vatesfr%2Ftequila/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vatesfr%2Ftequila/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vatesfr","download_url":"https://codeload.github.com/vatesfr/tequila/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246365638,"owners_count":20765546,"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-12-12T06:06:56.461Z","updated_at":"2025-03-30T18:40:34.898Z","avatar_url":"https://github.com/vatesfr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\n_Tequila_ is a basic PHP shell.\n\nIt currently has only one feature: instantiating objects and calling methods on\nthem.\n\nIt seems small but is in fact enough to have a very a functioning shell with\nvarious utility classes.\n\n# Syntax\n\nA basic command has the following format:\n\n\tclass method arg1 ... argN # Comment\n\nWhere each of this entries (except the comment) can be:\n\n- a boolean value (`true` or `false`, case insensitive);\n- the null value (`null`, case insensitive);\n- a string;\n- a variable;\n- a nested command.\n\n## String formats\n\nThere is 3 formats which aim to be enough for any use.\n\nThe first and simplest is _plain_: only alphanumerics, **/**, **-**, **_**,\n**.** and escaped sequences are allowed, but they are very light to type and\ntherefore much used for classes and methods names.\n\n\tthis\\ is\\ a\\ plain\\ string\n\nThe second one is the _quoted_ format which provides an easy way to type much\nstrings. They start and end with a quote (**\"**), every characters are allowed\nbut quotes and backslashes must be escaped, you even may use escaped sequences.\n\n\t\"This is a quoted string\"\n\nThe last one is _raw_ and allows the user to type raw string very easily without\nneeding to escape special characters. They start with a percent sign (**%**)\nfollowed by a start delimiter which can be anything but an alphanumeric, a space\nor a control character, and they end with the same character except for **(**,\n**[**, **{** and **\u003c** where it is the opposite (respectively **)**, **]**,\n**}** and **\u003e**). Thus you may use the character which suits the best your\nstring. Please note that matching pairs inside the string are ignored.\n\n\t%{A raw string}\n\t%(Backslashes do not need to be escaped \\, and nested pairs are allowed.)\n\nEscaped sequences:\n\n- \\n: New line\n- \\r: Carriage return\n- \\t: Tabulation\n- \\\\: Backslash itself\n- \\\": Quote (only for quoted strings)\n- \\ : Space (only for naked strings)\n\n## Variables\n\nVariables associate a identifier to a value.\n\nAn identifier is a string which conforms to the following regular expression\n`/[a-z0-9_]+/i`.\n\nA variable starts with a dollar sign (**$**) followed by its identifier.\n\n\tclass method $my_variable\n\n## Nested commands\n\nNested commands are mainly used to add dynamicity to scripts but can very handy\nin many other situations.\n\nA nested command starts with a dollar sign followed by a left parenthesis\n(**$(**) and ends with a right parenthesis (**)**).\n\n\tclass1 method $(class2 method)\n\n# Architecture\n\n## Run sequence\n\n### Bootstrapping\n\nThe `tequila` script is executed, it\n\n1. sets the include path;\n2. loads Gallic if necessary and configures it (used for class loading);\n3. instantiates a new `Tequila` object;\n4. uses the configuration file to… configure Tequila;\n5. calls `Tequila::start()`.\n\n### Input loop\n\n`Tequila::start()` runs a loop which reads and executes commands until it is\nasked to stop.\n\n1. It ensures it was not already running, otherwise throws an exception.\n2. While it is running it:\n   1. asks for a command to execute with `Tequila::prompt($prompt)`;\n   2. if not empty it is pushed on the history;\n   3. calls `Tequila::executeCommand($command)`;\n   3. if there was an error, prints it, otherwise prints the return value if not\n      `null`.\n\n### Command execution\n\n`Tequila::executeCommand($command)`\n\n1. parses the given command if necessary with `Tequila::parseCommand($command)`;\n2. executes all nested commands (with itself);\n3. executes the command with `Tequila::execute($class, $method, $args)`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvatesfr%2Ftequila","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvatesfr%2Ftequila","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvatesfr%2Ftequila/lists"}