{"id":17579219,"url":"https://github.com/miguelvis/sira","last_synced_at":"2025-09-13T19:45:27.358Z","repository":{"id":69296435,"uuid":"77633697","full_name":"MiguelVis/SiRA","owner":"MiguelVis","description":"Very simple framework to build light-weight REST APIs under PHP.","archived":false,"fork":false,"pushed_at":"2018-11-28T21:38:52.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-26T16:49:05.007Z","etag":null,"topics":["rest-api"],"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/MiguelVis.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-29T19:02:00.000Z","updated_at":"2019-11-03T18:24:29.000Z","dependencies_parsed_at":"2023-07-01T23:01:19.054Z","dependency_job_id":null,"html_url":"https://github.com/MiguelVis/SiRA","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MiguelVis/SiRA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelVis%2FSiRA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelVis%2FSiRA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelVis%2FSiRA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelVis%2FSiRA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MiguelVis","download_url":"https://codeload.github.com/MiguelVis/SiRA/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelVis%2FSiRA/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275020126,"owners_count":25391649,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["rest-api"],"created_at":"2024-10-22T00:44:06.932Z","updated_at":"2025-09-13T19:45:27.320Z","avatar_url":"https://github.com/MiguelVis.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"SiRA : Simple REST Api\n======================\n\nSiRA is a very simple framework to build light-weight REST APIs under PHP.\n\nCurrently, only replies data in JSON format, but it should be trivial to add support for other formats, like XML.\n\n\nEntry Point\n-----------\n\nAll requests to SiRA are done via the sira.php file.\n\nSiRA assumes you are using URL rewriting (see the included .htaccess file for more details).\n\nA GET request, could look something like this:\n\n`http://localhost/sira/customer?name=FloppySoftware`\n\nor:\n\n`http://www.myhost.com/api/v1/customer?name=FloppySoftware`\n\n\nConfiguration\n-------------\n\nSiRA configuration is defined in the config.php file - ie:\n\n```php\n$CFG_SIRA = array(\n\t'http_basic_auth' =\u003e true,\n\t'users' =\u003e array(\n\t\t'user' =\u003e 'password',\n\t\t'anotherUser' =\u003e 'anotherPassword'\n\t),\n\t'resources' =\u003e array(\n\t\t'test' =\u003e array(\n\t\t\t'folder' =\u003e 'res_test',\n\t\t\t'get'    =\u003e 'test_get',\n\t\t\t'put'    =\u003e 'test_put',\n\t\t\t'post'   =\u003e 'test_post',\n\t\t\t'delete' =\u003e 'test_delete'\n\t\t),\n\t\t'info' =\u003e array(\n\t\t\t'folder' =\u003e 'res_info',\n\t\t\t'get'    =\u003e 'info_get'\n\t\t)\n\t)\n);\n```\n\n\nHTTP Basic Authentication\n-------------------------\n\nSiRA supports HTTP Basic authentication. Just enable it in the configuration - ie:\n\n```php\n$CFG_SIRA = array(\n\t'http_basic_auth' =\u003e true,\n\t'users' =\u003e array(\n\t\t'user' =\u003e 'password',\n\t\t'anotherUser' =\u003e 'anotherPassword'\n\t)\n);\n```\n\n\nREST Controllers\n----------------\n\nResource controllers are defined in the configuration, and take the form:\n\n```php\n$CFG_SIRA = array(\n\t'resources' =\u003e array(\n\t\t'test' =\u003e array(\n\t\t\t'folder' =\u003e 'res_test',\n\t\t\t'get'    =\u003e 'test_get',\n\t\t\t'put'    =\u003e 'test_put',\n\t\t\t'post'   =\u003e 'test_post',\n\t\t\t'delete' =\u003e 'test_delete'\n\t\t),\n\t\t'info' =\u003e array(\n\t\t\t'folder' =\u003e 'res_info',\n\t\t\t'get'    =\u003e 'info_get'\n\t\t)\n\t)\n);\t\n```\n\nAs you can see, `test` and `info` are two resources. The field `folder` defines the directory\nwhere is located the corresponding resource. The fields `get`, `put`, `post` and\n`delete`, define the HTTP methods that are supported by the resource, and contain the name of the\ncorresponding PHP file (and the function, see below).\n\nFollowing the example above, we will have the following folder structure:\n\n```\nsira/\n\tres_test/\n\t\ttest_get.php\n\t\ttest_put.php\n\t\ttest_post.php\n\t\ttest_delete.php\n\tres_info\n\t\tinfo_get.php\n\t...\n```\n\nIn the test_get.php file, we will have something like this:\n\n```php\nfunction test_get($params)\n{\n\t$reply = array(\n\t\t'reply' =\u003e 'Hello from test_get()'\n\t);\n\t\n\treturn $reply;\n}\n```\n\nAnd so on.\n\n\nAuthor\n------\n\n(c) 2016-2018 Miguel Garcia / FloppySoftware.\n\nhttp://www.floppysoftware.es\n\nfloppysoftware@gmail.com\n\n\nLicense\n-------\n\nSiRA is released under the GNU Public License v3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelvis%2Fsira","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiguelvis%2Fsira","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelvis%2Fsira/lists"}