Library Search
结果页

Hello World - 消息发送与接收

在 技术栈 中找到 8 个匹配结果。

返回文档库
技术栈

技术栈

8 个
查看全部
RabbitMQ # RabbitMQ Hello World - Python (pika) ## 目标 演示最基本的消息发送(Producer)和接收(Consumer)流程,使用 Direct Exchange + 默认队列。 ## 环境准备 ```bash pip install pika ``` ## 完整代码 ### 发送端(producer.py) ```python import pika… 3% PHP # PHP Hello World 例程 ## 目标 运行第一个 PHP 程序:输出 "Hello, World!" 并在浏览器中验证。 ## 方式一:CLI 命令行 创建 `hello.php`: ```php <?php echo "Hello, World!\n"; echo "今天的日期是:" . date('Y-m-d') . "\n"; ``` 运行: ```bash p… 3% Symfony ```bash curl http://localhost:8000/api/hello # {"message":"Hello, Vibe!","framework":"Symfony","php_version":"8.3.0","timestamp":"2024-01-01T00:00:00+00:00"} curl http://localhost:8000/api/hello/Worl… 3% CodeIgniter curl http://localhost:8080/hello/World # {"message":"Hello, World!","powered_by":"CodeIgniter 4"} ``` 3% Laravel # 响应 { "message": "Hello, Vibe!", "framework": "Laravel", "php_version": "8.2.12", "timestamp": "2024-01-01T00:00:00.000000Z" } # 带参数 curl http://localhost:8000/api/hello/World # {"message":… 3% CakePHP der $builder) { $builder->connect('/hello', ['controller' => 'Hello', 'action' => 'index']); $builder->connect('/hello/{name}', ['controller' => 'Hello', 'action' => 'greet']) ->setPas… 3% Laminas (Zend Framework) sonResponse([ 'message' => "Hello, {$name}!", 'powered_by' => 'Mezzio', ]); } } ``` **4. 注册路由 — `config/routes.php`** ```php use App\Handler\HelloHandler; use App… 3% Phalcon CTYPE html> <html> <head><title>Phalcon Hello</title></head> <body> <h1><?= $message ?></h1> <p>Powered by <strong><?= $framework ?></strong></p> <p>PHP <?= PHP_VERSION ?></p> </body> </ht… 3%