HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/slfopp7cb1df/public_html/home/wp-content/plugins/nprojects/classes/nprojects-base.php
<?php
/**
 * WARNING: This file is part of the Projects plugin. DO NOT edit
 * this file under any circumstances.
 */

/**
 * Prevent direct access to this file
 */
defined( 'ABSPATH' ) or die();

/**
 * Abstraction singleton class that provide methods
 * to implement singleton design pattern for all sub-classes
 *
 * @package  Projects
 * @author   Binh Pham Thanh <binhpham@linethemes.com>
 */
abstract class nProjects_Base
{
	/**
	 * This property will hold all instances
	 * of sub-classes.
	 * 
	 * @var  array
	 */
	private static $instances = array();

	/**
	 * Create new instance of sub-class if it's doesn't created before and
	 * store it to memory. Return the stored instance if it is created
	 * 
	 * @return  mixed
	 */
	public static function instance() {
		$class = get_called_class();

		if ( ! isset( self::$instances[ $class ] ) )
			self::$instances[ $class ] = new $class();

		return self::$instances[ $class ];
	}
}