处理网络相关
@return void
187329
private function parseNetwork()
    {
        // 用户名密码处理
        $username = $this->request->getAttribute('username');
        if(null != $username)
        {
            $userPwd = $username . ':' . $this->request->getAttribute('password', '');
        }
        else
        {
            $userPwd = '';
        }
        curl_setopt_array($this->handler, array(
            // 连接超时
            CURLOPT_CONNECTTIMEOUT_MS       => $this->request->getAttribute('connectTimeout', 30000),
            // 总超时
            CURLOPT_TIMEOUT_MS              => $this->request->getAttribute('timeout', 0),
            // 下载限速
            CURLOPT_MAX_RECV_SPEED_LARGE    => $this->request->getAttribute('downloadSpeed'),
            // 上传限速
            CURLOPT_MAX_SEND_SPEED_LARGE    => $this->request->getAttribute('uploadSpeed'),
            // 连接中用到的用户名和密码
            CURLOPT_USERPWD                 => $userPwd,
        ));
    }
801860
public function init()
	{
		if($this->nextPageLabel===null)
			$this->nextPageLabel=Yii::t('yii','Next &gt;');
		if($this->prevPageLabel===null)
			$this->prevPageLabel=Yii::t('yii','&lt; Previous');
		if($this->firstPageLabel===null)
			$this->firstPageLabel=Yii::t('yii','&lt;&lt; First');
		if($this->lastPageLabel===null)
			$this->lastPageLabel=Yii::t('yii','Last &gt;&gt;');
		if($this->header===null)
			$this->header=Yii::t('yii','Go to page: ');

		if(!isset($this->htmlOptions['id']))
			$this->htmlOptions['id']=$this->getId();
		if(!isset($this->htmlOptions['class']))
			$this->htmlOptions['class']='yiiPager';
	}
