Creates string replacement table between source base and target base.
@return array<string,string> String replacement table for converting numbers
346249
private function buildConversionTable()
    {
        if ($this->source->getRadix() > $this->target->getRadix()) {
            return $this->createTable($this->source->getDigitList(), $this->target->getDigitList());
        }

        return array_flip($this->createTable($this->target->getDigitList(), $this->source->getDigitList()));
    }
1203962
private function getBaseTables() {
    $base_tables = [];

    /** @var array[] $wizard_plugins */
    $wizard_plugins = $this->viewsWizardManager->getDefinitions();
    foreach ($wizard_plugins as $wizard) {
      if (!array_key_exists('base_table', $wizard)) {
        continue;
      }
      $base_tables[$wizard['base_table']] = (string) $wizard['title'];
    }

    return $base_tables;
  }
1335554
public function getForDynamoDB()
    {
        $parameters = array();

        foreach ($this->keysByTable as $table => $keys) {
            $parameters[$table] = array(
                'Keys' => array()
            );

            foreach ($keys as $key) {
                list($hash, $range) = $key;

                $formatedKey = array();

                // Convert to attribute
                $hash = new Attribute($hash);
                $formatedKey['HashKeyElement'] = $hash->getForDynamoDB();

                // Range key
                if (null !== $range) {
                    $range = new Attribute($range);
                    $formatedKey['RangeKeyElement'] = $range->getForDynamoDB();
                }

                $parameters[$table]['Keys'][] = $formatedKey;
            }

            if (isset($this->attributesToGetByTable[$table])) {
                $parameters[$table]['AttributesToGet'] = $this->attributesToGetByTable[$table];
            }

        }

        return array('RequestItems' => $parameters);
    }
1347486
@Override
    public String[] outputColumnNames() {
        List<String> l = transform(inputSchema).getColumnNames();
        return l.toArray(new String[l.size()]);
    }
187683
private function compileColumns()
    {
        $columnstring = '';
        foreach ($this->columns as $columnentry) {
            if ($columnentry->table == false) {
                $columnentry->table = $this->table;
            }
            if ($columnentry->column == '*') {
                $columnstring .= '`' . $columnentry->table . '`.' . $columnentry->column;
            } else {
                $columnstring .= '`' . $columnentry->table . '`.`' . $columnentry->column . '`';
            }
            if ($columnentry->alias !== false) {
                $columnstring .= ' AS `' . $columnentry->alias . '`';
            }
            $columnstring .= ', ';
        }
        return rtrim($columnstring, ', ') . ' ';
    }
450091
public function makeTableMapDTO()
    {
        $data = [];
        $data['table_id'] = $this->binaryDataReader->readTableId();
        $this->binaryDataReader->advance(2);
        $data['schema_length'] = $this->binaryDataReader->readUInt8();
        $data['schema_name'] = $this->binaryDataReader->read($data['schema_length']);

        if (Config::checkDataBasesOnly($data['schema_name'])) {
            return null;
        }

        $this->binaryDataReader->advance(1);
        $data['table_length'] = $this->binaryDataReader->readUInt8();
        $data['table_name'] = $this->binaryDataReader->read($data['table_length']);

        if (Config::checkTablesOnly($data['table_name'])) {
            return null;
        }

        $this->binaryDataReader->advance(1);
        $data['columns_amount'] = $this->binaryDataReader->readCodedBinary();
        $data['column_types'] = $this->binaryDataReader->read($data['columns_amount']);

        if ($this->cache->has($data['table_id'])) {
            return new TableMapDTO($this->eventInfo, $this->cache->get($data['table_id']));
        }

        $this->binaryDataReader->readCodedBinary();

        $columns = $this->repository->getFields($data['schema_name'], $data['table_name']);

        $fields = [];
        // if you drop tables and parse of logs you will get empty scheme
        if (!empty($columns)) {
            $columnLength = strlen($data['column_types']);
            for ($i = 0; $i < $columnLength; ++$i) {
                // this a dirty hack to prevent row events containing columns which have been dropped
                if (!isset($columns[$i])) {
                    $columns[$i] = [
                        'COLUMN_NAME' => 'DROPPED_COLUMN_' . $i,
                        'COLLATION_NAME' => null,
                        'CHARACTER_SET_NAME' => null,
                        'COLUMN_COMMENT' => null,
                        'COLUMN_TYPE' => 'BLOB',
                        'COLUMN_KEY' => ''
                    ];

                    $type = ConstFieldType::IGNORE;
                } else {
                    $type = ord($data['column_types'][$i]);
                }

                $fields[$i] = Columns::parse($type, $columns[$i], $this->binaryDataReader);
            }
        }

        $tableMap = new TableMap(
            $data['schema_name'],
            $data['table_name'],
            $data['table_id'],
            $data['columns_amount'],
            $fields
        );

        $this->cache->set($data['table_id'], $tableMap);

        return new TableMapDTO($this->eventInfo, $tableMap);
    }
