Edit extension compile by c++
Esse commit está contido em:
+25
@@ -0,0 +1,25 @@
|
|||||||
|
## 安装和使用
|
||||||
|
### 下载
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/hihozhou/php-opencv.git
|
||||||
|
|
||||||
|
```
|
||||||
|
### 编译安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd php-opencv
|
||||||
|
phpize
|
||||||
|
./configure --with-php-config=your php-config path
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
```
|
||||||
|
|
||||||
|
### 修改php.ini
|
||||||
|
```
|
||||||
|
extension="opencv.so路径"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
##开发计划
|
||||||
|
|
||||||
+4
-2
@@ -57,7 +57,9 @@ if test "$PHP_OPENCV" != "no"; then
|
|||||||
dnl -L$OPENCV_DIR/$PHP_LIBDIR -lm
|
dnl -L$OPENCV_DIR/$PHP_LIBDIR -lm
|
||||||
dnl ])
|
dnl ])
|
||||||
dnl
|
dnl
|
||||||
dnl PHP_SUBST(OPENCV_SHARED_LIBADD)
|
|
||||||
|
|
||||||
PHP_NEW_EXTENSION(opencv, opencv.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
PHP_REQUIRE_CXX()
|
||||||
|
PHP_SUBST(OPENCV_SHARED_LIBADD)
|
||||||
|
PHP_ADD_LIBRARY(stdc++, 1, OPENCV_SHARED_LIBADD)
|
||||||
|
PHP_NEW_EXTENSION(opencv, opencv.cc, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
||||||
fi
|
fi
|
||||||
|
|||||||
+1
-1
@@ -8,6 +8,6 @@
|
|||||||
// ARG_ENABLE("opencv", "enable opencv support", "no");
|
// ARG_ENABLE("opencv", "enable opencv support", "no");
|
||||||
|
|
||||||
if (PHP_OPENCV != "no") {
|
if (PHP_OPENCV != "no") {
|
||||||
EXTENSION("opencv", "opencv.c", PHP_EXTNAME_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
|
EXTENSION("opencv", "opencv.cc", PHP_EXTNAME_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,13 +18,15 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
extern "C" {
|
||||||
#include "config.h"
|
#ifdef HAVE_CONFIG_H
|
||||||
#endif
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "php.h"
|
#include "php.h"
|
||||||
#include "php_ini.h"
|
#include "php_ini.h"
|
||||||
#include "ext/standard/info.h"
|
#include "ext/standard/info.h"
|
||||||
|
}
|
||||||
#include "php_opencv.h"
|
#include "php_opencv.h"
|
||||||
|
|
||||||
/* If you declare any globals in php_opencv.h uncomment this:
|
/* If you declare any globals in php_opencv.h uncomment this:
|
||||||
+5
-3
@@ -34,9 +34,11 @@ extern zend_module_entry opencv_module_entry;
|
|||||||
# define PHP_OPENCV_API
|
# define PHP_OPENCV_API
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ZTS
|
extern "C" {
|
||||||
#include "TSRM.h"
|
#ifdef ZTS
|
||||||
#endif
|
#include "TSRM.h"
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Declare any global variables you may need between the BEGIN
|
Declare any global variables you may need between the BEGIN
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário