Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developing in CLion #1

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2b5791c
Add rayaop extension and configuration setup
koriym Jun 30, 2024
94dd518
Replace and rename php_rayaop.h files
koriym Jun 30, 2024
a43b209
Add clean-tests and mrproper to Makefile
koriym Jun 30, 2024
cd48704
Add 'clean' and 'make' run configurations
koriym Jun 30, 2024
6f92479
Update PHP version in GitHub workflow
koriym Jun 30, 2024
a83bc59
Uncomment code to release class and method names
koriym Jun 30, 2024
e373bd3
Adjust return value cleanup and hash table initialization
koriym Jun 30, 2024
b8f2d47
Uncomment debug definition in rayaop.c
koriym Jun 30, 2024
e324283
Update rayaop.c with enhanced debugging and error handling
koriym Jun 30, 2024
23ed5ce
Add 'cmake-build-debug' to .gitignore
koriym Jun 30, 2024
f72bd3a
Add test.php with TestClass and Intercepted classes
koriym Jun 30, 2024
747999f
Add script to generate package.xml for pecl extensions
koriym Jun 30, 2024
fda5c27
Update link formatting and variable definitions
koriym Jun 30, 2024
d919ea5
Update source files and set CMP0115 policy in CMakeLists.txt
koriym Jun 30, 2024
935de3a
Update memory management for intercept hash table
koriym Jul 1, 2024
4cc134e
Change script name in run function
koriym Jul 1, 2024
4e935ca
Update PHP command in GitHub workflow
koriym Jul 1, 2024
4cc434a
fixup! Update PHP command in GitHub workflow
koriym Jul 1, 2024
29a4a16
Refactor hash table allocation and shutdown functions in rayaop.c
koriym Jul 4, 2024
959503f
Enable RAYAOP_DEBUG for debugging
koriym Jul 4, 2024
62b0e71
Update build workflow with memory check and test enhancements
koriym Jul 6, 2024
e0135b6
Update PROGRAM_PARAMS in make.xml
koriym Jul 6, 2024
e2fbca1
Refactor rayaop_zend_execute_ex for better maintainability
koriym Jul 6, 2024
ac47076
Update RayAop PHP extension header
koriym Jul 6, 2024
ca13b0d
Refactor rayaop.c for better management of intercept info
koriym Jul 6, 2024
ce44306
Refactor rayaop.c for improved organization and readability
koriym Jul 6, 2024
2c44bf4
Rename class and implement interface in PHP and C
koriym Jul 6, 2024
9fb75a7
Add basic tests for RayAOP extension
koriym Jul 6, 2024
7859d29
Add RED test for multiple interceptors in RayAOP
koriym Jul 6, 2024
abaacdc
Refactor error handling in rayaop.c
koriym Jul 6, 2024
4585a1f
Add comments and improve function descriptions in rayaop.c
koriym Jul 6, 2024
f0c96bd
Update and translate Ray Aop PECL extension documentation
koriym Jul 6, 2024
a0d109d
Update expected test output in multiple interceptors test
koriym Jul 6, 2024
71b72fd
Update database connection configuration
koriym Jul 6, 2024
8d9518f
Update README with enhanced installation guide and test execution det…
koriym Jul 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
php-version: ['8.0', '8.1', '8.2', '8.3']
php-version: ['8.1', '8.2', '8.3']

steps:
- name: Checkout code
Expand All @@ -37,5 +37,5 @@ jobs:

- name: Run demo
run: |
php -d extension=./modules/rayaop.so -i | grep rayaop
timeout 60s php -d extension=./modules/rayaop.so -d memory_limit=128M -d report_memleaks=1 -d zend.assertions=1 -d assert.exception=1 rayaop.php 2> php_stderr.log || true
php -dextension=./modules/rayaop.so -i | grep rayaop
timeout 60s php -dextension=./modules/rayaop.so -d memory_limit=128M -d report_memleaks=1 -d zend.assertions=1 -d assert.exception=1 smoke.php
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@

