GithubHelp home page GithubHelp logo

smfapi's Introduction

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 SmfRestServer.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);

smfapi's People

Contributors

erazorbg avatar petarov avatar robbixc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.