PHP code example of shineunited / wordpress-installer

1. Go to this page and download the library: Download shineunited/wordpress-installer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shineunited / wordpress-installer example snippets




namespace Example\Project;

use Composer\Composer;
use Composer\IO\IOInterface;
use ShineUnited\WordPress\Installer\Capability\ExtensionProvider;

class ComposerPlugin implements PluginInterface, Capable {

	public function activate(Composer $composer, IOInterface $io): void {
		// ...
	}

	public function deactivate(Composer $composer, IOInterface $io): void {
		// ...
	}

	public function uninstall(Composer $composer, IOInterface $io): void {
		// ...
	}

	public function getCapabilities(): array {
		return [
			ExtensionProvider::class => ExampleExtensionProvider::class
		];
	}
}



namespace Example\Project;

use ShineUnited\WordPress\Installer\Capability\ExtensionProvider;
use ShineUnited\WordPress\Installer\Extension\BeforeInitExtension;
use ShineUnited\WordPress\Installer\Extension\AfterInitExtension;
use ShineUnited\WordPress\Installer\Extension\BeforeEnvExtension;
use ShineUnited\WordPress\Installer\Extension\AfterEnvExtension;

class ExampleExtensionProvider implements ExtensionProvider {

	public function getExtensions(): array {
		return [
			new BeforeInitExtension('inc/before-init.php'), //