Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rryqszq4 committed Apr 9, 2019
1 parent efe4a4c commit 77b674f
Show file tree
Hide file tree
Showing 45 changed files with 1,242 additions and 1,762 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
ngx_php7 0.0.15 changes: 12 Jan 2019
* Fixed compiled pass on freebas 11.2 and used of clang compiler.

* Added Dockerfile by kjdev.

* Fixed support compile with php version 7.3.* .

* Code review.

ngx_php7 0.0.14 changes: 14 Dec 2018
* Add php function ngx_socket_*, ngx_request_*, ngx_var_*, ngx_log_*, ngx_query_args,
ngx_post_args and so on.
Expand Down
32 changes: 27 additions & 5 deletions src/ngx_http_php_core.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
/**
* Copyright(c) 2016-2018 rryqszq4
*
*
*/
/*
==============================================================================
Copyright (c) 2016-2019, rryqszq4 <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
==============================================================================
*/

#include "ngx_http_php_module.h"
#include "ngx_http_php_request.h"
Expand Down
38 changes: 30 additions & 8 deletions src/ngx_http_php_core.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
/**
* Copyright(c) 2016-2018 rryqszq4
*
*
*/

#ifndef NGX_HTTP_PHP_CORE_H
#define NGX_HTTP_PHP_CORE_H
/*
==============================================================================
Copyright (c) 2016-2019, rryqszq4 <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
==============================================================================
*/

#ifndef __NGX_HTTP_PHP_CORE_H__
#define __NGX_HTTP_PHP_CORE_H__

#include <ngx_http.h>
#include <php_embed.h>
Expand Down
65 changes: 27 additions & 38 deletions src/ngx_http_php_directive.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
/**
* Copyright(c) 2016-2018 rryqszq4
*
*
*/
/*
==============================================================================
Copyright (c) 2016-2019, rryqszq4 <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
==============================================================================
*/

#include "ngx_http_php_module.h"
#include "ngx_http_php_core.h"
Expand Down Expand Up @@ -361,39 +383,6 @@ ngx_http_php_stack_inline_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_OK;
}

char *
ngx_http_php_content_async_inline_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_http_php_main_conf_t *pmcf;
ngx_http_php_loc_conf_t *plcf;
ngx_str_t *value;
ngx_http_php_code_t *code;

if (cmd->post == NULL){
return NGX_CONF_ERROR;
}

pmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_php_module);
plcf = conf;

if (plcf->content_async_handler != NULL){
return "is duplicated";
}

value = cf->args->elts;

code = ngx_http_php_code_from_string(cf->pool, &value[1]);
if (code == NGX_CONF_UNSET_PTR){
return NGX_CONF_ERROR;
}

plcf->content_async_inline_code = code;
plcf->content_async_handler = cmd->post;
pmcf->enabled_content_async_handler = 1;

return NGX_CONF_OK;
}

char *
ngx_http_php_log_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
Expand Down
37 changes: 29 additions & 8 deletions src/ngx_http_php_directive.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
/**
* Copyright(c) 2016-2018 rryqszq4
*
*
*/
/*
==============================================================================
Copyright (c) 2016-2019, rryqszq4 <[email protected]>
All rights reserved.
#ifndef NGX_HTTP_PHP_DIRECTIVE_H
#define NGX_HTTP_PHP_DIRECTIVE_H
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
==============================================================================
*/

#ifndef __NGX_HTTP_PHP_DIRECTIVE_H__
#define __NGX_HTTP_PHP_DIRECTIVE_H__

#include <ngx_conf_file.h>
#include <nginx.h>
Expand All @@ -24,7 +46,6 @@ char *ngx_http_php_access_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_http_php_access_inline_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_http_php_content_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_http_php_content_inline_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_http_php_content_async_inline_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);

char *ngx_http_php_opcode_inline_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
char *ngx_http_php_stack_inline_phase(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
Expand Down
32 changes: 27 additions & 5 deletions src/ngx_http_php_handler.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
/**
* Copyright(c) 2016-2018 rryqszq4
*
*
*/
/*
==============================================================================
Copyright (c) 2016-2019, rryqszq4 <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
==============================================================================
*/

//#include "ngx_php_debug.h"
#include "ngx_http_php_module.h"
Expand Down
46 changes: 30 additions & 16 deletions src/ngx_http_php_handler.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
/**
* Copyright(c) 2016-2018 rryqszq4
*
*
*/


#ifndef NGX_HTTP_PHP_HANDLER_H
#define NGX_HTTP_PHP_HANDLER_H
/*
==============================================================================
Copyright (c) 2016-2019, rryqszq4 <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
==============================================================================
*/

#ifndef __NGX_HTTP_PHP_HANDLER_H__
#define __NGX_HTTP_PHP_HANDLER_H__

#include <nginx.h>
#include <ngx_http.h>
Expand Down Expand Up @@ -38,13 +59,6 @@ ngx_int_t ngx_http_php_opcode_inline_handler(ngx_http_request_t *r);
ngx_int_t ngx_http_php_stack_handler(ngx_http_request_t *r);
ngx_int_t ngx_http_php_stack_inline_handler(ngx_http_request_t *r);

/*ngx_int_t ngx_http_php_content_async_handler(ngx_http_request_t *r);
ngx_int_t ngx_http_php_content_async_inline_handler(ngx_http_request_t *r);
void *ngx_http_php_async_inline_thread(void *arg);
ngx_int_t ngx_http_php_content_sync_inline_handler(ngx_http_request_t *r);
void *ngx_http_php_sync_inline_thread(void *arg);*/

ngx_int_t ngx_http_php_log_handler(ngx_http_request_t *r);
ngx_int_t ngx_http_php_log_file_handler(ngx_http_request_t *r);
ngx_int_t ngx_http_php_log_inline_handler(ngx_http_request_t *r);
Expand Down
Loading

0 comments on commit 77b674f

Please sign in to comment.