+impl_val *psi_let_strval(impl_val *tmp, decl_type *spec, token_t impl_type, impl_val *ival, zval *zvalue, void **to_free)
+{
+ if (ival && impl_type == PSI_T_STRING) {
+ if (ival->zend.str) {
+ /*tmp->ptr = estrndup(ival->zend.str->val, ival->zend.str->len);
+ *to_free = tmp->ptr;*/
+ tmp->ptr = ival->zend.str->val;
+ } else {
+ tmp->ptr = "";
+ }
+ } else if (0 && Z_TYPE_P(zvalue) == IS_STRING) {
+ tmp->ptr = Z_STRVAL_P(zvalue);
+ } else {
+ zend_string *zs = zval_get_string(zvalue);
+ tmp->ptr = estrdup(zs->val);
+ *to_free = tmp->ptr;
+ zend_string_release(zs);
+ }
+
+ return tmp;
+}
+
+impl_val *psi_let_pathval(impl_val *tmp, decl_type *spec, token_t impl_type, impl_val *ival, zval *zvalue, void **to_free)
+{
+ tmp = psi_let_strval(tmp, spec, impl_type, ival, zvalue, to_free);
+ if (SUCCESS != php_check_open_basedir(tmp->ptr)) {
+ efree(tmp->ptr);
+ tmp->ptr = NULL;
+ return *to_free = NULL;
+ }
+ return tmp;
+}
+
+impl_val *psi_let_strlen(impl_val *tmp, decl_type *spec, token_t impl_type, impl_val *ival, zval *zvalue, void **to_free)
+{
+ if (ival && impl_type == PSI_T_STRING) {
+ if (ival->zend.str) {
+ tmp->lval = ival->zend.str->len;
+ } else {
+ tmp->lval = 0;
+ }
+ } else {
+ zend_string *zs = zval_get_string(zvalue);
+ tmp->lval = zs->len;
+ zend_string_release(zs);
+ }
+
+ return tmp;
+}