408633
public function ___build(): string
    {
        $tables = \implode(', ', $this->from);
        $where = $limit = '';

        if ($this->where !== '') {
            $where = \sprintf(' WHERE %s', $this->where);
        }
        if ($this->limit !== 0) {
            $limit = \sprintf(' LIMIT %s', $this->limit);
        }

        return \sprintf('DELETE FROM %s%s%s', $tables, $where, $limit);
    }
831551
public function baseConvert(array $source, int $sourceBase, int $targetBase): array
    {
        $result = [];
        while ($count = count($source)) {
            $quotient = [];
            $remainder = 0;
            for ($i = 0; $i !== $count; $i++) {
                $accumulator = $source[$i] + $remainder * $sourceBase;
                /* Same as PHP 7 intdiv($accumulator, $targetBase) */
                $digit = ($accumulator - ($accumulator % $targetBase)) / $targetBase;
                $remainder = $accumulator % $targetBase;
                if (count($quotient) || $digit) {
                    $quotient[] = $digit;
                }
            }
            array_unshift($result, $remainder);
            $source = $quotient;
        }

        return $result;
    }
986105
public function generateJson()
    {
        $sourceMap = array();
        $mappings  = $this->generateMappings();

        // File version (always the first entry in the object) and must be a positive integer.
        $sourceMap['version'] = self::VERSION;

        // An optional name of the generated code that this source map is associated with.
        $file = $this->options['sourceMapFilename'];

        if ($file) {
            $sourceMap['file'] = $file;
        }

        // An optional source root, useful for relocating source files on a server or removing repeated values in the
        // 'sources' entry. This value is prepended to the individual entries in the 'source' field.
        $root = $this->options['sourceRoot'];

        if ($root) {
            $sourceMap['sourceRoot'] = $root;
        }

        // A list of original sources used by the 'mappings' entry.
        $sourceMap['sources'] = array();

        foreach ($this->sources as $source_uri => $source_filename) {
            $sourceMap['sources'][] = $this->normalizeFilename($source_filename);
        }

        // A list of symbol names used by the 'mappings' entry.
        $sourceMap['names'] = array();

        // A string with the encoded mapping data.
        $sourceMap['mappings'] = $mappings;

        if ($this->options['outputSourceFiles']) {
            // An optional list of source content, useful when the 'source' can't be hosted.
            // The contents are listed in the same order as the sources above.
            // 'null' may be used if some original sources should be retrieved by name.
            $sourceMap['sourcesContent'] = $this->getSourcesContent();
        }

        // less.js compat fixes
        if (count($sourceMap['sources']) && empty($sourceMap['sourceRoot'])) {
            unset($sourceMap['sourceRoot']);
        }

        return json_encode($sourceMap);
    }
591249
public function getReplacements()
    {
        $replacements = array_merge(parent::getReplacements(), ['root_namespace' => $this->getAppNamespace()]);

        if ($this->scaffold) {
            return array_merge($replacements, $this->scaffolder->toArray());
        }

        return $replacements;
    }
942386
public function build(): string
    {
        $sql = [];
        $sql = $this->getUpdateSql($sql);
        $sql = $this->getSetSql($sql);
        $sql = $this->condition->getWhereSql($sql);
        $sql = $this->getOrderBySql($sql);
        $sql = $this->getLimitSql($sql);
        $result = trim(implode(' ', $sql)) . ';';

        return $result;
    }
62563
public String toBase85String() {
		String result;
		if(hasNoStringCache() || (result = getStringCache().base85String) == null) {
			getStringCache().base85String = result = toBase85String(null);
		}
		return result;
	}
701329
public function toTable()
  {
    $table = array();

    foreach($this->toLines(0) as $cells)
    {
      $pairs = $cells->split(TeamSpeak3::SEPARATOR_CELL);

      if(!func_num_args())
      {
        for($i = 0; $i < count($pairs); $i++) $pairs[$i]->unescape();
      }

      $table[] = $pairs;
    }

    return $table;
  }
