WordPress at a glance
class is not described

Composer\Installers

TaoInstaller{} WC 1.0

An installer to handle TAO extensions.

No Hooks.

Return

null. Nothing.

Usage

$TaoInstaller = new TaoInstaller();
// use class methods

Methods

  1. inflectPackageVars($vars)

Code of TaoInstaller{} WC 5.2.2

<?php
class TaoInstaller extends BaseInstaller
{
    const EXTRA_TAO_EXTENSION_NAME = 'tao-extension-name';

    protected $locations = array(
        'extension' => '{$name}'
    );
    
    public function inflectPackageVars($vars)
    {
        $extra = $this->package->getExtra();

        if (array_key_exists(self::EXTRA_TAO_EXTENSION_NAME, $extra)) {
            $vars['name'] = $extra[self::EXTRA_TAO_EXTENSION_NAME];
            return $vars;
        }

        $vars['name'] = str_replace('extension-', '', $vars['name']);
        $vars['name'] = str_replace('-', ' ', $vars['name']);
        $vars['name'] = lcfirst(str_replace(' ', '', ucwords($vars['name'])));

        return $vars;
    }
}