app-arena/php-sdk

App-Arena.com App-Manager PHP SDK

2.3.11 2020-03-25 15:39 UTC

README

入门指南

使用此 SDK 设置与您的 App-Arena™ 平台项目 的连接。

安装

使用 composer 安装 SDK 的最新版本。

composer require app-arena/php-sdk

在 index.php 或类似的文件中初始化 SDK

// In your index.php
require __DIR__ . '/vendor/autoload.php';

// Add App-Arena App-Manager
$am = new \AppArena\AppManager([
    'appId' => 1234, // (optional) If you know the appId, then submit it here. Else the SDK will try to get it form GET, POST, REQUEST parameters or facebook settings
    'versionId' => 123, // Add the required version ID of your project version here
    'root_path' => __DIR__ . '/public', // Root path accessible from the web
    'cache' => [
        'dir' => __DIR__ . '/public/var/cache', // Writable folder for file cache. Check the cache section for more options
    ],
    'apikey' => 'ABCDEFGHIJKLMNOPQRSTUVW' // Add you API key here
]);
// Get config values, languages, translations and infos from the current app, template or version
$configs      = $am->getConfigs();
$infos        = $am->getInfos();
$languages    = $am->getLanguages();
$translations = $am->getTranslations();

现在连接已设置,您可以从 App-Manager 接收内容。App-Manager SDK 会自动检测您是否想通过请求中发送的查询参数显示应用程序、模板或版本

如果您指定了多个这些查询参数,则 versionIdtemplateId 更重要,而 templateId 又比 appId 重要。

核心概念

  • 缓存:激活内置的后端缓存之一,以加快用户的加载时间
  • CSS / LESS / SCSS:了解 PHP SDK 如何让您轻松地为每个应用程序编译文件
  • 智能链接:基于用户设备和设置的智能用户重定向

特殊 GET 参数

将其中一个参数附加到 URL 以修改 PHP SDK 的行为

方法