construct a string of space-delimited control keys based on properties of this class.

@param bool $disconnect
@return string
11
protected function getControlKey($disconnect = false)
    {
        $key = '';

        if ($disconnect) {
            return "*immed";
        }

        /*
        if(?) *justproc
        if(?) *debug
        if(?) *debugproc
        if(?) *nostart
        if(?) *rpt*/

        // Idle timeout supported by XMLSERVICE 1.62
        // setting idle for *sbmjob protects the time taken by program calls
        // Do that with *idle(30/kill) or whatever the time in seconds.
        if (trim($this->getOption('idleTimeout')) != '') {
            $idleTimeout = $this->getOption('idleTimeout');
            $key .= " *idle($idleTimeout/kill)"; // ends idle only, but could end MSGW with *call(30/kill)
        }

        // if cdata requested, request it. XMLSERVICE will then wrap all output in CDATA tags.
        if ($this->getOption('cdata')) {
            $key .= " *cdata";
        }

        /* stateless calls in stored procedure job
         *
         * Add *here, which will run everything inside the current PHP/transport job
         * without spawning or submitting a separate XTOOLKIT job.
         */
        if ($this->isStateless()) {
            $key .= " *here";
        } else {
            // not stateless, so could make sense to supply *sbmjob parameters for spawning a separate job.
            if (trim($this->getOption('sbmjobParams')) != '') {
               $sbmjobParams = $this->getOption('sbmjobParams');
               $key .= " *sbmjob($sbmjobParams)";
            }
        }

        // if internal XMLSERVICE tracing, into database table XMLSERVLOG/LOG, is desired
        if ($this->getOption('trace')) {
            $key .= " *log";
        }

        // directive not to run any program, but to parse XML and return parsed output, including dim/dou.
        if ($this->getOption('parseOnly')) {
            $key .= " *test";

            // add a debugging level (1-9) to the parse, to make *test(n) where n is the debugging level
            if ($parseDebugLevel = $this->getOption('parseDebugLevel')) {
                $key .= "($parseDebugLevel)";
            }
        }

        // return XMLSERVICE version/license information (no XML calls)
        if ($this->getOption('license')) {
            $key .= " *license";
        }

        // check proc call speed (no XML calls)
        if ($this->getOption('transport')) {
            $key .= " *justproc";
        }

        // get performance of last call data (no XML calls)
        if ($this->getOption('performance')) {
            $key .= " *rpt";
        }

        // *fly is number of ticks of each operation. *nofly is the default
        if ($this->getOption('timeReport')) {
            $key .= " *fly";
        }

        // PASE CCSID for <sh> type of functions such as WRKACTJOB ('system' command in PASE)
        if ($paseCcsid = $this->getOption('paseCcsid')) {
            $key .= " *pase($paseCcsid)";
        }

        // allow custom control keys
        if ($this->getOption('customControl')) {
            $key .= " {$this->getOption('customControl')}";
        }

        return trim($key); // trim off any extra blanks on beginning or end
    }
522651
public function getConnectionString()
    {

        $settings = $this->connectionInfo;
        unset( $settings['search_path'] );

        foreach ($settings as $key => &$value) {
            $value = sprintf(
                "%s='%s'",
                $key,
                $value
            );
        }

        return implode(' ', $settings);

    }
929288
public function del($key)
    {
        if (is_string($key)) {
            $key = [$key];
        }

        return $this->getConnection()->del($key);
    }
1253719
final public function generateFile($filename, $format = 'Excel2007', $disconnect = true)
    {
        // perform the formatting
        $this->formatFile();
        // set the first sheet active, to make sure that is the sheet people see when they open the file
        $this->file->setActiveSheetIndex(0);

        list($path, $filename) = $this->writeFileToTmp($filename, $format, $disconnect);
        $this->setGenerated(true);

        return array($path, $filename);
    }
1178526
public function disconnect()
    {
        if (!$this->connected || !$this->server || ($this->mode ==  "mysql" && $this->server->connect_error)) {
            return false;
        }

        $result = false;

        switch ($this->mode) {

            case "mysql":
            case "sqlite":
                $result = $this->server->close();
                break;

            case "postgres":
            case "redshift":
                $result = pg_close($this->server);
                break;

            case "odbc":
                odbc_close($this->server);
                $result = true;
                break;

            case "mssql":
                $result = mssql_close($this->server);
                break;

            case "mssqlsrv":
                $result = sqlsrv_close($this->server);
                break;
        }

        # If the disconnect was successful, set class property to reflect it
        if ($result) {
            $this->connected = false;
        }

        return $result;
    }
486634
protected function _get_key($remove = false)
	{
		// get the current index information
		list($identifier, $sections, $index) = $this->_get_index();
		$index = $index === null ? array() : $index = $this->_unserialize($index);

		// get the key from the index
		$key = isset($index[$identifier][0]) ? $index[$identifier][0] : false;

		if ($remove === true)
		{
			if ( $key !== false )
			{
				unset($index[$identifier]);
				static::$redis->set($this->config['cache_id'].':index:'.$sections, $this->_serialize($index));
			}
		}
		else
		{
			// create a new key if needed
			$key === false and $key = $this->_new_key();
		}

		return $key;
	}
