WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

VgmcpInstaller() WC 1.0

Хуков нет.

Возвращает

Null. Ничего.

Использование

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

Методы

  1. inflectPackageVars($vars)
  2. inflectPackageVars($vars)
  3. inflectPackageVars($vars)
  4. inflectPluginVars($vars)
  5. inflectPluginVars($vars)
  6. inflectPluginVars($vars)
  7. inflectThemeVars($vars)
  8. inflectThemeVars($vars)
  9. inflectThemeVars($vars)

Код VgmcpInstaller: woocommerce/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php WC 4.3.1

<?php
class VgmcpInstaller extends BaseInstaller
{
    protected $locations = array(
        'bundle' => 'src/{$vendor}/{$name}/',
        'theme' => 'themes/{$name}/'
    );

    /**
     * Format package name.
     *
     * For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
     *
     * For package type vgmcp-theme, cut off a trailing '-theme' if present.
     *
     */
    public function inflectPackageVars($vars)
    {
        if ($vars['type'] === 'vgmcp-bundle') {
            return $this->inflectPluginVars($vars);
        }

        if ($vars['type'] === 'vgmcp-theme') {
            return $this->inflectThemeVars($vars);
        }

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-bundle$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}