# Ignore directories and its content
/Makefile.fragments
/Makefile.objects
/Makefile.objects
/cmake-build-debug
7 changes: 7 additions & 0 deletions .idea/runConfigurations/clean.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/runConfigurations/make.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 必要なCMakeのバージョンを指定
# link https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
cmake_minimum_required(VERSION 3.8)

# プロジェクトの名前と使用する言語を指定
# link https://cmake.org/cmake/help/latest/command/project.html
project(rayaop C)

# コンパイル時に定義するシンボルを指定
# link https://cmake.org/cmake/help/latest/command/add_compile_definitions.html
add_compile_definitions(HAVE_RAYAOP)


# `php-config` コマンドを使ってPHPのインクルードディレクトリを取得
# link https://cmake.org/cmake/help/latest/command/execute_process.html
execute_process (
COMMAND php-config --include-dir
OUTPUT_VARIABLE PHP_SOURCE
)

# 取得したディレクトリの末尾にある改行を削除
# link https://cmake.org/cmake/help/latest/command/string.html
string(REGEX REPLACE "\n$" "" PHP_SOURCE "${PHP_SOURCE}")

# 使用するソースディレクトリをメッセージとして表示
# link https://cmake.org/cmake/help/latest/command/message.html
message("Using source directory: ${PHP_SOURCE}")

# インクルードディレクトリを追加
# link https://cmake.org/cmake/help/latest/command/include_directories.html
include_directories(${PHP_SOURCE})
include_directories(${PHP_SOURCE}/main)
include_directories(${PHP_SOURCE}/Zend)
include_directories(${PHP_SOURCE}/TSRM)
include_directories(${PROJECT_SOURCE_DIR})

# カスタムターゲット `configure` を追加
# `phpize` と `./configure` を実行し、ソースファイルに依存させる
# link https://cmake.org/cmake/help/latest/command/add_custom_target.html
add_custom_target(configure
COMMAND phpize && ./configure
DEPENDS ${SOURCE_FILES}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

# ソースファイルのリストを指定
# link https://cmake.org/cmake/help/latest/command/set.html
set(SOURCE_FILES php_rayaop.h rayaop.c)

# ソースファイルからライブラリを作成(ただし、ALLビルドからは除外)
# link https://cmake.org/cmake/help/latest/command/add_library.html
add_library(___ EXCLUDE_FROM_ALL ${SOURCE_FILES})

# CMakeの CMP0115 ポリシーの振る舞いを設定。新しいポリシーでは、ソースファイルが存在しない場合でも
# add_executable() または add_library() を実行しますが、生成されたビルドがそのファイルを見つけられない場合にはエラーを生成します。
# link https://cmake.org/cmake/help/latest/policy/CMP0115.html
cmake_policy(SET CMP0115 NEW)

16 changes: 16 additions & 0 deletions Makefile.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
clean-tests:
rm -f tests/*.diff tests/*.exp tests/*.log tests/*.out tests/*.php tests/*.sh

mrproper: clean clean-tests
rm -rf autom4te.cache build modules vendor
rm -f acinclude.m4 aclocal.m4 config.guess config.h config.h.in config.log config.nice config.status config.sub \
configure configure.ac install-sh libtool ltmain.sh Makefile Makefile.fragments Makefile.global \
Makefile.objects missing mkinstalldirs run-tests.php *~

info: $(all_targets)
"$(PHP_EXECUTABLE)" -d "extension=$(phplibdir)/$(PHP_PECL_EXTENSION).so" --re "$(PHP_PECL_EXTENSION)"

package.xml: php_$(PHP_PECL_EXTENSION).h
$(PHP_EXECUTABLE) build-packagexml.php

.PHONY: all clean install distclean test prof-gen prof-clean prof-use clean-tests mrproper info
Loading
Loading