1326299
public function getCommand($hostConnection = true)
    {
        if (is_null($this->username)) {
            throw new \InvalidArgumentException("You must specify a SSH username");
        }

        if (is_null($this->host)) {
            throw new \InvalidArgumentException("You must specify a SSH host to connect");
        }

        $command = new Command($this->executable);

        if ($this->port != 22) {
            $command->addArgument("p", $this->port);
        }

        if (!is_null($this->privateKey)) {
            $command->addArgument("i", $this->privateKey);
        }

        if ($hostConnection) {
            $command->addParameter($this->getHostConnection());
        }

        return $command;
    }
921570
protected function connectionString($inbox = '')
    {
        return sprintf(static::$connectionFormat, $this->host, $this->port, $this->service, $this->enc, $inbox);
    }
675330
public function getName(array $keys = [], string $delimiter = "."): string
    {
        if (empty($keys)) {
            return $this->name;
        }

        $keys[] = $this->name;
        return implode($delimiter, $keys);
    }
1248378
protected function filterControl(string $delimiter, string $enclosure, string $escape, string $caller): array
    {
        $controls = ['delimiter' => $delimiter, 'enclosure' => $enclosure, 'escape' => $escape];
        foreach ($controls as $type => $control) {
            if ('escape' === $type && '' === $control && 70400 <= PHP_VERSION_ID) {
                continue;
            }

            if (1 !== strlen($control)) {
                throw new Exception(sprintf('%s() expects %s to be a single character', $caller, $type));
            }
        }

        return array_values($controls);
    }
1102773
public function toString($delimiter = ',')
    {
        $result = [];
        array_walk_recursive($this->attributes, function($v) use (&$result) {
            $result[] = $v;
        });

        return \implode($delimiter, $result);
    }
515809
function snake( string $delimiter = '_' ) : SplString
    {
        $string = $this->__toString();
        if( !ctype_lower( $string ) ){
            $string = preg_replace( '/\s+/u', '', ucwords( $this->__toString() ) );
            $string = $this->setString( preg_replace( '/(.)(?=[A-Z])/u', '$1'.$delimiter, $string ) );
            $this->setString( $string );
            $this->lower();
        }
        return $this;
    }
1020183
public function toString(string $delimiter = ' ')
    {
        $fieldListString = '';

        foreach ($this->fieldList as $fieldName => $fieldBoost) {
            $fieldListString .= $fieldName;

            if ($fieldBoost != 1.0) {
                $fieldListString .= '^' . number_format($fieldBoost, 1, '.', '');
            }

            $fieldListString .= $delimiter;
        }

        return rtrim($fieldListString, $delimiter);
    }
958395
public static function arrayToString(array $array, $delimiter = ""): string {
        $string = "";
        foreach ($array as $value) {
            if (\is_array($value)) {
                $string .= ArrayUtil::arrayToString($value, $delimiter) . $delimiter;
            } else {
                $string .= $value . $delimiter;
            }
        }
        return $string;
    }
24500
protected function getConnectionString($hosts, $protocol, $port)
    {
        // Normalize hosts into an array.
        $hosts = is_array($hosts) ? $hosts : [$hosts];

        $hosts = array_map(function ($host) use ($protocol, $port) {
            return "{$protocol}{$host}:{$port}";
        }, $hosts);

        return implode(' ', $hosts);
    }
179774
public function toString($delimiter = ' ') {
        $queryFieldString = '';

        foreach ($this->queryFields as $fieldName => $fieldBoost) {
            $queryFieldString .= $fieldName;

            if ($fieldBoost != 1.0) {
                $queryFieldString .= '^' . number_format($fieldBoost, 1, '.', '');
            }

            $queryFieldString .= $delimiter;
        }

        return rtrim($queryFieldString, $delimiter);
    }
551306
protected function connectDb($db, $reConnect = false)
    {
        if ($db == 'rlink') {
            //如果没有指定从数据库，则使用 master
            if (empty($this->conf['slaves'])) {
                self::$dbInst[$db] = $this->rlink = $reConnect ? $this->connectDb('wlink', true) : $this->wlink;
                return $this->rlink;
            }

            $n = mt_rand(0, count($this->conf['slaves']) - 1);
            $conf = $this->conf['slaves'][$n];
            empty($conf['engine']) && $conf['engine'] = '';
            self::$dbInst[$db] = $this->rlink = $this->connect(
                $conf['host'],
                $conf['username'],
                $conf['password'],
                $conf['dbname'],
                $conf['charset'],
                $conf['engine'],
                $conf['pconnect']
            );
            return $this->rlink;
        } elseif ($db == 'wlink') {
            $conf = $this->conf['master'];
            empty($conf['engine']) && $conf['engine'] = '';
            self::$dbInst[$db] = $this->wlink = $this->connect(
                $conf['host'],
                $conf['username'],
                $conf['password'],
                $conf['dbname'],
                $conf['charset'],
                $conf['engine'],
                $conf['pconnect']
            );
            return $this->wlink;
        }
        return false;
    }