Zend框架CLI [英] Zend framework cli
问题描述
我对Zend框架有疑问.我想在一个php文件中包含zend框架的主库,并在控制台上测试功能.我该如何简单地做到这一点.
I have a question about the Zend framework. I want to include the main library of the zend framework in a php file and test the functions on the console. How can I do this simply.
谢谢.
推荐答案
对于Zend框架1、2&3您可以使用composer依赖项管理器.
For Zend framework 1, 2 & 3 you can use composer dependency manager.
我认为您已经在系统上安装了php.
I assume you have php installed already on your system.
1)创建一个空文件夹,然后在其中放置composer.phar.
1) Create an empty folder and put composer.phar there.
2)更改为在控制台中创建的路径.
2) Change to the created path in the console.
3)根据要安装的版本运行以下命令之一.
3) Run one of the commands below depending on which version you want to install.
Zend 1
- php composer.phar需要zendframework/zendframework1
Zend 2
- php composer.phar需要zendframework/zendframework:2.4.11
Zend 3
- php composer.phar需要zendframework/zendframework:3.0.0
在包含内容的同一文件夹中创建脚本(例如test.php)
Create a script(e.g test.php) on the same folder with contents:
<?php
require __DIR__ . '/vendor/autoload.php';
// put your code after
运行脚本:
php test.php
php test.php
这篇关于Zend框架CLI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!