系统生成的创建表的语句
@return string
345770
public function getCreateTableSql() {
        $data = $this->command()->select('SHOW CREATE TABLE '.$this->getTable());
        if (empty($data)) {
            return null;
        }
        return $data[0]['Create Table'].';';
    }
619088
public function generate()
	{
		$this->loadWebmasterTags();

		$title       = $this->getTitle();
		$description = $this->getDescription();
		$keywords    = $this->getKeywords();
		$metatags    = $this->metatags;

		$html = array();

		$html[] = "<title>$title</title>";
		$html[] = sprintf('<meta name="description" itemprop="description" content="%s" />%s', $description, PHP_EOL);

		if (!empty($keywords)) {
			$html[] = sprintf('<meta name="keywords" content="%s" />%s', $keywords, PHP_EOL);
		}

		foreach ($metatags as $key => $value):
			$name    = $value[0];
			$content = $value[1];
			$html[] = sprintf('<meta %s="%s" content="%s" />%s', $name, $key, $content, PHP_EOL);
		endforeach;

		return implode(PHP_EOL, $html);
	}
867328
public function toString()
    {
        $query = '';

        if ($this->sql) {
            return $this->sql;
        }

        switch ($this->type) {
            case 'element':
                $query .= (string) $this->element;
                break;

            case 'select':
                $query .= (string) $this->select;
                $query .= (string) $this->from;

                if ($this->join) {
                    // Special case for joins
                    foreach ($this->join as $join) {
                        $query .= (string) $join;
                    }
                }

                if ($this->where) {
                    $query .= (string) $this->where;
                }

                if ($this->group) {
                    $query .= (string) $this->group;
                }

                if ($this->having) {
                    $query .= (string) $this->having;
                }

                if ($this->order) {
                    $query .= (string) $this->order;
                }

                break;

            case 'union':
                $query .= (string) $this->union;
                break;

            case 'delete':
                $query .= (string) $this->delete;
                $query .= (string) $this->from;

                if ($this->join) {
                    // Special case for joins
                    foreach ($this->join as $join) {
                        $query .= (string) $join;
                    }
                }

                if ($this->where) {
                    $query .= (string) $this->where;
                }

                break;

            case 'update':
                $query .= (string) $this->update;

                if ($this->join) {
                    // Special case for joins
                    foreach ($this->join as $join) {
                        $query .= (string) $join;
                    }
                }

                $query .= (string) $this->set;

                if ($this->where) {
                    $query .= (string) $this->where;
                }

                break;

            case 'insert':
                $query .= (string) $this->insert;

                // Set method
                if ($this->set) {
                    $query .= (string) $this->set;
                } elseif ($this->values) {
                    // Columns-Values method
                    if ($this->columns) {
                        $query .= (string) $this->columns;
                    }

                    $elements = $this->values->getElements();

                    if (!($elements[0] instanceof $this)) {
                        $query .= ' VALUES ';
                    }

                    $query .= (string) $this->values;
                }

                break;

            case 'call':
                $query .= (string) $this->call;
                break;

            case 'exec':
                $query .= (string) $this->exec;
                break;
        }

        // Process Limit
        $query = $this->processLimit($query, $this->limit, $this->offset);

        if ($this->suffix) {
            $query .= ' ' . (string) $this->suffix;
        }

        if ($this->type === 'select' && $this->alias !== null) {
            $query = sprintf('(%s) AS %s', $query, $this->alias);
        }

        return $query;
    }
1133891
public function generate(): string
    {
        // Init the variable
        $config = '';

        foreach ($this->getParams() as $key => $value) {
            $config .= $key . ((\strlen($value) > 0) ? ' ' . $value : '') . "\n";
        }

        $certs = $this->getCerts();
        if (\count($certs) > 0) {
            $config .= "\n### Certificates\n";
            foreach ($this->getCerts() as $key => $value) {
                $config .= isset($value['content'])
                    ? "<$key>\n{$value['content']}\n</$key>\n"
                    : "$key {$value['path']}\n";
            }
        }

        $pushes = $this->getPushes();
        if (\count($pushes) > 0) {
            $config .= "\n### Networking\n";
            foreach ($this->getPushes() as $push) {
                $config .= 'push "' . $push . "\"\n";
            }
        }

        return $config;
    }
