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

Composer\Installers

AsgardInstaller{} WC 1.0

Хуков нет.

Возвращает

Null. Ничего.

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

$AsgardInstaller = new AsgardInstaller();
// 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)

Код AsgardInstaller{} WC 4.5.2

woocommerce/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php
<?php
class AsgardInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'Modules/{$name}/',
        'theme' => 'Themes/{$name}/'
    );

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

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

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-module$/', '', $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;
    }
}