summaryrefslogtreecommitdiff
path: root/plugins/smf2/smf2.module
blob: 441b7bade35aa9fb3e63e8868309e426243e30a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

function smf2_init($config) {
  $smf_root_path = $config['root_path'];
  if (file_exists($smf_root_path . 'SSI.php')) {
    include_once $smf_root_path . 'SSI.php';
  }
  else {
    file_put_contents('php://stderr', "SMF not found at <{$smf_root_path}>.\n");
    exit;
  }
  require_once __DIR__ . '/BridgeSMF2.php';
  return new BridgeSMF2();
}

function smf_ssi($function) {
  $args = func_get_args();
  array_shift($args);

  ob_start();
  call_user_func_array("ssi_$function", $args);
  file_put_contents('php://stderr', ob_get_clean());
}