{"id":37014299,"url":"https://github.com/dan-leech/moodle-php-sdk","last_synced_at":"2026-01-14T01:25:03.833Z","repository":{"id":56961650,"uuid":"246270477","full_name":"dan-leech/moodle-php-sdk","owner":"dan-leech","description":"Unofficial SDK for Moodle REST APIs written in PHP","archived":false,"fork":true,"pushed_at":"2020-03-13T21:36:44.000Z","size":110,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-21T21:32:44.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"visol-forks/moodle-php-sdk","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dan-leech.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}},"created_at":"2020-03-10T10:23:36.000Z","updated_at":"2021-12-02T10:20:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dan-leech/moodle-php-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dan-leech/moodle-php-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-leech%2Fmoodle-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-leech%2Fmoodle-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-leech%2Fmoodle-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-leech%2Fmoodle-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dan-leech","download_url":"https://codeload.github.com/dan-leech/moodle-php-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-leech%2Fmoodle-php-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-14T01:25:03.218Z","updated_at":"2026-01-14T01:25:03.827Z","avatar_url":"https://github.com/dan-leech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moodle-PHP-SDK\nPHP SDK for Moodle RESTful APIs\n\n[![Build Status](https://travis-ci.org/agurodriguez/moodle-php-sdk.svg?branch=master)](https://travis-ci.org/agurodriguez/moodle-php-sdk)\n\n## Getting Started\n\n1. Install MoodleSDK\n\n    ```\n    php composer.phar require agurz/moodle-php-sdk\n    ```\n\n2. Create a `RestApiContext` instance\n\n    ```php\n    $context = new RestApiContext();\n    $context-\u003esetUrl('example.com/moodle')\n            -\u003esetCredential(new AuthTokenCredential('token'))\n    ```\n                \n3. Create a model object instance, set it's properties and call `get`, `create`, `update`, or `delete` operations\n\n    ```php\n    $user = new User();\n    $user-\u003esetUsername('username')\n         -\u003esetPassword('Password..01')\n         -\u003esetFirstName('first')\n         -\u003esetLastName('last')\n         -\u003esetFullName('first last')\n         -\u003esetEmail('test@example.com')\n         -\u003ecreate($context)\n    ```\n\n4. That's all!\n\n## Usage example\n\n### Creating a user and enrolling him into 'test-course' course\n\n```php\n\u003c?php\n\nrequire_once 'vendor/autoload.php';\n\nuse MoodleSDK\\Api\\Model\\Course;\nuse MoodleSDK\\Api\\Model\\User;\nuse MoodleSDK\\Auth\\AuthTokenCredential;\nuse MoodleSDK\\Rest\\RestApiContext;\n\n$context = RestApiContext::instance()\n                         -\u003esetUrl('example.com/moodle')\n                         -\u003esetCredential(new AuthTokenCredential('token'))\n\n$user = User::instance()\n            -\u003esetUsername('agurz')\n            -\u003esetPassword('Password..01')\n            -\u003esetFirstName('Agustn')\n            -\u003esetLastName('Rodríguez')\n            -\u003esetFullName('Agustn Rodríguez')\n            -\u003esetEmail('test@example.com')\n            -\u003ecreate($context);\n\n$course = Course::instance()\n                -\u003esetShortName('test-course')\n                -\u003eget($context)\n                -\u003eenrolUser($context, $user);\n```\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan-leech%2Fmoodle-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdan-leech%2Fmoodle-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan-leech%2Fmoodle-php-sdk/lists"}