承接 minicli/curly 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

minicli/curly

最新稳定版本:0.2.2

Composer 安装命令:

composer require minicli/curly

包简介

Simple Curl Client

README 文档

README

A tiny experimental curl client built for Minicli (but can be also used standalone).

Requirements

Requires curl and php-curl.

Installation

To include Curly in your app, first require the dependency with Composer:

composer require minicli/curly

Usage

Use the Minicli/Curl/Client class to make GET and POST requests using the get() and post() methods, respectively.

This example queries the DEV API and gets the latest posts from a user:

$crawler = new Client(); $articles_response = $crawler->get('https://dev.to/api/articles?username=erikaheidi'); if ($articles_response['code'] !== 200) { $app->getPrinter->error('Error while contacting the dev.to API.'); return 1; } $articles = json_decode($articles_response['body'], true); print_r($articles);

The following single-command Minicli application will fetch a user's latest stats from DEV.to using Curly (this requires minicli/minicli):

#!/usr/bin/env php <?php if (php_sapi_name() !== 'cli') { exit; } require __DIR__ . '/vendor/autoload.php'; use Minicli\App; use Minicli\Exception\CommandNotFoundException; use Minicli\Curly\Client; $app = new App([ 'debug' => true, 'theme' => '\Unicorn' ]); $app->registerCommand('devto', function () use ($app) { $app->getPrinter()->display('Fetching from DEV...'); $crawler = new Client(); $articles_response = $crawler->get('https://dev.to/api/articles?username=DEVUSERNAME'); if ($articles_response['code'] !== 200) { $app->getPrinter->error('Error while contacting the dev.to API.'); return 1; } $articles = json_decode($articles_response['body'], true); $table[] = ['Title', 'Reactions']; foreach($articles as $article) { $table[] = [$article['title'], $article['positive_reactions_count']]; } $app->getPrinter()->printTable($table); return 0; }); try { $app->runCommand($argv); } catch (CommandNotFoundException $notFoundException) { $app->getPrinter()->error("Command Not Found."); return 1; } return 0;

统计信息

  • 总下载量: 261.91k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 0
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固