Commit f3a53b56 authored by Dmitry Nikulin's avatar Dmitry Nikulin

Rename project to ipfs-images-php-client

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