-
02 ИЮНЬ 20171
-
01 ИЮНЬ 20171
palladium - пхп компонент для регистрации и авторизации
Работает на пхп 7+ и pdo
Включает в себя 4 компоненты: Registration, Identification, Search and Recovery
Пример регистрация<?php $registration = new \Palladium\Service\Registration($factory, $logger); $identity = $registration->createEmailIdentity('[email protected]', 'password'); $registration->bindAccountToIdentity($accountId, $identity);
https://github.com/teresko/palladium -
30 МАЙ 20171
zttp - пхп обертка для guzzle
$response = Zttp::withHeaders(['Fancy' => 'Pants'])->post($url, [ 'foo' => 'bar', 'baz' => 'qux', ]); $response->json();
https://github.com/kitetail/zttp -
29 МАЙ 20171
Imagery - php обертка для GD
Умеет ресайзить, кропать, перевораивать и вращать, создание коллажей, фильтры и эффекты.
Пример открытия файла$image = Imagery::open($filename); - from a file. $image = Imagery::create($width, $height); - new image $image = new Imagery(imagecreatefrombmp('image.bmp')); - from a resource
https://github.com/wapmorgan/Imagery
-
12 МАЙ 20170
-
01 МАЙ 20170
viber-bot-php - интерфейс на php для работы с API viber
Пример<?php require_once("../vendor/autoload.php"); use Viber\Bot; use Viber\Api\Sender; $apiKey = '<PLACE-YOU-API-KEY-HERE>'; // reply name $botSender = new Sender([ 'name' => 'Whois bot', 'avatar' => 'https://developers.viber.com/img/favicon.ico', ]); try { $bot = new Bot(['token' => $apiKey]); $bot ->onConversation(function ($event) use ($bot, $botSender) { // this event fires if user open chat, you can return "welcome message" // to user, but you can't send more messages! return (new \Viber\Api\Message\Text()) ->setSender($botSender) ->setText("Can i help you?"); }) ->onText('|whois .*|si', function ($event) use ($bot, $botSender) { // match by template, for example "whois Bogdaan" $bot->getClient()->sendMessage( (new \Viber\Api\Message\Text()) ->setSender($botSender) ->setReceiver($event->getSender()->getId()) ->setText("I do not know )") ); }) ->run(); } catch (Exception $e) { // todo - log exceptions }
https://github.com/bogdaan/viber-bot-php -
26 АПР 20170
wapmorgan/UnifiedPlaylist - php скрипт получение информации с плейлистов
use wapmorgan\UnifiedPlaylist\UnifiedPlaylist; if (UnifiedPlaylist::isPlaylist($tmpfile)) { $playlist = UnifiedPlaylist::open($tmpfile); /// ... operations here }
https://github.com/wapmorgan/UnifiedPlaylist -
07 АПР 20170
web-push-php - php скрипт для работы с web-push протоколом для отправки уведомлений в браузер
<?php use Minishlink\WebPush\WebPush; // array of notifications $notifications = array( array( 'endpoint' => 'https://updates.push.services.mozilla.com/push/abc...', // Firefox 43+ 'payload' => 'hello !', 'userPublicKey' => 'BPcMbnWQL5GOYX/5LKZXT6sLmHiMsJSiEvIFvfcDvX7IZ9qqtq68onpTPEYmyxSQNiH7UD/98AUcQ12kBoxz/0s=', // base 64 encoded, should be 88 chars 'userAuthToken' => 'CxVX6QsVToEGEcjfYPqXQw==', // base 64 encoded, should be 24 chars ), array( 'endpoint' => 'https://android.googleapis.com/gcm/send/abcdef...', // Chrome 'payload' => null, 'userPublicKey' => null, 'userAuthToken' => null, ), array( 'endpoint' => 'https://example.com/other/endpoint/of/another/vendor/abcdef...', 'payload' => '{msg:"test"}', 'userPublicKey' => '(stringOf88Chars)', 'userAuthToken' => '(stringOf24Chars)', ), ); $webPush = new WebPush(); // send multiple notifications with payload foreach ($notifications as $notification) { $webPush->sendNotification( $notification['endpoint'], $notification['payload'], // optional (defaults null) $notification['userPublicKey'], // optional (defaults null) $notification['userAuthToken'] // optional (defaults null) ); } $webPush->flush(); // send one notification and flush directly $webPush->sendNotification( $notifications[0]['endpoint'], $notifications[0]['payload'], // optional (defaults null) $notifications[0]['userPublicKey'], // optional (defaults null) $notifications[0]['userAuthToken'], // optional (defaults null) true // optional (defaults false) );
https://github.com/web-push-libs/web-push-php
Категории:
Оставить на заметку в: