diff --git a/wrenchboard/build/wrenchboard_api.cc b/wrenchboard/build/wrenchboard_api.cc index a5330adf..58b30ce9 100644 --- a/wrenchboard/build/wrenchboard_api.cc +++ b/wrenchboard/build/wrenchboard_api.cc @@ -150,8 +150,13 @@ PHP_METHOD(WrenchBoard, cfgReadChar) intern = Z_TSTOBJ_P(id); if(intern != NULL) { - intern->wrenchboard->logMessage("PHP_METHOD(WrenchBoard, cfgReadChar)"); + std::stringstream msg; + msg << "PHP_METHOD(WrenchBoard, cfgReadChar):"; + msg << (char*)parameter; + intern->wrenchboard->logMessage(msg.str().c_str()); std::string s = intern->wrenchboard->cfgReadChar((char*)parameter); + msg << " = " << s; + intern->wrenchboard->logMessage(msg.str().c_str()); RETURN_STRING(s.c_str()); } RETURN_NULL(); diff --git a/wrenchboard/src/Makefile b/wrenchboard/src/Makefile index dd522406..4ff8651a 100644 --- a/wrenchboard/src/Makefile +++ b/wrenchboard/src/Makefile @@ -36,7 +36,7 @@ EXTENSION_DIR = /usr/lib64/php/modules PHP_EXECUTABLE = /usr/bin/php EXTRA_LDFLAGS = EXTRA_LIBS = -INCLUDES = -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/pgsql +INCLUDES = -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/pgsql -I/usr/include/postgresql LFLAGS = LDFLAGS = SHARED_LIBTOOL = diff --git a/wrenchboard/src/config.log b/wrenchboard/src/config.log index 32c7ae66..5bf23e5d 100644 --- a/wrenchboard/src/config.log +++ b/wrenchboard/src/config.log @@ -12,9 +12,9 @@ generated by GNU Autoconf 2.69. Invocation command line was hostname = WrenchBoardDev uname -m = x86_64 -uname -r = 4.18.0-358.el8.x86_64 +uname -r = 4.18.0-383.el8.x86_64 uname -s = Linux -uname -v = #1 SMP Mon Jan 10 13:11:20 UTC 2022 +uname -v = #1 SMP Wed Apr 20 15:38:08 UTC 2022 /usr/bin/uname -p = x86_64 /bin/uname -X = unknown @@ -289,185 +289,185 @@ configure: failed program was: | #define PACKAGE_URL "" | /* end confdefs.h. */ | #include -configure:5075: checking how to print strings -configure:5102: result: printf -configure:5123: checking for a sed that does not truncate output -configure:5187: result: /usr/bin/sed -configure:5205: checking for fgrep -configure:5267: result: /usr/bin/grep -F -configure:5302: checking for ld used by cc -configure:5369: result: /usr/bin/ld -configure:5376: checking if the linker (/usr/bin/ld) is GNU ld -configure:5391: result: yes -configure:5403: checking for BSD- or MS-compatible name lister (nm) -configure:5457: result: /usr/bin/nm -B -configure:5587: checking the name lister (/usr/bin/nm -B) interface -configure:5594: cc -c -g -O2 conftest.c >&5 -configure:5597: /usr/bin/nm -B "conftest.o" -configure:5600: output +configure:5106: checking how to print strings +configure:5133: result: printf +configure:5154: checking for a sed that does not truncate output +configure:5218: result: /usr/bin/sed +configure:5236: checking for fgrep +configure:5298: result: /usr/bin/grep -F +configure:5333: checking for ld used by cc +configure:5400: result: /usr/bin/ld +configure:5407: checking if the linker (/usr/bin/ld) is GNU ld +configure:5422: result: yes +configure:5434: checking for BSD- or MS-compatible name lister (nm) +configure:5488: result: /usr/bin/nm -B +configure:5618: checking the name lister (/usr/bin/nm -B) interface +configure:5625: cc -c -g -O2 conftest.c >&5 +configure:5628: /usr/bin/nm -B "conftest.o" +configure:5631: output 0000000000000000 B some_variable -configure:5607: result: BSD nm -configure:5610: checking whether ln -s works -configure:5614: result: yes -configure:5622: checking the maximum length of command line arguments -configure:5753: result: 1572864 -configure:5801: checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format -configure:5841: result: func_convert_file_noop -configure:5848: checking how to convert x86_64-unknown-linux-gnu file names to toolchain format -configure:5868: result: func_convert_file_noop -configure:5875: checking for /usr/bin/ld option to reload object files -configure:5882: result: -r -configure:5956: checking for objdump -configure:5972: found /usr/bin/objdump -configure:5983: result: objdump -configure:6015: checking how to recognize dependent libraries -configure:6215: result: pass_all -configure:6300: checking for dlltool -configure:6330: result: no -configure:6360: checking how to associate runtime and link libraries -configure:6387: result: printf %s\n -configure:6447: checking for ar -configure:6463: found /usr/bin/ar -configure:6474: result: ar -configure:6511: checking for archiver @FILE support -configure:6528: cc -c -g -O2 conftest.c >&5 -configure:6528: $? = 0 -configure:6531: ar cru libconftest.a @conftest.lst >&5 -configure:6534: $? = 0 -configure:6539: ar cru libconftest.a @conftest.lst >&5 +configure:5638: result: BSD nm +configure:5641: checking whether ln -s works +configure:5645: result: yes +configure:5653: checking the maximum length of command line arguments +configure:5784: result: 1572864 +configure:5832: checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format +configure:5872: result: func_convert_file_noop +configure:5879: checking how to convert x86_64-unknown-linux-gnu file names to toolchain format +configure:5899: result: func_convert_file_noop +configure:5906: checking for /usr/bin/ld option to reload object files +configure:5913: result: -r +configure:5987: checking for objdump +configure:6003: found /usr/bin/objdump +configure:6014: result: objdump +configure:6046: checking how to recognize dependent libraries +configure:6246: result: pass_all +configure:6331: checking for dlltool +configure:6361: result: no +configure:6391: checking how to associate runtime and link libraries +configure:6418: result: printf %s\n +configure:6478: checking for ar +configure:6494: found /usr/bin/ar +configure:6505: result: ar +configure:6542: checking for archiver @FILE support +configure:6559: cc -c -g -O2 conftest.c >&5 +configure:6559: $? = 0 +configure:6562: ar cru libconftest.a @conftest.lst >&5 +configure:6565: $? = 0 +configure:6570: ar cru libconftest.a @conftest.lst >&5 ar: conftest.o: No such file or directory -configure:6542: $? = 1 -configure:6554: result: @ -configure:6612: checking for strip -configure:6628: found /usr/bin/strip -configure:6639: result: strip -configure:6711: checking for ranlib -configure:6727: found /usr/bin/ranlib -configure:6738: result: ranlib -configure:6815: checking for gawk -configure:6842: result: gawk -configure:6882: checking command to parse /usr/bin/nm -B output from cc object -configure:7035: cc -c -g -O2 conftest.c >&5 -configure:7038: $? = 0 -configure:7042: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm -configure:7045: $? = 0 -configure:7111: cc -o conftest -g -O2 conftest.c conftstm.o >&5 -configure:7114: $? = 0 -configure:7152: result: ok -configure:7199: checking for sysroot -configure:7229: result: no -configure:7236: checking for a working dd -configure:7274: result: /usr/bin/dd -configure:7278: checking how to truncate binary pipes -configure:7293: result: /usr/bin/dd bs=4096 count=1 -configure:7429: cc -c -g -O2 conftest.c >&5 -configure:7432: $? = 0 -configure:7622: checking for mt -configure:7652: result: no -configure:7672: checking if : is a manifest tool -configure:7678: : '-?' -configure:7686: result: no -configure:8358: checking for ANSI C header files -configure:8378: cc -c -g -O2 conftest.c >&5 -configure:8378: $? = 0 -configure:8451: cc -o conftest -g -O2 conftest.c -lstdc++ >&5 -configure:8451: $? = 0 -configure:8451: ./conftest -configure:8451: $? = 0 -configure:8462: result: yes -configure:8475: checking for sys/types.h -configure:8475: cc -c -g -O2 conftest.c >&5 -configure:8475: $? = 0 -configure:8475: result: yes -configure:8475: checking for sys/stat.h -configure:8475: cc -c -g -O2 conftest.c >&5 -configure:8475: $? = 0 -configure:8475: result: yes -configure:8475: checking for stdlib.h -configure:8475: cc -c -g -O2 conftest.c >&5 -configure:8475: $? = 0 -configure:8475: result: yes -configure:8475: checking for string.h -configure:8475: cc -c -g -O2 conftest.c >&5 -configure:8475: $? = 0 -configure:8475: result: yes -configure:8475: checking for memory.h -configure:8475: cc -c -g -O2 conftest.c >&5 -configure:8475: $? = 0 -configure:8475: result: yes -configure:8475: checking for strings.h -configure:8475: cc -c -g -O2 conftest.c >&5 -configure:8475: $? = 0 -configure:8475: result: yes -configure:8475: checking for inttypes.h -configure:8475: cc -c -g -O2 conftest.c >&5 -configure:8475: $? = 0 -configure:8475: result: yes -configure:8475: checking for stdint.h -configure:8475: cc -c -g -O2 conftest.c >&5 -configure:8475: $? = 0 -configure:8475: result: yes -configure:8475: checking for unistd.h -configure:8475: cc -c -g -O2 conftest.c >&5 -configure:8475: $? = 0 -configure:8475: result: yes -configure:8489: checking for dlfcn.h -configure:8489: cc -c -g -O2 conftest.c >&5 -configure:8489: $? = 0 -configure:8489: result: yes -configure:8756: checking for objdir -configure:8771: result: .libs -configure:9035: checking if cc supports -fno-rtti -fno-exceptions -configure:9053: cc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 +configure:6573: $? = 1 +configure:6585: result: @ +configure:6643: checking for strip +configure:6659: found /usr/bin/strip +configure:6670: result: strip +configure:6742: checking for ranlib +configure:6758: found /usr/bin/ranlib +configure:6769: result: ranlib +configure:6846: checking for gawk +configure:6873: result: gawk +configure:6913: checking command to parse /usr/bin/nm -B output from cc object +configure:7066: cc -c -g -O2 conftest.c >&5 +configure:7069: $? = 0 +configure:7073: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm +configure:7076: $? = 0 +configure:7142: cc -o conftest -g -O2 conftest.c conftstm.o >&5 +configure:7145: $? = 0 +configure:7183: result: ok +configure:7230: checking for sysroot +configure:7260: result: no +configure:7267: checking for a working dd +configure:7305: result: /usr/bin/dd +configure:7309: checking how to truncate binary pipes +configure:7324: result: /usr/bin/dd bs=4096 count=1 +configure:7460: cc -c -g -O2 conftest.c >&5 +configure:7463: $? = 0 +configure:7653: checking for mt +configure:7683: result: no +configure:7703: checking if : is a manifest tool +configure:7709: : '-?' +configure:7717: result: no +configure:8389: checking for ANSI C header files +configure:8409: cc -c -g -O2 conftest.c >&5 +configure:8409: $? = 0 +configure:8482: cc -o conftest -g -O2 conftest.c -lstdc++ >&5 +configure:8482: $? = 0 +configure:8482: ./conftest +configure:8482: $? = 0 +configure:8493: result: yes +configure:8506: checking for sys/types.h +configure:8506: cc -c -g -O2 conftest.c >&5 +configure:8506: $? = 0 +configure:8506: result: yes +configure:8506: checking for sys/stat.h +configure:8506: cc -c -g -O2 conftest.c >&5 +configure:8506: $? = 0 +configure:8506: result: yes +configure:8506: checking for stdlib.h +configure:8506: cc -c -g -O2 conftest.c >&5 +configure:8506: $? = 0 +configure:8506: result: yes +configure:8506: checking for string.h +configure:8506: cc -c -g -O2 conftest.c >&5 +configure:8506: $? = 0 +configure:8506: result: yes +configure:8506: checking for memory.h +configure:8506: cc -c -g -O2 conftest.c >&5 +configure:8506: $? = 0 +configure:8506: result: yes +configure:8506: checking for strings.h +configure:8506: cc -c -g -O2 conftest.c >&5 +configure:8506: $? = 0 +configure:8506: result: yes +configure:8506: checking for inttypes.h +configure:8506: cc -c -g -O2 conftest.c >&5 +configure:8506: $? = 0 +configure:8506: result: yes +configure:8506: checking for stdint.h +configure:8506: cc -c -g -O2 conftest.c >&5 +configure:8506: $? = 0 +configure:8506: result: yes +configure:8506: checking for unistd.h +configure:8506: cc -c -g -O2 conftest.c >&5 +configure:8506: $? = 0 +configure:8506: result: yes +configure:8520: checking for dlfcn.h +configure:8520: cc -c -g -O2 conftest.c >&5 +configure:8520: $? = 0 +configure:8520: result: yes +configure:8787: checking for objdir +configure:8802: result: .libs +configure:9066: checking if cc supports -fno-rtti -fno-exceptions +configure:9084: cc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C -configure:9057: $? = 0 -configure:9070: result: no -configure:9428: checking for cc option to produce PIC -configure:9435: result: -fPIC -DPIC -configure:9443: checking if cc PIC flag -fPIC -DPIC works -configure:9461: cc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5 -configure:9465: $? = 0 -configure:9478: result: yes -configure:9507: checking if cc static flag -static works -configure:9535: result: no -configure:9550: checking if cc supports -c -o file.o -configure:9571: cc -c -g -O2 -o out/conftest2.o conftest.c >&5 -configure:9575: $? = 0 -configure:9597: result: yes -configure:9605: checking if cc supports -c -o file.o -configure:9652: result: yes -configure:9685: checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries -configure:10944: result: yes -configure:10981: checking whether -lc should be explicitly linked in -configure:10989: cc -c -g -O2 conftest.c >&5 -configure:10992: $? = 0 -configure:11007: cc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /usr/bin/grep -lc \>/dev/null 2\>\&1 -configure:11010: $? = 0 -configure:11024: result: no -configure:11184: checking dynamic linker characteristics -configure:11765: cc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c -lstdc++ >&5 -configure:11765: $? = 0 -configure:12005: result: GNU/Linux ld.so -configure:12127: checking how to hardcode library paths into programs -configure:12152: result: immediate -configure:12700: checking whether stripping libraries is possible -configure:12705: result: yes -configure:12740: checking if libtool supports shared libraries -configure:12742: result: yes -configure:12745: checking whether to build shared libraries -configure:12770: result: yes -configure:12773: checking whether to build static libraries -configure:12777: result: no -configure:12800: checking how to run the C++ preprocessor -configure:12866: result: g++ -E -configure:12886: g++ -E conftest.cpp -configure:12886: $? = 0 -configure:12900: g++ -E conftest.cpp +configure:9088: $? = 0 +configure:9101: result: no +configure:9459: checking for cc option to produce PIC +configure:9466: result: -fPIC -DPIC +configure:9474: checking if cc PIC flag -fPIC -DPIC works +configure:9492: cc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5 +configure:9496: $? = 0 +configure:9509: result: yes +configure:9538: checking if cc static flag -static works +configure:9566: result: no +configure:9581: checking if cc supports -c -o file.o +configure:9602: cc -c -g -O2 -o out/conftest2.o conftest.c >&5 +configure:9606: $? = 0 +configure:9628: result: yes +configure:9636: checking if cc supports -c -o file.o +configure:9683: result: yes +configure:9716: checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries +configure:10975: result: yes +configure:11012: checking whether -lc should be explicitly linked in +configure:11020: cc -c -g -O2 conftest.c >&5 +configure:11023: $? = 0 +configure:11038: cc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /usr/bin/grep -lc \>/dev/null 2\>\&1 +configure:11041: $? = 0 +configure:11055: result: no +configure:11215: checking dynamic linker characteristics +configure:11796: cc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c -lstdc++ >&5 +configure:11796: $? = 0 +configure:12036: result: GNU/Linux ld.so +configure:12158: checking how to hardcode library paths into programs +configure:12183: result: immediate +configure:12731: checking whether stripping libraries is possible +configure:12736: result: yes +configure:12771: checking if libtool supports shared libraries +configure:12773: result: yes +configure:12776: checking whether to build shared libraries +configure:12801: result: yes +configure:12804: checking whether to build static libraries +configure:12808: result: no +configure:12831: checking how to run the C++ preprocessor +configure:12897: result: g++ -E +configure:12917: g++ -E conftest.cpp +configure:12917: $? = 0 +configure:12931: g++ -E conftest.cpp conftest.cpp:22:10: fatal error: ac_nonexistent.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~ compilation terminated. -configure:12900: $? = 1 +configure:12931: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" @@ -491,35 +491,35 @@ configure: failed program was: | #define LT_OBJDIR ".libs/" | /* end confdefs.h. */ | #include -configure:13062: checking for ld used by g++ -configure:13129: result: /usr/bin/ld -m elf_x86_64 -configure:13136: checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld -configure:13151: result: yes -configure:13206: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries -configure:14279: result: yes -configure:14315: g++ -c -g -O2 conftest.cpp >&5 -configure:14318: $? = 0 -configure:14799: checking for g++ option to produce PIC -configure:14806: result: -fPIC -DPIC -configure:14814: checking if g++ PIC flag -fPIC -DPIC works -configure:14832: g++ -c -g -O2 -fPIC -DPIC -DPIC conftest.cpp >&5 -configure:14836: $? = 0 -configure:14849: result: yes -configure:14872: checking if g++ static flag -static works -configure:14900: result: no -configure:14912: checking if g++ supports -c -o file.o -configure:14933: g++ -c -g -O2 -o out/conftest2.o conftest.cpp >&5 -configure:14937: $? = 0 -configure:14959: result: yes -configure:14964: checking if g++ supports -c -o file.o -configure:15011: result: yes -configure:15041: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries -configure:15081: result: yes -configure:15222: checking dynamic linker characteristics -configure:15970: result: GNU/Linux ld.so -configure:16035: checking how to hardcode library paths into programs -configure:16060: result: immediate -configure:16359: creating ./config.status +configure:13093: checking for ld used by g++ +configure:13160: result: /usr/bin/ld -m elf_x86_64 +configure:13167: checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld +configure:13182: result: yes +configure:13237: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries +configure:14310: result: yes +configure:14346: g++ -c -g -O2 conftest.cpp >&5 +configure:14349: $? = 0 +configure:14830: checking for g++ option to produce PIC +configure:14837: result: -fPIC -DPIC +configure:14845: checking if g++ PIC flag -fPIC -DPIC works +configure:14863: g++ -c -g -O2 -fPIC -DPIC -DPIC conftest.cpp >&5 +configure:14867: $? = 0 +configure:14880: result: yes +configure:14903: checking if g++ static flag -static works +configure:14931: result: no +configure:14943: checking if g++ supports -c -o file.o +configure:14964: g++ -c -g -O2 -o out/conftest2.o conftest.cpp >&5 +configure:14968: $? = 0 +configure:14990: result: yes +configure:14995: checking if g++ supports -c -o file.o +configure:15042: result: yes +configure:15072: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries +configure:15112: result: yes +configure:15253: checking dynamic linker characteristics +configure:16001: result: GNU/Linux ld.so +configure:16066: checking how to hardcode library paths into programs +configure:16091: result: immediate +configure:16390: creating ./config.status ## ---------------------- ## ## Running config.status. ## diff --git a/wrenchboard/src/config.m4 b/wrenchboard/src/config.m4 index f4d60b08..22a36fef 100644 --- a/wrenchboard/src/config.m4 +++ b/wrenchboard/src/config.m4 @@ -7,6 +7,7 @@ if test $PHP_WRENCHBOARD_API_OAMEYE != "no"; then PHP_SUBST(WRENCHBOARD_API_OAMEYE_SHARED_LIBADD) PHP_ADD_LIBRARY(stdc++, 1, WRENCHBOARD_API_OAMEYE_SHARED_LIBADD) PHP_ADD_INCLUDE(/usr/include/pgsql) + PHP_ADD_INCLUDE(/usr/include/postgresql) PHP_ADD_LIBRARY_WITH_PATH(pq, /usr/lib64, WRENCHBOARD_API_OAMEYE_SHARED_LIBADD) PHP_ADD_LIBRARY(curl, 1, WRENCHBOARD_API_OAMEYE_SHARED_LIBADD) PHP_ADD_LIBRARY(config++, 1, WRENCHBOARD_API_OAMEYE_SHARED_LIBADD) diff --git a/wrenchboard/src/configure b/wrenchboard/src/configure index c27f7bcb..2efb95fb 100755 --- a/wrenchboard/src/configure +++ b/wrenchboard/src/configure @@ -4480,6 +4480,37 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + + cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then + eval "INCLUDEPATH$unique=set" + + if test ""; then + INCLUDES="-I$ai_p $INCLUDES" + else + INCLUDES="$INCLUDES -I$ai_p" + fi + + fi + + fi + + + if test "/usr/include/postgresql" != "/usr/include"; then + + if test -z "/usr/include/postgresql" || echo "/usr/include/postgresql" | grep '^/' >/dev/null ; then + ai_p=/usr/include/postgresql + else + + ep_dir=`echo /usr/include/postgresql|$SED 's%/*[^/][^/]*/*$%%'` + + ep_realdir=`(cd "$ep_dir" && pwd)` + ai_p="$ep_realdir"/`basename "/usr/include/postgresql"` + fi + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" diff --git a/wrenchboard/src/core/wrenchboard_api.cc b/wrenchboard/src/core/wrenchboard_api.cc index 97a2da56..cca47847 100644 --- a/wrenchboard/src/core/wrenchboard_api.cc +++ b/wrenchboard/src/core/wrenchboard_api.cc @@ -75,7 +75,7 @@ PHP_METHOD(WrenchBoard, wrenchboard_api) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", ¶m, ¶m_out) == FAILURE) { // Bad parameters - RETURN_NULL(); + RETURN_NULL(); } intern = Z_TSTOBJ_P(id); @@ -144,15 +144,20 @@ PHP_METHOD(WrenchBoard, cfgReadChar) zval *id = getThis(); wrenchboard_object *intern; - /*if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", ¶meter, ¶meter_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", ¶meter, ¶meter_len) == FAILURE) { RETURN_NULL(); } - */ + intern = Z_TSTOBJ_P(id); if(intern != NULL) { - intern->wrenchboard->logMessage("PHP_METHOD(WrenchBoard, cfgReadChar)"); - //std::string s = intern->wrenchboard->cfgReadChar((char*)parameter); - //RETURN_STRING(s.c_str()); + std::stringstream msg; + msg << "PHP_METHOD(WrenchBoard, cfgReadChar):"; + msg << (char*)parameter; + intern->wrenchboard->logMessage(msg.str().c_str()); + std::string s = intern->wrenchboard->cfgReadChar((char*)parameter); + msg << " = " << s; + intern->wrenchboard->logMessage(msg.str().c_str()); + RETURN_STRING(s.c_str()); } RETURN_NULL(); } @@ -168,15 +173,15 @@ PHP_METHOD(WrenchBoard, cfgReadLong) zval *id = getThis(); wrenchboard_object *intern; - /* if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", ¶meter, ¶meter_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", ¶meter, ¶meter_len) == FAILURE) { RETURN_NULL(); } - */ + intern = Z_TSTOBJ_P(id); if(intern != NULL) { intern->wrenchboard->logMessage("PHP_METHOD(WrenchBoard, cfgReadLong)"); - //long l = intern->wrenchboard->cfgReadLong((char*)parameter); - //RETURN_LONG(l); + long l = intern->wrenchboard->cfgReadLong((char*)parameter); + RETURN_LONG(l); } RETURN_NULL(); }