PHP Класс Piwik\Plugins\CoreConsole\Commands\GeneratePluginBase

Наследование: extends Piwik\Plugin\ConsoleCommand
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
getPluginPath ( $pluginName )
isEnabled ( )

Защищенные методы

Метод Описание
askPluginNameAndValidate ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, $pluginNames, $invalidArgumentException ) : array
checkAndUpdateRequiredPiwikVersion ( $pluginName, Symfony\Component\Console\Output\OutputInterface $output )
copyTemplateMethodToExisitingClass ( string $sourceClassName, string $methodName, array $replace ) Copies the given method and all needed use statements into an existing class. The target class name will be built based on the given $replace argument.
copyTemplateToPlugin ( string $templateFolder, string $pluginName, array $replace = [], array $whitelistFiles = [] )
createFileWithinPluginIfNotExists ( $pluginNameOrCore, $fileName, $content )
getPluginNames ( )
getPluginNamesHavingNotSpecificFile ( $filename )
makeTranslationIfPossible ( $pluginName, $translatedText ) : string Creates a lang/en.json within the plugin in case it does not exist yet and adds a translation for the given text.

Приватные методы

Метод Описание
buildTranslationKey ( $translatedText )
createFolderWithinPluginIfNotExists ( $pluginNameOrCore, $folder )
getPathToCore ( )
getRelativePluginPath ( $pluginName )
removeNonJsonCompatibleCharacters ( $text )
replaceContent ( $replace, $contentToReplace )
toJson ( $value )

Описание методов

askPluginNameAndValidate() защищенный Метод

protected askPluginNameAndValidate ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, $pluginNames, $invalidArgumentException ) : array
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
Результат array

checkAndUpdateRequiredPiwikVersion() защищенный Метод

protected checkAndUpdateRequiredPiwikVersion ( $pluginName, Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface

copyTemplateMethodToExisitingClass() защищенный Метод

Copies the given method and all needed use statements into an existing class. The target class name will be built based on the given $replace argument.
protected copyTemplateMethodToExisitingClass ( string $sourceClassName, string $methodName, array $replace )
$sourceClassName string
$methodName string
$replace array

copyTemplateToPlugin() защищенный Метод

protected copyTemplateToPlugin ( string $templateFolder, string $pluginName, array $replace = [], array $whitelistFiles = [] )
$templateFolder string full path like /home/...
$pluginName string
$replace array array(key => value) $key will be replaced by $value in all templates
$whitelistFiles array If not empty, only given files/directories will be copied. For instance array('/Controller.php', '/templates', '/templates/index.twig')

createFileWithinPluginIfNotExists() защищенный Метод

protected createFileWithinPluginIfNotExists ( $pluginNameOrCore, $fileName, $content )

getPluginNames() защищенный Метод

protected getPluginNames ( )

getPluginNamesHavingNotSpecificFile() защищенный Метод

protected getPluginNamesHavingNotSpecificFile ( $filename )

getPluginPath() публичный Метод

public getPluginPath ( $pluginName )

isEnabled() публичный Метод

public isEnabled ( )

makeTranslationIfPossible() защищенный Метод

Creates a lang/en.json within the plugin in case it does not exist yet and adds a translation for the given text.
protected makeTranslationIfPossible ( $pluginName, $translatedText ) : string
$pluginName
$translatedText
Результат string Either the generated translation key or the original text if a different translation for this generated translation key already exists.