Created
May 30, 2015 20:31
-
-
Save JDGrimes/bad1d4d4857c4bcbd3da to your computer and use it in GitHub Desktop.
Module API that never happened
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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