1254027
public function replace($table, array $columns = null, array $where = null): ?array
    {
        if (\is_array($table)) {
            $columns = $this->getColumns($table, false);
            $table = $this->getTable($table);
            $where = $table;
        } elseif ($where) {
            $where = [SQL::WHERE => $where];
        }

        if (!\is_array($columns) || empty($columns)) {
            return null;
        }

        $map = [];
        $stack = [];

        foreach ($columns as $column => $replacements) {
            if (\is_array($replacements)) {
                foreach ($replacements as $old => $new) {
                    $mapKey = $this->mapKey();

                    $stack[] = $this->columnQuote($column) . ' = REPLACE(' . $this->columnQuote($column) . ', ' . $mapKey . 'a, ' . $mapKey . 'b)';

                    $map[$mapKey . 'a'] = [$old, PDO::PARAM_STR];
                    $map[$mapKey . 'b'] = [$new, PDO::PARAM_STR];
                }
            }
        }

        if ($stack === []) {
            return null;
        }

        $sql = 'UPDATE ' . $this->tableQuote($table) . ' SET ' .
            \implode(', ', $stack) . $this->suffixClause($where, $map);

        return [$sql, $map];
    }
185634
public function replace() {

		if(null !== $this -> match) {

			foreach($this -> match[0] as $index => $match) {

				$match 	= new MatchTranslation($this -> match[2][$index], true);
				$output = $match -> replace() -> getLine();

				$match 	= new MatchEscape($output, true);
				$output = $match -> replace() -> getLine();
				
				$match 	= new MatchRouter($output, true);
				$output = $match -> replace() -> getLine();

				$match 	= new MatchHelper($output, true);
				$output = $match -> replace() -> getLine();

				$match 	= new MatchFails($output, true);
				$output = $match -> replace() -> getLine();

				$match 	= new MatchPasses($output, true);
				$output = $match -> replace() -> getLine();

				//User defined functions
				foreach(TemplateData :: getTemplateFunctions() as $action => $closure) {

					$class  = Template :: NAMESPACE_MATCH . 'MatchUserDefined';
					$match  = new $class($output, $action, true);
					$output = $match -> replace() -> getLine();
				}

				$match 	= new MatchVariable($output);
				$output = $match -> replace() -> getLine();

				$code = '$this -> template(\'' . $this -> action . '\', [' . $output . '])';
				$code = false === $this -> getInline() ? '<?php echo ' . $code . '; ?>' : $code;

				$this -> line = preg_replace('/' . preg_quote($this -> match[0][$index], '/') . '/', $code, $this -> line , 1);
			}
		}

		return $this;
	}
1148557
private static function ReplaceVars(){
            $oThis = self::CreateInstanceIfNotExists();

            $aP = array();
            $iOffset = 0;

            while(preg_match('/(\{\$(.*?)\})/i', $oThis->sBuffer, $aMatches, PREG_OFFSET_CAPTURE, $iOffset)){
                $mVar = $aMatches[2][0];

                if(Storage::Has($mVar)){
                    $mTo = Storage::Get($mVar);

                    if(is_bool($mTo))
                        $mTo = ($mTo) ? "true" : "false";

                    $mTo = html_entity_decode($mTo, ENT_NOQUOTES/*, Config::Read("l10n.charset")*/);
                    $oThis->sBuffer = str_replace($aMatches[0][0], $mTo, $oThis->sBuffer);
                }

                $iOffset = $aMatches[0][1]+strlen($aMatches[0][0]);
            }
        }
1144584
public function toString()
    {
        if (!$this->_parts['table']) {
            throw new SqlException("Invalid `CREATE TABLE` statement missing table name.");
        }

        if (!$this->_parts['columns']) {
            throw new SqlException("Invalid `CREATE TABLE` statement missing columns.");
        }

        return 'CREATE TABLE' .
            $this->_buildFlag('IF NOT EXISTS', $this->_parts['ifNotExists']) .
            $this->_buildChunk($this->dialect()->name($this->_parts['table'])) .
            $this->_buildDefinition($this->_parts['columns'], $this->_parts['constraints']) .
            $this->_buildChunk($this->dialect()->meta('table', $this->_parts['meta']));
    }