在新手学堂里面,咱们将从零基于 zendAPI
开发一个简单的 PHP
扩展,这个扩展的名字叫作 hellozapi
, 如今咱们着手准备开发须要的环境吧。php
demo 的项目库地址 github.com/zendapi/dem…
你们能够自行下载学习git
操做系统: MacOS 10.12.6
PHP: 安装的位置是 /usr/local/php7
版本号: 7.1.5
编译器: clang 3.5
, 安装的位置 /usr/local/llvm-3.5
CMake: 版本号: 3.7.2
编辑器: Qt Creator 4.3.1
zendAPI库: 版本 0.0.1
, 安装的位置 /usr/local
github
├── CMakeLists.txt // 项目主编译脚本
├── README.md // 项目说明文件
├── assets // 用于存放项目静态资源
│ └── php.ini // 用于测试的 PHP 配置文件
└── hellozapi // 项目代码文件夹
├── defs.h // hellozapi 头文件
├── defs.cpp // hellozapi 实现文件
└── entry.cpp // hellozapi 入口文件复制代码
如今咱们开始着手准备 hellozapi
的开发文件夹api
cd ~/
mkdir zendapidemodevel
cd zendapidemodevel
mkdir assets
mkdir hellzapi
touch CMakeLists.txt
touch README.md
touch assets/php.ini
touch hellozapi/defs.h
touch hellozapi/defs.cpp
touch hellozapi/entry.cpp复制代码
建立项目编译文件夹bash
cd ../
mkdir build-zendapidemo-debug复制代码
到此咱们的项目结构就准备完成,让咱们开始咱们的 zendAPI
扩展开发之旅吧。php7