Download the PHP package chrispittman/lti1-php without Composer

On this page you can find all versions of the php package chrispittman/lti1-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lti1-php

lti1_php

Composer package for LTI 1.x interactions in PHP

⚠️ DEPRECATED: with the impending retirement of LTI 1.0/1.1/1.2, nobody should use this anymore.

Usage example

Here's a sample Laravel controller which uses this to launch an LTI app.

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Chrispittman\Lti1\LTIUtils;
use App;
use Cache;
use Redirect;
use Session;

class LTIController extends Controller
{
    // assumes these routes are present:
    // Route::post('/lti_launch', 'LTIController@postLaunch');
    // Route::get('/lti_redirect', 'LTIController@getRedirect');
    // Route::get('/lti_tool', 'LTIController@getTool');

    public function postLaunch(Request $request) {
        $lti_utils = new LTIUtils();
        if (!$lti_utils->is_basic_lti_request()) {
            App::abort(403,"Not a basic LTI request.");
        }
        $consumer_key = $request->get('oauth_consumer_key');
        $shared_secret = STORED_SHARED_SECRET_HERE;
        if (!$lti_utils->is_valid_oauth_signature($consumer_key, $shared_secret, $request->url())) {
            App::abort(403,"Invalid OAuth signature.");
        }

        $request->session()->put('lti_launch_data', $_POST);

        $uuid = self::gen_uuid();
        Cache::put('lti_launch_data_' . $uuid, $_POST, 5);

        $launch_url = "/lti_redirect?uuid=".$uuid;
        return Redirect::to($launch_url);
    }

    public function getRedirect(Request $request) {
        // * What is this?
        // * Why not just use the data in the session?
        // * Why not just redirect straight to the tool?
        // Sessions are tricky with iframes, which many LMSes put tools inside of:
        // http://www.dr-chuck.com/csev-blog/2013/03/lti-frames-and-cookies-oh-my/
        // ...so we use the cache as a temporary holding area until we have a working session,
        // popping open a new window if needed.
        $uuid = $_REQUEST['uuid'];
        $tool_start_page = "/lti_tool";
        if (Session::has('lti_launch_data')) {
            return Redirect::to('/lti_tool');
        }
        if ($request->has('newwin')) {
            Session::put('lti_launch_data', Cache::get('lti_launch_data_' . $uuid));
            return Redirect::to('/lti_tool');

        }
        return "<html><body><br><br><br><div style='text-align:center;font-family:sans-serif;font-size:200%;'><a href='".$request->fullUrl()."&newwin=true' target='_blank'>Click here to load this page.</a></div></body></html>";
    }

    public function getTool(Request $request) {
        return "Here's the first page of the tool. <br><br> ".json_encode(Session::get('lti_launch_data'));
    }

    protected static function gen_uuid() {
        return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
            // 32 bits for "time_low"
            mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
            // 16 bits for "time_mid"
            mt_rand( 0, 0xffff ),
            // 16 bits for "time_hi_and_version",
            // four most significant bits holds version number 4
            mt_rand( 0, 0x0fff ) | 0x4000,
            // 16 bits, 8 bits for "clk_seq_hi_res",
            // 8 bits for "clk_seq_low",
            // two most significant bits holds zero and one for variant DCE1.1
            mt_rand( 0, 0x3fff ) | 0x8000,
            // 48 bits for "node"
            mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
        );
    }
}

All versions of lti1-php with dependencies

PHP Build Version
Package Version
Requires php Version >5.6.0
imsglobal/lti Version ^3.0.2
ext-xml Version *
ext-curl Version *
ext-dom Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chrispittman/lti1-php contains the following files

Loading the files please wait ....