Commit f3a53b56 authored by Dmitry Nikulin's avatar Dmitry Nikulin

Rename project to ipfs-images-php-client

parent 609f6c88
API Index
=========
* AttachmentsClient
* [AttachmentsClient](AttachmentsClient-AttachmentsClient.md)
* IpfsImagesClient
* [IpfsImagesClient](IpfsImagesClient-IpfsImagesClient.md)
AttachmentsClient\AttachmentsClient
IpfsImagesClient\IpfsImagesClient
===============
......@@ -6,8 +6,8 @@ AttachmentsClient\AttachmentsClient
* Class name: AttachmentsClient
* Namespace: AttachmentsClient
* Class name: IpfsImagesClient
* Namespace: IpfsImagesClient
......@@ -21,7 +21,7 @@ Methods
### __construct
mixed AttachmentsClient\AttachmentsClient::__construct(string $baseUrl)
mixed IpfsImagesClient\IpfsImagesClient::__construct(string $baseUrl)
Создаёт экземпляр клиента.
......@@ -37,7 +37,7 @@ Methods
### getDownloadUrl
string AttachmentsClient\AttachmentsClient::getDownloadUrl(string $hash, string $name)
string IpfsImagesClient\IpfsImagesClient::getDownloadUrl(string $hash, string $name)
Возвращает URL для скачивания файла по его хэшу и имени.
......@@ -54,7 +54,7 @@ Methods
### getThumbnailUrl
string AttachmentsClient\AttachmentsClient::getThumbnailUrl(string $hash, $name)
string IpfsImagesClient\IpfsImagesClient::getThumbnailUrl(string $hash, $name)
Возвращает URL для миниатюры (thumbnail) изображения.
......@@ -71,7 +71,7 @@ Methods
### uploadFromFile
string AttachmentsClient\AttachmentsClient::uploadFromFile(string $filename)
string IpfsImagesClient\IpfsImagesClient::uploadFromFile(string $filename)
Загружает файл с диска на сервер (по имени файла).
......@@ -88,7 +88,7 @@ Methods
### uploadFromMemory
string AttachmentsClient\AttachmentsClient::uploadFromMemory(mixed $data, string $name)
string IpfsImagesClient\IpfsImagesClient::uploadFromMemory(mixed $data, string $name)
Загружает файл из памяти на сервер.
......@@ -106,7 +106,7 @@ Methods
### getUploadUrl
string AttachmentsClient\AttachmentsClient::getUploadUrl()
string IpfsImagesClient\IpfsImagesClient::getUploadUrl()
Возвращает URL для заливки (upload) файла. Вынесено в отдельный
protected-метод, чтобы можно было переопределить это в субклассе,
......
# Attachments PHP client
# IPFS images server PHP client
Эта библиотека предоставляет интерфейс на PHP для загрузки файлов на
сервер вложений.
сервер изображений.
Поддерживается загрузка файлов с диска и из памяти.
......@@ -11,18 +11,17 @@
```
{
"require": {
"theowl/attachments-client": "dev-master"
"ipfs-images/ipfs-images-php-client": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "<attachments-client-repo>"
"url": "git@gitlab.eterfund.ru:ipfs-images/ipfs-images-php-client.git"
}
]
}
```
`<attachments-client-repo>` нужно заменить на адрес репозитория.
После этого выполнить:
```
$ composer install
......@@ -45,9 +44,9 @@ $ vendor/bin/phpdocmd docs/structure.xml
require('vendor/autoload.php');
use AttachmentsClient\AttachmentsClient;
use IpfsImagesClient\IpfsImagesClient;
$client = new AttachmentsClient('http://img.azbyka.ru');
$client = new IpfsImagesClient('http://img.azbyka.ru');
echo "Trying file upload:\n";
echo $client->uploadFromFile(__FILE__);
echo "\n\n";
......
{
"name": "theowl/attachments-client",
"description": "A wrapper to access attachments server HTTP API",
"name": "ipfs-images/ipfs-images-php-client",
"description": "A wrapper to access IPFS images server HTTP API",
"autoload": {
"psr-4": {
"AttachmentsClient\\": "src/"
"IpfsImagesClient\\": "src/"
}
},
"require": {
......
<?php
namespace AttachmentsClient;
namespace IpfsImagesClient;
require('vendor/autoload.php');
use GuzzleHttp\Client;
class AttachmentsClient {
class IpfsImagesClient {
private $baseUrl;
private $client;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment