{"id":23479495,"url":"https://github.com/plinker-rpc/core","last_synced_at":"2025-07-11T07:37:55.042Z","repository":{"id":57042716,"uuid":"103975908","full_name":"plinker-rpc/core","owner":"plinker-rpc","description":"Plinker PHP RPC client/server makes it really easy to link and execute generic PHP components on remote systems, while maintaining the feel of a local method call.","archived":false,"fork":false,"pushed_at":"2022-08-16T19:20:38.000Z","size":2230,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T08:15:51.782Z","etag":null,"topics":["composer-package","php","plinker-rpc"],"latest_commit_sha":null,"homepage":"https://plinker-rpc.github.io/core/","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/plinker-rpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-18T18:25:15.000Z","updated_at":"2022-08-16T18:09:42.000Z","dependencies_parsed_at":"2022-08-23T23:40:25.222Z","dependency_job_id":null,"html_url":"https://github.com/plinker-rpc/core","commit_stats":null,"previous_names":[],"tags_count":88,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinker-rpc%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinker-rpc%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinker-rpc%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinker-rpc%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plinker-rpc","download_url":"https://codeload.github.com/plinker-rpc/core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248758435,"owners_count":21156957,"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":["composer-package","php","plinker-rpc"],"created_at":"2024-12-24T19:29:53.674Z","updated_at":"2025-04-13T17:59:11.288Z","avatar_url":"https://github.com/plinker-rpc.png","language":"PHP","funding_links":["https://www.paypal.me/lcherone"],"categories":[],"sub_categories":[],"readme":"**PlinkerRPC - Core**\n=========\n\n[![Build Status](https://travis-ci.org/plinker-rpc/core.svg?branch=master)](https://travis-ci.org/plinker-rpc/core)\n[![StyleCI](https://styleci.io/repos/103975908/shield?branch=master)](https://styleci.io/repos/103975908)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/plinker-rpc/core/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/plinker-rpc/core/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/plinker-rpc/core/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/plinker-rpc/core/code-structure/master/code-coverage)\n[![Packagist Version](https://img.shields.io/packagist/v/plinker/core.svg?style=flat-square)](https://github.com/plinker-rpc/core/releases)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/plinker/core.svg?style=flat-square)](https://packagist.org/packages/plinker/core)\n\nPlinkerRPC PHP client/server makes it really easy to link and execute generic PHP components on remote systems, while maintaining the feel of a local method call.\n\n**Docs:** [https://plinker-rpc.github.io/core](https://plinker-rpc.github.io/core)\n\n**New changes in version 3 include:**\n\n - Now compaible with [PHP extension](https://github.com/plinker-rpc/php-ext).\n - Built-in core components and info method added so components can be discovered.\n - Only one client instance is now needed, made use of __get() to dynamically set component.\n - User defined components/classes, so you can call your own code.\n - Both request and response is encrypted and signed.\n\n## Install\n\nRequire this package with composer using the following command:\n\n``` bash\n$ composer require plinker/core\n```\n\n### Additional Setup\n\nThis component does not require any additional setup.\n\n## Client\n\nCreating a client instance is done as follows:\n\n\n    \u003c?php\n    require 'vendor/autoload.php';\n\n    /**\n     * Initialize plinker client.\n     *\n     * @param string $server - URL to server listener.\n     * @param string $config - server secret, and/or a additional component data\n     */\n    $client = new \\Plinker\\Core\\Client(\n        'http://example.com/server.php',\n        [\n            'secret' =\u003e 'a secret password',\n        ]\n    );\n    \n    // or using global function\n    $client = plinker_client('http://example.com/server.php', 'a secret password');\n    \n\n## Server\n\nCreating a server listener is done as follows:\n\n**Optional features:**\n\n - Set a secret, which all clients will require. \n - Lock down to specific client IP addresses for addtional security.\n - Define your own classes in the `classes` array then access like above `$client-\u003eclass-\u003emethod()`, which can interface out of scope components or composer packages.\n - Define addtional key values for database connections etc, or you could pass the parameters through the client connection.\n\n\u003c!-- after list code block fix --\u003e\n\n    \u003c?php\n    require 'vendor/autoload.php';\n\n    /**\n     * Initialize plinker server.\n     */\n    if (isset($_SERVER['HTTP_PLINKER'])) {\n        // init plinker server\n        echo (new \\Plinker\\Server([\n            'secret' =\u003e 'a secret password',\n            'allowed_ips' =\u003e [\n                '127.0.0.1'\n            ],\n            'classes' =\u003e [\n                'test' =\u003e [\n                    // path to file\n                    'classes/test.php',\n                    // addtional key/values\n                    [\n                        'key' =\u003e 'value'\n                    ]\n                ],\n                // you can use namespaced classes\n                'Foo\\\\Demo' =\u003e [\n                    // path to file\n                    'some_class/demo.php',\n                    // addtional key/values\n                    [\n                        'key' =\u003e 'value'\n                    ]\n                ],\n                // ...\n            ]\n        ]))-\u003elisten();\n    }\n    \n\n## Methods\n\nOnce setup, you call the class though its namespace to its method.\n\n\n### Info\n\nThe info method returns defined endpoint methods and their parameters.\n\n**Call**\n\n\n```\n$result = $client-\u003einfo();\n```\n\n**Response**\n```\nArray\n(\n    [class] =\u003e Array\n        (\n            [Foo\\Demo] =\u003e Array\n                (\n                    [config] =\u003e Array\n                        (\n                            [key] =\u003e value\n                        )\n\n                    [methods] =\u003e Array\n                        (\n                            [config] =\u003e Array\n                                (\n                                )\n\n                            [this] =\u003e Array\n                                (\n                                )\n\n                            [test] =\u003e Array\n                                (\n                                    [0] =\u003e x\n                                    [1] =\u003e y\n                                )\n\n                        )\n\n                )\n\n        )\n\n)\n```\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/plinker-rpc/core/blob/master/CONTRIBUTING) for details.\n\n## Security\n\nIf you discover any security related issues, please contact me via [https://cherone.co.uk](https://cherone.co.uk) instead of using the issue tracker.\n\n## Credits\n\n- [Lawrence Cherone](https://github.com/lcherone)\n- [All Contributors](https://github.com/plinker-rpc/core/graphs/contributors)\n\n\n## Development Encouragement\n\nIf you use this code and make money from it and want to show your appreciation,\nplease feel free to make a donation [https://www.paypal.me/lcherone](https://www.paypal.me/lcherone), thanks.\n\n## Sponsors\n\nGet your company or name listed here.\n\n## License\n\nThe MIT License (MIT). Please see [License File](https://github.com/plinker-rpc/core/blob/master/LICENSE) for more information.\n\nSee [organisations page](https://github.com/plinker-rpc) for additional components.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplinker-rpc%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplinker-rpc%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplinker-rpc%2Fcore/lists"}