993028
public function handle()
    {
        $topicName = trim($this->argument('topic'));

        $prefix = trim($this->option('prefix'));
        $max = trim($this->option('max'));
        $next = trim($this->option('next'));

        /**
         * @var Client
         */
        $client = $this->mns;
        if (!$client) {
            $this->error('请先配置阿里云MSN服务，并在DI里面注册');

            return;
        }

        try {
            $data = [];
            $topic = $client->getTopicRef($topicName);
            $res = $topic->listSubscription($max, $prefix, $next);
            if ($res->isSucceed()) {
                foreach ($res->getSubscriptionNames() as $subscriptionName) {
                    $subscription['name'] = $subscriptionName;

                    $attr = $topic->getSubscriptionAttribute($subscriptionName)->getSubscriptionAttributes();

                    $subscription['endpoint'] = $attr->getEndpoint();
                    $subscription['filterTag'] = $attr->getFilterTag();
                    $subscription['strategy'] = $attr->getStrategy();
                    $subscription['contentFormat'] = $attr->getContentFormat();
                    $subscription['createTime'] = date('Y-m-d H:i:s', $attr->getCreateTime());
                    $subscription['updateTime'] = date('Y-m-d H:i:s', $attr->getLastModifyTime());
                    $data[] = $subscription;
                }
            }


            $subscriptionHeaders = ['Name', 'Endpoint', 'FilterTag', 'Strategy', 'ContentFormat', 'CreateTime', 'UpdateTime'];
            $this->line("List of Subscriptions for Topic: $topicName");
            $this->table($subscriptionHeaders, $data);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
    }
749909
public function reload()
    {
        $httpServer = $this->getHttpServer();

        // 是否已启动
        if (!$httpServer->isRunning()) {
            output()->writeln('<error>The server is not running! cannot reload</error>', true, true);
        }

        output()->writeln(sprintf('<info>Server %s is reloading</info>', input()->getScript()));

        // 重载
        $reloadTask = input()->hasOpt('t');
        $httpServer->reload($reloadTask);
        output()->writeln(sprintf('<success>Server %s reload success</success>', input()->getScript()));
    }
905986
public function next()
    {
        $iterator = $this->iterators[$this->index];
        $next = $iterator->next();

        if (false === $this->valid() && isset($this->iterators[$this->index + 1])) {
            $this->index++;
        }
    }
1355599
public function safeUp()
    {
        $this->db->createCommand()
            ->insert('dp_admin_menu_url', [
                'name' => '菜单拖拽排序',
                'alias' => 'admin.menu.drop',
                'route' => '/admin/menu/drop',
                'host' => '',
                'note' => '',
                'method' => 'POST',
                'status' => 1,
            ])
            ->execute();

        $this->db->createCommand()
            ->insert('dp_admin_menu_url_relation', [
                'menu_id' => 5,
                'url_id' => $this->db->lastInsertID,
                'status' => 1,
            ])
            ->execute();
    }
39356
public function index()
    {
        $pagination = new Pagination();
        $pattern = StaticFilter::filter(
            'text',
            $this->getController()->request->getQuery('pattern', null)
        );
        $this->view = 'scaffold/index';
        $descriptor =  $this->getDescriptor();

        /** @var Select $query */
        $query = call_user_func_array([$this->getModelName(), 'find'], []);
        $field = $descriptor->getDisplayField();
        $tableName = $descriptor->getDescriptor()->getEntity()->getTableName();
        $query->where(
            [
                "{$tableName}.{$field} LIKE :pattern" => [
                    ':pattern' => "%{$pattern}%"
                ]
            ]
        );
        $pagination->setTotal($query->count());
        $query->limit(
            $pagination->rowsPerPage,
            $pagination->offset
        );
        $records = $query->all();
        $this->set(compact('pagination', 'records', 'pattern', 'descriptor'));
    }
158562
public function index()
    {
        $this->request->allowMethod('get');

        $query = $this->SavedSearches->find('all')
            ->where(['name IS NOT' => null])
            ->where(['name !=' => ''])
            ->where($this->request->getQueryParams());

        $entities = $this->paginate($query);

        $this->set('success', true);
        $this->set('data', $entities);
        $this->set('_serialize', ['success', 'data']);
    }
388197
public function executeResult(): void
    {
        // 状态码
        http_response_code($this->statusCode);
        // Content-Type
        if ($this->contentType != '') {
            header('Content-Type: ' . $this->contentType);
        }
        // 额外HTTP头
        if (! empty($this->extraHeaders)) {
            foreach ($this->extraHeaders as $value) {
                header($value);
            }
        }
        // session提交
        if (Application::$app->sessionStarted) {
            Application::$app->getService('session')->commit();
        }
        // 输出
        $this->outputContent();
    }
1142451
public function index()
    {
        $index = $this->getIndexName();

        $this->assertTrue(
            $this->table->hasIndex($index), "The {$this->name} column is not indexed."
        );

        $this->assertTrue(
            $this->table->getIndex($index)->isSimpleIndex(), "The {$this->name} column is not a simple index."
        );
    }
375726
public function index()
    {
        $groups = $this->Filter->filter($this->Groups->find('all'));
        $this->set([
            'groups' => $this->Filter->paginate($groups)
        ]);
    }
133121
public function next()
    {
        if ($this->x + 1 < $this->width) {
            $this->x++;
        } else {
            $this->x = 0;
            $this->y++;
        }

        $this->index++;
    }
472945
public function index()
    {
        $this->viewBuilder()->setLayout(false);
        $this->set('uiConfig', $this->config['ui']);
        $this->set('url', $this->getDefaultDocumentUrl());
    }
895253
public function index() {
		$currentType = $this->request->getQuery('type');

		if (DatabaseLogsTable::isSearchEnabled()) {
			$query = $this->DatabaseLogs->find('search', ['search' => $this->request->getQuery()]);
		} else {
			$conditions = $this->DatabaseLogs->textSearch();
			if ($currentType) {
				$conditions['type'] = $currentType;
			}
			$query = $this->DatabaseLogs->find()->where($conditions);
		}
		$query = $query->select(['id', 'created', 'type', 'summary', 'count']);

		$logs = $this->paginate($query);
		$types = $this->DatabaseLogs->getTypes();

		$this->set(compact('logs', 'types', 'currentType'));
	}
1218784
private function buildRow(): void
    {
        if ($this->model->noGutters) {
            $this->grid->addClass('no-gutters');
        }

        if ($this->model->rowClass) {
            $this->grid->addClass($this->model->rowClass);
        }

        if ($this->model->align) {
            $this->grid->align($this->model->align);
        }

        if ($this->model->justify) {
            $this->grid->justify($this->model->justify);
        }
    }
619344
public function index()
    {
        $this->getListingService()
            ->setOrder($this->getOrder())
            ->setPagination($this->getPagination())
            ->getFilters()->add($this->getSearchFilter());
        $this->set(
            [
                $this->getEntityNamePlural() => $this->getListingService()
                    ->getList(),
                'pagination' => $this->getListingService()->getPagination()
            ]
        );
    }
1188441
public function handle()
    {
        $id = $this->argument('id');

        if ($id === null) {
            $this->table(
                ['ID', 'Email'],
                User::all(['id', 'email'])->toArray()
            );
            $id = $this->ask('ID?');
        }

        User::where('id', $id)->update([
            'password' => bcrypt($this->secret('New password?'))
        ]);

        $this->info('User was updated');
    }