コード例 #1
0
 /**
  * Retrieve administration informations if the token is valid.
  *
  * @param string $token The sha1 encrypted access token.
  * @throws luya\Exception If invalid token.
  * @return array
  */
 public function actionIndex($token)
 {
     if (empty(Yii::$app->remoteToken) || sha1(Yii::$app->remoteToken) !== $token) {
         throw new Exception('The provided remote token is wrong.');
     }
     return ['yii_version' => Yii::getVersion(), 'luya_version' => Boot::VERSION, 'app_title' => Yii::$app->siteTitle, 'app_debug' => (int) YII_DEBUG, 'app_env' => YII_ENV, 'app_transfer_exceptions' => (int) Yii::$app->errorHandler->transferException, 'admin_online_count' => UserOnline::getCount(), 'app_elapsed_time' => Yii::getLogger()->getElapsedTime()];
 }