Skip to content
This repository has been archived by the owner on Apr 11, 2019. It is now read-only.

erazorbg/smfapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST API for Simple Machines Forum (SMF) 2.0

Build Status

Note: This is a fork of the SMF REST API by Andre Nickatina. Our intention is to upgrade and maintain the API.

Use this to integrate your SMF version 2.0 forum with 3rd party software If you need help using this script or integrating your forum with other software, feel free to contact [email protected]

Installation using composer

Add the following to your composer.json file:

"require": 
{
	"erazorbg/smfapi": "dev-master"
},
"repositories": 
[
	{
	    "type": "vcs",
	    "url" : "https://github.com/erazorbg/smfapi.git"
	}
]

Update dependencies:

php composer update

Configuration

  • Upload the content of the Server folder to your SMF installation folder
  • (optional) Change the path to your Settings.php
//path/to/your/smf/api/folder/smf_2_api.php

// manually add the location of your Settings.php here
if (!isset($settings_path) || empty($settings_path)) {
    // specify the settings path here if it's not in smf root and you want to speed things up
    // $settings_path = $_SERVER['DOCUMENT_ROOT'] . /path/to/Settings.php
    if (isset($settings_path) && !file_exists($settings_path)) {
        unset($settings_path);
    }
}
  • (optional) In case you use nginx as webserver configure it to emulate the .htaccess
Satisfy Any

RewriteEngine on

RewriteRule .* index.php [L]
 
  • Set an API key in the index.php file:
define ('SECRET_KEY', 'Put your secret key here'); // set your secret key here

Hint: You may generate a key under Linux with a bash command like:

dd if=/dev/urandom bs=8 count=8 | openssl base64 | tr -d '\n'

Usage

<?php

$client = new SmfApi\Client\SmfRestClient($apiServerUrl, $secretKey);

About

REST API for Simple Machines Forum (SMF) 2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages