{"id":15350795,"url":"https://github.com/grobmeier/cicada","last_synced_at":"2025-10-25T01:40:45.434Z","repository":{"id":12393401,"uuid":"15046048","full_name":"grobmeier/cicada","owner":"grobmeier","description":"Cicada lightweight php framework","archived":false,"fork":false,"pushed_at":"2017-05-09T12:41:03.000Z","size":484,"stargazers_count":7,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-09-28T04:53:35.363Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grobmeier.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-09T11:57:19.000Z","updated_at":"2023-12-22T03:28:59.000Z","dependencies_parsed_at":"2022-08-26T16:02:03.594Z","dependency_job_id":null,"html_url":"https://github.com/grobmeier/cicada","commit_stats":null,"previous_names":["cicada/cicada"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/grobmeier/cicada","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobmeier%2Fcicada","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobmeier%2Fcicada/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobmeier%2Fcicada/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobmeier%2Fcicada/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grobmeier","download_url":"https://codeload.github.com/grobmeier/cicada/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobmeier%2Fcicada/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280893645,"owners_count":26409279,"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-10-24T02:00:06.418Z","response_time":73,"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":[],"created_at":"2024-10-01T11:59:15.259Z","updated_at":"2025-10-25T01:40:45.417Z","avatar_url":"https://github.com/grobmeier.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cicada\n======\n\nA micro framework for creating traditional or REST-like web applications.\n\n[![Latest Stable Version](https://poser.pugx.org/cicada/cicada/v/stable.png)](https://packagist.org/packages/cicada/cicada) [![Total Downloads](https://poser.pugx.org/cicada/cicada/downloads.png)](https://packagist.org/packages/cicada/cicada) [![Build Status](https://travis-ci.org/cicada/cicada.png)](https://travis-ci.org/cicada/cicada) [![Coverage Status](https://coveralls.io/repos/cicada/cicada/badge.png)](https://coveralls.io/r/cicada/cicada) [![License](https://poser.pugx.org/cicada/cicada/license.png)](https://packagist.org/packages/cicada/cicada)\n\nInstallation\n------------\n\nAdd Cicada as a requirement for your project via Composer:\n\n```\ncomposer require \"cicada/cicada=@stable\"\n```\n\nUsage\n-----\n\nMinimal application:\n\n```php\nrequire '../vendor/autoload.php';\n\nuse Cicada\\Application;\n\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\n\n$app = new Application();\n\n// Add a route\n$app-\u003eget('/hello/{name}', function (Application $app, Request $request, $name) {\n    return new Response(\"Hello $name\");\n});\n\n$app-\u003erun();\n```\n\nThis application has one route which will match GET requests starting with\n`/hello/` and will forward the matched `{name}` into the callback function as\n`$name`.\n\nThe callback function should return a\n[Response](http://symfony.com/doc/current/components/http_foundation/introduction.html#response)\nobject. If it returns a string, it will implicitly be converted into a Response.\n\n\nHandling exceptions\n-------------------\n\nIt is possible that route callbacks throw an exception. By default, Cicada will\nin this case return a HTTP 500 response (Internal Server Error). However, it\nis possible to add exception handlers which will intercept specific exceptions\nand return an appropriate response.\n\nFor example, if you want to catch a custom NotImplementedException and return a\ncustom error message:\n\n```php\n$app-\u003eexception(function (NotImplementedException $ex) {\n    $msg = \"Dreadfully sorry, old chap, but tis' not implemented yet.\";\n    return new Response($msg, Response::HTTP_INTERNAL_SERVER_ERROR);\n});\n```\n\nThe callback function passed to `$app-\u003eexception()` must have a single argument\nand that argument must have a class type hint which denotes the exception class\nwhich it will handle.\n\nIt's possible to specify multiple exception handlers and they will be tried in\norder in which they were specified:\n\n```php\n$app-\u003eexception(function (SomeException $ex) {\n    return new Response(\"Arrrghhhhh\", Response::HTTP_INTERNAL_SERVER_ERROR);\n});\n\n\n$app-\u003eexception(function (OtherException $ex) {\n    return new Response(\"FFFFUUUUUUU...\", Response::HTTP_INTERNAL_SERVER_ERROR);\n});\n\n// If all else fails, this will catch any exceptions\n$app-\u003eexception(function (Exception $ex) {\n    $msg =\"Something went wrong. The incident has been logged and our code monkeys are on it.\";\n    return new Response($msg, Response::HTTP_INTERNAL_SERVER_ERROR);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrobmeier%2Fcicada","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrobmeier%2Fcicada","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrobmeier%2Fcicada/lists"}