Synchronize each multisite.

@command drupal:sync:all-sites
@aliases dsa sync:all
@executeInVm
332095
public function allSites() {
    $multisites = $this->getConfigValue('multisites');
    $this->printSyncMap($multisites);
    $continue = $this->confirm("Continue?", TRUE);
    if (!$continue) {
      return 0;
    }
    foreach ($multisites as $multisite) {
      $this->say("Refreshing site <comment>$multisite</comment>...");
      $this->switchSiteContext($multisite);
      $this->sync();
    }
  }
584064
protected List<Object> syncAndReturnAll() {
        List<Object> responseList = new ArrayList<>(clients.size());
        innerSync(responseList);
        return responseList;
    }
414873
def all_posts(self):
        """"""
        rev = self.db.get('site:rev')
        if int(rev) != self.revision:
            self.reload_site()

        return self._all_posts
602597
def sync_repos(repo_ids)
      collected = []
      repos = Repository.where(:id => repo_ids).syncable
      repos.each do |repo|
        if latest_task(repo).try(:state) != 'running'
          ForemanTasks.async_task(::Actions::Katello::Repository::Sync, repo)
        end
        collected << format_sync_progress(repo)
      end
      collected
    end
292445
protected function synchronizeConfigs(array $configFiles): void
	{
		foreach($configFiles as $variableName => $path) {
			$rowToAdd = $this->createRow($path);
			Helpers::appendToFile($this->configurationFile, $rowToAdd);
		}
	}
585976
public static function syncAllGroups()
	{
		// @TODO: chunk this to 1000 groups at a time

		$db = \App::get('db');

		$query = "SELECT gidNumber FROM `#__xgroups`;";

		$db->setQuery($query);

		$result = $db->loadColumn();

		if ($result === false)
		{
			return false;
		}

		foreach ($result as $row)
		{
			self::syncGroup($row);

			if (is_array(self::$errors['fatal']) && !empty(self::$errors['fatal'][0]))
			{
				// If there's a fatal error, go ahead and stop
				return self::$errors;
			}
		}

		if (!empty(self::$errors['fatal'][0]) || !empty(self::$errors['warning'][0]))
		{
			return self::$errors;
		}
		else
		{
			return self::$success;
		}
	}
1260584
public function updateAcsfSites($site, $target_env) {
    $this->say("Running updates for site <comment>$site</comment> in environment <comment>$target_env</comment>.");
    $this->switchSiteContext($site);
    $this->invokeCommand('artifact:update:drupal');
  }
865991
public function syncProjectPaths($paths, $dryRun = false) {
		foreach($paths as $path) {
			if(!DNProject::get()->filter('Name', $path)->count()) {
				$this->message($path);
				if(!$dryRun) {
					DNProject::create_from_path($path)->write();
				}
			}
		}
	}
926429
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($local_alias)
      ->option('--target-dump', sys_get_temp_dir() . '/tmp.target.sql.gz')
      ->option('structure-tables-key', 'lightweight')
      ->option('create-db');

    if ($this->getConfigValue('drush.sanitize')) {
      $task->drush('sql-sanitize');
    }

    $task->drush('cr');
    $task->drush('sqlq "TRUNCATE cache_entity"');

    $result = $task->run();

    return $result;
  }
563905
public function syncAll(array $options = [])
    {
        $sites = $this->siteRepository->findAll();

        foreach ($sites as $site) {
            $paymentMethods = \GuzzleHttp\json_decode((string) $this->api->settings->getPaymentMethods($site->getExternalId())->getBody());

            foreach ($paymentMethods as $paymentMethod) {
                $entity = $this->paymentMethodUpdater->updateFromApiResponse(DandomainFoundation\objectToArray($paymentMethod), $site->getCurrency()->getIsoCodeAlpha());
                $this->repository->save($entity);
            }
        }
    }
156018
def _load_sites(self):
        
        if not self.sites:
            self.sites = task.list_sites(self.datadir)
        return self.sites
1022411
def sync_all(name, **kwargs):
    '''
    
    '''
    ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}

    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = "saltutil.sync_all would have been run"
        return ret

    try:
        sync_status = __salt__['saltutil.sync_all'](**kwargs)
        for key, value in sync_status.items():
            if value:
                ret['changes'][key] = value
                ret['comment'] = "Sync performed"
    except Exception as e:
        log.error("Failed to run saltutil.sync_all: %s", e)
        ret['result'] = False
        ret['comment'] = "Failed to run sync_all: {0}".format(e)
        return ret

    if not ret['changes']:
        ret['comment'] = "No updates to sync"

    return ret
1130580
private function loadAll(): void
  {
    $this->findSourceFiles();
    $this->detectNameConflicts();
    $this->getColumnTypes();
    $this->readStoredRoutineMetadata();
    $this->getConstants();
    $this->getOldStoredRoutinesInfo();
    $this->getCorrectSqlMode();

    $this->loadStoredRoutines();

    // Drop obsolete stored routines.
    $this->dropObsoleteRoutines();

    // Remove metadata of stored routines that have been removed.
    $this->removeObsoleteMetadata();

    $this->io->writeln('');

    // Write the metadata to file.
    $this->writeStoredRoutineMetadata();
  }
791058
public function syncAll(array $options = [])
    {
        // @todo fix site repository
        $siteIds = [26];
        $currency = 'DKK';

        foreach ($siteIds as $siteId) {
            $shippingMethods = \GuzzleHttp\json_decode((string) $this->api->settings->getShippingMethods($siteId)->getBody());

            foreach ($shippingMethods as $shippingMethod) {
                $entity = $this->shippingMethodUpdater->updateFromApiResponse(DandomainFoundation\objectToArray($shippingMethod), $currency);
                $this->repository->save($entity);
            }
        }
    }
688734
private void sync() {
    List<SwimMember> syncMembers = discoveryService.getNodes().stream()
        .map(node -> new SwimMember(MemberId.from(node.id().id()), node.address()))
        .filter(member -> !member.id().equals(localMember.id()))
        .collect(Collectors.toList());
    for (SwimMember member : syncMembers) {
      sync(member.copy());
    }
  }
243285
def synchronize! updater
      source_hash[updater.filename] = source_hash[updater.filename].synchronize(updater)
    end
53946
public boolean syncServers(NewRelicCache cache)
    {
        boolean ret = true;

        if(apiClient == null)
            throw new IllegalArgumentException("null API client");

        // Get the server configuration using the REST API
        if(cache.isServersEnabled())
        {
            ret = false;

            logger.info("Getting the servers");
            cache.servers().add(apiClient.servers().list());
            cache.setUpdatedAt();

            ret = true;
        }

        return ret;
    }