Skip to content

Commit

Permalink
Seperate C files, improve compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Jan 18, 2013
1 parent b057202 commit 7e81a14
Show file tree
Hide file tree
Showing 49 changed files with 961 additions and 168 deletions.
59 changes: 59 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.in by autoheader. */

/* Whether to build yaf as dynamic module */
#define COMPILE_DL_YAF 1

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define PACKAGE_NAME ""

/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""

/* Define to the version of this package. */
#define PACKAGE_VERSION ""

/* define to 1 if you want to change the POST/GET by php script */
#define PHP_YAF_DEBUG 0

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
34 changes: 33 additions & 1 deletion config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,37 @@ if test "$PHP_YAF" != "no"; then
else
AC_MSG_RESULT([$php_version, ok])
fi
PHP_NEW_EXTENSION(yaf, yaf.c yaf_application.c yaf_bootstrap.c yaf_dispatcher.c yaf_exception.c yaf_config.c yaf_request.c yaf_response.c yaf_view.c yaf_controller.c yaf_action.c yaf_router.c yaf_loader.c yaf_registry.c yaf_plugin.c yaf_session.c, $ext_shared)
PHP_NEW_EXTENSION(yaf,
yaf.c \
yaf_application.c \
yaf_bootstrap.c \
yaf_dispatcher.c \
yaf_exception.c \
yaf_config.c \
configs/ini.c \
configs/simple.c \
yaf_request.c \
requests/http.c \
requests/simple.c \
yaf_response.c \
response/http.c \
response/cli.c \
yaf_view.c \
views/interface.c \
views/simple.c \
yaf_controller.c \
yaf_action.c \
yaf_router.c \
routes/interface.c \
routes/static.c \
routes/simple.c \
routes/supervar.c \
routes/regex.c \
routes/rewrite.c \
routes/map.c \
yaf_loader.c \
yaf_registry.c \
yaf_plugin.c \
yaf_session.c,
$ext_shared)
fi
5 changes: 2 additions & 3 deletions config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
ARG_ENABLE("yaf", "enable yaf support", "no");

if (PHP_YAF == "yes") {
EXTENSION("yaf", "yaf.c yaf_application.c yaf_loader.c yaf_bootstrap.c yaf_config.c yaf_dispatcher.c yaf_registry.c yaf_controller.c yaf_action.c yaf_view.c yaf_request.c yaf_response.c yaf_router.c yaf_exception.c yaf_plugin.c yaf_session.c");

AC_DEFINE("HAVE_YAF", 1, "Have Yaf Support");
EXTENSION("yaf", "yaf.c yaf_application.c yaf_bootstrap.c yaf_dispatcher.c yaf_exception.c yaf_config.c configs/ini.c configs/simple.c yaf_request.c requests/http.c requests/simple.c yaf_response.c response/http.c response/cli.c yaf_view.c views/interface.c views/simple.c yaf_controller.c yaf_action.c yaf_router.c routes/interface.c routes/static.c routes/simple.c routes/supervar.c routes/regex.c routes/rewrite.c routes/map.c yaf_loader.c yaf_registry.c yaf_plugin.c yaf_session.c");
AC_DEFINE("HAVE_YAF", 1, "Have Yaf Support");
}
41 changes: 28 additions & 13 deletions configs/ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,31 @@

/* $Id: ini.c 329002 2013-01-07 12:55:53Z laruence $ */

zend_class_entry *yaf_config_ini_ce;
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

yaf_config_t * yaf_config_ini_instance(yaf_config_t *this_ptr, zval *filename, zval *section TSRMLS_DC);
#include "php.h"
#include "php_ini.h"
#include "Zend/zend_interfaces.h"

#define YAF_CONFIG_INI_PARSING_START 0
#define YAF_CONFIG_INI_PARSING_PROCESS 1
#define YAF_CONFIG_INI_PARSING_END 2
#include "php_yaf.h"
#include "yaf_namespace.h"
#include "yaf_exception.h"
#include "yaf_config.h"
#include "configs/ini.h"

zend_class_entry *yaf_config_ini_ce;

#ifdef HAVE_SPL
extern PHPAPI zend_class_entry *spl_ce_Countable;
#endif