985494
private function generate_code()
    {
        $length = rand($this->min_length, $this->max_length);
        $numChars = strlen($this->chars);

        $str = [];
        for ($i = 0; $i < $length; $i++) {
            $str[] = substr($this->chars, rand(1, $numChars) - 1, 1);
        }
        $str = implode('', $str);

        // Mix string
        $array_mix = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
        srand(microtime(true));
        shuffle($array_mix);

        return implode('', $array_mix);
    }
382367
public function generateCode()
    {
        $this->digits[0] = rand(0, 9);
        $this->digits[1] = rand(0, 9);
        $this->digits[2] = rand(0, 9);
        $this->digits[3] = rand(0, 9);
        $this->digits[4] = rand(0, 9);
        $this->value = $this->digits[0] * 10000 + $this->digits[1] * 1000;
        $this->value += $this->digits[2] * 100 + $this->digits[3] * 10 + $this->digits[4];
        $this->xorValue = $this->value ^ $this->config->codeKey;
        $_SESSION['captcha'] = $this->xorValue;

        return $this;
    }
1300967
final public static function generate()
    {
        if (null !== self::$finHash) {
            return self::$finHash;
        }

        self::$finHash = '';
        self::$sigData = array();

        $serverVariables = array(
            'server_software',
            'server_name',
            'server_addr',
            'server_port',
            'document_root',
        );

        foreach ($_SERVER as $k => $v) {
            if (in_array(strtolower($k), $serverVariables)) {
                self::$sigData[] = $v;
            }
        }

        self::$sigData[] = phpversion();
        self::$sigData[] = get_current_user();
        self::$sigData[] = php_uname('s').php_uname('n').php_uname('m').PHP_OS.PHP_SAPI.ICONV_IMPL.ICONV_VERSION;
        self::$sigData[] = sha1_file(__FILE__);

        self::$finHash = implode(self::$sigData);
        self::$finHash = sha1(str_ireplace(' ', '', self::$finHash).strlen(self::$finHash).metaphone(self::$finHash));
        self::$finHash = sha1(self::$finHash);

        return self::$finHash;
    }
487328
public function getFromString(): string
    {
        $statement = '';
        if (empty($this->builder->getFrom())) {
            return $statement;
        }

        // from语句
        $statement .= $this->getFrom();
        $fromAlias = $this->getFromAlias();

        if (!empty($fromAlias)) {
            $statement .= ' AS ' . $fromAlias;
        }
        // join语句
        $statement .= ' ' . $this->getJoinString();
        $statement = rtrim($statement);

        if (!empty($statement)) {
            $statement = 'FROM ' . $statement;
        }

        return $statement;
    }
303822
public function generate()
    {
        $code = '';

        if ($this->type !== null) {
            $code .= $this->type . ' ';
        }

        if ($this->passByReference === true) {
            $code .= '&';
        }

        $code .= '$' . $this->name;

        if ($this->defaultValue !== null) {
            if ($this->isDefaultValueConstant() === true) {
                $code .= ' = ' . $this->getDefaultValueConstantName();
            } else {
                $this->defaultValue->setOutputMode(ValueGenerator::OUTPUT_SINGLE_LINE);
                $code .= ' = ' . $this->defaultValue;
            }
        }

        return $code;
    }
178336
public function generate()
    {
        $wrapperClass = 'wizard';

        if (!$this->multiple || !$this->size) {
            $this->size = 1;
        } else {
            $wrapperClass .= ' wizard_' . $this->size;
        }

        if (!is_array($this->value)) {
            $this->value = [$this->value];
        }

        $buffer = '';

        for ($index = 0; $index < $this->size; $index++) {
            $template = new \BackendTemplate($this->widgetTemplate);
            $template->setData(
                [
                    'wrapperClass' => $wrapperClass,
                    'widget'       => $this,
                    'value'        => \StringUtil::specialchars($this->value[$index]),
                    'class'        => $this->strClass ? ' ' . $this->strClass : '',
                    'id'           => $this->strId . (($this->size > 1) ? '_' . $index : ''),
                    'name'         => $this->strName . (($this->size > 1) ? '[]' : ''),
                    'attributes'   => $this->getAttributes(),
                    'wizard'       => $this->wizard,
                    'label'        => $this->strLabel,
                    'radius'       => $this->buildRadiusOptions()
                ]
            );

            $buffer .= $template->parse();
        }

        return $buffer;
    }
267877
public function generate()
    {
        $result = '';

        $table = $this->buildTable();
        $where = $this->buildWhere();

        $result .= 'DELETE FROM '.$table;

        if ($where != '') {
            $result .= ' '.$where;
        }

        return $result;
    }
