repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
acquia/blt | src/Robo/Commands/Sync/SyncCommand.php | SyncCommand.syncDbAllSites | public function syncDbAllSites() {
$exit_code = 0;
$multisites = $this->getConfigValue('multisites');
$this->printSyncMap($multisites);
$continue = $this->confirm("Continue?");
if (!$continue) {
return $exit_code;
}
foreach ($multisites as $multisite) {
$this->say("Refreshing s... | php | public function syncDbAllSites() {
$exit_code = 0;
$multisites = $this->getConfigValue('multisites');
$this->printSyncMap($multisites);
$continue = $this->confirm("Continue?");
if (!$continue) {
return $exit_code;
}
foreach ($multisites as $multisite) {
$this->say("Refreshing s... | [
"public",
"function",
"syncDbAllSites",
"(",
")",
"{",
"$",
"exit_code",
"=",
"0",
";",
"$",
"multisites",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'multisites'",
")",
";",
"$",
"this",
"->",
"printSyncMap",
"(",
"$",
"multisites",
")",
";",
"$",
... | Iteratively copies remote db to local db for each multisite.
@command drupal:sync:db:all-sites
@aliases dsba sync:all:db
@executeInVm | [
"Iteratively",
"copies",
"remote",
"db",
"to",
"local",
"db",
"for",
"each",
"multisite",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Sync/SyncCommand.php#L92-L113 | train |
acquia/blt | src/Robo/Commands/Sync/SyncCommand.php | SyncCommand.syncDb | public function syncDb() {
$local_alias = '@' . $this->getConfigValue('drush.aliases.local');
$remote_alias = '@' . $this->getConfigValue('drush.aliases.remote');
$task = $this->taskDrush()
->alias('')
->drush('cache-clear drush')
->drush('sql-sync')
->arg($remote_alias)
->arg... | php | public function syncDb() {
$local_alias = '@' . $this->getConfigValue('drush.aliases.local');
$remote_alias = '@' . $this->getConfigValue('drush.aliases.remote');
$task = $this->taskDrush()
->alias('')
->drush('cache-clear drush')
->drush('sql-sync')
->arg($remote_alias)
->arg... | [
"public",
"function",
"syncDb",
"(",
")",
"{",
"$",
"local_alias",
"=",
"'@'",
".",
"$",
"this",
"->",
"getConfigValue",
"(",
"'drush.aliases.local'",
")",
";",
"$",
"remote_alias",
"=",
"'@'",
".",
"$",
"this",
"->",
"getConfigValue",
"(",
"'drush.aliases.r... | Copies remote db to local db for default site.
@command drupal:sync:default:db
@aliases dsb drupal:sync:db sync:db
@validateDrushConfig
@executeInVm | [
"Copies",
"remote",
"db",
"to",
"local",
"db",
"for",
"default",
"site",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Sync/SyncCommand.php#L124-L148 | train |
acquia/blt | src/Robo/Commands/Setup/ToggleModulesCommand.php | ToggleModulesCommand.toggleModules | public function toggleModules() {
if ($this->input()->hasArgument('environment')) {
$environment = $this->input()->getArgument('environment');
}
elseif ($this->getConfig()->has('environment')) {
$environment = $this->getConfigValue('environment');
}
elseif (!empty($_ENV['environment'])) ... | php | public function toggleModules() {
if ($this->input()->hasArgument('environment')) {
$environment = $this->input()->getArgument('environment');
}
elseif ($this->getConfig()->has('environment')) {
$environment = $this->getConfigValue('environment');
}
elseif (!empty($_ENV['environment'])) ... | [
"public",
"function",
"toggleModules",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"input",
"(",
")",
"->",
"hasArgument",
"(",
"'environment'",
")",
")",
"{",
"$",
"environment",
"=",
"$",
"this",
"->",
"input",
"(",
")",
"->",
"getArgument",
"(",
... | Enables and uninstalls specified modules.
You may define the environment for which modules should be toggled by
passing the --environment=[value] option to this command setting
$_ENV['environment'] via the CLI, or defining environment in one of your
BLT configuration files.
@command drupal:toggle:modules
@aliases dt... | [
"Enables",
"and",
"uninstalls",
"specified",
"modules",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/ToggleModulesCommand.php#L28-L51 | train |
acquia/blt | src/Robo/Commands/Setup/ToggleModulesCommand.php | ToggleModulesCommand.doToggleModules | protected function doToggleModules($command, $config_key) {
if ($this->getConfig()->has($config_key)) {
$this->say("Executing <comment>drush $command</comment> for modules defined in <comment>$config_key</comment>...");
$modules = (array) $this->getConfigValue($config_key);
$modules_list = implode... | php | protected function doToggleModules($command, $config_key) {
if ($this->getConfig()->has($config_key)) {
$this->say("Executing <comment>drush $command</comment> for modules defined in <comment>$config_key</comment>...");
$modules = (array) $this->getConfigValue($config_key);
$modules_list = implode... | [
"protected",
"function",
"doToggleModules",
"(",
"$",
"command",
",",
"$",
"config_key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"has",
"(",
"$",
"config_key",
")",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Executing <com... | Enables or uninstalls an array of modules.
@param string $command
The drush command to execute, e.g., pm-enable or pm-uninstall.
@param string $config_key
The config key containing the array of modules.
@throws \Acquia\Blt\Robo\Exceptions\BltException | [
"Enables",
"or",
"uninstalls",
"an",
"array",
"of",
"modules",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/ToggleModulesCommand.php#L63-L81 | train |
acquia/blt | src/Robo/Hooks/DrupalVmHook.php | DrupalVmHook.interactExecuteOnHost | public function interactExecuteOnHost() {
if (!$this->getInspector()->isVmCli() && $this->getInspector()->isDrupalVmLocallyInitialized() && $this->getConfigValue('vm.blt-in-vm')) {
$this->logger->warning("Drupal VM is locally initialized, but you are not inside the VM.");
$this->logger->warning("You sho... | php | public function interactExecuteOnHost() {
if (!$this->getInspector()->isVmCli() && $this->getInspector()->isDrupalVmLocallyInitialized() && $this->getConfigValue('vm.blt-in-vm')) {
$this->logger->warning("Drupal VM is locally initialized, but you are not inside the VM.");
$this->logger->warning("You sho... | [
"public",
"function",
"interactExecuteOnHost",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isVmCli",
"(",
")",
"&&",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isDrupalVmLocallyInitialized",
"(",
")",
"&&",
... | Ask whether user would like to execute on host machine.
@hook interact @executeInVm
@throws BltException | [
"Ask",
"whether",
"user",
"would",
"like",
"to",
"execute",
"on",
"host",
"machine",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Hooks/DrupalVmHook.php#L19-L29 | train |
acquia/blt | src/Robo/Commands/Ci/CiCommand.php | CiCommand.travisInit | public function travisInit() {
$result = $this->taskFilesystemStack()
->copy($this->getConfigValue('blt.root') . '/scripts/travis/.travis.yml', $this->getConfigValue('repo.root') . '/.travis.yml', TRUE)
->stopOnFail()
->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
->... | php | public function travisInit() {
$result = $this->taskFilesystemStack()
->copy($this->getConfigValue('blt.root') . '/scripts/travis/.travis.yml', $this->getConfigValue('repo.root') . '/.travis.yml', TRUE)
->stopOnFail()
->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
->... | [
"public",
"function",
"travisInit",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"taskFilesystemStack",
"(",
")",
"->",
"copy",
"(",
"$",
"this",
"->",
"getConfigValue",
"(",
"'blt.root'",
")",
".",
"'/scripts/travis/.travis.yml'",
",",
"$",
"this",... | Initializes default Travis CI configuration for this project.
@command recipes:ci:travis:init
@aliases rcti ci:travis:init | [
"Initializes",
"default",
"Travis",
"CI",
"configuration",
"for",
"this",
"project",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Ci/CiCommand.php#L42-L54 | train |
acquia/blt | src/Robo/Commands/Ci/CiCommand.php | CiCommand.gitlabInit | public function gitlabInit() {
$result = $this->taskFilesystemStack()
->copy($this->getConfigValue('blt.root') . '/scripts/gitlab/gitlab-ci.yml', $this->getConfigValue('repo.root') . '/.gitlab-ci.yml', TRUE)
->stopOnFail()
->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
... | php | public function gitlabInit() {
$result = $this->taskFilesystemStack()
->copy($this->getConfigValue('blt.root') . '/scripts/gitlab/gitlab-ci.yml', $this->getConfigValue('repo.root') . '/.gitlab-ci.yml', TRUE)
->stopOnFail()
->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
... | [
"public",
"function",
"gitlabInit",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"taskFilesystemStack",
"(",
")",
"->",
"copy",
"(",
"$",
"this",
"->",
"getConfigValue",
"(",
"'blt.root'",
")",
".",
"'/scripts/gitlab/gitlab-ci.yml'",
",",
"$",
"this... | Initializes default GitLab Pipelines configuration for this project.
@command recipes:ci:gitlab:init
@aliases rcgi ci:gitlab:init | [
"Initializes",
"default",
"GitLab",
"Pipelines",
"configuration",
"for",
"this",
"project",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Ci/CiCommand.php#L84-L95 | train |
acquia/blt | src/Robo/Common/ComposerMunge.php | ComposerMunge.mungeFiles | public static function mungeFiles($file1, $file2) {
$default_contents = [];
$file1_contents = (array) json_decode(file_get_contents($file1), TRUE) + $default_contents;
$file2_contents = (array) json_decode(file_get_contents($file2), TRUE) + $default_contents;
$output = self::mergeKeyed($file1_contents,... | php | public static function mungeFiles($file1, $file2) {
$default_contents = [];
$file1_contents = (array) json_decode(file_get_contents($file1), TRUE) + $default_contents;
$file2_contents = (array) json_decode(file_get_contents($file2), TRUE) + $default_contents;
$output = self::mergeKeyed($file1_contents,... | [
"public",
"static",
"function",
"mungeFiles",
"(",
"$",
"file1",
",",
"$",
"file2",
")",
"{",
"$",
"default_contents",
"=",
"[",
"]",
";",
"$",
"file1_contents",
"=",
"(",
"array",
")",
"json_decode",
"(",
"file_get_contents",
"(",
"$",
"file1",
")",
","... | Selectively merges parts of two composer.json files.
@param string $file1
The file path to the first composer.json file.
@param string $file2
The file path to the second composer.json file.
@return string
The new, merged composer.json contents. | [
"Selectively",
"merges",
"parts",
"of",
"two",
"composer",
".",
"json",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Common/ComposerMunge.php#L21-L39 | train |
acquia/blt | src/Robo/Common/ComposerMunge.php | ComposerMunge.mergeKeyed | protected static function mergeKeyed($file1_contents, $file2_contents, $exclude_keys = []) {
// Merge keyed arrays objects.
$merge_keys = [
'config',
'extra',
];
$output = $file1_contents;
foreach ($merge_keys as $key) {
// Set empty keys to empty placeholder arrays.
if (!arr... | php | protected static function mergeKeyed($file1_contents, $file2_contents, $exclude_keys = []) {
// Merge keyed arrays objects.
$merge_keys = [
'config',
'extra',
];
$output = $file1_contents;
foreach ($merge_keys as $key) {
// Set empty keys to empty placeholder arrays.
if (!arr... | [
"protected",
"static",
"function",
"mergeKeyed",
"(",
"$",
"file1_contents",
",",
"$",
"file2_contents",
",",
"$",
"exclude_keys",
"=",
"[",
"]",
")",
"{",
"// Merge keyed arrays objects.",
"$",
"merge_keys",
"=",
"[",
"'config'",
",",
"'extra'",
",",
"]",
";"... | Merges specific keyed arrays and objects in composer.json files.
@param $file1_contents
@param $file2_contents
@param array $exclude_keys
@return mixed | [
"Merges",
"specific",
"keyed",
"arrays",
"and",
"objects",
"in",
"composer",
".",
"json",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Common/ComposerMunge.php#L50-L71 | train |
acquia/blt | src/Robo/Commands/Validate/TwigCommand.php | TwigCommand.lintFileSets | public function lintFileSets() {
$this->say("Validating twig syntax for all custom modules and themes...");
/** @var \Acquia\Blt\Robo\Filesets\FilesetManager $fileset_manager */
$fileset_manager = $this->getContainer()->get('filesetManager');
$fileset_ids = $this->getConfigValue('validate.twig.filesets... | php | public function lintFileSets() {
$this->say("Validating twig syntax for all custom modules and themes...");
/** @var \Acquia\Blt\Robo\Filesets\FilesetManager $fileset_manager */
$fileset_manager = $this->getContainer()->get('filesetManager');
$fileset_ids = $this->getConfigValue('validate.twig.filesets... | [
"public",
"function",
"lintFileSets",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Validating twig syntax for all custom modules and themes...\"",
")",
";",
"/** @var \\Acquia\\Blt\\Robo\\Filesets\\FilesetManager $fileset_manager */",
"$",
"fileset_manager",
"=",
"$",
"this... | Executes Twig validator against all validate.twig.filesets files.
@command tests:twig:lint:all
@aliases ttla twig tests:twig:lint validate:twig | [
"Executes",
"Twig",
"validator",
"against",
"all",
"validate",
".",
"twig",
".",
"filesets",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Validate/TwigCommand.php#L25-L33 | train |
acquia/blt | src/Robo/Commands/Validate/TwigCommand.php | TwigCommand.lintFileList | public function lintFileList($file_list) {
$this->say("Linting twig files...");
$files = explode("\n", $file_list);
/** @var \Acquia\Blt\Robo\Filesets\FilesetManager $fileset_manager */
$fileset_manager = $this->getContainer()->get('filesetManager');
$fileset_ids = $this->getConfigValue('validate.... | php | public function lintFileList($file_list) {
$this->say("Linting twig files...");
$files = explode("\n", $file_list);
/** @var \Acquia\Blt\Robo\Filesets\FilesetManager $fileset_manager */
$fileset_manager = $this->getContainer()->get('filesetManager');
$fileset_ids = $this->getConfigValue('validate.... | [
"public",
"function",
"lintFileList",
"(",
"$",
"file_list",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Linting twig files...\"",
")",
";",
"$",
"files",
"=",
"explode",
"(",
"\"\\n\"",
",",
"$",
"file_list",
")",
";",
"/** @var \\Acquia\\Blt\\Robo\\Filesets\\F... | Executes Twig validator against a list of files, if in twig.filesets.
@command tests:twig:lint:files
@aliases ttlf
@param string $file_list
A list of files to scan, separated by \n. | [
"Executes",
"Twig",
"validator",
"against",
"a",
"list",
"of",
"files",
"if",
"in",
"twig",
".",
"filesets",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Validate/TwigCommand.php#L44-L57 | train |
acquia/blt | src/Robo/Commands/Validate/TwigCommand.php | TwigCommand.executeTwigLintCommandAgainstFilesets | protected function executeTwigLintCommandAgainstFilesets(array $filesets) {
$command = $this->createTwigLintCommand();
/** @var \Acquia\Blt\Robo\Application $application */
$application = $this->getContainer()->get('application');
$application->add($command);
$passed = TRUE;
$failed_filesets =... | php | protected function executeTwigLintCommandAgainstFilesets(array $filesets) {
$command = $this->createTwigLintCommand();
/** @var \Acquia\Blt\Robo\Application $application */
$application = $this->getContainer()->get('application');
$application->add($command);
$passed = TRUE;
$failed_filesets =... | [
"protected",
"function",
"executeTwigLintCommandAgainstFilesets",
"(",
"array",
"$",
"filesets",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"createTwigLintCommand",
"(",
")",
";",
"/** @var \\Acquia\\Blt\\Robo\\Application $application */",
"$",
"application",
"=",... | Lints twig against multiple filesets.
@param \Symfony\Component\Finder\Finder[] $filesets
@throws \Acquia\Blt\Robo\Exceptions\BltException | [
"Lints",
"twig",
"against",
"multiple",
"filesets",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Validate/TwigCommand.php#L66-L98 | train |
acquia/blt | src/Robo/Commands/Validate/TwigCommand.php | TwigCommand.createTwigLintCommand | protected function createTwigLintCommand() {
$twig = new Environment(new FilesystemLoader());
$repo_root = $this->getConfigValue('repo.root');
$extension_file_contents = file_get_contents($repo_root . '/docroot/core/lib/Drupal/Core/Template/TwigExtension.php');
// Get any custom defined Twig filters t... | php | protected function createTwigLintCommand() {
$twig = new Environment(new FilesystemLoader());
$repo_root = $this->getConfigValue('repo.root');
$extension_file_contents = file_get_contents($repo_root . '/docroot/core/lib/Drupal/Core/Template/TwigExtension.php');
// Get any custom defined Twig filters t... | [
"protected",
"function",
"createTwigLintCommand",
"(",
")",
"{",
"$",
"twig",
"=",
"new",
"Environment",
"(",
"new",
"FilesystemLoader",
"(",
")",
")",
";",
"$",
"repo_root",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'repo.root'",
")",
";",
"$",
"ext... | Creates the Twig lint command.
@return \Symfony\Bridge\Twig\Command\LintCommand | [
"Creates",
"the",
"Twig",
"lint",
"command",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Validate/TwigCommand.php#L105-L160 | train |
acquia/blt | src/Robo/Wizards/SetupWizard.php | SetupWizard.wizardGenerateSettingsFiles | public function wizardGenerateSettingsFiles() {
$missing = FALSE;
if (!$this->getInspector()->isDrupalLocalSettingsFilePresent()) {
$this->logger->warning("<comment>{$this->getConfigValue('drupal.local_settings_file')}</comment> is missing.");
$missing = TRUE;
}
elseif (!$this->getInspector(... | php | public function wizardGenerateSettingsFiles() {
$missing = FALSE;
if (!$this->getInspector()->isDrupalLocalSettingsFilePresent()) {
$this->logger->warning("<comment>{$this->getConfigValue('drupal.local_settings_file')}</comment> is missing.");
$missing = TRUE;
}
elseif (!$this->getInspector(... | [
"public",
"function",
"wizardGenerateSettingsFiles",
"(",
")",
"{",
"$",
"missing",
"=",
"FALSE",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isDrupalLocalSettingsFilePresent",
"(",
")",
")",
"{",
"$",
"this",
"->",
"logger",
"... | Wizard for generating setup files.
Executes blt blt:init:settings command. | [
"Wizard",
"for",
"generating",
"setup",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Wizards/SetupWizard.php#L17-L35 | train |
acquia/blt | src/Robo/Wizards/SetupWizard.php | SetupWizard.wizardInstallDrupal | public function wizardInstallDrupal() {
if (!$this->getInspector()->isMySqlAvailable()) {
return FALSE;
}
if (!$this->getInspector()->isDrupalInstalled()) {
$this->logger->warning('Drupal is not installed.');
$confirm = $this->confirm("Do you want to install Drupal?");
if ($confirm) ... | php | public function wizardInstallDrupal() {
if (!$this->getInspector()->isMySqlAvailable()) {
return FALSE;
}
if (!$this->getInspector()->isDrupalInstalled()) {
$this->logger->warning('Drupal is not installed.');
$confirm = $this->confirm("Do you want to install Drupal?");
if ($confirm) ... | [
"public",
"function",
"wizardInstallDrupal",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isMySqlAvailable",
"(",
")",
")",
"{",
"return",
"FALSE",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"getInspector",
"(",
... | Wizard for installing Drupal.
Executes blt drupal:install. | [
"Wizard",
"for",
"installing",
"Drupal",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Wizards/SetupWizard.php#L42-L58 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isDrupalInstalled | public function isDrupalInstalled() {
$this->logger->debug("Verifying that Drupal is installed...");
$result = $this->executor->drush("sqlq \"SHOW TABLES LIKE 'config'\"")->run();
$output = trim($result->getMessage());
$installed = $result->wasSuccessful() && $output == 'config';
return $installed;... | php | public function isDrupalInstalled() {
$this->logger->debug("Verifying that Drupal is installed...");
$result = $this->executor->drush("sqlq \"SHOW TABLES LIKE 'config'\"")->run();
$output = trim($result->getMessage());
$installed = $result->wasSuccessful() && $output == 'config';
return $installed;... | [
"public",
"function",
"isDrupalInstalled",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"\"Verifying that Drupal is installed...\"",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"executor",
"->",
"drush",
"(",
"\"sqlq \\\"SHOW TABLES LIKE 'c... | Checks that Drupal is installed, caches result.
This method caches its result in $this->drupalIsInstalled.
@return bool
TRUE if Drupal is installed. | [
"Checks",
"that",
"Drupal",
"is",
"installed",
"caches",
"result",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L206-L213 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.getDrushStatus | public function getDrushStatus() {
$status_info = (array) json_decode($this->executor->drush('status --format=json --fields=*')->run()->getMessage(), TRUE);
return $status_info;
} | php | public function getDrushStatus() {
$status_info = (array) json_decode($this->executor->drush('status --format=json --fields=*')->run()->getMessage(), TRUE);
return $status_info;
} | [
"public",
"function",
"getDrushStatus",
"(",
")",
"{",
"$",
"status_info",
"=",
"(",
"array",
")",
"json_decode",
"(",
"$",
"this",
"->",
"executor",
"->",
"drush",
"(",
"'status --format=json --fields=*'",
")",
"->",
"run",
"(",
")",
"->",
"getMessage",
"("... | Gets the result of `drush status`.
@return array
The result of `drush status`. | [
"Gets",
"the",
"result",
"of",
"drush",
"status",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L221-L225 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isDrushAliasValid | public function isDrushAliasValid($alias) {
$bin = $this->getConfigValue('composer.bin');
$command = "'$bin/drush' site:alias @$alias --format=json";
return $this->executor->execute($command)
->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERY_VERBOSE)
->run()
->wasSuccessf... | php | public function isDrushAliasValid($alias) {
$bin = $this->getConfigValue('composer.bin');
$command = "'$bin/drush' site:alias @$alias --format=json";
return $this->executor->execute($command)
->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERY_VERBOSE)
->run()
->wasSuccessf... | [
"public",
"function",
"isDrushAliasValid",
"(",
"$",
"alias",
")",
"{",
"$",
"bin",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'composer.bin'",
")",
";",
"$",
"command",
"=",
"\"'$bin/drush' site:alias @$alias --format=json\"",
";",
"return",
"$",
"this",
"... | Validates a drush alias.
@param string $alias
@return bool
TRUE if alias is valid. | [
"Validates",
"a",
"drush",
"alias",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L263-L270 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.getDrushMajorVersion | public function getDrushMajorVersion() {
$version_info = json_decode($this->executor->drush('version --format=json')->run()->getMessage(), TRUE);
if (!empty($version_info['drush-version'])) {
$version = $version_info['drush-version'];
}
else {
$version = $version_info;
}
$major_vers... | php | public function getDrushMajorVersion() {
$version_info = json_decode($this->executor->drush('version --format=json')->run()->getMessage(), TRUE);
if (!empty($version_info['drush-version'])) {
$version = $version_info['drush-version'];
}
else {
$version = $version_info;
}
$major_vers... | [
"public",
"function",
"getDrushMajorVersion",
"(",
")",
"{",
"$",
"version_info",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"executor",
"->",
"drush",
"(",
"'version --format=json'",
")",
"->",
"run",
"(",
")",
"->",
"getMessage",
"(",
")",
",",
"TRUE",
... | Gets the major version of drush.
@return int
The major version of drush. | [
"Gets",
"the",
"major",
"version",
"of",
"drush",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L278-L290 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isMySqlAvailable | public function isMySqlAvailable() {
if (is_null($this->isMySqlAvailable)) {
$this->isMySqlAvailable = $this->getMySqlAvailable();
}
return $this->isMySqlAvailable;
} | php | public function isMySqlAvailable() {
if (is_null($this->isMySqlAvailable)) {
$this->isMySqlAvailable = $this->getMySqlAvailable();
}
return $this->isMySqlAvailable;
} | [
"public",
"function",
"isMySqlAvailable",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"isMySqlAvailable",
")",
")",
"{",
"$",
"this",
"->",
"isMySqlAvailable",
"=",
"$",
"this",
"->",
"getMySqlAvailable",
"(",
")",
";",
"}",
"return",
"$... | Determines if MySQL is available, caches result.
This method caches its result in $this->mySqlAvailable.
@return bool
TRUE if MySQL is available. | [
"Determines",
"if",
"MySQL",
"is",
"available",
"caches",
"result",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L300-L306 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.getMySqlAvailable | public function getMySqlAvailable() {
$this->logger->debug("Verifying that MySQL is available...");
/** @var \Robo\Result $result */
$result = $this->executor->drush("sqlq \"SHOW DATABASES\"")
->run();
return $result->wasSuccessful();
} | php | public function getMySqlAvailable() {
$this->logger->debug("Verifying that MySQL is available...");
/** @var \Robo\Result $result */
$result = $this->executor->drush("sqlq \"SHOW DATABASES\"")
->run();
return $result->wasSuccessful();
} | [
"public",
"function",
"getMySqlAvailable",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"\"Verifying that MySQL is available...\"",
")",
";",
"/** @var \\Robo\\Result $result */",
"$",
"result",
"=",
"$",
"this",
"->",
"executor",
"->",
"drush",
... | Determines if MySQL is available. Uses MySQL credentials from Drush.
This method does not cache its result.
@return bool
TRUE if MySQL is available. | [
"Determines",
"if",
"MySQL",
"is",
"available",
".",
"Uses",
"MySQL",
"credentials",
"from",
"Drush",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L316-L323 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isDrupalVmLocallyInitialized | public function isDrupalVmLocallyInitialized() {
if (is_null($this->isDrupalVmLocallyInitialized)) {
$this->isDrupalVmLocallyInitialized = $this->isVmCli() || $this->getConfigValue('vm.enable');
$statement = $this->isDrupalVmLocallyInitialized ? "is" : "is not";
$this->logger->debug("Drupal VM $st... | php | public function isDrupalVmLocallyInitialized() {
if (is_null($this->isDrupalVmLocallyInitialized)) {
$this->isDrupalVmLocallyInitialized = $this->isVmCli() || $this->getConfigValue('vm.enable');
$statement = $this->isDrupalVmLocallyInitialized ? "is" : "is not";
$this->logger->debug("Drupal VM $st... | [
"public",
"function",
"isDrupalVmLocallyInitialized",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"isDrupalVmLocallyInitialized",
")",
")",
"{",
"$",
"this",
"->",
"isDrupalVmLocallyInitialized",
"=",
"$",
"this",
"->",
"isVmCli",
"(",
")",
"|... | Determines if Drupal VM is initialized for the local machine.
I.E., whether Drupal VM is the default LAMP stack for BLT on local machine.
@return bool
TRUE if Drupal VM is initialized for the local machine. | [
"Determines",
"if",
"Drupal",
"VM",
"is",
"initialized",
"for",
"the",
"local",
"machine",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L344-L352 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isDrupalVmConfigValid | public function isDrupalVmConfigValid() {
$valid = TRUE;
$status = $this->getDrupalVmStatus();
$machine_name = $this->getConfigValue('project.machine_name');
if (empty($status[$machine_name]['state'])) {
$this->logger->error("Could not find VM. Please ensure that the VM machine name matches projec... | php | public function isDrupalVmConfigValid() {
$valid = TRUE;
$status = $this->getDrupalVmStatus();
$machine_name = $this->getConfigValue('project.machine_name');
if (empty($status[$machine_name]['state'])) {
$this->logger->error("Could not find VM. Please ensure that the VM machine name matches projec... | [
"public",
"function",
"isDrupalVmConfigValid",
"(",
")",
"{",
"$",
"valid",
"=",
"TRUE",
";",
"$",
"status",
"=",
"$",
"this",
"->",
"getDrupalVmStatus",
"(",
")",
";",
"$",
"machine_name",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'project.machine_nam... | Determines if Drupal VM config is valid.
@return bool
TRUE is Drupal VM config is valid. | [
"Determines",
"if",
"Drupal",
"VM",
"config",
"is",
"valid",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L360-L382 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isDrupalVmBooted | public function isDrupalVmBooted() {
if (!$this->commandExists('vagrant')) {
$this->isDrupalVmBooted = FALSE;
}
if (is_null($this->isDrupalVmBooted)) {
$status = $this->getDrupalVmStatus();
$machine_name = $this->getConfigValue('project.machine_name');
$this->isDrupalVmBooted = !emp... | php | public function isDrupalVmBooted() {
if (!$this->commandExists('vagrant')) {
$this->isDrupalVmBooted = FALSE;
}
if (is_null($this->isDrupalVmBooted)) {
$status = $this->getDrupalVmStatus();
$machine_name = $this->getConfigValue('project.machine_name');
$this->isDrupalVmBooted = !emp... | [
"public",
"function",
"isDrupalVmBooted",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"commandExists",
"(",
"'vagrant'",
")",
")",
"{",
"$",
"this",
"->",
"isDrupalVmBooted",
"=",
"FALSE",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
... | Determines if Drupal VM is booted.
@return bool
TRUE if Drupal VM is booted. | [
"Determines",
"if",
"Drupal",
"VM",
"is",
"booted",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L390-L406 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isVagrantPluginInstalled | public function isVagrantPluginInstalled($plugin) {
$installed = (bool) $this->executor->execute("vagrant plugin list | grep '$plugin'")
->interactive(FALSE)
->silent(TRUE)
->run()
->getMessage();
return $installed;
} | php | public function isVagrantPluginInstalled($plugin) {
$installed = (bool) $this->executor->execute("vagrant plugin list | grep '$plugin'")
->interactive(FALSE)
->silent(TRUE)
->run()
->getMessage();
return $installed;
} | [
"public",
"function",
"isVagrantPluginInstalled",
"(",
"$",
"plugin",
")",
"{",
"$",
"installed",
"=",
"(",
"bool",
")",
"$",
"this",
"->",
"executor",
"->",
"execute",
"(",
"\"vagrant plugin list | grep '$plugin'\"",
")",
"->",
"interactive",
"(",
"FALSE",
")",... | Checks to see if a given vagrant plugin is installed.
You can check to see if vagrant is installed with commandExists('vagrant').
@param string $plugin
The plugin name.
@return bool
TRUE if the plugin is installed. | [
"Checks",
"to",
"see",
"if",
"a",
"given",
"vagrant",
"plugin",
"is",
"installed",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L429-L437 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.getComposerVersion | public function getComposerVersion() {
$version = $this->executor->execute("composer --version")
->interactive(FALSE)
->silent(TRUE)
->run()
->getMessage();
return $version;
} | php | public function getComposerVersion() {
$version = $this->executor->execute("composer --version")
->interactive(FALSE)
->silent(TRUE)
->run()
->getMessage();
return $version;
} | [
"public",
"function",
"getComposerVersion",
"(",
")",
"{",
"$",
"version",
"=",
"$",
"this",
"->",
"executor",
"->",
"execute",
"(",
"\"composer --version\"",
")",
"->",
"interactive",
"(",
"FALSE",
")",
"->",
"silent",
"(",
"TRUE",
")",
"->",
"run",
"(",
... | Gets Composer version.
@return string
The version of Composer. | [
"Gets",
"Composer",
"version",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L451-L459 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isBltAliasInstalled | public function isBltAliasInstalled() {
$cli_config_file = $this->getCliConfigFile();
if (!is_null($cli_config_file) && file_exists($cli_config_file)) {
$contents = file_get_contents($cli_config_file);
if (strstr($contents, 'function blt')) {
return TRUE;
}
}
return FALSE;
} | php | public function isBltAliasInstalled() {
$cli_config_file = $this->getCliConfigFile();
if (!is_null($cli_config_file) && file_exists($cli_config_file)) {
$contents = file_get_contents($cli_config_file);
if (strstr($contents, 'function blt')) {
return TRUE;
}
}
return FALSE;
} | [
"public",
"function",
"isBltAliasInstalled",
"(",
")",
"{",
"$",
"cli_config_file",
"=",
"$",
"this",
"->",
"getCliConfigFile",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"cli_config_file",
")",
"&&",
"file_exists",
"(",
"$",
"cli_config_file",
")",... | Checks to see if BLT alias is installed on CLI.
@return bool
TRUE if BLT alias is installed. | [
"Checks",
"to",
"see",
"if",
"BLT",
"alias",
"is",
"installed",
"on",
"CLI",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L467-L477 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.getCliConfigFile | public function getCliConfigFile() {
$file = NULL;
if (DIRECTORY_SEPARATOR == '\\') {
$user = $_SERVER['USERNAME'];
$home_dir = $_SERVER['USERPROFILE'];
}
else {
$user = posix_getpwuid(posix_getuid());
$home_dir = $user['dir'];
}
if (strstr(getenv('SHELL'), 'zsh')) {
... | php | public function getCliConfigFile() {
$file = NULL;
if (DIRECTORY_SEPARATOR == '\\') {
$user = $_SERVER['USERNAME'];
$home_dir = $_SERVER['USERPROFILE'];
}
else {
$user = posix_getpwuid(posix_getuid());
$home_dir = $user['dir'];
}
if (strstr(getenv('SHELL'), 'zsh')) {
... | [
"public",
"function",
"getCliConfigFile",
"(",
")",
"{",
"$",
"file",
"=",
"NULL",
";",
"if",
"(",
"DIRECTORY_SEPARATOR",
"==",
"'\\\\'",
")",
"{",
"$",
"user",
"=",
"$",
"_SERVER",
"[",
"'USERNAME'",
"]",
";",
"$",
"home_dir",
"=",
"$",
"_SERVER",
"["... | Determines the CLI config file.
@return null|string
Returns file path or NULL if none was found. | [
"Determines",
"the",
"CLI",
"config",
"file",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L485-L513 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isGitMinimumVersionSatisfied | public function isGitMinimumVersionSatisfied($minimum_version) {
exec("git --version | cut -d' ' -f3", $output, $exit_code);
if (version_compare($output[0], $minimum_version, '>=')) {
return TRUE;
}
return FALSE;
} | php | public function isGitMinimumVersionSatisfied($minimum_version) {
exec("git --version | cut -d' ' -f3", $output, $exit_code);
if (version_compare($output[0], $minimum_version, '>=')) {
return TRUE;
}
return FALSE;
} | [
"public",
"function",
"isGitMinimumVersionSatisfied",
"(",
"$",
"minimum_version",
")",
"{",
"exec",
"(",
"\"git --version | cut -d' ' -f3\"",
",",
"$",
"output",
",",
"$",
"exit_code",
")",
";",
"if",
"(",
"version_compare",
"(",
"$",
"output",
"[",
"0",
"]",
... | Verifies that installed minimum git version is met.
@param string $minimum_version
The minimum git version that is required.
@return bool
TRUE if minimum version is satisfied. | [
"Verifies",
"that",
"installed",
"minimum",
"git",
"version",
"is",
"met",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L538-L544 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.getLocalBehatConfig | public function getLocalBehatConfig() {
$behat_local_config_file = $this->getConfigValue('repo.root') . '/tests/behat/local.yml';
$behat_local_config = new BltConfig();
$loader = new YamlConfigLoader();
$processor = new YamlConfigProcessor();
$processor->extend($loader->load($behat_local_config_fil... | php | public function getLocalBehatConfig() {
$behat_local_config_file = $this->getConfigValue('repo.root') . '/tests/behat/local.yml';
$behat_local_config = new BltConfig();
$loader = new YamlConfigLoader();
$processor = new YamlConfigProcessor();
$processor->extend($loader->load($behat_local_config_fil... | [
"public",
"function",
"getLocalBehatConfig",
"(",
")",
"{",
"$",
"behat_local_config_file",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'repo.root'",
")",
".",
"'/tests/behat/local.yml'",
";",
"$",
"behat_local_config",
"=",
"new",
"BltConfig",
"(",
")",
";",
... | Gets the local behat configuration defined in local.yml.
@return \Acquia\Blt\Robo\Config\BltConfig
The local Behat configuration. | [
"Gets",
"the",
"local",
"behat",
"configuration",
"defined",
"in",
"local",
".",
"yml",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L564-L575 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.filesExist | public function filesExist($files) {
foreach ($files as $file) {
if (!file_exists($file)) {
$this->logger->warning("Required file $file does not exist.");
return FALSE;
}
}
return TRUE;
} | php | public function filesExist($files) {
foreach ($files as $file) {
if (!file_exists($file)) {
$this->logger->warning("Required file $file does not exist.");
return FALSE;
}
}
return TRUE;
} | [
"public",
"function",
"filesExist",
"(",
"$",
"files",
")",
"{",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"warning",
"(",
"\"Requir... | Determines if all file in a given array exist.
@return bool
TRUE if all files exist. | [
"Determines",
"if",
"all",
"file",
"in",
"a",
"given",
"array",
"exist",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L612-L621 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isBehatConfigured | public function isBehatConfigured() {
// Verify that URIs required for Drupal and Behat are configured correctly.
$local_behat_config = $this->getLocalBehatConfig();
if ($this->getConfigValue('project.local.uri') != $local_behat_config->get('local.extensions.Behat\MinkExtension.base_url')) {
$this->l... | php | public function isBehatConfigured() {
// Verify that URIs required for Drupal and Behat are configured correctly.
$local_behat_config = $this->getLocalBehatConfig();
if ($this->getConfigValue('project.local.uri') != $local_behat_config->get('local.extensions.Behat\MinkExtension.base_url')) {
$this->l... | [
"public",
"function",
"isBehatConfigured",
"(",
")",
"{",
"// Verify that URIs required for Drupal and Behat are configured correctly.",
"$",
"local_behat_config",
"=",
"$",
"this",
"->",
"getLocalBehatConfig",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getConfigValue"... | Determines if Behat is properly configured on the local machine.
This will ensure that required Behat file exists, and that require
configuration values are properly defined.
@return bool
TRUE is Behat is properly configured on the local machine. | [
"Determines",
"if",
"Behat",
"is",
"properly",
"configured",
"on",
"the",
"local",
"machine",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L632-L662 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.getCurrentSchemaVersion | public function getCurrentSchemaVersion() {
if (file_exists($this->getConfigValue('blt.config-files.schema-version'))) {
$version = trim(file_get_contents($this->getConfigValue('blt.config-files.schema-version')));
}
else {
$version = $this->getContainer()->get('updater')->getLatestUpdateMethodV... | php | public function getCurrentSchemaVersion() {
if (file_exists($this->getConfigValue('blt.config-files.schema-version'))) {
$version = trim(file_get_contents($this->getConfigValue('blt.config-files.schema-version')));
}
else {
$version = $this->getContainer()->get('updater')->getLatestUpdateMethodV... | [
"public",
"function",
"getCurrentSchemaVersion",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"getConfigValue",
"(",
"'blt.config-files.schema-version'",
")",
")",
")",
"{",
"$",
"version",
"=",
"trim",
"(",
"file_get_contents",
"(",
"$",
"... | Gets the current schema version of the root project.
@return string
The current schema version. | [
"Gets",
"the",
"current",
"schema",
"version",
"of",
"the",
"root",
"project",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L751-L760 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.warnIfDrupalVmNotRunning | protected function warnIfDrupalVmNotRunning() {
if (!$this->isVmCli() && $this->isDrupalVmLocallyInitialized() && !$this->isDrupalVmBooted()) {
$this->logger->warning("Drupal VM is locally initialized, but is not running.");
}
} | php | protected function warnIfDrupalVmNotRunning() {
if (!$this->isVmCli() && $this->isDrupalVmLocallyInitialized() && !$this->isDrupalVmBooted()) {
$this->logger->warning("Drupal VM is locally initialized, but is not running.");
}
} | [
"protected",
"function",
"warnIfDrupalVmNotRunning",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isVmCli",
"(",
")",
"&&",
"$",
"this",
"->",
"isDrupalVmLocallyInitialized",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"isDrupalVmBooted",
"(",
")",
")",
... | Emits a warning if Drupal VM is initialized but not running. | [
"Emits",
"a",
"warning",
"if",
"Drupal",
"VM",
"is",
"initialized",
"but",
"not",
"running",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L772-L776 | train |
acquia/blt | src/Robo/Inspector/Inspector.php | Inspector.isActiveConfigIdentical | public function isActiveConfigIdentical() {
$uri = $this->getConfigValue('drush.uri');
$result = $this->executor->drush("config:status --uri=$uri 2>&1")->run();
$message = trim($result->getMessage());
$identical = strstr($message, 'No differences between DB and sync directory') !== FALSE;
return $i... | php | public function isActiveConfigIdentical() {
$uri = $this->getConfigValue('drush.uri');
$result = $this->executor->drush("config:status --uri=$uri 2>&1")->run();
$message = trim($result->getMessage());
$identical = strstr($message, 'No differences between DB and sync directory') !== FALSE;
return $i... | [
"public",
"function",
"isActiveConfigIdentical",
"(",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'drush.uri'",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"executor",
"->",
"drush",
"(",
"\"config:status --uri=$uri 2>&1\"",
")",... | Determines if the active config is identical to sync directory.
@return bool
TRUE if config is identical. | [
"Determines",
"if",
"the",
"active",
"config",
"is",
"identical",
"to",
"sync",
"directory",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Inspector/Inspector.php#L831-L838 | train |
acquia/blt | src/Robo/Tasks/DrushTask.php | DrushTask.drush | public function drush($command) {
// Clear out options associated with previous drush command.
$this->setOptionsForLastCommand();
if (!$this->defaultsInitialized) {
$this->init();
}
if (is_array($command)) {
$command = implode(' ', array_filter($command));
}
$this->commands[] ... | php | public function drush($command) {
// Clear out options associated with previous drush command.
$this->setOptionsForLastCommand();
if (!$this->defaultsInitialized) {
$this->init();
}
if (is_array($command)) {
$command = implode(' ', array_filter($command));
}
$this->commands[] ... | [
"public",
"function",
"drush",
"(",
"$",
"command",
")",
"{",
"// Clear out options associated with previous drush command.",
"$",
"this",
"->",
"setOptionsForLastCommand",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"defaultsInitialized",
")",
"{",
"$",
"th... | Adds the given drush command to a stack.
@param string $command
The drush command to execute. Do NOT include "drush" prefix.
@return $this | [
"Adds",
"the",
"given",
"drush",
"command",
"to",
"a",
"stack",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Tasks/DrushTask.php#L112-L126 | train |
acquia/blt | src/Robo/Tasks/DrushTask.php | DrushTask.init | protected function init() {
if ($this->getConfig()->get('drush.bin')) {
$this->executable = str_replace(' ', '\\ ', $this->getConfig()->get('drush.bin'));
}
else {
$this->executable = 'drush';
}
if (!isset($this->dir)) {
$this->dir($this->getConfig()->get('drush.dir'));
}
... | php | protected function init() {
if ($this->getConfig()->get('drush.bin')) {
$this->executable = str_replace(' ', '\\ ', $this->getConfig()->get('drush.bin'));
}
else {
$this->executable = 'drush';
}
if (!isset($this->dir)) {
$this->dir($this->getConfig()->get('drush.dir'));
}
... | [
"protected",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"get",
"(",
"'drush.bin'",
")",
")",
"{",
"$",
"this",
"->",
"executable",
"=",
"str_replace",
"(",
"' '",
",",
"'\\\\ '",
",",
"$",
"this",
... | Sets up drush defaults using config. | [
"Sets",
"up",
"drush",
"defaults",
"using",
"config",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Tasks/DrushTask.php#L236-L261 | train |
acquia/blt | src/Robo/Tasks/DrushTask.php | DrushTask.mixedToBool | protected function mixedToBool($mixedVar) {
if (is_string($mixedVar)) {
$boolVar = ($mixedVar === 'yes' || $mixedVar === 'true');
}
else {
$boolVar = (bool) $mixedVar;
}
return $boolVar;
} | php | protected function mixedToBool($mixedVar) {
if (is_string($mixedVar)) {
$boolVar = ($mixedVar === 'yes' || $mixedVar === 'true');
}
else {
$boolVar = (bool) $mixedVar;
}
return $boolVar;
} | [
"protected",
"function",
"mixedToBool",
"(",
"$",
"mixedVar",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"mixedVar",
")",
")",
"{",
"$",
"boolVar",
"=",
"(",
"$",
"mixedVar",
"===",
"'yes'",
"||",
"$",
"mixedVar",
"===",
"'true'",
")",
";",
"}",
"el... | Helper function to get the boolean equivalent of a variable.
@param mixed $mixedVar
@return bool
TRUE/FALSE as per PHP's cast to boolean ruleset, with the exception that
a string value not equal to 'yes' or 'true' will evaluate to FALSE. | [
"Helper",
"function",
"to",
"get",
"the",
"boolean",
"equivalent",
"of",
"a",
"variable",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Tasks/DrushTask.php#L272-L280 | train |
acquia/blt | src/Robo/Tasks/DrushTask.php | DrushTask.setOptionsForLastCommand | protected function setOptionsForLastCommand() {
if (isset($this->commands)) {
$numberOfCommands = count($this->commands);
$correspondingCommand = $numberOfCommands - 1;
$this->options[$correspondingCommand] = $this->arguments;
$this->arguments = '';
}
elseif (isset($this->arguments) ... | php | protected function setOptionsForLastCommand() {
if (isset($this->commands)) {
$numberOfCommands = count($this->commands);
$correspondingCommand = $numberOfCommands - 1;
$this->options[$correspondingCommand] = $this->arguments;
$this->arguments = '';
}
elseif (isset($this->arguments) ... | [
"protected",
"function",
"setOptionsForLastCommand",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"commands",
")",
")",
"{",
"$",
"numberOfCommands",
"=",
"count",
"(",
"$",
"this",
"->",
"commands",
")",
";",
"$",
"correspondingCommand",
"="... | Associates arguments with their corresponding drush command. | [
"Associates",
"arguments",
"with",
"their",
"corresponding",
"drush",
"command",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Tasks/DrushTask.php#L285-L295 | train |
acquia/blt | src/Robo/Tasks/DrushTask.php | DrushTask.setGlobalOptions | protected function setGlobalOptions() {
if (isset($this->uri) && !empty($this->uri)) {
$this->option('uri', $this->uri);
}
if (!$this->interactive) {
$this->option('no-interaction');
}
if ($this->verbose !== FALSE) {
$verbosity_threshold = $this->verbosityThreshold();
switc... | php | protected function setGlobalOptions() {
if (isset($this->uri) && !empty($this->uri)) {
$this->option('uri', $this->uri);
}
if (!$this->interactive) {
$this->option('no-interaction');
}
if ($this->verbose !== FALSE) {
$verbosity_threshold = $this->verbosityThreshold();
switc... | [
"protected",
"function",
"setGlobalOptions",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"uri",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"uri",
")",
")",
"{",
"$",
"this",
"->",
"option",
"(",
"'uri'",
",",
"$",
"this",
"->... | Set the options to be used for each drush command in the stack. | [
"Set",
"the",
"options",
"to",
"be",
"used",
"for",
"each",
"drush",
"command",
"in",
"the",
"stack",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Tasks/DrushTask.php#L300-L350 | train |
acquia/blt | src/Robo/Tasks/DrushTask.php | DrushTask.setupExecution | protected function setupExecution() {
$this->setOptionsForLastCommand();
$this->setGlobalOptions();
$globalOptions = $this->arguments;
foreach ($this->commands as $commandNumber => $command) {
if ($this->alias) {
$command = "@{$this->alias} {$command}";
}
$options = isset($t... | php | protected function setupExecution() {
$this->setOptionsForLastCommand();
$this->setGlobalOptions();
$globalOptions = $this->arguments;
foreach ($this->commands as $commandNumber => $command) {
if ($this->alias) {
$command = "@{$this->alias} {$command}";
}
$options = isset($t... | [
"protected",
"function",
"setupExecution",
"(",
")",
"{",
"$",
"this",
"->",
"setOptionsForLastCommand",
"(",
")",
";",
"$",
"this",
"->",
"setGlobalOptions",
"(",
")",
";",
"$",
"globalOptions",
"=",
"$",
"this",
"->",
"arguments",
";",
"foreach",
"(",
"$... | Adds drush commands with their corresponding options to stack. | [
"Adds",
"drush",
"commands",
"with",
"their",
"corresponding",
"options",
"to",
"stack",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Tasks/DrushTask.php#L403-L422 | train |
acquia/blt | src/Robo/Commands/Doctor/FileSystemCheck.php | FileSystemCheck.checkFileSystem | protected function checkFileSystem() {
$paths = [
'%files' => 'Public files directory',
'%private' => 'Private files directory',
'%temp' => 'Temporary files directory',
];
foreach ($paths as $key => $title) {
if (empty($this->drushStatus['%paths'][$key])) {
$this->logProblem... | php | protected function checkFileSystem() {
$paths = [
'%files' => 'Public files directory',
'%private' => 'Private files directory',
'%temp' => 'Temporary files directory',
];
foreach ($paths as $key => $title) {
if (empty($this->drushStatus['%paths'][$key])) {
$this->logProblem... | [
"protected",
"function",
"checkFileSystem",
"(",
")",
"{",
"$",
"paths",
"=",
"[",
"'%files'",
"=>",
"'Public files directory'",
",",
"'%private'",
"=>",
"'Private files directory'",
",",
"'%temp'",
"=>",
"'Temporary files directory'",
",",
"]",
";",
"foreach",
"(",... | Checks that configured file system paths exist and are writable. | [
"Checks",
"that",
"configured",
"file",
"system",
"paths",
"exist",
"and",
"are",
"writable",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Doctor/FileSystemCheck.php#L17-L67 | train |
acquia/blt | src/Robo/Commands/Fix/PhpCbfCommand.php | PhpCbfCommand.phpcbfFileSet | public function phpcbfFileSet() {
$this->say('Fixing and beautifying code...');
$bin = $this->getConfigValue('composer.bin');
$result = $this->taskExec("$bin/phpcbf")
->dir($this->getConfigValue('repo.root'))
->run();
$exit_code = $result->getExitCode();
// - 0 indicates that no fixabl... | php | public function phpcbfFileSet() {
$this->say('Fixing and beautifying code...');
$bin = $this->getConfigValue('composer.bin');
$result = $this->taskExec("$bin/phpcbf")
->dir($this->getConfigValue('repo.root'))
->run();
$exit_code = $result->getExitCode();
// - 0 indicates that no fixabl... | [
"public",
"function",
"phpcbfFileSet",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"'Fixing and beautifying code...'",
")",
";",
"$",
"bin",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'composer.bin'",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",... | Fixes and beautifies custom code according to Drupal Coding standards.
@command source:fix:php-standards
@aliases sfps fix phpcbf fix:phpcbf | [
"Fixes",
"and",
"beautifies",
"custom",
"code",
"according",
"to",
"Drupal",
"Coding",
"standards",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Fix/PhpCbfCommand.php#L20-L50 | train |
acquia/blt | src/Robo/Datastore/FileStore.php | FileStore.get | public function get($key) {
$out = NULL;
// Read the json encoded value from disk if it exists.
$path = $this->getFileName($key);
if (file_exists($path)) {
$out = file_get_contents($path);
$out = json_decode($out, TRUE);
}
return $out;
} | php | public function get($key) {
$out = NULL;
// Read the json encoded value from disk if it exists.
$path = $this->getFileName($key);
if (file_exists($path)) {
$out = file_get_contents($path);
$out = json_decode($out, TRUE);
}
return $out;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"out",
"=",
"NULL",
";",
"// Read the json encoded value from disk if it exists.",
"$",
"path",
"=",
"$",
"this",
"->",
"getFileName",
"(",
"$",
"key",
")",
";",
"if",
"(",
"file_exists",
"(",
"$... | Reads retrieves data from the store.
@param string $key
A key.
@return mixed The value fpr the given key or null. | [
"Reads",
"retrieves",
"data",
"from",
"the",
"store",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Datastore/FileStore.php#L29-L38 | train |
acquia/blt | src/Robo/Datastore/FileStore.php | FileStore.set | public function set($key, $data) {
$path = $this->getFileName($key, TRUE);
file_put_contents($path, json_encode($data));
} | php | public function set($key, $data) {
$path = $this->getFileName($key, TRUE);
file_put_contents($path, json_encode($data));
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"data",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getFileName",
"(",
"$",
"key",
",",
"TRUE",
")",
";",
"file_put_contents",
"(",
"$",
"path",
",",
"json_encode",
"(",
"$",
"data",
")",
... | Saves a value with the given key.
@param string $key
A key.
@param mixed $data
Data to save to the store. | [
"Saves",
"a",
"value",
"with",
"the",
"given",
"key",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Datastore/FileStore.php#L48-L51 | train |
acquia/blt | src/Robo/Datastore/FileStore.php | FileStore.remove | public function remove($key) {
$path = $this->getFileName($key, TRUE);
if (file_exists($path)) {
unlink($path);
}
} | php | public function remove($key) {
$path = $this->getFileName($key, TRUE);
if (file_exists($path)) {
unlink($path);
}
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getFileName",
"(",
"$",
"key",
",",
"TRUE",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"unlink",
"(",
"$",
"path",
")",
"... | Remove value from the store.
@param string $key
A key. | [
"Remove",
"value",
"from",
"the",
"store",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Datastore/FileStore.php#L72-L77 | train |
acquia/blt | src/Robo/Datastore/FileStore.php | FileStore.keys | public function keys() {
$root = $this->directory;
if (file_exists($root) && is_readable($root)) {
return array_diff(scandir($root), array('..', '.'));
}
return [];
} | php | public function keys() {
$root = $this->directory;
if (file_exists($root) && is_readable($root)) {
return array_diff(scandir($root), array('..', '.'));
}
return [];
} | [
"public",
"function",
"keys",
"(",
")",
"{",
"$",
"root",
"=",
"$",
"this",
"->",
"directory",
";",
"if",
"(",
"file_exists",
"(",
"$",
"root",
")",
"&&",
"is_readable",
"(",
"$",
"root",
")",
")",
"{",
"return",
"array_diff",
"(",
"scandir",
"(",
... | Return a list of all keys in the store.
@return array A list of keys | [
"Return",
"a",
"list",
"of",
"all",
"keys",
"in",
"the",
"store",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Datastore/FileStore.php#L93-L99 | train |
acquia/blt | src/Robo/Datastore/FileStore.php | FileStore.getFileName | protected function getFileName($key, $writable = FALSE) {
$key = $this->cleanKey($key);
if ($writable) {
$this->ensureDirectoryWritable();
}
if (!$key) {
throw new BltException('Could not save data to a file because it is missing an ID');
}
return $this->directory . '/' . $key;
} | php | protected function getFileName($key, $writable = FALSE) {
$key = $this->cleanKey($key);
if ($writable) {
$this->ensureDirectoryWritable();
}
if (!$key) {
throw new BltException('Could not save data to a file because it is missing an ID');
}
return $this->directory . '/' . $key;
} | [
"protected",
"function",
"getFileName",
"(",
"$",
"key",
",",
"$",
"writable",
"=",
"FALSE",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"cleanKey",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"writable",
")",
"{",
"$",
"this",
"->",
"ensureDirect... | Get a valid file name for the given key.
@param string $key
The data key to be written or read.
@return string A file path
@throws \Exception | [
"Get",
"a",
"valid",
"file",
"name",
"for",
"the",
"given",
"key",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Datastore/FileStore.php#L111-L122 | train |
acquia/blt | src/Robo/Datastore/FileStore.php | FileStore.ensureDirectoryWritable | protected function ensureDirectoryWritable() {
// Reality check to prevent stomping on the local filesystem if there is
// something wrong with the config.
if (!$this->directory) {
throw new BltException('Could not save data to a file because the path setting is mis-configured.');
}
$writable... | php | protected function ensureDirectoryWritable() {
// Reality check to prevent stomping on the local filesystem if there is
// something wrong with the config.
if (!$this->directory) {
throw new BltException('Could not save data to a file because the path setting is mis-configured.');
}
$writable... | [
"protected",
"function",
"ensureDirectoryWritable",
"(",
")",
"{",
"// Reality check to prevent stomping on the local filesystem if there is",
"// something wrong with the config.",
"if",
"(",
"!",
"$",
"this",
"->",
"directory",
")",
"{",
"throw",
"new",
"BltException",
"(",... | Check that the directory is writable and create it if we can. | [
"Check",
"that",
"the",
"directory",
"is",
"writable",
"and",
"create",
"it",
"if",
"we",
"can",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Datastore/FileStore.php#L141-L156 | train |
acquia/blt | src/Robo/Commands/Blt/AliasCommand.php | AliasCommand.installBltAlias | public function installBltAlias() {
if (isset($_SERVER['ComSpec'])) {
$bltRoot = $this->getConfigValue('blt.root') . '\\vendor\\bin';
$this->logger->error("Setting a blt alias is not supported in cmd.exe");
$this->say("<info>Please use Windows to add <comment>$bltRoot</comment> to your Environment... | php | public function installBltAlias() {
if (isset($_SERVER['ComSpec'])) {
$bltRoot = $this->getConfigValue('blt.root') . '\\vendor\\bin';
$this->logger->error("Setting a blt alias is not supported in cmd.exe");
$this->say("<info>Please use Windows to add <comment>$bltRoot</comment> to your Environment... | [
"public",
"function",
"installBltAlias",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'ComSpec'",
"]",
")",
")",
"{",
"$",
"bltRoot",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'blt.root'",
")",
".",
"'\\\\vendor\\\\bin'",
";",
"$",... | Installs the BLT alias for command line usage.
@command blt:init:shell-alias
@aliases alias install-alias | [
"Installs",
"the",
"BLT",
"alias",
"for",
"command",
"line",
"usage",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Blt/AliasCommand.php#L21-L57 | train |
acquia/blt | src/Robo/Commands/Blt/AliasCommand.php | AliasCommand.createNewAlias | protected function createNewAlias() {
$this->say("Installing <comment>blt</comment> alias...");
$config_file = $this->getInspector()->getCliConfigFile();
if (is_null($config_file)) {
$this->logger->error("Could not install blt alias. No profile found. Tried ~/.zshrc, ~/.bashrc, ~/.bash_profile, ~/.pro... | php | protected function createNewAlias() {
$this->say("Installing <comment>blt</comment> alias...");
$config_file = $this->getInspector()->getCliConfigFile();
if (is_null($config_file)) {
$this->logger->error("Could not install blt alias. No profile found. Tried ~/.zshrc, ~/.bashrc, ~/.bash_profile, ~/.pro... | [
"protected",
"function",
"createNewAlias",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Installing <comment>blt</comment> alias...\"",
")",
";",
"$",
"config_file",
"=",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"getCliConfigFile",
"(",
")",
";",
... | Creates a new BLT alias in appropriate CLI config file. | [
"Creates",
"a",
"new",
"BLT",
"alias",
"in",
"appropriate",
"CLI",
"config",
"file",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Blt/AliasCommand.php#L62-L84 | train |
acquia/blt | src/Robo/Commands/Blt/AliasCommand.php | AliasCommand.getAliasInfo | protected function getAliasInfo() {
$alias_length = NULL;
$alias = NULL;
$config_file = $this->getInspector()->getCliConfigFile();
$contents = file_get_contents($config_file);
$needle = 'function blt() {';
$begin_alias_pos = strpos($contents, $needle);
$end_alias_pos = $this->getClosingBrack... | php | protected function getAliasInfo() {
$alias_length = NULL;
$alias = NULL;
$config_file = $this->getInspector()->getCliConfigFile();
$contents = file_get_contents($config_file);
$needle = 'function blt() {';
$begin_alias_pos = strpos($contents, $needle);
$end_alias_pos = $this->getClosingBrack... | [
"protected",
"function",
"getAliasInfo",
"(",
")",
"{",
"$",
"alias_length",
"=",
"NULL",
";",
"$",
"alias",
"=",
"NULL",
";",
"$",
"config_file",
"=",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"getCliConfigFile",
"(",
")",
";",
"$",
"contents",... | Gets information about the installed BLT alias.
@return array
An array of information about the installed BLT alias. | [
"Gets",
"information",
"about",
"the",
"installed",
"BLT",
"alias",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Blt/AliasCommand.php#L104-L128 | train |
acquia/blt | src/Robo/Commands/Blt/AliasCommand.php | AliasCommand.updateAlias | protected function updateAlias() {
$alias_info = $this->getAliasInfo();
$new_contents = str_replace($alias_info['alias'], $alias_info['canonical_alias'], $alias_info['contents']);
$bytes = file_put_contents($alias_info['config_file'], $new_contents);
if (!$bytes) {
throw new BltException("Could no... | php | protected function updateAlias() {
$alias_info = $this->getAliasInfo();
$new_contents = str_replace($alias_info['alias'], $alias_info['canonical_alias'], $alias_info['contents']);
$bytes = file_put_contents($alias_info['config_file'], $new_contents);
if (!$bytes) {
throw new BltException("Could no... | [
"protected",
"function",
"updateAlias",
"(",
")",
"{",
"$",
"alias_info",
"=",
"$",
"this",
"->",
"getAliasInfo",
"(",
")",
";",
"$",
"new_contents",
"=",
"str_replace",
"(",
"$",
"alias_info",
"[",
"'alias'",
"]",
",",
"$",
"alias_info",
"[",
"'canonical_... | Replaces installed alias with up-to-date alias. | [
"Replaces",
"installed",
"alias",
"with",
"up",
"-",
"to",
"-",
"date",
"alias",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Blt/AliasCommand.php#L133-L144 | train |
acquia/blt | src/Robo/Commands/Blt/AliasCommand.php | AliasCommand.getClosingBracketPosition | protected function getClosingBracketPosition($contents, $start_pos) {
$brackets = ['{'];
for ($pos = $start_pos; $pos < strlen($contents); $pos++) {
$char = substr($contents, $pos, 1);
if ($char == '{') {
array_push($brackets, $char);
}
elseif ($char == '}') {
array_pop($... | php | protected function getClosingBracketPosition($contents, $start_pos) {
$brackets = ['{'];
for ($pos = $start_pos; $pos < strlen($contents); $pos++) {
$char = substr($contents, $pos, 1);
if ($char == '{') {
array_push($brackets, $char);
}
elseif ($char == '}') {
array_pop($... | [
"protected",
"function",
"getClosingBracketPosition",
"(",
"$",
"contents",
",",
"$",
"start_pos",
")",
"{",
"$",
"brackets",
"=",
"[",
"'{'",
"]",
";",
"for",
"(",
"$",
"pos",
"=",
"$",
"start_pos",
";",
"$",
"pos",
"<",
"strlen",
"(",
"$",
"contents"... | Find the position of a closing bracket for a given stanza in a string.
@param $contents
The string containing the brackets.
@param int $start_pos
The position of the opening bracket in the string that should be matched.
@return int|null | [
"Find",
"the",
"position",
"of",
"a",
"closing",
"bracket",
"for",
"a",
"given",
"stanza",
"in",
"a",
"string",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Blt/AliasCommand.php#L156-L172 | train |
acquia/blt | src/Robo/Hooks/CommandEventHook.php | CommandEventHook.skipDisabledCommands | public function skipDisabledCommands(ConsoleCommandEvent $event) {
$command = $event->getCommand();
if ($this->isCommandDisabled($command->getName())) {
$event->disableCommand();
}
// @todo Transmit analytics on command execution. Do the same in status hook.
} | php | public function skipDisabledCommands(ConsoleCommandEvent $event) {
$command = $event->getCommand();
if ($this->isCommandDisabled($command->getName())) {
$event->disableCommand();
}
// @todo Transmit analytics on command execution. Do the same in status hook.
} | [
"public",
"function",
"skipDisabledCommands",
"(",
"ConsoleCommandEvent",
"$",
"event",
")",
"{",
"$",
"command",
"=",
"$",
"event",
"->",
"getCommand",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isCommandDisabled",
"(",
"$",
"command",
"->",
"getName",
... | Disable any command listed in the `disable-target` config key.
@hook command-event * | [
"Disable",
"any",
"command",
"listed",
"in",
"the",
"disable",
"-",
"target",
"config",
"key",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Hooks/CommandEventHook.php#L21-L28 | train |
acquia/blt | src/Robo/Commands/Validate/PhpcsCommand.php | PhpcsCommand.sniffFileSets | public function sniffFileSets() {
$bin = $this->getConfigValue('composer.bin');
$result = $this->taskExecStack()
->dir($this->getConfigValue('repo.root'))
->exec("$bin/phpcs")
->run();
$exit_code = $result->getExitCode();
if ($exit_code) {
if ($this->input()->isInteractive()) {
... | php | public function sniffFileSets() {
$bin = $this->getConfigValue('composer.bin');
$result = $this->taskExecStack()
->dir($this->getConfigValue('repo.root'))
->exec("$bin/phpcs")
->run();
$exit_code = $result->getExitCode();
if ($exit_code) {
if ($this->input()->isInteractive()) {
... | [
"public",
"function",
"sniffFileSets",
"(",
")",
"{",
"$",
"bin",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'composer.bin'",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"taskExecStack",
"(",
")",
"->",
"dir",
"(",
"$",
"this",
"->",
"getConf... | Executes PHP Code Sniffer against all phpcs.filesets files.
By default, these include custom themes, modules, and tests.
@command tests:phpcs:sniff:all
@aliases tpsa phpcs tests:phpcs:sniff validate:phpcs | [
"Executes",
"PHP",
"Code",
"Sniffer",
"against",
"all",
"phpcs",
".",
"filesets",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Validate/PhpcsCommand.php#L22-L39 | train |
acquia/blt | src/Robo/Commands/Validate/PhpcsCommand.php | PhpcsCommand.sniffFileList | public function sniffFileList($file_list) {
$this->say("Sniffing directories containing changed files...");
$files = explode("\n", $file_list);
$files = array_filter($files);
if ($files) {
$temp_path = $this->getConfigValue('repo.root') . '/tmp/phpcs-fileset';
$this->taskWriteToFile($temp_pa... | php | public function sniffFileList($file_list) {
$this->say("Sniffing directories containing changed files...");
$files = explode("\n", $file_list);
$files = array_filter($files);
if ($files) {
$temp_path = $this->getConfigValue('repo.root') . '/tmp/phpcs-fileset';
$this->taskWriteToFile($temp_pa... | [
"public",
"function",
"sniffFileList",
"(",
"$",
"file_list",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Sniffing directories containing changed files...\"",
")",
";",
"$",
"files",
"=",
"explode",
"(",
"\"\\n\"",
",",
"$",
"file_list",
")",
";",
"$",
"files"... | Executes PHP Code Sniffer against a list of files, if in phpcs.filesets.
This command will execute PHP Codesniffer against a list of files if those
files are a subset of the phpcs.filesets filesets.
@command tests:phpcs:sniff:files
@aliases tpsf
@param string $file_list
A list of files to scan, separated by \n.
@re... | [
"Executes",
"PHP",
"Code",
"Sniffer",
"against",
"a",
"list",
"of",
"files",
"if",
"in",
"phpcs",
".",
"filesets",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Validate/PhpcsCommand.php#L66-L83 | train |
acquia/blt | src/Robo/Commands/Acsf/AcsfCommand.php | AcsfCommand.printPreamble | public function printPreamble() {
$this->logger->notice("This command will initialize support for Acquia Cloud Site Factory by performing the following tasks:");
$this->logger->notice(" * Adding drupal/acsf and acquia/acsf-tools the require array in your composer.json file.");
$this->logger->notice(" * Ex... | php | public function printPreamble() {
$this->logger->notice("This command will initialize support for Acquia Cloud Site Factory by performing the following tasks:");
$this->logger->notice(" * Adding drupal/acsf and acquia/acsf-tools the require array in your composer.json file.");
$this->logger->notice(" * Ex... | [
"public",
"function",
"printPreamble",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"notice",
"(",
"\"This command will initialize support for Acquia Cloud Site Factory by performing the following tasks:\"",
")",
";",
"$",
"this",
"->",
"logger",
"->",
"notice",
"(",... | Prints information about the command. | [
"Prints",
"information",
"about",
"the",
"command",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Acsf/AcsfCommand.php#L18-L30 | train |
acquia/blt | src/Robo/Commands/Acsf/AcsfCommand.php | AcsfCommand.acsfInitialize | public function acsfInitialize($options = ['acsf-version' => '^2.47.0']) {
$this->printPreamble();
$this->acsfHooksInitialize();
$this->say('Adding acsf module as a dependency...');
$package_options = [
'package_name' => 'drupal/acsf',
'package_version' => $options['acsf-version'],
];
... | php | public function acsfInitialize($options = ['acsf-version' => '^2.47.0']) {
$this->printPreamble();
$this->acsfHooksInitialize();
$this->say('Adding acsf module as a dependency...');
$package_options = [
'package_name' => 'drupal/acsf',
'package_version' => $options['acsf-version'],
];
... | [
"public",
"function",
"acsfInitialize",
"(",
"$",
"options",
"=",
"[",
"'acsf-version'",
"=>",
"'^2.47.0'",
"]",
")",
"{",
"$",
"this",
"->",
"printPreamble",
"(",
")",
";",
"$",
"this",
"->",
"acsfHooksInitialize",
"(",
")",
";",
"$",
"this",
"->",
"say... | Initializes ACSF support for project.
@command recipes:acsf:init:all
@aliases acsf acsf:init
@options acsf-version | [
"Initializes",
"ACSF",
"support",
"for",
"project",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Acsf/AcsfCommand.php#L40-L74 | train |
acquia/blt | src/Robo/Commands/Acsf/AcsfCommand.php | AcsfCommand.acsfDrushInitialize | public function acsfDrushInitialize() {
$this->say('Executing initialization command provided acsf module...');
$acsf_include = $this->getConfigValue('docroot') . '/modules/contrib/acsf/acsf_init';
$result = $this->taskExecStack()
->exec($this->getConfigValue('repo.root') . "/vendor/bin/drush acsf-ini... | php | public function acsfDrushInitialize() {
$this->say('Executing initialization command provided acsf module...');
$acsf_include = $this->getConfigValue('docroot') . '/modules/contrib/acsf/acsf_init';
$result = $this->taskExecStack()
->exec($this->getConfigValue('repo.root') . "/vendor/bin/drush acsf-ini... | [
"public",
"function",
"acsfDrushInitialize",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"'Executing initialization command provided acsf module...'",
")",
";",
"$",
"acsf_include",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'docroot'",
")",
".",
"'/modules/c... | Refreshes the ACSF settings and hook files.
@command recipes:acsf:init:drush
@aliases raid acsf:init:drush | [
"Refreshes",
"the",
"ACSF",
"settings",
"and",
"hook",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Acsf/AcsfCommand.php#L83-L95 | train |
acquia/blt | src/Robo/Commands/Acsf/AcsfCommand.php | AcsfCommand.downloadDrush8 | protected function downloadDrush8($destination) {
$file = fopen($destination, 'w');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
'https://github.com/drush-ops/drush/releases/download/8.1.15/drush.phar');
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, ... | php | protected function downloadDrush8($destination) {
$file = fopen($destination, 'w');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
'https://github.com/drush-ops/drush/releases/download/8.1.15/drush.phar');
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, ... | [
"protected",
"function",
"downloadDrush8",
"(",
"$",
"destination",
")",
"{",
"$",
"file",
"=",
"fopen",
"(",
"$",
"destination",
",",
"'w'",
")",
";",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_URL",
",",
... | Download drush 8 binary.
@param string $destination
Download destination. | [
"Download",
"drush",
"8",
"binary",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Acsf/AcsfCommand.php#L126-L139 | train |
acquia/blt | src/Robo/Commands/Setup/BuildCommand.php | BuildCommand.composerInstall | public function composerInstall() {
$result = $this->taskExec(
(DIRECTORY_SEPARATOR == "\\") ? 'set' : 'export' .
" COMPOSER_EXIT_ON_PATCH_FAILURE=1 && composer install --ansi --no-interaction --optimize-autoloader --apcu-autoloader"
)
->dir($this->getConfigValue('repo.root'))
->intera... | php | public function composerInstall() {
$result = $this->taskExec(
(DIRECTORY_SEPARATOR == "\\") ? 'set' : 'export' .
" COMPOSER_EXIT_ON_PATCH_FAILURE=1 && composer install --ansi --no-interaction --optimize-autoloader --apcu-autoloader"
)
->dir($this->getConfigValue('repo.root'))
->intera... | [
"public",
"function",
"composerInstall",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"taskExec",
"(",
"(",
"DIRECTORY_SEPARATOR",
"==",
"\"\\\\\"",
")",
"?",
"'set'",
":",
"'export'",
".",
"\" COMPOSER_EXIT_ON_PATCH_FAILURE=1 && composer install --ansi --no-... | Installs Composer dependencies.
@command source:build:composer
@aliases sbc setup:composer:install | [
"Installs",
"Composer",
"dependencies",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/BuildCommand.php#L102-L113 | train |
acquia/blt | src/Robo/Common/ArrayManipulator.php | ArrayManipulator.expandFromDotNotatedKeys | public static function expandFromDotNotatedKeys(array $array) {
$data = new Data();
// @todo Make this work at all levels of array.
foreach ($array as $key => $value) {
$data->set($key, $value);
}
return $data->export();
} | php | public static function expandFromDotNotatedKeys(array $array) {
$data = new Data();
// @todo Make this work at all levels of array.
foreach ($array as $key => $value) {
$data->set($key, $value);
}
return $data->export();
} | [
"public",
"static",
"function",
"expandFromDotNotatedKeys",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"data",
"=",
"new",
"Data",
"(",
")",
";",
"// @todo Make this work at all levels of array.",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"val... | Converts dot-notated keys to proper associative nested keys.
E.g., [drush.alias => 'self'] would be expanded to
['drush' => ['alias' => 'self']]
@param array $array
The array containing unexpanded dot-notated keys.
@return array
The expanded array. | [
"Converts",
"dot",
"-",
"notated",
"keys",
"to",
"proper",
"associative",
"nested",
"keys",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Common/ArrayManipulator.php#L54-L63 | train |
acquia/blt | src/Robo/Common/ArrayManipulator.php | ArrayManipulator.flattenMultidimensionalArray | public static function flattenMultidimensionalArray(array $array, $glue) {
$iterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($array));
$result = array();
foreach ($iterator as $leafValue) {
$keys = array();
foreach (range(0, $iterator->getDepth()) as $depth) {
$keys[... | php | public static function flattenMultidimensionalArray(array $array, $glue) {
$iterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($array));
$result = array();
foreach ($iterator as $leafValue) {
$keys = array();
foreach (range(0, $iterator->getDepth()) as $depth) {
$keys[... | [
"public",
"static",
"function",
"flattenMultidimensionalArray",
"(",
"array",
"$",
"array",
",",
"$",
"glue",
")",
"{",
"$",
"iterator",
"=",
"new",
"\\",
"RecursiveIteratorIterator",
"(",
"new",
"\\",
"RecursiveArrayIterator",
"(",
"$",
"array",
")",
")",
";"... | Flattens a multidimensional array to a flat array, using custom glue.
This is the inverse of expandFromDotNotatedKeys(), e.g.,
['drush' => ['alias' => 'self']] would be flattened to
[drush.alias => 'self'].
@param array $array
The multidimensional array.
@param string $glue
The character(s) to use for imploding keys.... | [
"Flattens",
"a",
"multidimensional",
"array",
"to",
"a",
"flat",
"array",
"using",
"custom",
"glue",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Common/ArrayManipulator.php#L97-L109 | train |
acquia/blt | src/Robo/Common/ArrayManipulator.php | ArrayManipulator.convertArrayToFlatTextArray | public static function convertArrayToFlatTextArray(array $array) {
$rows = [];
$max_line_length = 60;
foreach ($array as $key => $value) {
if (is_array($value)) {
$flattened_array = self::flattenToDotNotatedKeys($value);
foreach ($flattened_array as $sub_key => $sub_value) {
... | php | public static function convertArrayToFlatTextArray(array $array) {
$rows = [];
$max_line_length = 60;
foreach ($array as $key => $value) {
if (is_array($value)) {
$flattened_array = self::flattenToDotNotatedKeys($value);
foreach ($flattened_array as $sub_key => $sub_value) {
... | [
"public",
"static",
"function",
"convertArrayToFlatTextArray",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"rows",
"=",
"[",
"]",
";",
"$",
"max_line_length",
"=",
"60",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
... | Converts a multi-dimensional array to a human-readable flat array.
Used primarily for rendering tables via Symfony Console commands.
@param array $array
The multi-dimensional array.
@return array
The human-readble, flat array. | [
"Converts",
"a",
"multi",
"-",
"dimensional",
"array",
"to",
"a",
"human",
"-",
"readable",
"flat",
"array",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Common/ArrayManipulator.php#L122-L156 | train |
acquia/blt | src/Robo/Commands/Blt/ConfigCommand.php | ConfigCommand.getValue | public function getValue($key) {
if (!$this->getConfig()->has($key)) {
throw new BltException("$key is not set.");
}
$this->say($this->getConfigValue($key));
} | php | public function getValue($key) {
if (!$this->getConfig()->has($key)) {
throw new BltException("$key is not set.");
}
$this->say($this->getConfigValue($key));
} | [
"public",
"function",
"getValue",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"BltException",
"(",
"\"$key is not set.\"",
")",
";",
"}",
"$",
"th... | Gets the value of a config variable.
@command blt:config:get
@aliases bcg config:get
@param string $key
The key for the configuration item to get.
@throws \Acquia\Blt\Robo\Exceptions\BltException | [
"Gets",
"the",
"value",
"of",
"a",
"config",
"variable",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Blt/ConfigCommand.php#L25-L31 | train |
acquia/blt | src/Robo/Commands/Blt/ConfigCommand.php | ConfigCommand.dump | public function dump() {
$config = $this->getConfig()->export();
ksort($config);
$this->printArrayAsTable($config);
} | php | public function dump() {
$config = $this->getConfig()->export();
ksort($config);
$this->printArrayAsTable($config);
} | [
"public",
"function",
"dump",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"export",
"(",
")",
";",
"ksort",
"(",
"$",
"config",
")",
";",
"$",
"this",
"->",
"printArrayAsTable",
"(",
"$",
"config",
")",
";",
... | Dumps all configuration values.
@command blt:config:dump
@aliases bcd dump config:dump | [
"Dumps",
"all",
"configuration",
"values",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Blt/ConfigCommand.php#L40-L44 | train |
acquia/blt | src/Robo/Common/YamlMunge.php | YamlMunge.mungeFiles | public static function mungeFiles($file1, $file2) {
$file1_contents = (array) self::parseFile($file1);
$file2_contents = (array) self::parseFile($file2);
return self::arrayMergeRecursiveExceptEmpty($file1_contents, $file2_contents);
} | php | public static function mungeFiles($file1, $file2) {
$file1_contents = (array) self::parseFile($file1);
$file2_contents = (array) self::parseFile($file2);
return self::arrayMergeRecursiveExceptEmpty($file1_contents, $file2_contents);
} | [
"public",
"static",
"function",
"mungeFiles",
"(",
"$",
"file1",
",",
"$",
"file2",
")",
"{",
"$",
"file1_contents",
"=",
"(",
"array",
")",
"self",
"::",
"parseFile",
"(",
"$",
"file1",
")",
";",
"$",
"file2_contents",
"=",
"(",
"array",
")",
"self",
... | Merges the arrays in two yaml files.
@param string $file1
The file path of the first file.
@param string $file2
The file path of the second file.
@return array
The merged arrays. | [
"Merges",
"the",
"arrays",
"in",
"two",
"yaml",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Common/YamlMunge.php#L24-L29 | train |
acquia/blt | src/Robo/Common/YamlMunge.php | YamlMunge.arrayMergeRecursiveExceptEmpty | public static function arrayMergeRecursiveExceptEmpty(array &$array1, array &$array2) {
$merged = $array1;
foreach ($array2 as $key => &$value) {
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key]) && !empty($value)) {
$merged[$key] = self::arrayMergeRecursiveExceptEmpty($merg... | php | public static function arrayMergeRecursiveExceptEmpty(array &$array1, array &$array2) {
$merged = $array1;
foreach ($array2 as $key => &$value) {
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key]) && !empty($value)) {
$merged[$key] = self::arrayMergeRecursiveExceptEmpty($merg... | [
"public",
"static",
"function",
"arrayMergeRecursiveExceptEmpty",
"(",
"array",
"&",
"$",
"array1",
",",
"array",
"&",
"$",
"array2",
")",
"{",
"$",
"merged",
"=",
"$",
"array1",
";",
"foreach",
"(",
"$",
"array2",
"as",
"$",
"key",
"=>",
"&",
"$",
"va... | Recursively merges arrays UNLESS second array is empty.
Preserves data types. If value in second array is empty, it will REPLACE
the corresponding key in the first array, rather than being merged.
@param array $array1
The first array.
@param array $array2
The second array.
@return array | [
"Recursively",
"merges",
"arrays",
"UNLESS",
"second",
"array",
"is",
"empty",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Common/YamlMunge.php#L91-L104 | train |
acquia/blt | src/Robo/Commands/Validate/AcsfCommand.php | AcsfCommand.validateAcsf | public function validateAcsf() {
$this->say("Validating ACSF settings...");
$task = $this->taskDrush()
->stopOnFail()
->drush("--include=modules/contrib/acsf/acsf_init acsf-init-verify");
$result = $task->run();
if (!$result->wasSuccessful()) {
throw new BltException("Failed to verify ... | php | public function validateAcsf() {
$this->say("Validating ACSF settings...");
$task = $this->taskDrush()
->stopOnFail()
->drush("--include=modules/contrib/acsf/acsf_init acsf-init-verify");
$result = $task->run();
if (!$result->wasSuccessful()) {
throw new BltException("Failed to verify ... | [
"public",
"function",
"validateAcsf",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Validating ACSF settings...\"",
")",
";",
"$",
"task",
"=",
"$",
"this",
"->",
"taskDrush",
"(",
")",
"->",
"stopOnFail",
"(",
")",
"->",
"drush",
"(",
"\"--include=modu... | Executes the acsf-init-validate command.
@command tests:acsf:validate | [
"Executes",
"the",
"acsf",
"-",
"init",
"-",
"validate",
"command",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Validate/AcsfCommand.php#L18-L27 | train |
acquia/blt | src/Robo/Commands/Setup/SettingsCommand.php | SettingsCommand.installGitHook | protected function installGitHook($hook) {
$fs = new Filesystem();
$project_hook_directory = $this->getConfigValue('repo.root') . "/.git/hooks";
$project_hook = $project_hook_directory . "/$hook";
if ($this->getConfigValue('git.hooks.' . $hook)) {
$this->say("Installing $hook git hook...");
... | php | protected function installGitHook($hook) {
$fs = new Filesystem();
$project_hook_directory = $this->getConfigValue('repo.root') . "/.git/hooks";
$project_hook = $project_hook_directory . "/$hook";
if ($this->getConfigValue('git.hooks.' . $hook)) {
$this->say("Installing $hook git hook...");
... | [
"protected",
"function",
"installGitHook",
"(",
"$",
"hook",
")",
"{",
"$",
"fs",
"=",
"new",
"Filesystem",
"(",
")",
";",
"$",
"project_hook_directory",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'repo.root'",
")",
".",
"\"/.git/hooks\"",
";",
"$",
"... | Installs a given git hook.
This symlinks the hook into the project's .git/hooks directory.
@param string $hook
The git hook to install, e.g., 'pre-commit'.
@throws \Acquia\Blt\Robo\Exceptions\BltException | [
"Installs",
"a",
"given",
"git",
"hook",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/SettingsCommand.php#L251-L289 | train |
acquia/blt | src/Robo/Commands/Setup/ConfigCommand.php | ConfigCommand.update | public function update() {
$task = $this->taskDrush()
->stopOnFail()
// Execute db updates.
// This must happen before features are imported or configuration is
// imported. For instance, if you add a dependency on a new extension to
// an existing configuration file, you must enable t... | php | public function update() {
$task = $this->taskDrush()
->stopOnFail()
// Execute db updates.
// This must happen before features are imported or configuration is
// imported. For instance, if you add a dependency on a new extension to
// an existing configuration file, you must enable t... | [
"public",
"function",
"update",
"(",
")",
"{",
"$",
"task",
"=",
"$",
"this",
"->",
"taskDrush",
"(",
")",
"->",
"stopOnFail",
"(",
")",
"// Execute db updates.",
"// This must happen before features are imported or configuration is",
"// imported. For instance, if you add ... | Update current database to reflect the state of the Drupal file system.
@command drupal:update
@aliases du setup:update
@executeInVm | [
"Update",
"current",
"database",
"to",
"reflect",
"the",
"state",
"of",
"the",
"Drupal",
"file",
"system",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/ConfigCommand.php#L21-L39 | train |
acquia/blt | src/Robo/Commands/Setup/ConfigCommand.php | ConfigCommand.import | public function import() {
$strategy = $this->getConfigValue('cm.strategy');
if ($strategy != 'none') {
$cm_core_key = $this->getConfigValue('cm.core.key');
$this->logConfig($this->getConfigValue('cm'), 'cm');
$task = $this->taskDrush();
$this->invokeHook('pre-config-import');
/... | php | public function import() {
$strategy = $this->getConfigValue('cm.strategy');
if ($strategy != 'none') {
$cm_core_key = $this->getConfigValue('cm.core.key');
$this->logConfig($this->getConfigValue('cm'), 'cm');
$task = $this->taskDrush();
$this->invokeHook('pre-config-import');
/... | [
"public",
"function",
"import",
"(",
")",
"{",
"$",
"strategy",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'cm.strategy'",
")",
";",
"if",
"(",
"$",
"strategy",
"!=",
"'none'",
")",
"{",
"$",
"cm_core_key",
"=",
"$",
"this",
"->",
"getConfigValue",
... | Imports configuration from the config directory according to cm.strategy.
@command drupal:config:import
@aliases dci setup:config-import
@validateDrushConfig
@executeInVm | [
"Imports",
"configuration",
"from",
"the",
"config",
"directory",
"according",
"to",
"cm",
".",
"strategy",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/ConfigCommand.php#L50-L111 | train |
acquia/blt | src/Robo/Commands/Setup/ConfigCommand.php | ConfigCommand.importConfigSplit | protected function importConfigSplit($task, $cm_core_key) {
$task->drush("pm-enable")->arg('config_split');
$task->drush("config-import")->arg($cm_core_key);
// Runs a second import to ensure splits are
// both defined and imported.
$task->drush("config-import")->arg($cm_core_key);
} | php | protected function importConfigSplit($task, $cm_core_key) {
$task->drush("pm-enable")->arg('config_split');
$task->drush("config-import")->arg($cm_core_key);
// Runs a second import to ensure splits are
// both defined and imported.
$task->drush("config-import")->arg($cm_core_key);
} | [
"protected",
"function",
"importConfigSplit",
"(",
"$",
"task",
",",
"$",
"cm_core_key",
")",
"{",
"$",
"task",
"->",
"drush",
"(",
"\"pm-enable\"",
")",
"->",
"arg",
"(",
"'config_split'",
")",
";",
"$",
"task",
"->",
"drush",
"(",
"\"config-import\"",
")... | Import configuration using config_split module.
@param \Acquia\Blt\Robo\Tasks\DrushTask $task
@param string $cm_core_key | [
"Import",
"configuration",
"using",
"config_split",
"module",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/ConfigCommand.php#L129-L135 | train |
acquia/blt | src/Robo/Commands/Setup/ConfigCommand.php | ConfigCommand.importFeatures | protected function importFeatures($task, $cm_core_key) {
$task->drush("config-import")->arg($cm_core_key)->option('partial');
$task->drush("pm-enable")->arg('features');
$task->drush("cc")->arg('drush');
if ($this->getConfig()->has('cm.features.bundle')) {
// Clear drush caches to register feature... | php | protected function importFeatures($task, $cm_core_key) {
$task->drush("config-import")->arg($cm_core_key)->option('partial');
$task->drush("pm-enable")->arg('features');
$task->drush("cc")->arg('drush');
if ($this->getConfig()->has('cm.features.bundle')) {
// Clear drush caches to register feature... | [
"protected",
"function",
"importFeatures",
"(",
"$",
"task",
",",
"$",
"cm_core_key",
")",
"{",
"$",
"task",
"->",
"drush",
"(",
"\"config-import\"",
")",
"->",
"arg",
"(",
"$",
"cm_core_key",
")",
"->",
"option",
"(",
"'partial'",
")",
";",
"$",
"task",... | Import configuration using features module.
@param \Acquia\Blt\Robo\Tasks\DrushTask $task
@param string $cm_core_key | [
"Import",
"configuration",
"using",
"features",
"module",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/ConfigCommand.php#L143-L156 | train |
acquia/blt | src/Robo/Commands/Setup/ConfigCommand.php | ConfigCommand.checkFeaturesOverrides | protected function checkFeaturesOverrides() {
if ($this->getConfigValue('cm.features.no-overrides')) {
// @codingStandardsIgnoreStart
$this->say("Checking for features overrides...");
if ($this->getConfig()->has('cm.features.bundle')) {
$task = $this->taskDrush()->stopOnFail();
for... | php | protected function checkFeaturesOverrides() {
if ($this->getConfigValue('cm.features.no-overrides')) {
// @codingStandardsIgnoreStart
$this->say("Checking for features overrides...");
if ($this->getConfig()->has('cm.features.bundle')) {
$task = $this->taskDrush()->stopOnFail();
for... | [
"protected",
"function",
"checkFeaturesOverrides",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getConfigValue",
"(",
"'cm.features.no-overrides'",
")",
")",
"{",
"// @codingStandardsIgnoreStart",
"$",
"this",
"->",
"say",
"(",
"\"Checking for features overrides...\"",... | Checks whether features are overridden.
@throws \Exception
If cm.features.no-overrides is true, and there are features overrides
an exception will be thrown. | [
"Checks",
"whether",
"features",
"are",
"overridden",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/ConfigCommand.php#L165-L190 | train |
acquia/blt | src/Robo/Commands/Setup/ConfigCommand.php | ConfigCommand.getExportedSiteUuid | protected function getExportedSiteUuid($cm_core_key) {
$site_config_file = $this->getConfigValue('docroot') . '/' . $this->getConfigValue("cm.core.dirs.$cm_core_key.path") . '/system.site.yml';
if (file_exists($site_config_file)) {
$site_config = Yaml::parseFile($site_config_file);
$site_uuid = $sit... | php | protected function getExportedSiteUuid($cm_core_key) {
$site_config_file = $this->getConfigValue('docroot') . '/' . $this->getConfigValue("cm.core.dirs.$cm_core_key.path") . '/system.site.yml';
if (file_exists($site_config_file)) {
$site_config = Yaml::parseFile($site_config_file);
$site_uuid = $sit... | [
"protected",
"function",
"getExportedSiteUuid",
"(",
"$",
"cm_core_key",
")",
"{",
"$",
"site_config_file",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'docroot'",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getConfigValue",
"(",
"\"cm.core.dirs.$cm_core_key.pat... | Returns the site UUID stored in exported configuration.
@param string $cm_core_key
@return null | [
"Returns",
"the",
"site",
"UUID",
"stored",
"in",
"exported",
"configuration",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/ConfigCommand.php#L212-L222 | train |
acquia/blt | src/Robo/Commands/Blt/DevCommand.php | DevCommand.linkComposer | public function linkComposer($options = ['blt-path' => InputOption::VALUE_REQUIRED]) {
$composer_json_filepath = $this->getConfigValue('repo.root') . '/composer.json';
$composer_json = json_decode(file_get_contents($composer_json_filepath));
$composer_json->repositories->blt = [
'type' => 'path',
... | php | public function linkComposer($options = ['blt-path' => InputOption::VALUE_REQUIRED]) {
$composer_json_filepath = $this->getConfigValue('repo.root') . '/composer.json';
$composer_json = json_decode(file_get_contents($composer_json_filepath));
$composer_json->repositories->blt = [
'type' => 'path',
... | [
"public",
"function",
"linkComposer",
"(",
"$",
"options",
"=",
"[",
"'blt-path'",
"=>",
"InputOption",
"::",
"VALUE_REQUIRED",
"]",
")",
"{",
"$",
"composer_json_filepath",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'repo.root'",
")",
".",
"'/composer.json... | Links to a local BLT package via a Composer path repository.
@command blt:dev:link-composer
@param array $options | [
"Links",
"to",
"a",
"local",
"BLT",
"package",
"via",
"a",
"Composer",
"path",
"repository",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Blt/DevCommand.php#L19-L33 | train |
acquia/blt | src/Robo/Hooks/ValidateHook.php | ValidateHook.validateSettingsFileIsValid | public function validateSettingsFileIsValid(CommandData $commandData) {
if (!$this->getInspector()->isDrupalSettingsFilePresent()) {
throw new BltException("Could not find settings.php for this site.");
}
if (!$this->getInspector()->isDrupalSettingsFileValid()) {
throw new BltException("BLT set... | php | public function validateSettingsFileIsValid(CommandData $commandData) {
if (!$this->getInspector()->isDrupalSettingsFilePresent()) {
throw new BltException("Could not find settings.php for this site.");
}
if (!$this->getInspector()->isDrupalSettingsFileValid()) {
throw new BltException("BLT set... | [
"public",
"function",
"validateSettingsFileIsValid",
"(",
"CommandData",
"$",
"commandData",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isDrupalSettingsFilePresent",
"(",
")",
")",
"{",
"throw",
"new",
"BltException",
"(",
"\... | Checks active settings.php file.
@hook validate @validateSettingsFileIsValid | [
"Checks",
"active",
"settings",
".",
"php",
"file",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Hooks/ValidateHook.php#L76-L84 | train |
acquia/blt | src/Robo/Hooks/ValidateHook.php | ValidateHook.validateVmConfig | public function validateVmConfig() {
if ($this->getInspector()->isDrupalVmLocallyInitialized() && $this->getInspector()->isDrupalVmBooted() && !$this->getInspector()->isDrupalVmConfigValid()) {
throw new BltException("Drupal VM configuration is invalid.");
}
} | php | public function validateVmConfig() {
if ($this->getInspector()->isDrupalVmLocallyInitialized() && $this->getInspector()->isDrupalVmBooted() && !$this->getInspector()->isDrupalVmConfigValid()) {
throw new BltException("Drupal VM configuration is invalid.");
}
} | [
"public",
"function",
"validateVmConfig",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isDrupalVmLocallyInitialized",
"(",
")",
"&&",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isDrupalVmBooted",
"(",
")",
"&&",
"!... | Validates that current PHP process is being executed inside of the VM.
@hook validate validateVmConfig | [
"Validates",
"that",
"current",
"PHP",
"process",
"is",
"being",
"executed",
"inside",
"of",
"the",
"VM",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Hooks/ValidateHook.php#L117-L121 | train |
acquia/blt | src/Robo/Hooks/ValidateHook.php | ValidateHook.validateGitConfig | public function validateGitConfig() {
if (!$this->getInspector()->isGitMinimumVersionSatisfied('2.0')) {
throw new BltException("Your system does not meet BLT's requirements. Please update git to 2.0 or newer.");
}
if (!$this->getInspector()->isGitUserSet()) {
if (!$this->getConfigValue('git.use... | php | public function validateGitConfig() {
if (!$this->getInspector()->isGitMinimumVersionSatisfied('2.0')) {
throw new BltException("Your system does not meet BLT's requirements. Please update git to 2.0 or newer.");
}
if (!$this->getInspector()->isGitUserSet()) {
if (!$this->getConfigValue('git.use... | [
"public",
"function",
"validateGitConfig",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isGitMinimumVersionSatisfied",
"(",
"'2.0'",
")",
")",
"{",
"throw",
"new",
"BltException",
"(",
"\"Your system does not meet BLT's requir... | Validates that Git user is configured.
@hook validate @validateGitConfig | [
"Validates",
"that",
"Git",
"user",
"is",
"configured",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Hooks/ValidateHook.php#L128-L139 | train |
acquia/blt | src/Robo/Commands/Git/GitCommand.php | GitCommand.commitMsgHook | public function commitMsgHook($message) {
$this->say('Validating commit message syntax...');
$pattern = $this->getConfigValue('git.commit-msg.pattern');
$help_description = $this->getConfigValue('git.commit-msg.help_description');
$example = $this->getConfigValue('git.commit-msg.example');
$this->lo... | php | public function commitMsgHook($message) {
$this->say('Validating commit message syntax...');
$pattern = $this->getConfigValue('git.commit-msg.pattern');
$help_description = $this->getConfigValue('git.commit-msg.help_description');
$example = $this->getConfigValue('git.commit-msg.example');
$this->lo... | [
"public",
"function",
"commitMsgHook",
"(",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"'Validating commit message syntax...'",
")",
";",
"$",
"pattern",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'git.commit-msg.pattern'",
")",
";",
"$",
"h... | Validates a git commit message.
@command internal:git-hook:execute:commit-msg
@aliases git:commit-msg
@hidden
@return int | [
"Validates",
"a",
"git",
"commit",
"message",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Git/GitCommand.php#L22-L43 | train |
acquia/blt | src/Robo/Commands/Git/GitCommand.php | GitCommand.preCommitHook | public function preCommitHook($changed_files) {
$collection = $this->collectionBuilder();
$collection->setProgressIndicator(NULL);
$collection->addCode(
function () use ($changed_files) {
return $this->invokeCommands([
'tests:phpcs:sniff:files' => ['file_list' => $changed_files],
... | php | public function preCommitHook($changed_files) {
$collection = $this->collectionBuilder();
$collection->setProgressIndicator(NULL);
$collection->addCode(
function () use ($changed_files) {
return $this->invokeCommands([
'tests:phpcs:sniff:files' => ['file_list' => $changed_files],
... | [
"public",
"function",
"preCommitHook",
"(",
"$",
"changed_files",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"collectionBuilder",
"(",
")",
";",
"$",
"collection",
"->",
"setProgressIndicator",
"(",
"NULL",
")",
";",
"$",
"collection",
"->",
"addCo... | Validates staged files.
@command internal:git-hook:execute:pre-commit
@aliases git:pre-commit
@hidden
@param string $changed_files
A list of staged files, separated by \n.
@return \Robo\Result | [
"Validates",
"staged",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Git/GitCommand.php#L57-L89 | train |
acquia/blt | src/Robo/Hooks/DrushHook.php | DrushHook.validateDrushConfig | public function validateDrushConfig(CommandData $commandData) {
$alias = $this->getConfigValue('drush.alias');
if ($alias && !$this->getInspector()->isDrushAliasValid("$alias")) {
$this->logger->error("Invalid drush alias '@$alias'.");
$this->logger->info('Troubleshooting suggestions:');
$this... | php | public function validateDrushConfig(CommandData $commandData) {
$alias = $this->getConfigValue('drush.alias');
if ($alias && !$this->getInspector()->isDrushAliasValid("$alias")) {
$this->logger->error("Invalid drush alias '@$alias'.");
$this->logger->info('Troubleshooting suggestions:');
$this... | [
"public",
"function",
"validateDrushConfig",
"(",
"CommandData",
"$",
"commandData",
")",
"{",
"$",
"alias",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'drush.alias'",
")",
";",
"if",
"(",
"$",
"alias",
"&&",
"!",
"$",
"this",
"->",
"getInspector",
"(... | Validates drush configuration for failed commands.
@hook validate @validateDrushConfig | [
"Validates",
"drush",
"configuration",
"for",
"failed",
"commands",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Hooks/DrushHook.php#L19-L29 | train |
acquia/blt | src/Robo/Common/TextMunge.php | TextMunge.munge | public static function munge($file1, $file2) {
$file1_contents = file($file1);
$file2_contents = file($file2);
$munged_contents = self::arrayMergeNoDuplicates($file1_contents, $file2_contents);
return (string) $munged_contents;
} | php | public static function munge($file1, $file2) {
$file1_contents = file($file1);
$file2_contents = file($file2);
$munged_contents = self::arrayMergeNoDuplicates($file1_contents, $file2_contents);
return (string) $munged_contents;
} | [
"public",
"static",
"function",
"munge",
"(",
"$",
"file1",
",",
"$",
"file2",
")",
"{",
"$",
"file1_contents",
"=",
"file",
"(",
"$",
"file1",
")",
";",
"$",
"file2_contents",
"=",
"file",
"(",
"$",
"file2",
")",
";",
"$",
"munged_contents",
"=",
"s... | Merges the arrays in two text files.
@param string $file1
The file path of the first file.
@param string $file2
The file path of the second file.
@return string
The merged arrays, in yaml format. | [
"Merges",
"the",
"arrays",
"in",
"two",
"text",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Common/TextMunge.php#L23-L30 | train |
acquia/blt | src/Robo/Common/TextMunge.php | TextMunge.arrayMergeNoDuplicates | public static function arrayMergeNoDuplicates(array &$array1, array &$array2) {
$merged = array_merge($array1, $array2);
$merged_without_dups = array_unique($merged);
$merged_rekeyed = array_values($merged_without_dups);
return $merged_rekeyed;
} | php | public static function arrayMergeNoDuplicates(array &$array1, array &$array2) {
$merged = array_merge($array1, $array2);
$merged_without_dups = array_unique($merged);
$merged_rekeyed = array_values($merged_without_dups);
return $merged_rekeyed;
} | [
"public",
"static",
"function",
"arrayMergeNoDuplicates",
"(",
"array",
"&",
"$",
"array1",
",",
"array",
"&",
"$",
"array2",
")",
"{",
"$",
"merged",
"=",
"array_merge",
"(",
"$",
"array1",
",",
"$",
"array2",
")",
";",
"$",
"merged_without_dups",
"=",
... | Merges two arrays and removes duplicate values.
@param array $array1
The first array.
@param array $array2
The second array.
@return array | [
"Merges",
"two",
"arrays",
"and",
"removes",
"duplicate",
"values",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Common/TextMunge.php#L42-L48 | train |
acquia/blt | src/Robo/Commands/Validate/AllCommand.php | AllCommand.all | public function all() {
$commands = [
'tests:composer:validate',
'tests:php:lint',
'tests:phpcs:sniff:all',
'tests:yaml:lint:all',
'tests:twig:lint:all',
];
// To enable this command, set validate.acsf to TRUE in blt.yml.
if ($this->getConfigValue('validate.acsf') == TRUE) ... | php | public function all() {
$commands = [
'tests:composer:validate',
'tests:php:lint',
'tests:phpcs:sniff:all',
'tests:yaml:lint:all',
'tests:twig:lint:all',
];
// To enable this command, set validate.acsf to TRUE in blt.yml.
if ($this->getConfigValue('validate.acsf') == TRUE) ... | [
"public",
"function",
"all",
"(",
")",
"{",
"$",
"commands",
"=",
"[",
"'tests:composer:validate'",
",",
"'tests:php:lint'",
",",
"'tests:phpcs:sniff:all'",
",",
"'tests:yaml:lint:all'",
",",
"'tests:twig:lint:all'",
",",
"]",
";",
"// To enable this command, set validate... | Runs all code validation commands.
@command validate
@aliases validate:all
@hidden | [
"Runs",
"all",
"code",
"validation",
"commands",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Validate/AllCommand.php#L19-L34 | train |
acquia/blt | src/Robo/Commands/Doctor/ComposerCheck.php | ComposerCheck.performAllChecks | public function performAllChecks() {
$this->checkRequire();
$this->checkBltRequireDev();
if (!$this->getInspector()->isVmCli()) {
$this->checkPrestissimo();
}
$this->checkComposerConfig();
return $this->problems;
} | php | public function performAllChecks() {
$this->checkRequire();
$this->checkBltRequireDev();
if (!$this->getInspector()->isVmCli()) {
$this->checkPrestissimo();
}
$this->checkComposerConfig();
return $this->problems;
} | [
"public",
"function",
"performAllChecks",
"(",
")",
"{",
"$",
"this",
"->",
"checkRequire",
"(",
")",
";",
"$",
"this",
"->",
"checkBltRequireDev",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isVmCli",
"(",
")",
... | Checks that composer.json is configured correctly. | [
"Checks",
"that",
"composer",
".",
"json",
"is",
"configured",
"correctly",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Doctor/ComposerCheck.php#L105-L114 | train |
acquia/blt | src/Robo/Commands/Doctor/ComposerCheck.php | ComposerCheck.checkComposerConfig | protected function checkComposerConfig() {
// @todo specify third key Acquia\\Blt\\Custom\\.
$this->compareComposerConfig('autoload', 'psr-4');
// @todo specify third key Drupal\\Tests\\PHPUnit\\\.
$this->compareComposerConfig('autoload-dev', 'psr-4');
$this->compareComposerConfig('extra', 'installe... | php | protected function checkComposerConfig() {
// @todo specify third key Acquia\\Blt\\Custom\\.
$this->compareComposerConfig('autoload', 'psr-4');
// @todo specify third key Drupal\\Tests\\PHPUnit\\\.
$this->compareComposerConfig('autoload-dev', 'psr-4');
$this->compareComposerConfig('extra', 'installe... | [
"protected",
"function",
"checkComposerConfig",
"(",
")",
"{",
"// @todo specify third key Acquia\\\\Blt\\\\Custom\\\\.",
"$",
"this",
"->",
"compareComposerConfig",
"(",
"'autoload'",
",",
"'psr-4'",
")",
";",
"// @todo specify third key Drupal\\\\Tests\\\\PHPUnit\\\\\\.",
"$",
... | Emits a warning if project Composer config is different than default. | [
"Emits",
"a",
"warning",
"if",
"project",
"Composer",
"config",
"is",
"different",
"than",
"default",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Doctor/ComposerCheck.php#L140-L152 | train |
acquia/blt | src/Robo/Commands/Doctor/WebUriCheck.php | WebUriCheck.checkUriResponse | protected function checkUriResponse() {
$site_available = $this->getExecutor()->execute("curl -I --insecure " . $this->drushStatus['uri'])->run()->wasSuccessful();
if (!$site_available) {
$this->logProblem(__FUNCTION__, [
"Did not get a response from {$this->drushStatus['uri']}",
"Is your ... | php | protected function checkUriResponse() {
$site_available = $this->getExecutor()->execute("curl -I --insecure " . $this->drushStatus['uri'])->run()->wasSuccessful();
if (!$site_available) {
$this->logProblem(__FUNCTION__, [
"Did not get a response from {$this->drushStatus['uri']}",
"Is your ... | [
"protected",
"function",
"checkUriResponse",
"(",
")",
"{",
"$",
"site_available",
"=",
"$",
"this",
"->",
"getExecutor",
"(",
")",
"->",
"execute",
"(",
"\"curl -I --insecure \"",
".",
"$",
"this",
"->",
"drushStatus",
"[",
"'uri'",
"]",
")",
"->",
"run",
... | Checks that configured URI responds to requests. | [
"Checks",
"that",
"configured",
"URI",
"responds",
"to",
"requests",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Doctor/WebUriCheck.php#L40-L51 | train |
acquia/blt | src/Robo/Commands/Doctor/WebUriCheck.php | WebUriCheck.checkHttps | protected function checkHttps() {
if (strstr($this->drushStatus['uri'], 'https')) {
if (!$this->getExecutor()->execute('curl -cacert ' . $this->drushStatus['uri'])->run()->wasSuccessful()) {
$this->logProblem(__FUNCTION__, [
"The SSL certificate for your local site appears to be invalid for ... | php | protected function checkHttps() {
if (strstr($this->drushStatus['uri'], 'https')) {
if (!$this->getExecutor()->execute('curl -cacert ' . $this->drushStatus['uri'])->run()->wasSuccessful()) {
$this->logProblem(__FUNCTION__, [
"The SSL certificate for your local site appears to be invalid for ... | [
"protected",
"function",
"checkHttps",
"(",
")",
"{",
"if",
"(",
"strstr",
"(",
"$",
"this",
"->",
"drushStatus",
"[",
"'uri'",
"]",
",",
"'https'",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getExecutor",
"(",
")",
"->",
"execute",
"(",
"'... | Checks that SSL cert is valid for configured URI. | [
"Checks",
"that",
"SSL",
"cert",
"is",
"valid",
"for",
"configured",
"URI",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Doctor/WebUriCheck.php#L56-L64 | train |
acquia/blt | src/Robo/Commands/Setup/WizardCommand.php | WizardCommand.wizard | public function wizard($options = [
'recipe' => InputOption::VALUE_REQUIRED,
]) {
$recipe_filename = $options['recipe'];
if ($recipe_filename) {
$answers = $this->loadRecipeFile($recipe_filename);
}
else {
$answers = $this->askForAnswers();
}
$this->say("<comment>You have ente... | php | public function wizard($options = [
'recipe' => InputOption::VALUE_REQUIRED,
]) {
$recipe_filename = $options['recipe'];
if ($recipe_filename) {
$answers = $this->loadRecipeFile($recipe_filename);
}
else {
$answers = $this->askForAnswers();
}
$this->say("<comment>You have ente... | [
"public",
"function",
"wizard",
"(",
"$",
"options",
"=",
"[",
"'recipe'",
"=>",
"InputOption",
"::",
"VALUE_REQUIRED",
",",
"]",
")",
"{",
"$",
"recipe_filename",
"=",
"$",
"options",
"[",
"'recipe'",
"]",
";",
"if",
"(",
"$",
"recipe_filename",
")",
"{... | Wizard for setting initial configuration.
@command wizard | [
"Wizard",
"for",
"setting",
"initial",
"configuration",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/WizardCommand.php#L26-L57 | train |
acquia/blt | src/Robo/Commands/Setup/WizardCommand.php | WizardCommand.loadRecipeFile | protected function loadRecipeFile($filename) {
if (!file_exists($filename)) {
throw new FileNotFoundException($filename);
}
$recipe = Yaml::parse(
file_get_contents($filename)
);
$configs = [$recipe];
$processor = new Processor();
$configuration_tree = new ProjectConfiguration();... | php | protected function loadRecipeFile($filename) {
if (!file_exists($filename)) {
throw new FileNotFoundException($filename);
}
$recipe = Yaml::parse(
file_get_contents($filename)
);
$configs = [$recipe];
$processor = new Processor();
$configuration_tree = new ProjectConfiguration();... | [
"protected",
"function",
"loadRecipeFile",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"(",
"$",
"filename",
")",
";",
"}",
"$",
"recipe",
"=",
"Yaml",
"::",... | Load a recipe.
@param string $filename
The recipe filename.
@return array | [
"Load",
"a",
"recipe",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/WizardCommand.php#L67-L83 | train |
acquia/blt | src/Robo/Commands/Setup/WizardCommand.php | WizardCommand.askForAnswers | protected function askForAnswers() {
$this->say("<info>Let's start by entering some information about your project.</info>");
$answers['human_name'] = $this->askDefault("Project name (human readable):", $this->getConfigValue('project.human_name'));
$default_machine_name = StringManipulator::convertStringToM... | php | protected function askForAnswers() {
$this->say("<info>Let's start by entering some information about your project.</info>");
$answers['human_name'] = $this->askDefault("Project name (human readable):", $this->getConfigValue('project.human_name'));
$default_machine_name = StringManipulator::convertStringToM... | [
"protected",
"function",
"askForAnswers",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"<info>Let's start by entering some information about your project.</info>\"",
")",
";",
"$",
"answers",
"[",
"'human_name'",
"]",
"=",
"$",
"this",
"->",
"askDefault",
"(",
"\... | Prompts the user for information.
@return array
An array of answers. | [
"Prompts",
"the",
"user",
"for",
"information",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Setup/WizardCommand.php#L91-L132 | train |
acquia/blt | src/Robo/Commands/Validate/ComposerCommand.php | ComposerCommand.validate | public function validate() {
$this->say("Validating composer.json and composer.lock...");
$result = $this->taskExecStack()
->dir($this->getConfigValue('repo.root'))
->exec('composer validate --no-check-all --ansi')
->run();
if (!$result->wasSuccessful()) {
$this->say($result->getMess... | php | public function validate() {
$this->say("Validating composer.json and composer.lock...");
$result = $this->taskExecStack()
->dir($this->getConfigValue('repo.root'))
->exec('composer validate --no-check-all --ansi')
->run();
if (!$result->wasSuccessful()) {
$this->say($result->getMess... | [
"public",
"function",
"validate",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Validating composer.json and composer.lock...\"",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"taskExecStack",
"(",
")",
"->",
"dir",
"(",
"$",
"this",
"->",
"getConfigVa... | Validates root composer.json and composer.lock files.
@command tests:composer:validate
@aliases tcv validate:composer | [
"Validates",
"root",
"composer",
".",
"json",
"and",
"composer",
".",
"lock",
"files",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Validate/ComposerCommand.php#L20-L33 | train |
acquia/blt | src/Robo/Commands/Doctor/ConfigCheck.php | ConfigCheck.checkDeprecatedKeys | protected function checkDeprecatedKeys() {
$deprecated_keys = [
'project.hash_salt',
'project.profile.contrib',
'project.vendor',
'project.description',
'project.themes',
'hosting',
];
$deprecated_keys_exist = FALSE;
$outcome = [];
foreach ($deprecated_keys as $de... | php | protected function checkDeprecatedKeys() {
$deprecated_keys = [
'project.hash_salt',
'project.profile.contrib',
'project.vendor',
'project.description',
'project.themes',
'hosting',
];
$deprecated_keys_exist = FALSE;
$outcome = [];
foreach ($deprecated_keys as $de... | [
"protected",
"function",
"checkDeprecatedKeys",
"(",
")",
"{",
"$",
"deprecated_keys",
"=",
"[",
"'project.hash_salt'",
",",
"'project.profile.contrib'",
",",
"'project.vendor'",
",",
"'project.description'",
",",
"'project.themes'",
",",
"'hosting'",
",",
"]",
";",
"... | Checks that is configured correctly at a high level. | [
"Checks",
"that",
"is",
"configured",
"correctly",
"at",
"a",
"high",
"level",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Doctor/ConfigCheck.php#L30-L51 | train |
acquia/blt | src/Robo/Commands/Vm/VmCommand.php | VmCommand.vm | public function vm($options = ['no-boot' => FALSE]) {
if (!$this->getInspector()->isDrupalVmConfigPresent()) {
$confirm = $this->confirm("Drupal VM is not currently installed. Install it now? ", TRUE);
if ($confirm) {
$this->install();
}
else {
return FALSE;
}
}
... | php | public function vm($options = ['no-boot' => FALSE]) {
if (!$this->getInspector()->isDrupalVmConfigPresent()) {
$confirm = $this->confirm("Drupal VM is not currently installed. Install it now? ", TRUE);
if ($confirm) {
$this->install();
}
else {
return FALSE;
}
}
... | [
"public",
"function",
"vm",
"(",
"$",
"options",
"=",
"[",
"'no-boot'",
"=>",
"FALSE",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isDrupalVmConfigPresent",
"(",
")",
")",
"{",
"$",
"confirm",
"=",
"$",
"this",
... | Configures and boots a Drupal VM.
@command recipes:drupalvm:init
@aliases rdi vm
@options no-boot
@throws \Exception | [
"Configures",
"and",
"boots",
"a",
"Drupal",
"VM",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Vm/VmCommand.php#L61-L84 | train |
acquia/blt | src/Robo/Commands/Vm/VmCommand.php | VmCommand.nuke | public function nuke() {
$confirm = $this->confirm("This will destroy your VM, and delete all associated configuration. Continue?");
if ($confirm) {
$this->taskExecStack()
->exec("vagrant destroy")
->dir($this->getConfigValue('repo.root'))
->printOutput(TRUE)
->stopOnFail()... | php | public function nuke() {
$confirm = $this->confirm("This will destroy your VM, and delete all associated configuration. Continue?");
if ($confirm) {
$this->taskExecStack()
->exec("vagrant destroy")
->dir($this->getConfigValue('repo.root'))
->printOutput(TRUE)
->stopOnFail()... | [
"public",
"function",
"nuke",
"(",
")",
"{",
"$",
"confirm",
"=",
"$",
"this",
"->",
"confirm",
"(",
"\"This will destroy your VM, and delete all associated configuration. Continue?\"",
")",
";",
"if",
"(",
"$",
"confirm",
")",
"{",
"$",
"this",
"->",
"taskExecSta... | Destroys existing VM and all related configuration.
@command recipes:drupalvm:destroy
@aliases rdd vm:nuke
@throws \Exception | [
"Destroys",
"existing",
"VM",
"and",
"all",
"related",
"configuration",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Vm/VmCommand.php#L93-L112 | train |
acquia/blt | src/Robo/Commands/Vm/VmCommand.php | VmCommand.config | protected function config() {
$this->say("Generating default configuration for Drupal VM...");
$this->createDrushAlias();
$this->createConfigFiles();
$this->customizeConfigFiles();
$vm_config = Yaml::parse(file_get_contents($this->projectDrupalVmConfigFile));
$this->validateConfig($vm_config);... | php | protected function config() {
$this->say("Generating default configuration for Drupal VM...");
$this->createDrushAlias();
$this->createConfigFiles();
$this->customizeConfigFiles();
$vm_config = Yaml::parse(file_get_contents($this->projectDrupalVmConfigFile));
$this->validateConfig($vm_config);... | [
"protected",
"function",
"config",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Generating default configuration for Drupal VM...\"",
")",
";",
"$",
"this",
"->",
"createDrushAlias",
"(",
")",
";",
"$",
"this",
"->",
"createConfigFiles",
"(",
")",
";",
"$"... | Generates default configuration for Drupal VM. | [
"Generates",
"default",
"configuration",
"for",
"Drupal",
"VM",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Vm/VmCommand.php#L128-L148 | train |
acquia/blt | src/Robo/Commands/Vm/VmCommand.php | VmCommand.localInitialize | protected function localInitialize() {
if (!$this->getInspector()->isBltLocalConfigFilePresent()) {
$this->invokeCommands(['blt:init:settings']);
}
$filename = $this->getConfigValue('blt.config-files.local');
$this->logger->info("Updating $filename");
$contents = Yaml::parse(file_get_content... | php | protected function localInitialize() {
if (!$this->getInspector()->isBltLocalConfigFilePresent()) {
$this->invokeCommands(['blt:init:settings']);
}
$filename = $this->getConfigValue('blt.config-files.local');
$this->logger->info("Updating $filename");
$contents = Yaml::parse(file_get_content... | [
"protected",
"function",
"localInitialize",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getInspector",
"(",
")",
"->",
"isBltLocalConfigFilePresent",
"(",
")",
")",
"{",
"$",
"this",
"->",
"invokeCommands",
"(",
"[",
"'blt:init:settings'",
"]",
")",
... | Configures local machine to use Drupal VM as default env for BLT commands. | [
"Configures",
"local",
"machine",
"to",
"use",
"Drupal",
"VM",
"as",
"default",
"env",
"for",
"BLT",
"commands",
"."
] | 8a903c1d930f82f4b9ee657d62d123782dd2ed59 | https://github.com/acquia/blt/blob/8a903c1d930f82f4b9ee657d62d123782dd2ed59/src/Robo/Commands/Vm/VmCommand.php#L153-L167 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.