public function loadHeaders()
	{
		// Cycle through all pluginPaths
		$this->headers = array();
		foreach ($this->pluginPaths as $pluginPath) {
			
			// If directory does not exist, skip it
			if (!file_exists($pluginPath) || !is_dir($pluginPath))
			{
				continue;
			}

			// Fetch the contents of the path
			$pluginPathContents = array_diff(scandir($pluginPath), array('..', '.'));
			
			// Now go through each entry in the plugin folder
			foreach ($pluginPathContents as $pluginFolder) {
				if (!is_dir($pluginPath . DS . $pluginFolder))
				{
					continue;
				}

				// If a header file exists, use it
				$file = $pluginPath . DS . $pluginFolder . DS . 'header.php';
				$pluginName = ucfirst($pluginFolder);
				$className = '\FuzeWorks\Plugins\\'.$pluginName.'Header'; 
				if (file_exists($file))
				{
					// And load it
					if (in_array($pluginName, $this->cfg->disabled_plugins))
					{
						$this->headers[$pluginName] = 'disabled';
					}
					else
					{
						require_once($file);
						$header = new $className();
						$this->headers[$pluginName] = $header;
						$this->headers[$pluginName]->init();
						Factory::getInstance()->logger->log('Loaded Plugin Header: \'' . $pluginName . '\'');
					}

				}

				// If it doesn't exist, skip it
				continue;
			}

		}
	}
public function loadHeaders()
	{
		// Cycle through all pluginPaths
		$this->headers = array();
		foreach ($this->pluginPaths as $pluginPath) {
			
			// If directory does not exist, skip it
			if (!file_exists($pluginPath) || !is_dir($pluginPath))
			{
				continue;
			}

			// Fetch the contents of the path
			$pluginPathContents = array_diff(scandir($pluginPath), array('..', '.'));
			
			// Now go through each entry in the plugin folder
			foreach ($pluginPathContents as $pluginFolder) {
				if (!is_dir($pluginPath . DS . $pluginFolder))
				{
					continue;
				}

				// If a header file exists, use it
				$file = $pluginPath . DS . $pluginFolder . DS . 'header.php';
				$pluginName = ucfirst($pluginFolder);
				$className = '\FuzeWorks\Plugins\\'.$pluginName.'Header'; 
				if (file_exists($file))
				{
					// And load it
					if (in_array($pluginName, $this->cfg->disabled_plugins))
					{
						$this->headers[$pluginName] = 'disabled';
					}
					else
					{
						require_once($file);
						$header = new $className();
						$this->headers[$pluginName] = $header;
						$this->headers[$pluginName]->init();
						Factory::getInstance()->logger->log('Loaded Plugin Header: \'' . $pluginName . '\'');
					}

				}

				// If it doesn't exist, skip it
				continue;
			}

		}
	}
public function loadHeaders ( ) { // Cycle through all pluginPaths $ this -> headers = array ( ) ; foreach ( $ this -> pluginPaths as $ pluginPath ) { // If directory does not exist, skip it if ( ! file_exists ( $ pluginPath ) || ! is_dir ( $ pluginPath ) ) { continue ; } // Fetch the contents of the path $ pluginPathContents = array_diff ( scandir ( $ pluginPath ) , array ( '..' , '.' ) ) ; // Now go through each entry in the plugin folder foreach ( $ pluginPathContents as $ pluginFolder ) { if ( ! is_dir ( $ pluginPath . DS . $ pluginFolder ) ) { continue ; } // If a header file exists, use it $ file = $ pluginPath . DS . $ pluginFolder . DS . 'header.php' ; $ pluginName = ucfirst ( $ pluginFolder ) ; $ className = '\FuzeWorks\Plugins\\' . $ pluginName . 'Header' ; if ( file_exists ( $ file ) ) { // And load it if ( in_array ( $ pluginName , $ this -> cfg -> disabled_plugins ) ) { $ this -> headers [ $ pluginName ] = 'disabled' ; } else { require_once ( $ file ) ; $ header = new $ className ( ) ; $ this -> headers [ $ pluginName ] = $ header ; $ this -> headers [ $ pluginName ] -> init ( ) ; Factory :: getInstance ( ) -> logger -> log ( 'Loaded Plugin Header: \'' . $ pluginName . '\'' ) ; } } // If it doesn't exist, skip it continue ; } } }
Load the header files of all plugins.
Load the header files of all plugins .