-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSafecloud.php
More file actions
41 lines (37 loc) · 1.12 KB
/
Copy pathSafecloud.php
File metadata and controls
41 lines (37 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Safecloud plugin.
*
* Decentralised encrypted storage network:
* - Client (browser) — encrypts/decrypts, manages manifests, HLS streaming
* - Jets (Node.js) — socket.io routing servers, chunk fan-out
* - Drops (browser) — IndexedDB storage nodes, earn Safebux tokens
*
* @module Safecloud
*/
class Safecloud
{
/**
* Used by Q_Response::addScript('{{Safecloud}}/js/...') etc.
*/
static $loaded = false;
/**
* Called by Q framework when the plugin is loaded.
*/
static function Q_init()
{
// Register base URL alias {{Safecloud}}
// (Q framework picks this up automatically from the plugin directory)
// Add default config from config/plugin.json if not already set
Q_Config::load(PLUGINS_DIR . DS . 'Safecloud' . DS . 'config' . DS . 'plugin.json');
self::$loaded = true;
}
/**
* Called before every request.
* Adds the Safecloud browser plugin JS to every page automatically.
*/
static function Q_responseExtras()
{
Q_Response::addScript('{{Safecloud}}/js/Safecloud.js', 'head');
}
}