DEFAULT_LAUNCH_PRIVACY
DEFAULT_LAUNCH_PRIVACY
Default level of information-sharing privacy between consumer and provider
A toolbox of tools for quickly constructing LTI tool providers that hook back into the Canvas API reflexively.
The basic idea is that you need an XML configuration file of credentials and use that to instantiate the Toolbox. The toolbox can then perform LTI authentication, handle API requests, generate an LTI Configuration XML file, etc. for you.
$toolProvider : \smtech\ReflexiveCanvasLTI\LTI\ToolProvider
LTI Tool Provider for handling authentication and consumer/user management
serialize() : string
Provide serialization support for the Toolbox
This allows a Toolbox to be stored in the $_SESSION
variables.
Caveat emptor: because mysqli
objects can not be serialized,
serialization is limited to storing a reference to the configuration file
that generated this object, which will be reaccessed (along with cached
configuration metadata) when the object is unserialized.
unserialize(string $serialized) : \smtech\ReflexiveCanvasLTI\Toolbox
Provide serialization support for Toolbox
This allows a Toolbox to be stored in the $_SESSION
variables.
string | $serialized | A Toolbox object serialized by |
fromConfiguration(string $configFilePath, boolean $forceRecache = false) : \smtech\ReflexiveCanvasLTI\Toolbox
Create a Toolbox instance from a configuration file
string | $configFilePath | Path to the configuration file |
boolean | $forceRecache | Whether or not to rely on cached configuration metadata or to force a refresh from the configuration file |
config(string $key, mixed $value = null) : mixed
Access or update a specific configuration metadata key/value pair
The TOOL_*
constants refer to keys used by the Toolbox by default.
string | $key | The metadata key to look up/create/update |
mixed | $value | (Optional) If not present (or |
If not updating the metadata, the metadata (if any) currently stored
setToolProvider(\smtech\ReflexiveCanvasLTI\LTI\ToolProvider $toolProvider)
Update the ToolProvider object
\smtech\ReflexiveCanvasLTI\LTI\ToolProvider | $toolProvider |
getToolProvider() : \smtech\ReflexiveCanvasLTI\LTI\ToolProvider
Get the ToolProvider object
This does some just-in-time initialization, so that if the ToolProvider has not yet been accessed, it will be instantiated and initialized by this method.
lti_createConsumer(string $name, string $key = false, string $secret = false) : boolean
Create a new Tool consumer
string | $name | Human-readable name |
string | $key | (Optional) Consumer key (unique within the tool provider) |
string | $secret | (Optional) Shared secret |
Whether or not the consumer was created
api_get(string $url, array<mixed,string> $data = array(), array<mixed,string> $headers = array()) : \smtech\CanvasPest\CanvasObject|\smtech\CanvasPest\CanvasArray
Make a GET request to the API
string | $url | |
array<mixed,string> | $data | (Optional) |
array<mixed,string> | $headers | (Optional) |
api_post(string $url, array<mixed,string> $data = array(), array<mixed,string> $headers = array()) : \smtech\CanvasPest\CanvasObject|\smtech\CanvasPest\CanvasArray
Make a POST request to the API
string | $url | |
array<mixed,string> | $data | (Optional) |
array<mixed,string> | $headers | (Optional) |
api_put(string $url, array<mixed,string> $data = array(), array<mixed,string> $headers = array()) : \smtech\CanvasPest\CanvasObject|\smtech\CanvasPest\CanvasArray
Make a PUT request to the API
string | $url | |
array<mixed,string> | $data | (Optional) |
array<mixed,string> | $headers | (Optional) |
api_delete(string $url, array<mixed,string> $data = array(), array<mixed,string> $headers = array()) : \smtech\CanvasPest\CanvasObject|\smtech\CanvasPest\CanvasArray
Make a DELETE request to the API
string | $url | |
array<mixed,string> | $data | (Optional) |
array<mixed,string> | $headers | (Optional) |
log(string $message, string $priority = null) : boolean
Add a message to the tool log file
If no logger object is ready, the message will be queued for delayed logging until a logger object is ready.
string | $message | |
string | $priority | (Optional, defaults to |
Success