1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/hutongkou-api-php

Клонировать/Скачать
api.php 527
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Mr.Reboot Отправлено 14.12.2016 18:05 45446d7
<?php
/**
* 定义API抽象类
* 输出通信数据
*/
abstract class Api
{
const JSON = 'Json';
const XML = 'Xml';
/**
* 定义工厂方式
* @param string $type [description]
* @return class [description]
*/
public static function factory($type = self::JSON)
{
$type = isset($_GET['format']) ? $_GET['format'] : $type;
$resultClass = ucwords($type);
require_once dirname(__FILE__) . '/Response/' . $type . '.php';
return new $resultClass;
}
abstract function response($code, $message, $data);
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/hutongkou-api-php.git
git@api.gitlife.ru:oschina-mirror/hutongkou-api-php.git
oschina-mirror
hutongkou-api-php
hutongkou-api-php
master