{"id":18803088,"url":"https://github.com/nabeelalihashmi/lightcache","last_synced_at":"2026-01-05T11:30:17.725Z","repository":{"id":38892034,"uuid":"504907852","full_name":"nabeelalihashmi/LightCache","owner":"nabeelalihashmi","description":"Simple and Fast Files based PHP Caching Library.","archived":false,"fork":false,"pushed_at":"2022-06-23T18:40:49.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-29T20:22:54.579Z","etag":null,"topics":["cache","php-cache","php-caching","php-library"],"latest_commit_sha":null,"homepage":"","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/nabeelalihashmi.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":"2022-06-18T17:26:38.000Z","updated_at":"2022-06-19T08:31:34.000Z","dependencies_parsed_at":"2022-09-18T17:03:14.443Z","dependency_job_id":null,"html_url":"https://github.com/nabeelalihashmi/LightCache","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeelalihashmi%2FLightCache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeelalihashmi%2FLightCache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeelalihashmi%2FLightCache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeelalihashmi%2FLightCache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabeelalihashmi","download_url":"https://codeload.github.com/nabeelalihashmi/LightCache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239735259,"owners_count":19688262,"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":["cache","php-cache","php-caching","php-library"],"created_at":"2024-11-07T22:33:02.500Z","updated_at":"2026-01-05T11:30:17.692Z","avatar_url":"https://github.com/nabeelalihashmi.png","language":"PHP","readme":"![LightCache](./docs/header.png)\n\n# LightCache\n\nA Fast, Easy and FileSystem based Cache for PHP.\n## About Author\n[Nabeel Ali](https://iconiccodes.com)\n\nWebsite: [https://iconiccodes.com](https://iconiccodes.com)\n\nEmail: [mail2nabeelali@gmail.com](mailto:mail2nabeelali@gmail.com)\n\n## Features\n\n    * Fast\n    * Easy\n    * Lightweight\n    * Supports Expiration\n\n\n## Installtion\n```\ncomposer require nabeelalihashmi/LightCache\n```\n\n## Basic Usage\n```\n$cache = new IconicCodes\\LightCache\\FilesCache;\n$cache-\u003ecachedir = __DIR__ . \"/cache\";\n\n$cache-\u003eget('key', function () {\n    return [\"value\", time() + 10]; // cache for 10 seconds\n});\n\n$cache-\u003edelete('key');\n\n```\n\n## Methods\n\n* `get`\n* `getValue`\n* `has`\n* `delete`\n* `set`\n\n### get($key, $callback)\nReturns the value of the key. If the key is not found, the callback will be called and the value will be cached. If the key is found, the callback will not be called. The callback shall return an array with the value and the expiration time.\n\n```\n$cache-get('key', function() {\n    return [\"value\", time() + 10]; // cache for 10 seconds\n});\n```\n\nThis is probably most used function.\n\n### getValue($key)\nReturn value if key exists or cache is not exired. If key does not exist, returns false. If cache is expired, returns false.\n\n### has($key)\nReturns true if key exists. Doesn't check cache expiration.\n\n### delete($key)\nDeletes key from cache. This is probably the second most used function.\n\n## set($key, $value, $expiration)\nSets the value of the key. The expiration time is optional. If not set, the value will be cached for ever.\n\n-------------------------\n\n## License\n\nLightCache is released under permissive licese with following conditions:\n\n* It cannot be used to create adult apps.\n* It cannot be used to gambling apps.\n* It cannot be used to create apps having hate speech.\n\n### MIT License\n\nCopyright 2022 Nabeel Ali | IconicCodes.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabeelalihashmi%2Flightcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabeelalihashmi%2Flightcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabeelalihashmi%2Flightcache/lists"}