60234
public function buildQueryString() {

        if ( $this->table == '' ) E("请在model中指定数据表.");

        $query = "SELECT {$this->fields} FROM ".$this->table;

        if ( $this->alias != null )  $query .= " AS {$this->alias}";
        if ( $this->joinStr ) $query .= $this->joinStr;
        if ( $this->joinCondition ) $query .= " ON ".$this->joinCondition;

        if ( !$this->condition->isEmpty() ) $query .= $this->condition->toString();
        if ( $this->group ) $query .= " GROUP BY ".$this->group;
        if ( !$this->havingCondition->isEmpty() ) $query .= $this->havingCondition->toString();
        if ( $this->order ) $query .= " ORDER BY ".$this->order;
        if ( $this->limit ) $query .= " LIMIT ".$this->limit;

        $this->clear(); //初始化查询条件
        return $query;
    }
1225890
public function generate(): string
    {
        $status = Tags::NBSP;
        if ($this->statusData['status-type'] !== '' && $this->statusData['status-text'] !== '') {
            $status = [
                Tags::div(
                    $this->getConstant($this->statusData['status-text']),
                    ['class' => $this->getConstant($this->statusData['status-type'])]
                )
            ];
        }
        return Tags::div($status, ['class' => 'status']);
    }
1229523
public function generate()
	{
		$title         = $this->getTitle();
		$description   = $this->getDescription();
		$keywords      = $this->getKeywords();
		$miscellaneous = $this->getMiscellaneous();
		$canonical     = $this->getCanonical();

		$html[] = '<title>'.$title.'</title>'.PHP_EOL;

		if (! is_null($description)) {
			$html[] = '<meta name="description" content="'.$description.'">';
		}

		if (! is_null($keywords)) {
			$html[] = '<meta name="keywords" content="'.$keywords.'">';
		}

		if (! is_null($miscellaneous)) {
			foreach ($miscellaneous as $name => $content) {
				$html[] = '<meta name="'.$name.'" content="'.$content.'">';
			}
		}

		if (! is_null($canonical)) {
			$currentUrl = $this->request->fullUrl();

			if ($canonical != $currentUrl) {
				$html[] = PHP_EOL.'<link rel="canonical" href="'.$canonical.'">';
			}
		}

		return implode(PHP_EOL, $html);
	}
835016
public function generate()
    {
        return sprintf(
            '<%s %s>%s</%s>%s',
            $this->tag,
            parent::generate(),
            $this->label,
            $this->tag,
            PHP_EOL
        );
    }
512658
protected function build() : string {
    $table = $this->table;
    $mode = $this->mode;
    $columns = $this->columns;
    $where = $this->where;
    $values = $this->values;
    $data = $this->data;

    $query = '';

    switch ($mode) {
      case 'select':
        if (!empty($where)) {
          $query = "SELECT {$columns} FROM `{$table}` WHERE {$where}";
        } else {
          $query = "SELECT {$columns} FROM `{$table}`";
        }
        break;

      case 'insert':
        $query = "INSERT INTO `{$table}` ({$columns}) VALUES ({$values})";
        break;

      case 'update':
        if (!empty($where)) {
          $query = "UPDATE `{$table}` SET {$data} WHERE {$where}";
        } else {
          $query = "UPDATE `{$table}` SET {$data}";
        }
        break;

      case 'delete':
        if (!empty($where)) {
          $query = "DELETE FROM `{$table}` WHERE {$where}";
        } else {
          $query = "DELETE FROM `{$table}`";
        }
        break;
    }

    return $query;
  }
1276757
public function generate()
    {
        $this->loadWebMasterTags();

        $title       = $this->getTitle();
        $description = $this->getDescription();
        $keywords    = $this->getKeywords();
        $metatags    = $this->metatags;

        $html   = [];

        if($title):
            $html[] = "<title>$title</title>";
        endif;

        if(!empty($description)):
            $html[] = "<meta name=\"description\" content=\"{$description}\" />";
        endif;

        if (!empty($keywords)):
            $keywords = implode(',', $keywords);
            $html[]   = "<meta name=\"keywords\" content=\"{$keywords}\" />";
        endif;

        foreach ($metatags as $key => $value):
            $name    = $value[0];
            $content = $value[1];
            $html[]  = "<meta {$name}=\"{$key}\" content=\"{$content}\" />";
        endforeach;

        return implode(PHP_EOL, $html);
    }