{"id":19218689,"url":"https://github.com/fadilxcoder/dba-php-packagist","last_synced_at":"2025-09-12T21:48:53.709Z","repository":{"id":147782748,"uuid":"618948774","full_name":"fadilxcoder/dba-php-packagist","owner":"fadilxcoder","description":"PHP DBA Cache - IMD","archived":false,"fork":false,"pushed_at":"2023-03-26T11:24:00.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-21T13:28:30.308Z","etag":null,"topics":["developer-tools","packagist","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/fadilxcoder/in-memory-dba","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/fadilxcoder.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":"2023-03-25T20:15:35.000Z","updated_at":"2023-03-26T11:24:39.000Z","dependencies_parsed_at":"2023-05-27T12:45:07.653Z","dependency_job_id":null,"html_url":"https://github.com/fadilxcoder/dba-php-packagist","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/fadilxcoder%2Fdba-php-packagist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Fdba-php-packagist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Fdba-php-packagist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Fdba-php-packagist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fadilxcoder","download_url":"https://codeload.github.com/fadilxcoder/dba-php-packagist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240292395,"owners_count":19778311,"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":["developer-tools","packagist","php"],"created_at":"2024-11-09T14:27:46.275Z","updated_at":"2025-02-23T09:14:45.938Z","avatar_url":"https://github.com/fadilxcoder.png","language":"PHP","readme":"Fake InMemoryDatabase - PHP DBA Cache\n=======================================\n\n- SF6 - `var/storage/app.db4`\n\n- Usage :\n```php\n...\n    $faker = Faker::create();\n    $db = new InMemoryDatabase();\n    $cache = $db-\u003einitialize();\n\n    foreach (range(1, 5) as $value) {\n        $uuid  = $faker-\u003euuid();\n        # Insert values into cache\n        $cache-\u003eput(\n            $uuid, \n            [\n                'idx' =\u003e $value,\n                'uuid' =\u003e $uuid,\n                'fullname' =\u003e  $faker-\u003ename(),\n                'email' =\u003e $faker-\u003esafeEmail(),\n                'phone' =\u003e $faker-\u003ephoneNumber(),\n                'job' =\u003e $faker-\u003ejobTitle(),\n                'credit_card' =\u003e $faker-\u003ecreditCardType(),\n                'credit_card_number' =\u003e $faker-\u003ecreditCardNumber(),\n                'iban' =\u003e $faker-\u003eiban(),\n            ]\n        );\n        $output-\u003ewriteln([\n            'Account UUID ' . $uuid . '✅'\n        ]);\n    }\n\n    # Update values into cache\n    $content = $cache-\u003eget($uuid);\n    $newArr = [\n        'country_code' =\u003e $faker-\u003ecountryCode(),\n        'currency_code' =\u003e $faker-\u003ecurrencyCode(),\n    ];\n    $cache-\u003eput($uuid, array_merge($content, $newArr));\n\n    dump(\n        $uuid,\n        $content,\n        $cache-\u003ehas($uuid),\n        $cache-\u003eget($uuid),\n        $cache-\u003edelete($uuid),\n        $cache-\u003eget($uuid)\n    );\n\n    # Remove cache file\n    $db-\u003etruncate();\n...\n\n```\n\n```bash\n/var/www/html # php bin/console dba:cache:init\n\nAccount UUID 414dcab8-799c-36ed-95c8-bceceaefa035✅\nAccount UUID 63353b8d-2867-37d1-bbf4-407d28837584✅\nAccount UUID d51007d9-740a-31b4-9342-4589d08b1402✅\nAccount UUID e835c52c-5a9f-3c60-b0c5-cf4c3d96fe14✅\nAccount UUID 35ae48d8-c3fb-3462-99f9-df7cbe0bb872✅\n\n^ \"35ae48d8-c3fb-3462-99f9-df7cbe0bb872\"\n\n^ array:9 [\n  \"idx\" =\u003e 5\n  \"uuid\" =\u003e \"35ae48d8-c3fb-3462-99f9-df7cbe0bb872\"\n  \"fullname\" =\u003e \"Adella Wisozk\"\n  \"email\" =\u003e \"qadams@example.net\"\n  \"phone\" =\u003e \"1-254-667-9320\"\n  \"job\" =\u003e \"Probation Officers and Correctional Treatment Specialist\"\n  \"credit_card\" =\u003e \"Discover Card\"\n  \"credit_card_number\" =\u003e \"5516717022368992\"\n  \"iban\" =\u003e \"AL2184335126V2D02L4B6P9740A2\"\n]\n\n^ true\n\n^ array:11 [\n  \"idx\" =\u003e 5\n  \"uuid\" =\u003e \"35ae48d8-c3fb-3462-99f9-df7cbe0bb872\"\n  \"fullname\" =\u003e \"Adella Wisozk\"\n  \"email\" =\u003e \"qadams@example.net\"\n  \"phone\" =\u003e \"1-254-667-9320\"\n  \"job\" =\u003e \"Probation Officers and Correctional Treatment Specialist\"\n  \"credit_card\" =\u003e \"Discover Card\"\n  \"credit_card_number\" =\u003e \"5516717022368992\"\n  \"iban\" =\u003e \"AL2184335126V2D02L4B6P9740A2\"\n  \"country_code\" =\u003e \"ES\"\n  \"currency_code\" =\u003e \"ZMW\"\n]\n\n^ true\n\n^ false\n\n```\n\n[Click for more information.](https://github.com/gjerokrsteski/php-dba-cache.git)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadilxcoder%2Fdba-php-packagist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffadilxcoder%2Fdba-php-packagist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadilxcoder%2Fdba-php-packagist/lists"}