Skip to content

Instantly share code, notes, and snippets.

@JDGrimes
Created May 30, 2015 20:31
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 JDGrimes/bad1d4d4857c4bcbd3da to your computer and use it in GitHub Desktop.
Save JDGrimes/bad1d4d4857c4bcbd3da to your computer and use it in GitHub Desktop.
Module API that never happened
<?php
/**
* Class to provide a bootstrap for modules.
*
* @package WordPoints
* @since 1.10.0
*/
/**
* Provides a bootstrap for modules.
*
* @since 1.10.0
*/
abstract class WordPoints_Module {
/**
* The version of the module.
*
* @since 1.10.0
*
* @var string
*/
protected $version;
/**
* The full path to the main file of the module.
*
* @since 1.10.0
*
* @var string
*/
protected $file;
/**
* Get the module's version.
*
* @since 1.10.0
*
* @return string The module's version.
*/
public function version() {
return $this->version;
}
/**
* Get the path to the module's main file.
*
* @since 1.10.0
*
* @return string The path to the module's main file.
*/
public function file() {
return $this->file;
}
/**
* Get the path to the module's main directory.
*
* @since 1.10.0
*
* @return string The path to the module's main directory.
*/
public function dir() {
return dirname( $this->file );
}
/**
* Get the URL of the module's main directory.
*
* @since 1.10.0
*
* @return string The URL of the module's main directory.
*/
public function url() {
return wordpoints_modules_url( '/', $this->file );
}
}
// EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment