Read configuration
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user