/** {{{ ARG_INFO
*/
ZEND_BEGIN_ARG_INFO_EX(yaf_config_ini_void_arginfo, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(yaf_config_ini_construct_arginfo, 0, 0, 1)
ZEND_ARG_INFO(0, config_file)
ZEND_ARG_INFO(0, section)
Expand Down Expand Up @@ -808,14 +823,14 @@ zend_function_entry yaf_config_ini_methods[] = {
PHP_ME(yaf_config_ini, __isset, yaf_config_ini_isset_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, get, yaf_config_ini_get_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, set, yaf_config_ini_set_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, count, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, rewind, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, current, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, next, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, valid, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, key, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, toArray, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, readonly, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, count, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, rewind, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, current, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, next, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, valid, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, key, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, toArray, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, readonly, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_ini, offsetUnset, yaf_config_ini_unset_arginfo, ZEND_ACC_PUBLIC)
PHP_MALIAS(yaf_config_ini, offsetGet, get, yaf_config_ini_rget_arginfo, ZEND_ACC_PUBLIC)
PHP_MALIAS(yaf_config_ini, offsetExists, __isset, yaf_config_ini_isset_arginfo, ZEND_ACC_PUBLIC)
Expand Down
40 changes: 40 additions & 0 deletions configs/ini.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
+----------------------------------------------------------------------+
| Yet Another Framework |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Xinchen Hui <[email protected]> |
+----------------------------------------------------------------------+
*/

/* $Id: yaf_config.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef YAF_CONFIG_INI_H
#define YAF_CONFIG_INI_H

#define YAF_CONFIG_INI_PARSING_START 0
#define YAF_CONFIG_INI_PARSING_PROCESS 1
#define YAF_CONFIG_INI_PARSING_END 2

extern zend_class_entry *yaf_config_ini_ce;

yaf_config_t * yaf_config_ini_instance(yaf_config_t *this_ptr, zval *filename, zval *section TSRMLS_DC);

YAF_STARTUP_FUNCTION(config_ini);

#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
36 changes: 28 additions & 8 deletions configs/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,30 @@

/* $Id: simple.c 329002 2013-01-07 12:55:53Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "Zend/zend_interfaces.h"

#include "php_yaf.h"
#include "yaf_namespace.h"
#include "yaf_exception.h"
#include "yaf_config.h"
#include "configs/simple.h"

zend_class_entry *yaf_config_simple_ce;

#ifdef HAVE_SPL
extern PHPAPI zend_class_entry *spl_ce_Countable;
#endif

/** {{{ ARG_INFO
*/
ZEND_BEGIN_ARG_INFO_EX(yaf_config_simple_void_arginfo, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(yaf_config_simple_construct_arginfo, 0, 0, 1)
ZEND_ARG_INFO(0, config_file)
ZEND_ARG_INFO(0, section)
Expand Down Expand Up @@ -325,15 +345,15 @@ zend_function_entry yaf_config_simple_methods[] = {
PHP_ME(yaf_config_simple, __isset, yaf_config_simple_isset_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, get, yaf_config_simple_get_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, set, yaf_config_simple_set_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, count, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, count, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, offsetUnset, yaf_config_simple_unset_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, rewind, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, current, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, next, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, valid, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, key, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, readonly, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, toArray, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, rewind, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, current, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, next, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, valid, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, key, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, readonly, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_config_simple, toArray, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC)
PHP_MALIAS(yaf_config_simple, __set, set, yaf_config_simple_set_arginfo, ZEND_ACC_PUBLIC)
PHP_MALIAS(yaf_config_simple, __get, get, yaf_config_simple_get_arginfo, ZEND_ACC_PUBLIC)
PHP_MALIAS(yaf_config_simple, offsetGet, get, yaf_config_simple_rget_arginfo, ZEND_ACC_PUBLIC)
Expand Down
36 changes: 36 additions & 0 deletions configs/simple.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
+----------------------------------------------------------------------+
| Yet Another Framework |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Xinchen Hui <[email protected]> |
+----------------------------------------------------------------------+
*/

/* $Id: yaf_config.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef YAF_CONFIG_SIMPLE_H
#define YAF_CONFIG_SIMPLE_H

extern zend_class_entry *yaf_config_simple_ce;

yaf_config_t * yaf_config_simple_instance(yaf_config_t *this_ptr, zval *values, zval *readonly TSRMLS_DC);

YAF_STARTUP_FUNCTION(config_simple);

#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
15 changes: 14 additions & 1 deletion requests/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@

/* $Id: http.c 329002 2013-01-07 12:55:53Z laruence $ */

#include "ext/standard/url.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "main/SAPI.h"

#include "php_yaf.h"
#include "yaf_namespace.h"
#include "yaf_request.h"
#include "yaf_exception.h"
#include "requests/http.h"

#include "ext/standard/url.h" /* for php_url */

static zend_class_entry * yaf_request_http_ce;

Expand Down
33 changes: 33 additions & 0 deletions requests/http.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
+----------------------------------------------------------------------+
| Yet Another Framework |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Xinchen Hui <[email protected]> |
+----------------------------------------------------------------------+
*/

/* $Id: yaf_request.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef YAF_REQUEST_HTTP_H
#define YAF_REQUEST_HTTP_H

yaf_request_t * yaf_request_http_instance(yaf_request_t *this_ptr, char *request_uri, char *base_uri TSRMLS_DC);
YAF_STARTUP_FUNCTION(request_http);

#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
13 changes: 13 additions & 0 deletions requests/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@

/* $Id: simple.c 329002 2013-01-07 12:55:53Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "main/SAPI.h"

#include "php_yaf.h"
#include "yaf_namespace.h"
#include "yaf_request.h"
#include "yaf_exception.h"
#include "requests/simple.h"

static zend_class_entry *yaf_request_simple_ce;

/** {{{ yaf_request_t * yaf_request_simple_instance(yaf_request_t *this_ptr, zval *module, zval *controller, zval *action, zval *method, zval *params TSRMLS_DC)
Expand Down
Loading

0 comments on commit 7e81a14

Please sign in to comment.