Skip to content

Instantly share code, notes, and snippets.

@kalenjohnson
Forked from drrobotnik/slack-commands.php
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kalenjohnson/edf8b4110f3cd570a23c to your computer and use it in GitHub Desktop.
Save kalenjohnson/edf8b4110f3cd570a23c to your computer and use it in GitHub Desktop.
class autoloader {
public static $loader;
public static function init()
{
if (self::$loader == NULL)
self::$loader = new self();
return self::$loader;
}
public function __construct()
{
spl_autoload_register( array($this,'commands') );
}
public function commands( $class ) {
include plugin_dir_path( __FILE__ ) . 'commands/' . $class . '.command.php';
}
}
//call
autoloader::init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment