VaultPress::init PHP Method

init() static public method

static public init ( )
    static function &init()
    {
        static $instance = false;
        if (!$instance) {
            $instance = new VaultPress();
        }
        return $instance;
    }

Usage Example

 function want($type)
 {
     $vp = VaultPress::init();
     if ($type == 'plugins') {
         $this->dir = realpath($vp->resolve_content_dir() . 'plugins');
         $this->type = 'p';
         return true;
     }
     if ($type == 'themes') {
         $this->dir = realpath($vp->resolve_content_dir() . 'themes');
         $this->type = 't';
         return true;
     }
     if ($type == 'uploads') {
         $this->dir = realpath($vp->resolve_upload_path());
         $this->type = 'u';
         return true;
     }
     if ($type == 'content') {
         $this->dir = realpath($vp->resolve_content_dir());
         $this->type = 'c';
         return true;
     }
     if ($type == 'root') {
         $this->dir = realpath(ABSPATH);
         $this->type = 'r';
         return true;
     }
     die('naughty naughty');
 }
All Usage Examples Of VaultPress::init
VaultPress