-
27 ФЕВР 20180
-
06 ФЕВР 20180
laracart - пакет для создания товарной корзины в laravel
LaraCart::add( $itemID, $name = null, $qty = 1, $price = '0.00', $options = [], $taxable = true, $lineItem = false ) // Adding an item to the cart LaraCart::add(2, 'Shirt', 200, 15.99, [ 'size' => 'XL' ]); // If you need line items rather than just updating the qty you can do LaraCart::addLine(2, 'Shirt', 200, 15.99, [ 'size' => 'XL' ]); // Also you can have your item not taxed $item = LaraCart::addLine(2, 'Shirt', 200, 15.99, [ 'size' => 'XL' ], $taxable = false );
https://github.com/lukepolo/laracart -
05 ФЕВР 20180
-
23 ЯНВ 20180
alek13/slack - простой laravel пакет для отправки сообщений в slack
Пример отправки сообщенияSlack::to('#accounting')->send('Are we rich yet?');
https://github.com/alek13/slack -
22 ЯНВ 20182
telegram-api - пхп апи для создание бота телеграм
<?php use \unreal4u\TelegramAPI\HttpClientRequestHandler; use \unreal4u\TelegramAPI\TgLog; use \unreal4u\TelegramAPI\Telegram\Methods\SendMessage; $loop = \React\EventLoop\Factory::create(); $handler = new HttpClientRequestHandler($loop); $tgLog = new TgLog(BOT_TOKEN, $handler); $sendMessage = new SendMessage(); $sendMessage->chat_id = A_USER_CHAT_ID; $sendMessage->text = 'Hello world!'; $tgLog->performApiRequest($sendMessage); $loop->run();
https://github.com/unreal4u/telegram-api -
19 ЯНВ 20180
idg - геренартор картинок ( быстрее чем html->pdf->image )
Требования Imagick. Можно создавать такие изображения:<?php require_once __DIR__ . '/vendor/autoload.php'; // font for example $fontRegular = 'RobotoCondensed-Regular.ttf'; $idg = new \Idg\Idg(1000, 3000, null, new ImagickPixel('#fff')); $idg->beginDocument(40, 30, 40, 30); $idg->beginRow(); $idg->beginColumn(300); $idg->image('test_image.jpg'); $idg->beginBlock()->setLeft(20); $idg->text('Figure 1. Dolore eu fugiat nulla pariatur.') ->setFont($fontRegular)->setFontSize(14)->setTextColor('#555'); $idg->endBlock(); $idg->endColumn(); $idg->beginColumn(600); $idg->text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.') ->setFont($fontRegular); $idg->endColumn(); $idg->endRow(); $idg->endDocument(); $idg->compose(); header('Content-Type: image/' . $idg->getCanvas()->getImageFormat()); print $idg->getImageBlob();
https://github.com/NikitchenkoSergey/idg -
18 ЯНВ 20181
Как разместить 11 000 000 элементов в памяти PHP
<?php pack('LLLc', 'user'); $key = '/var/www/test/visits/shmop.php'; $shm_key = ftok($key, 'v'); $shm_id = shmop_open($shm_key, "c", 0644, 13*11000000); $i = 1; while ($visitsData = @file_get_contents("data/visits_$i.json")) { $visitsData = json_decode($visitsData, true); foreach ($visitsData['visits'] as $k => $row) { $data = pack('LLLc', $row['user'], $row['location'], $row['visited_at'], $row['mark']); shmop_write ($shm_id , $data, $row['id']*13); } $i++;echo "$i\n"; } unset($visitsData); //$data = shmop_read($shm_id , $row['id']*13, 13); //$data = unpack('Luser/Llocation/Lvisited_at/cmark', $data); sleep(3600);
https://github.com/morozovsk/php-arrays-in-memory-comparison -
26 ДЕК 20170
Категории:
Оставить на заметку в: