{"id":22422115,"url":"https://github.com/abumq/residue-php","last_synced_at":"2025-03-27T05:22:50.552Z","repository":{"id":148853229,"uuid":"119530095","full_name":"abumq/residue-php","owner":"abumq","description":"Official PHP client library to interact with residue logging server seamlessly.","archived":false,"fork":false,"pushed_at":"2019-10-25T08:44:10.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T10:27:41.774Z","etag":null,"topics":["logging-library","php","php-library","remote-logging","residue","residue-client"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abumq.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-30T12:02:54.000Z","updated_at":"2024-04-05T22:38:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b27013d-6acb-412e-9ed6-cac6288a9d44","html_url":"https://github.com/abumq/residue-php","commit_stats":null,"previous_names":["abumq/residue-php"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abumq%2Fresidue-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abumq%2Fresidue-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abumq%2Fresidue-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abumq%2Fresidue-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abumq","download_url":"https://codeload.github.com/abumq/residue-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245786716,"owners_count":20671796,"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":["logging-library","php","php-library","remote-logging","residue","residue-client"],"created_at":"2024-12-05T17:11:45.632Z","updated_at":"2025-03-27T05:22:50.534Z","avatar_url":"https://github.com/abumq.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"﷽\n\n# Residue PHP Client\n\nA very simple, secure PHP library to interact with residue seamlessly.\n\nThis library provides interface for connecting and interacting with residue server seamlessly, means, once you are connected this module takes care of expired clients and keep itself updated with latest parameters and ping server when needed to stay alive.\n\n[![Version](https://img.shields.io/github/release/amrayn/residue-php.svg)](https://github.com/amrayn/residue-php/releases/latest) [![GitHub license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/amrayn/residue-php/blob/master/LICENCE)\n\n[![Donate](https://amrayn.github.io/donate.png?v2)](https://amrayn.com/donate)\n\n## Dependencies\nThis library currently depends on following binaries\n\n * `ripe`\n * `nc` (netcat)\n\nPlease check out [sample configuration](/samples/client.conf.json) to find out more\n\n## Progress\nThis library does not currently support following features:\n\n * Unknown clients\n * Plain log request\n * Custom key size\n\n## Config\n\n| **Config** | **Type** | **Description** |\n|------------|----------|-----------------|\n| `url`      | String   | Combination of URI and port of residue server |\n| `application_id`      | String   | Application ID for `%app` format specifier |\n| `rsa_key_size`      | Number   | RSA key size (generated randomly) for unknown clients |\n| `time_offset`      | Number   | Log time offset (in seconds) |\n| `client_id`      | String   | Client ID that server knows this client as |\n| `client_private_key`      | String   | Full path of RSA private key |\n| `client_key_secret`      | String   | Secret (passphrase) for encrypted private key (if any) |\n| `server_public_key`      | String   | Full path to server public key (if any) |\n| `ripe_bin`      | String   | Command to successfully run [ripe](https://github.com/amrayn/ripe) binary using user that will run your PHP script\u003cbr\u003e\u003cbr\u003eProblems occur if the user running the script cannot run `ripe` or `nc` binaries. You may also be interested in following issues on stackexchange network\u003cbr\u003e* [how to set crontab PATH variable](https://unix.stackexchange.com/questions/148133/how-to-set-crontab-path-variable)\u003cbr\u003e* [How to get CRON to call in the correct PATHs](https://stackoverflow.com/questions/2388087/how-to-get-cron-to-call-in-the-correct-paths)\u003cbr\u003e* [How to set cron PATH globally (i.e. for all users) permanently?](https://superuser.com/questions/164394/how-to-set-cron-path-globally-i-e-for-all-users-permanently) |\n| `nc_bin`      | String   | Command to successfully run [nc](https://linux.die.net/man/1/nc) binary using user that will run your PHP script |\n| `session_dir`      | String   | Full path to an empty directory for storing temporary objects by library (e.g, connection params etc). This directory must not contain anything and it may be cleared at times by this library. |\n| `reset_conn`      | Number   | Forcefully resets the connection after this time (in seconds) |\n| `internal_log_file_limit` | Number | Maximum limit (in KB) for internal logging file (stored in `\u003csession_dir\u003e/internal.log`). Defaults to 2048 KB |\n\n### Sample Config\n```\n{\n    \"url\": \"localhost:8777\",\n    \"application_id\": \"com.amrayn.residue.php.sampleapp\",\n    \"rsa_key_size\": 2048,\n    \"time_offset\": 0,\n    \"client_id\": \"muflihun00102030\",\n    \"client_private_key\": \"keys/muflihun00102030.pem\",\n    \"client_key_secret\": \"\",\n    \"server_public_key\": \"keys/server.pub.pem\",\n    \"ripe_bin\": \"ripe\",\n    \"nc_bin\": \"nc\",\n    \"session_dir\": \"/tmp/resphp/\",\n    \"reset_conn\": 120,\n    \"internal_log_file_limit\": 2048\n}\n```\n## Usage\n```\n// initialize only once in the beginning of the script\n\\residue\\Residue::init(\"/path/to/client.conf.json\");\n\n$logger = new \\residue\\Logger(\"sample-app\");\n\n// we're all set! (if everything was good in client.conf.json file)\n\n$logger-\u003edebug(\"another\");\n\n// array\n$logger-\u003einfo([1, 2]);\n\n// object\n$logger-\u003einfo(\"blah %s this\", $myCar);\n\n// number\n$logger-\u003einfo(1234);\n$logger-\u003einfo(1234.233);\n\n// formatted (see http://php.net/manual/en/function.sprintf.php)\n$logger-\u003einfo(\"test %s %s\", 1, 2);\n\n\n// verbose log\n$logger-\u003everbose(9, \"this is msg %d ---\", 123);\n\n```\n\n## License\n```\nCopyright 2017-present Amrayn Web Services\nCopyright 2017-present @abumusamq\n\nhttps://github.com/amrayn/\nhttps://muflihun.com\nhttps://amrayn.com\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabumq%2Fresidue-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabumq%2Fresidue-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabumq%2Fresidue-php/lists"}