Completed
Push — master ( a27cb0...d7e2a7 )
by Seth
05:05
created
common.inc.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -17,29 +17,29 @@
 block discarded – undo
17 17
 
18 18
 /* prepare the toolbox */
19 19
 if (empty($_SESSION[Toolbox::class])) {
20
-    $_SESSION[Toolbox::class] =& Toolbox::fromConfiguration(CONFIG_FILE);
20
+	$_SESSION[Toolbox::class] =& Toolbox::fromConfiguration(CONFIG_FILE);
21 21
 }
22 22
 $toolbox =& $_SESSION[Toolbox::class];
23 23
 if (php_sapi_name() !== 'cli') {
24
-    $toolbox->smarty_prependTemplateDir(__DIR__ . '/templates', basename(__DIR__));
25
-    $toolbox->smarty_assign([
26
-        'category' => DataUtilities::titleCase(preg_replace('/[\-_]+/', ' ', basename(__DIR__)))
27
-    ]);
28
-    $smarty =& $toolbox->getSmarty();
24
+	$toolbox->smarty_prependTemplateDir(__DIR__ . '/templates', basename(__DIR__));
25
+	$toolbox->smarty_assign([
26
+		'category' => DataUtilities::titleCase(preg_replace('/[\-_]+/', ' ', basename(__DIR__)))
27
+	]);
28
+	$smarty =& $toolbox->getSmarty();
29 29
 }
30 30
 
31 31
 /* set the Tool Consumer's instance URL, if present */
32 32
 if (empty($_SESSION[CANVAS_INSTANCE_URL])) {
33
-    if (!empty($requestApiDomain)) {
34
-        $_SESSION[CANVAS_INSTANCE_URL] = "https://{$requestApiDomain}";
35
-    } elseif (!empty($_SESSION[ToolProvider::class]['canvas']['api_domain'])) {
36
-        $_SESSION[CANVAS_INSTANCE_URL] = 'https://' . $_SESSION[ToolProvider::class]['canvas']['api_domain'];
37
-    } else {
38
-        $_SESSION[CANVAS_INSTANCE_URL] = $httpReferer;
39
-
40
-        /* FIXME hack to trick the Toolbox into using the right API domain */
41
-        $_SESSION[ToolProvider::class]['canvas']['api_domain'] = parse_url($httpReferer, PHP_URL_HOST);
42
-    }
33
+	if (!empty($requestApiDomain)) {
34
+		$_SESSION[CANVAS_INSTANCE_URL] = "https://{$requestApiDomain}";
35
+	} elseif (!empty($_SESSION[ToolProvider::class]['canvas']['api_domain'])) {
36
+		$_SESSION[CANVAS_INSTANCE_URL] = 'https://' . $_SESSION[ToolProvider::class]['canvas']['api_domain'];
37
+	} else {
38
+		$_SESSION[CANVAS_INSTANCE_URL] = $httpReferer;
39
+
40
+		/* FIXME hack to trick the Toolbox into using the right API domain */
41
+		$_SESSION[ToolProvider::class]['canvas']['api_domain'] = parse_url($httpReferer, PHP_URL_HOST);
42
+	}
43 43
 }
44 44
 
45 45
 /*
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
17 17
 
18 18
 /* prepare the toolbox */
19 19
 if (empty($_SESSION[Toolbox::class])) {
20
-    $_SESSION[Toolbox::class] =& Toolbox::fromConfiguration(CONFIG_FILE);
20
+    $_SESSION[Toolbox::class] = & Toolbox::fromConfiguration(CONFIG_FILE);
21 21
 }
22
-$toolbox =& $_SESSION[Toolbox::class];
22
+$toolbox = & $_SESSION[Toolbox::class];
23 23
 if (php_sapi_name() !== 'cli') {
24 24
     $toolbox->smarty_prependTemplateDir(__DIR__ . '/templates', basename(__DIR__));
25 25
     $toolbox->smarty_assign([
26 26
         'category' => DataUtilities::titleCase(preg_replace('/[\-_]+/', ' ', basename(__DIR__)))
27 27
     ]);
28
-    $smarty =& $toolbox->getSmarty();
28
+    $smarty = & $toolbox->getSmarty();
29 29
 }
30 30
 
31 31
 /* set the Tool Consumer's instance URL, if present */
@@ -46,6 +46,6 @@  discard block
 block discarded – undo
46 46
  * FIXME convience variables until plugins are all updated (must come after the
47 47
  * instance URL detection, so that the API URL is set correctly)
48 48
  */
49
-$api =& $toolbox->getAPI();
50
-$sql =& $toolbox->getMySQL();
51
-$customPrefs =& $toolbox->getCustomPrefs();
49
+$api = & $toolbox->getAPI();
50
+$sql = & $toolbox->getMySQL();
51
+$customPrefs = & $toolbox->getCustomPrefs();
Please login to merge, or discard this patch.