GithubHelp home page GithubHelp logo

moodlerest's Introduction

Hello! My name is Lawrence 🤓, and I am a ✨software developer✨ 🖥️


Let me start with some of my favorite things. My #1 author is Isaac Asimov 📚. I read many of his novels and short stories. I love science 🪐 and I am a curious person. I like many TV shows 🎬 like Star Trek, Lost, Breaking Bad and Cosmos.

But we are here to talk about my skillset. Althought my focus is backend development I have frontend skills too. Let's see some of my coding preferences:

Backend development

       🐘  PHP

         Laravel

       ⛪  Blade and Smarty template systems

Frontend development

         Javascript

         HTML

         CSS

         Tailwind CSS

         jQuery (but I prefer JS native)

Databases

        🐬  MySQL and 🦭  MariaDB

          Oracle

        🪶  SQLite


To be brief, I use many tools commonly used in development, like GIT, SSH and Docker. About operating systems I prefer Linux, but work with Windows too. I already installed and configured many web servers with Apache, PHP and MySQL/MariaDB. And I love to learn new technologies.

Let's not extend this talk anymore. Go, look at some goodies I made opensource.

moodlerest's People

Contributors

llagerlof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodlerest's Issues

Request to call before core_user_get_course_user_profiles

Hello, I'm using it from your example :

$MoodleRest = new MoodleRest();
$MoodleRest->setServerAddress("http://$ip/$moodle_folder/webservice/rest/server.php");
$MoodleRest->setToken($token);
$MoodleRest->setReturnFormat(MoodleRest::RETURN_ARRAY);

$result1 = $MoodleRest->request('core_group_get_groups', array('groupids' => array(1,2))); // groupids[0]=1&groupids[1]=2

echo "result1:\n" . print_r($result1, true);
$params = array('userlist' => array(array('userid' => 3, 'courseid' => 3), array('userid' => 5, 'courseid' => 3))); //userlist[0][userid]=5&userlist[1][userid]=4&userlist[0][courseid]=2&userlist[1][courseid]=2

$result2 = $MoodleRest->request('core_user_get_course_user_profiles', $params);

echo "result2:\n" . print_r($result2, true);
die();

what I get back is "Array ( [exception] => webservice_access_exception [errorcode] => accessexception [message] => Exception du contrôle d'accès"
it's about not having access to core_user_get_course_user_profiles which is a login-required fonction.

What I have to call before this request ?

invalid argument error

hi
i want to use this function core_course_get_courses_by_field
and send request with examlpe2 in this package doc.
$MoodleRest->request('core_course_get_courses_by_field', array( array('field'=>'idnumber','value'=>'111111111')), \MoodleRest::METHOD_GET);

and then get error invalid argument.
everyone can help me ...
Thank you in advance

Error in file_get_contents

I have performed a test according to the code below

`<?php

require_once "MoodleRest.php";

$parameters = array('userlist' => array(array('userid' => 13, 'courseid' => 2), array('userid' => 13, 'courseid' => 2)));

$json = (new MoodleRest())->setServerAddress("http://dev.moodle.local/webservice/rest/server.php")->setToken('f0bb33743851adc4c2475240787c07b0')->setReturnFormat(MoodleRest::RETURN_JSON)->request('core_user_get_course_user_profiles', $parameters);

echo $json;`

And I got the following error

image

Can you help me?

file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

Hi my man! after all, thank you for this lib, it's very useful, btw, I found this error:


A PHP Error was encountered

Severity: Warning

Message: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

Filename: moodlerest/MoodleRest.php

Line Number: 437

Backtrace:

File: /var/www/html/moogesdev/vendor/llagerlof/moodlerest/MoodleRest.php
Line: 437
Function: file_get_contents 

I'd fix it with the following code:

if ($this->getMethod() != self::METHOD_POST) {
            // GET
            //$moodle_request = file_get_contents($this->getUrl(false));
            $arrContextOptions=array(
                "ssl"=>array(
                    "verify_peer"=>false,
                    "verify_peer_name"=>false,
                ),
            );  
          $moodle_request = file_get_contents($this->getUrl(false), false, stream_context_create($arrContextOptions));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.