本文整理汇总了C++中zephir_hash_move_forward_ex函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_hash_move_forward_ex函数的具体用法?C++ zephir_hash_move_forward_ex怎么用?C++ zephir_hash_move_forward_ex使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zephir_hash_move_forward_ex函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
//.........这里部分代码省略.........
if (ZEPHIR_IS_EMPTY(columnSql)) {
zephir_concat_self_str(&columnSql, SL("VARCHAR") TSRMLS_CC);
}
ZEPHIR_CALL_METHOD(&_0, column, "getsize", NULL, 0);
zephir_check_call_status();
ZEPHIR_INIT_VAR(_1);
ZEPHIR_CONCAT_SVS(_1, "(", _0, ")");
zephir_concat_self(&columnSql, _1 TSRMLS_CC);
break;
}
if (ZEPHIR_IS_LONG(type, 3)) {
if (ZEPHIR_IS_EMPTY(columnSql)) {
zephir_concat_self_str(&columnSql, SL("NUMERIC") TSRMLS_CC);
}
ZEPHIR_CALL_METHOD(&_0, column, "getsize", NULL, 0);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(&_2, column, "getscale", NULL, 0);
zephir_check_call_status();
ZEPHIR_INIT_LNVAR(_1);
ZEPHIR_CONCAT_SVSVS(_1, "(", _0, ",", _2, ")");
zephir_concat_self(&columnSql, _1 TSRMLS_CC);
break;
}
if (ZEPHIR_IS_LONG(type, 4)) {
if (ZEPHIR_IS_EMPTY(columnSql)) {
zephir_concat_self_str(&columnSql, SL("TIMESTAMP") TSRMLS_CC);
}
break;
}
if (ZEPHIR_IS_LONG(type, 5)) {
if (ZEPHIR_IS_EMPTY(columnSql)) {
zephir_concat_self_str(&columnSql, SL("CHARACTER") TSRMLS_CC);
}
ZEPHIR_CALL_METHOD(&_0, column, "getsize", NULL, 0);
zephir_check_call_status();
ZEPHIR_INIT_LNVAR(_1);
ZEPHIR_CONCAT_SVS(_1, "(", _0, ")");
zephir_concat_self(&columnSql, _1 TSRMLS_CC);
break;
}
if (ZEPHIR_IS_LONG(type, 6)) {
if (ZEPHIR_IS_EMPTY(columnSql)) {
zephir_concat_self_str(&columnSql, SL("TEXT") TSRMLS_CC);
}
break;
}
if (ZEPHIR_IS_LONG(type, 7)) {
if (ZEPHIR_IS_EMPTY(columnSql)) {
zephir_concat_self_str(&columnSql, SL("FLOAT") TSRMLS_CC);
}
break;
}
if (ZEPHIR_IS_EMPTY(columnSql)) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Unrecognized SQLite data type", "phalcon/db/dialect/sqlite.zep", 112);
return;
}
ZEPHIR_CALL_METHOD(&typeValues, column, "gettypevalues", NULL, 0);
zephir_check_call_status();
if (!(ZEPHIR_IS_EMPTY(typeValues))) {
if (Z_TYPE_P(typeValues) == IS_ARRAY) {
ZEPHIR_INIT_VAR(valueSql);
ZVAL_STRING(valueSql, "", 1);
zephir_is_iterable(typeValues, &_4, &_3, 0, 0, "phalcon/db/dialect/sqlite.zep", 123);
for (
; zephir_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS
; zephir_hash_move_forward_ex(_4, &_3)
) {
ZEPHIR_GET_HVALUE(value, _5);
ZEPHIR_SINIT_NVAR(_6);
ZVAL_STRING(&_6, "\"", 0);
ZEPHIR_CALL_FUNCTION(&_0, "addcslashes", &_7, 109, value, &_6);
zephir_check_call_status();
ZEPHIR_INIT_LNVAR(_1);
ZEPHIR_CONCAT_SVS(_1, "\"", _0, "\", ");
zephir_concat_self(&valueSql, _1 TSRMLS_CC);
}
ZEPHIR_SINIT_NVAR(_6);
ZVAL_LONG(&_6, 0);
ZEPHIR_SINIT_VAR(_8);
ZVAL_LONG(&_8, -2);
ZEPHIR_INIT_VAR(_9);
zephir_substr(_9, valueSql, 0 , -2 , 0);
ZEPHIR_INIT_VAR(_10);
ZEPHIR_CONCAT_SVS(_10, "(", _9, ")");
zephir_concat_self(&columnSql, _10 TSRMLS_CC);
} else {
ZEPHIR_SINIT_NVAR(_8);
ZVAL_STRING(&_8, "\"", 0);
ZEPHIR_CALL_FUNCTION(&_2, "addcslashes", &_7, 109, typeValues, &_8);
zephir_check_call_status();
ZEPHIR_INIT_LNVAR(_10);
ZEPHIR_CONCAT_SVS(_10, "(\"", _2, "\")");
zephir_concat_self(&columnSql, _10 TSRMLS_CC);
}
}
} while(0);
RETURN_CCTOR(columnSql);
}
示例2: PHP_METHOD
/**
* Returns a complete resultset as an array, if the resultset has a big number of rows
* it could consume more memory than currently it does. Export the resultset to an array
* couldn't be faster with a large number of records
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) {
HashTable *_2$$7, *_5$$8;
HashPosition _1$$7, _4$$8;
zephir_fcall_cache_entry *_9 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
zval *renameColumns_param = NULL, *result = NULL, *records = NULL, *record = NULL, *renamed = NULL, *renamedKey = NULL, *key = NULL, *value = NULL, *renamedRecords = NULL, *columnMap = NULL, *_0$$3, **_3$$7, **_6$$8, *_7$$10 = NULL, *_8$$10 = NULL, *_10$$12 = NULL, *_11$$12 = NULL;
zend_bool renameColumns;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 1, &renameColumns_param);
if (!renameColumns_param) {
renameColumns = 1;
} else {
renameColumns = zephir_get_boolval(renameColumns_param);
}
ZEPHIR_OBS_VAR(records);
zephir_read_property_this(&records, this_ptr, SL("_rows"), PH_NOISY_CC);
if (Z_TYPE_P(records) != IS_ARRAY) {
ZEPHIR_OBS_VAR(result);
zephir_read_property_this(&result, this_ptr, SL("_result"), PH_NOISY_CC);
_0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_row"), PH_NOISY_CC);
if (Z_TYPE_P(_0$$3) != IS_NULL) {
ZEPHIR_CALL_METHOD(NULL, result, "execute", NULL, 0);
zephir_check_call_status();
}
ZEPHIR_CALL_METHOD(&records, result, "fetchall", NULL, 0);
zephir_check_call_status();
zephir_update_property_this(this_ptr, SL("_row"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC);
zephir_update_property_this(this_ptr, SL("_rows"), records TSRMLS_CC);
}
if (renameColumns) {
ZEPHIR_OBS_VAR(columnMap);
zephir_read_property_this(&columnMap, this_ptr, SL("_columnMap"), PH_NOISY_CC);
if (Z_TYPE_P(columnMap) != IS_ARRAY) {
RETURN_CCTOR(records);
}
ZEPHIR_INIT_VAR(renamedRecords);
array_init(renamedRecords);
if (Z_TYPE_P(records) == IS_ARRAY) {
zephir_is_iterable(records, &_2$$7, &_1$$7, 0, 0, "phalcon/mvc/model/resultset/simple.zep", 218);
for (
; zephir_hash_get_current_data_ex(_2$$7, (void**) &_3$$7, &_1$$7) == SUCCESS
; zephir_hash_move_forward_ex(_2$$7, &_1$$7)
) {
ZEPHIR_GET_HVALUE(record, _3$$7);
ZEPHIR_INIT_NVAR(renamed);
array_init(renamed);
zephir_is_iterable(record, &_5$$8, &_4$$8, 0, 0, "phalcon/mvc/model/resultset/simple.zep", 216);
for (
; zephir_hash_get_current_data_ex(_5$$8, (void**) &_6$$8, &_4$$8) == SUCCESS
; zephir_hash_move_forward_ex(_5$$8, &_4$$8)
) {
ZEPHIR_GET_HMKEY(key, _5$$8, _4$$8);
ZEPHIR_GET_HVALUE(value, _6$$8);
ZEPHIR_OBS_NVAR(renamedKey);
if (!(zephir_array_isset_fetch(&renamedKey, columnMap, key, 0 TSRMLS_CC))) {
ZEPHIR_INIT_NVAR(_7$$10);
object_init_ex(_7$$10, phalcon_mvc_model_exception_ce);
ZEPHIR_INIT_LNVAR(_8$$10);
ZEPHIR_CONCAT_SVS(_8$$10, "Column '", key, "' is not part of the column map");
ZEPHIR_CALL_METHOD(NULL, _7$$10, "__construct", &_9, 9, _8$$10);
zephir_check_call_status();
zephir_throw_exception_debug(_7$$10, "phalcon/mvc/model/resultset/simple.zep", 200 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
return;
}
if (Z_TYPE_P(renamedKey) == IS_ARRAY) {
ZEPHIR_OBS_NVAR(renamedKey);
if (!(zephir_array_isset_long_fetch(&renamedKey, renamedKey, 0, 0 TSRMLS_CC))) {
ZEPHIR_INIT_NVAR(_10$$12);
object_init_ex(_10$$12, phalcon_mvc_model_exception_ce);
ZEPHIR_INIT_LNVAR(_11$$12);
ZEPHIR_CONCAT_SVS(_11$$12, "Column '", key, "' is not part of the column map");
ZEPHIR_CALL_METHOD(NULL, _10$$12, "__construct", &_9, 9, _11$$12);
zephir_check_call_status();
zephir_throw_exception_debug(_10$$12, "phalcon/mvc/model/resultset/simple.zep", 206 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
return;
}
}
zephir_array_update_zval(&renamed, renamedKey, &value, PH_COPY | PH_SEPARATE);
}
zephir_array_append(&renamedRecords, renamed, PH_SEPARATE, "phalcon/mvc/model/resultset/simple.zep", 216);
}
}
RETURN_CCTOR(renamedRecords);
}
RETURN_CCTOR(records);
}
示例3: PHP_METHOD
/**
* Returns an array of Phalcon\Db\Column objects describing a table
*
* <code>
* print_r($connection->describeColumns("posts"));
* </code>
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeColumns) {
HashTable *_5;
HashPosition _4;
zephir_fcall_cache_entry *_41 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
zval *table_param = NULL, *schema_param = NULL, *columns = NULL, *columnType = NULL, *field = NULL, *definition = NULL, *oldColumn = NULL, *sizePattern = NULL, *matches = NULL, *matchOne = NULL, *matchTwo = NULL, *columnName = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, *_7$$5 = NULL, *_8$$5 = NULL, *_9$$6 = NULL, *_10$$6 = NULL, *_11$$7 = NULL, *_12$$8 = NULL, *_13$$9 = NULL, *_14$$10 = NULL, *_15$$11 = NULL, *_16$$12 = NULL, *_17$$13 = NULL, *_18$$14 = NULL, *_19$$14 = NULL, *_20$$15 = NULL, *_21$$15 = NULL, *_22$$16 = NULL, *_23$$16 = NULL, *_24$$17 = NULL, *_25$$17 = NULL, *_26$$18 = NULL, *_27$$18 = NULL, *_28$$19 = NULL, *_29$$20 = NULL, *_30$$21 = NULL, *_31$$4 = NULL, *_32$$22 = NULL, *_33$$24 = NULL, *_34$$25 = NULL, *_35$$3, *_36$$3, *_37$$3, *_38$$3 = NULL, *_40$$3 = NULL, *_39$$32;
zval *table = NULL, *schema = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &table_param, &schema_param);
zephir_get_strval(table, table_param);
if (!schema_param) {
ZEPHIR_INIT_VAR(schema);
ZVAL_EMPTY_STRING(schema);
} else {
zephir_get_strval(schema, schema_param);
}
ZEPHIR_INIT_VAR(oldColumn);
ZVAL_NULL(oldColumn);
ZEPHIR_INIT_VAR(sizePattern);
ZVAL_STRING(sizePattern, "#\\(([0-9]+)(?:,\\s*([0-9]+))*\\)#", 1);
ZEPHIR_INIT_VAR(columns);
array_init(columns);
_1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC);
ZEPHIR_CALL_METHOD(&_2, _1, "describecolumns", NULL, 0, table, schema);
zephir_check_call_status();
ZEPHIR_INIT_VAR(_3);
ZVAL_LONG(_3, 3);
ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3);
zephir_check_call_status();
zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/mysql.zep", 345);
for (
; zephir_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS
; zephir_hash_move_forward_ex(_5, &_4)
) {
ZEPHIR_GET_HVALUE(field, _6);
ZEPHIR_INIT_NVAR(definition);
zephir_create_array(definition, 1, 0 TSRMLS_CC);
add_assoc_long_ex(definition, SS("bindType"), 2);
ZEPHIR_OBS_NVAR(columnType);
zephir_array_fetch_long(&columnType, field, 1, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 119 TSRMLS_CC);
while (1) {
if (zephir_memnstr_str(columnType, SL("bigint"), "phalcon/db/adapter/pdo/mysql.zep", 126)) {
ZEPHIR_INIT_NVAR(_7$$5);
ZVAL_LONG(_7$$5, 14);
zephir_array_update_string(&definition, SL("type"), &_7$$5, PH_COPY | PH_SEPARATE);
zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE);
ZEPHIR_INIT_NVAR(_8$$5);
ZVAL_LONG(_8$$5, 1);
zephir_array_update_string(&definition, SL("bindType"), &_8$$5, PH_COPY | PH_SEPARATE);
break;
}
if (zephir_memnstr_str(columnType, SL("int"), "phalcon/db/adapter/pdo/mysql.zep", 136)) {
ZEPHIR_INIT_NVAR(_9$$6);
ZVAL_LONG(_9$$6, 0);
zephir_array_update_string(&definition, SL("type"), &_9$$6, PH_COPY | PH_SEPARATE);
zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE);
ZEPHIR_INIT_NVAR(_10$$6);
ZVAL_LONG(_10$$6, 1);
zephir_array_update_string(&definition, SL("bindType"), &_10$$6, PH_COPY | PH_SEPARATE);
break;
}
if (zephir_memnstr_str(columnType, SL("varchar"), "phalcon/db/adapter/pdo/mysql.zep", 146)) {
ZEPHIR_INIT_NVAR(_11$$7);
ZVAL_LONG(_11$$7, 2);
zephir_array_update_string(&definition, SL("type"), &_11$$7, PH_COPY | PH_SEPARATE);
break;
}
if (zephir_memnstr_str(columnType, SL("datetime"), "phalcon/db/adapter/pdo/mysql.zep", 154)) {
ZEPHIR_INIT_NVAR(_12$$8);
ZVAL_LONG(_12$$8, 4);
zephir_array_update_string(&definition, SL("type"), &_12$$8, PH_COPY | PH_SEPARATE);
break;
}
if (zephir_memnstr_str(columnType, SL("enum"), "phalcon/db/adapter/pdo/mysql.zep", 162)) {
ZEPHIR_INIT_NVAR(_13$$9);
ZVAL_LONG(_13$$9, 5);
zephir_array_update_string(&definition, SL("type"), &_13$$9, PH_COPY | PH_SEPARATE);
break;
}
if (zephir_memnstr_str(columnType, SL("char"), "phalcon/db/adapter/pdo/mysql.zep", 170)) {
ZEPHIR_INIT_NVAR(_14$$10);
ZVAL_LONG(_14$$10, 5);
zephir_array_update_string(&definition, SL("type"), &_14$$10, PH_COPY | PH_SEPARATE);
break;
}
if (zephir_memnstr_str(columnType, SL("date"), "phalcon/db/adapter/pdo/mysql.zep", 178)) {
ZEPHIR_INIT_NVAR(_15$$11);
ZVAL_LONG(_15$$11, 1);
//.........这里部分代码省略.........
示例4: PHP_METHOD
//.........这里部分代码省略.........
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "/H/S", 1);
zephir_array_append(&vIUB, _0, PH_SEPARATE, "test/regexdna.zep", 32);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "(a|c|t)", 1);
zephir_array_append(&vIUBnew, _0, PH_SEPARATE, "test/regexdna.zep", 32);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "/K/S", 1);
zephir_array_append(&vIUB, _0, PH_SEPARATE, "test/regexdna.zep", 33);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "(g|t)", 1);
zephir_array_append(&vIUBnew, _0, PH_SEPARATE, "test/regexdna.zep", 33);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "/M/S", 1);
zephir_array_append(&vIUB, _0, PH_SEPARATE, "test/regexdna.zep", 34);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "(a|c)", 1);
zephir_array_append(&vIUBnew, _0, PH_SEPARATE, "test/regexdna.zep", 34);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "/N/S", 1);
zephir_array_append(&vIUB, _0, PH_SEPARATE, "test/regexdna.zep", 35);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "(a|c|g|t)", 1);
zephir_array_append(&vIUBnew, _0, PH_SEPARATE, "test/regexdna.zep", 35);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "/R/S", 1);
zephir_array_append(&vIUB, _0, PH_SEPARATE, "test/regexdna.zep", 36);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "(a|g)", 1);
zephir_array_append(&vIUBnew, _0, PH_SEPARATE, "test/regexdna.zep", 36);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "/S/S", 1);
zephir_array_append(&vIUB, _0, PH_SEPARATE, "test/regexdna.zep", 37);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "(c|g)", 1);
zephir_array_append(&vIUBnew, _0, PH_SEPARATE, "test/regexdna.zep", 37);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "/V/S", 1);
zephir_array_append(&vIUB, _0, PH_SEPARATE, "test/regexdna.zep", 38);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "(a|c|g)", 1);
zephir_array_append(&vIUBnew, _0, PH_SEPARATE, "test/regexdna.zep", 38);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "/W/S", 1);
zephir_array_append(&vIUB, _0, PH_SEPARATE, "test/regexdna.zep", 39);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "(a|t)", 1);
zephir_array_append(&vIUBnew, _0, PH_SEPARATE, "test/regexdna.zep", 39);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "/Y/S", 1);
zephir_array_append(&vIUB, _0, PH_SEPARATE, "test/regexdna.zep", 40);
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "(c|t)", 1);
zephir_array_append(&vIUBnew, _0, PH_SEPARATE, "test/regexdna.zep", 40);
ZEPHIR_INIT_VAR(stuffToRemove);
ZVAL_STRING(stuffToRemove, "^>.*$|\n", 1);
ZEPHIR_INIT_NVAR(discard);
ZVAL_NULL(discard);
ZEPHIR_INIT_VAR(contents);
zephir_file_get_contents(contents, path TSRMLS_CC);
ZEPHIR_INIT_VAR(initialLength);
ZVAL_LONG(initialLength, zephir_fast_strlen_ev(contents));
ZEPHIR_INIT_VAR(_1);
ZEPHIR_CONCAT_SVS(_1, "/", stuffToRemove, "/mS");
ZEPHIR_INIT_NVAR(_0);
ZVAL_STRING(_0, "", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 53, _1, _0, contents);
zephir_check_temp_parameter(_0);
zephir_check_call_status();
ZEPHIR_CPY_WRT(contents, _2);
ZEPHIR_INIT_VAR(codeLength);
ZVAL_LONG(codeLength, zephir_fast_strlen_ev(contents));
zephir_is_iterable(variants, &_5, &_4, 0, 0, "test/regexdna.zep", 59);
for (
; zephir_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS
; zephir_hash_move_forward_ex(_5, &_4)
) {
ZEPHIR_GET_HVALUE(regex, _6);
zend_print_zval(regex, 0);
php_printf("%s", " ");
ZEPHIR_INIT_NVAR(_0);
ZEPHIR_INIT_LNVAR(_7);
ZEPHIR_CONCAT_SVS(_7, "/", regex, "/iS");
zephir_preg_match(_0, _7, contents, discard, 1, 0 , 0 TSRMLS_CC);
zend_print_zval(_0, 0);
php_printf("%c", '\n');
}
ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 53, vIUB, vIUBnew, contents);
zephir_check_call_status();
ZEPHIR_CPY_WRT(contents, _2);
php_printf("%c", '\n');
zend_print_zval(initialLength, 0);
php_printf("%c", '\n');
zend_print_zval(codeLength, 0);
php_printf("%c", '\n');
php_printf("%d", zephir_fast_strlen_ev(contents));
php_printf("%c", '\n');
ZEPHIR_MM_RESTORE();
}
示例5: PHP_METHOD
/**
* Loads registered template engines, if none is registered it will use Phalcon\Mvc\View\Engine\Php
*
* @return array
*/
PHP_METHOD(Phalcon_Mvc_View_Simple, _loadTemplateEngines) {
zephir_fcall_cache_entry *_4 = NULL, *_6 = NULL;
HashTable *_2;
HashPosition _1;
int ZEPHIR_LAST_CALL_STATUS;
zval *engines = NULL, *dependencyInjector, *registeredEngines, *arguments, *extension = NULL, *engineService = NULL, *engineObject = NULL, *_0 = NULL, **_3, *_5 = NULL;
ZEPHIR_MM_GROW();
ZEPHIR_OBS_VAR(engines);
zephir_read_property_this(&engines, this_ptr, SL("_engines"), PH_NOISY_CC);
if (ZEPHIR_IS_FALSE_IDENTICAL(engines)) {
ZEPHIR_OBS_VAR(dependencyInjector);
zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);
ZEPHIR_INIT_NVAR(engines);
array_init(engines);
ZEPHIR_OBS_VAR(registeredEngines);
zephir_read_property_this(®isteredEngines, this_ptr, SL("_registeredEngines"), PH_NOISY_CC);
if (Z_TYPE_P(registeredEngines) != IS_ARRAY) {
ZEPHIR_INIT_VAR(_0);
object_init_ex(_0, phalcon_mvc_view_engine_php_ce);
ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 368, this_ptr, dependencyInjector);
zephir_check_call_status();
zephir_array_update_string(&engines, SL(".phtml"), &_0, PH_COPY | PH_SEPARATE);
} else {
if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the application services", "phalcon/mvc/view/simple.zep", 139);
return;
}
ZEPHIR_INIT_VAR(arguments);
zephir_create_array(arguments, 2, 0 TSRMLS_CC);
zephir_array_fast_append(arguments, this_ptr);
zephir_array_fast_append(arguments, dependencyInjector);
zephir_is_iterable(registeredEngines, &_2, &_1, 0, 0, "phalcon/mvc/view/simple.zep", 171);
for (
; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS
; zephir_hash_move_forward_ex(_2, &_1)
) {
ZEPHIR_GET_HMKEY(extension, _2, _1);
ZEPHIR_GET_HVALUE(engineService, _3);
if (Z_TYPE_P(engineService) == IS_OBJECT) {
if (zephir_instance_of_ev(engineService, zend_ce_closure TSRMLS_CC)) {
ZEPHIR_INIT_NVAR(engineObject);
ZEPHIR_CALL_USER_FUNC_ARRAY(engineObject, engineService, arguments);
zephir_check_call_status();
} else {
ZEPHIR_CPY_WRT(engineObject, engineService);
}
} else {
if (Z_TYPE_P(engineService) == IS_STRING) {
ZEPHIR_CALL_METHOD(&engineObject, dependencyInjector, "getshared", &_4, 0, engineService, arguments);
zephir_check_call_status();
} else {
ZEPHIR_INIT_NVAR(_0);
object_init_ex(_0, phalcon_mvc_view_exception_ce);
ZEPHIR_INIT_LNVAR(_5);
ZEPHIR_CONCAT_SV(_5, "Invalid template engine registration for extension: ", extension);
ZEPHIR_CALL_METHOD(NULL, _0, "__construct", &_6, 9, _5);
zephir_check_call_status();
zephir_throw_exception_debug(_0, "phalcon/mvc/view/simple.zep", 165 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
return;
}
}
zephir_array_update_zval(&engines, extension, &engineObject, PH_COPY | PH_SEPARATE);
}
}
zephir_update_property_this(this_ptr, SL("_engines"), engines TSRMLS_CC);
} else {
ZEPHIR_OBS_NVAR(engines);
zephir_read_property_this(&engines, this_ptr, SL("_engines"), PH_NOISY_CC);
}
RETURN_CCTOR(engines);
}
示例6: PHP_METHOD
/**
* Phalcon\Config\Adapter\Ini constructor
*/
PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct) {
HashTable *_4, *_7$$6;
HashPosition _3, _6$$6;
zephir_fcall_cache_entry *_11 = NULL, *_15 = NULL, *_16 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
zval *filePath_param = NULL, *mode = NULL, *iniConfig = NULL, *config = NULL, *section = NULL, *sections = NULL, *directives = NULL, *path = NULL, *lastValue = NULL, **_5, *_0$$4, *_1$$4, *_2$$4, **_8$$6, *_9$$7 = NULL, *_12$$8 = NULL, _13$$8 = zval_used_for_init, *_14$$9 = NULL;
zval *filePath = NULL, *_10$$7 = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &filePath_param, &mode);
if (unlikely(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(filePath_param) == IS_STRING)) {
zephir_get_strval(filePath, filePath_param);
} else {
ZEPHIR_INIT_VAR(filePath);
ZVAL_EMPTY_STRING(filePath);
}
if (!mode) {
ZEPHIR_CPY_WRT(mode, ZEPHIR_GLOBAL(global_null));
} else {
ZEPHIR_SEPARATE_PARAM(mode);
}
if (Z_TYPE_P(mode) == IS_NULL) {
ZEPHIR_INIT_NVAR(mode);
ZVAL_LONG(mode, 1);
}
ZEPHIR_CALL_FUNCTION(&iniConfig, "parse_ini_file", NULL, 136, filePath, ZEPHIR_GLOBAL(global_true), mode);
zephir_check_call_status();
if (ZEPHIR_IS_FALSE_IDENTICAL(iniConfig)) {
ZEPHIR_INIT_VAR(_0$$4);
object_init_ex(_0$$4, phalcon_config_exception_ce);
ZEPHIR_INIT_VAR(_1$$4);
zephir_basename(_1$$4, filePath TSRMLS_CC);
ZEPHIR_INIT_VAR(_2$$4);
ZEPHIR_CONCAT_SVS(_2$$4, "Configuration file ", _1$$4, " can't be loaded");
ZEPHIR_CALL_METHOD(NULL, _0$$4, "__construct", NULL, 9, _2$$4);
zephir_check_call_status();
zephir_throw_exception_debug(_0$$4, "phalcon/config/adapter/ini.zep", 81 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
return;
}
ZEPHIR_INIT_VAR(config);
array_init(config);
zephir_is_iterable(iniConfig, &_4, &_3, 0, 0, "phalcon/config/adapter/ini.zep", 102);
for (
; zephir_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS
; zephir_hash_move_forward_ex(_4, &_3)
) {
ZEPHIR_GET_HMKEY(section, _4, _3);
ZEPHIR_GET_HVALUE(directives, _5);
if (Z_TYPE_P(directives) == IS_ARRAY) {
ZEPHIR_INIT_NVAR(sections);
array_init(sections);
zephir_is_iterable(directives, &_7$$6, &_6$$6, 0, 0, "phalcon/config/adapter/ini.zep", 94);
for (
; zephir_hash_get_current_data_ex(_7$$6, (void**) &_8$$6, &_6$$6) == SUCCESS
; zephir_hash_move_forward_ex(_7$$6, &_6$$6)
) {
ZEPHIR_GET_HMKEY(path, _7$$6, _6$$6);
ZEPHIR_GET_HVALUE(lastValue, _8$$6);
zephir_get_strval(_10$$7, path);
ZEPHIR_CALL_METHOD(&_9$$7, this_ptr, "_parseinistring", &_11, 0, _10$$7, lastValue);
zephir_check_call_status();
zephir_array_append(§ions, _9$$7, PH_SEPARATE, "phalcon/config/adapter/ini.zep", 92);
}
if (zephir_fast_count_int(sections TSRMLS_CC)) {
ZEPHIR_INIT_NVAR(_12$$8);
ZEPHIR_SINIT_NVAR(_13$$8);
ZVAL_STRING(&_13$$8, "array_merge_recursive", 0);
ZEPHIR_CALL_USER_FUNC_ARRAY(_12$$8, &_13$$8, sections);
zephir_check_call_status();
zephir_array_update_zval(&config, section, &_12$$8, PH_COPY | PH_SEPARATE);
}
} else {
ZEPHIR_CALL_METHOD(&_14$$9, this_ptr, "_cast", &_15, 137, directives);
zephir_check_call_status();
zephir_array_update_zval(&config, section, &_14$$9, PH_COPY | PH_SEPARATE);
}
}
ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_ini_ce, this_ptr, "__construct", &_16, 19, config);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
示例7: PHP_METHOD
/**
* Executes a prepared statement binding. This function uses integer indexes starting from zero
*
*<code>
* $statement = $db->prepare('SELECT * FROM robots WHERE name = :name');
* $result = $connection->executePrepared($statement, array('name' => 'Voltron'));
*</code>
*
* @param \PDOStatement statement
* @param array placeholders
* @param array dataTypes
* @return \PDOStatement
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo, executePrepared) {
zephir_fcall_cache_entry *_4 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
zend_bool _3;
HashTable *_1;
HashPosition _0;
zval *placeholders = NULL;
zval *statement, *placeholders_param = NULL, *dataTypes, *wildcard = NULL, *value = NULL, *type = NULL, *castValue = NULL, *parameter = NULL, **_2;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 3, 0, &statement, &placeholders_param, &dataTypes);
placeholders = placeholders_param;
zephir_is_iterable(placeholders, &_1, &_0, 0, 0, "phalcon/db/adapter/pdo.zep", 215);
for (
; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS
; zephir_hash_move_forward_ex(_1, &_0)
) {
ZEPHIR_GET_HMKEY(wildcard, _1, _0);
ZEPHIR_GET_HVALUE(value, _2);
if (Z_TYPE_P(wildcard) == IS_LONG) {
ZEPHIR_INIT_NVAR(parameter);
ZVAL_LONG(parameter, (zephir_get_numberval(wildcard) + 1));
} else {
if (Z_TYPE_P(wildcard) == IS_STRING) {
ZEPHIR_CPY_WRT(parameter, wildcard);
} else {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid bind parameter (1)", "phalcon/db/adapter/pdo.zep", 188);
return;
}
}
_3 = Z_TYPE_P(dataTypes) == IS_ARRAY;
if (_3) {
ZEPHIR_OBS_NVAR(type);
_3 = zephir_array_isset_fetch(&type, dataTypes, wildcard, 0 TSRMLS_CC);
}
if (_3) {
if (ZEPHIR_IS_LONG(type, 32)) {
ZEPHIR_INIT_NVAR(castValue);
ZVAL_DOUBLE(castValue, zephir_get_doubleval(value));
ZEPHIR_INIT_NVAR(type);
ZVAL_LONG(type, 1024);
} else {
ZEPHIR_CPY_WRT(castValue, value);
}
if (ZEPHIR_IS_LONG(type, 1024)) {
ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_4, 0, parameter, castValue);
zephir_check_call_status();
} else {
ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_4, 0, parameter, castValue, type);
zephir_check_call_status();
}
} else {
ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_4, 0, parameter, value);
zephir_check_call_status();
}
}
ZEPHIR_CALL_METHOD(NULL, statement, "execute", NULL, 0);
zephir_check_call_status();
RETVAL_ZVAL(statement, 1, 0);
RETURN_MM();
}
示例8: PHP_METHOD
/**
* Writes the log to the stream itself
*/
PHP_METHOD(Phalcon_Logger_Adapter_Firephp, logInternal) {
HashTable *_8;
HashPosition _7;
zephir_fcall_cache_entry *_2 = NULL;
zval *context = NULL;
int type, time, ZEPHIR_LAST_CALL_STATUS;
zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, *chunk = NULL, *format = NULL, *chString = NULL, *content = NULL, *key = NULL, *index = NULL, *_0, *_3 = NULL, *_4, *_5, _6, **_9, _1$$3 = zval_used_for_init;
zval *message = NULL, *_10$$4 = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 4, 0, &message_param, &type_param, &time_param, &context_param);
zephir_get_strval(message, message_param);
type = zephir_get_intval(type_param);
time = zephir_get_intval(time_param);
zephir_get_arrval(context, context_param);
_0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC);
if (!(zephir_is_true(_0))) {
ZEPHIR_SINIT_VAR(_1$$3);
ZVAL_STRING(&_1$$3, "X-Wf-Protocol-1: http://meta.wildfirehq.org/Protocol/JsonStream/0.2", 0);
ZEPHIR_CALL_FUNCTION(NULL, "header", &_2, 248, &_1$$3);
zephir_check_call_status();
ZEPHIR_SINIT_NVAR(_1$$3);
ZVAL_STRING(&_1$$3, "X-Wf-1-Plugin-1: http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3", 0);
ZEPHIR_CALL_FUNCTION(NULL, "header", &_2, 248, &_1$$3);
zephir_check_call_status();
ZEPHIR_SINIT_NVAR(_1$$3);
ZVAL_STRING(&_1$$3, "X-Wf-Structure-1: http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1", 0);
ZEPHIR_CALL_FUNCTION(NULL, "header", &_2, 248, &_1$$3);
zephir_check_call_status();
if (1) {
zephir_update_property_this(this_ptr, SL("_initialized"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC);
} else {
zephir_update_property_this(this_ptr, SL("_initialized"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC);
}
}
ZEPHIR_CALL_METHOD(&_3, this_ptr, "getformatter", NULL, 0);
zephir_check_call_status();
ZEPHIR_INIT_VAR(_4);
ZVAL_LONG(_4, type);
ZEPHIR_INIT_VAR(_5);
ZVAL_LONG(_5, time);
ZEPHIR_CALL_METHOD(&format, _3, "format", NULL, 0, message, _4, _5, context);
zephir_check_call_status();
ZEPHIR_SINIT_VAR(_6);
ZVAL_LONG(&_6, 4500);
ZEPHIR_CALL_FUNCTION(&chunk, "str_split", NULL, 74, format, &_6);
zephir_check_call_status();
ZEPHIR_OBS_VAR(index);
zephir_read_property_this(&index, this_ptr, SL("_index"), PH_NOISY_CC);
zephir_is_iterable(chunk, &_8, &_7, 0, 0, "phalcon/logger/adapter/firephp.zep", 92);
for (
; zephir_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS
; zephir_hash_move_forward_ex(_8, &_7)
) {
ZEPHIR_GET_HMKEY(key, _8, _7);
ZEPHIR_GET_HVALUE(chString, _9);
zephir_get_strval(_10$$4, index);
ZEPHIR_INIT_NVAR(content);
ZEPHIR_CONCAT_SVSV(content, "X-Wf-1-1-1-", _10$$4, ": ", chString);
if (zephir_array_isset_long(chunk, (zephir_get_numberval(key) + 1))) {
zephir_concat_self_str(&content, SL("|\\") TSRMLS_CC);
}
ZEPHIR_CALL_FUNCTION(NULL, "header", &_2, 248, content);
zephir_check_call_status();
ZEPHIR_SEPARATE(index);
zephir_increment(index);
}
zephir_update_property_this(this_ptr, SL("_index"), index TSRMLS_CC);
ZEPHIR_MM_RESTORE();
}
示例9: PHP_METHOD
/**
* Do a role inherit from another existing role
*/
PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) {
zephir_fcall_cache_entry *_8 = NULL;
HashTable *_6;
HashPosition _5;
int ZEPHIR_LAST_CALL_STATUS;
zval *roleName_param = NULL, *roleToInherit, *roleInheritName = NULL, *rolesNames, *deepInheritName = NULL, *_0 = NULL, *_2, *_3, *_4, **_7, *_9;
zval *roleName = NULL, *_1;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 0, &roleName_param, &roleToInherit);
zephir_get_strval(roleName, roleName_param);
ZEPHIR_OBS_VAR(rolesNames);
zephir_read_property_this(&rolesNames, this_ptr, SL("_rolesNames"), PH_NOISY_CC);
if (!(zephir_array_isset(rolesNames, roleName))) {
ZEPHIR_INIT_VAR(_0);
object_init_ex(_0, phalcon_acl_exception_ce);
ZEPHIR_INIT_VAR(_1);
ZEPHIR_CONCAT_SVS(_1, "Role '", roleName, "' does not exist in the role list");
ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 9, _1);
zephir_check_call_status();
zephir_throw_exception_debug(_0, "phalcon/acl/adapter/memory.zep", 194 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
return;
}
if (Z_TYPE_P(roleToInherit) == IS_OBJECT) {
ZEPHIR_CALL_METHOD(&roleInheritName, roleToInherit, "getname", NULL, 0);
zephir_check_call_status();
} else {
ZEPHIR_CPY_WRT(roleInheritName, roleToInherit);
}
_2 = zephir_fetch_nproperty_this(this_ptr, SL("_roleInherits"), PH_NOISY_CC);
if (zephir_array_isset(_2, roleInheritName)) {
_3 = zephir_fetch_nproperty_this(this_ptr, SL("_roleInherits"), PH_NOISY_CC);
zephir_array_fetch(&_4, _3, roleInheritName, PH_NOISY | PH_READONLY, "phalcon/acl/adapter/memory.zep", 207 TSRMLS_CC);
zephir_is_iterable(_4, &_6, &_5, 0, 0, "phalcon/acl/adapter/memory.zep", 210);
for (
; zephir_hash_get_current_data_ex(_6, (void**) &_7, &_5) == SUCCESS
; zephir_hash_move_forward_ex(_6, &_5)
) {
ZEPHIR_GET_HVALUE(deepInheritName, _7);
ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinherit", &_8, 80, roleName, deepInheritName);
zephir_check_call_status();
}
}
if (!(zephir_array_isset(rolesNames, roleInheritName))) {
ZEPHIR_INIT_NVAR(_0);
object_init_ex(_0, phalcon_acl_exception_ce);
ZEPHIR_INIT_VAR(_9);
ZEPHIR_CONCAT_SVS(_9, "Role '", roleInheritName, "' (to inherit) does not exist in the role list");
ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 9, _9);
zephir_check_call_status();
zephir_throw_exception_debug(_0, "phalcon/acl/adapter/memory.zep", 216 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
return;
}
if (ZEPHIR_IS_EQUAL(roleName, roleInheritName)) {
RETURN_MM_BOOL(0);
}
_3 = zephir_fetch_nproperty_this(this_ptr, SL("_roleInherits"), PH_NOISY_CC);
if (!(zephir_array_isset(_3, roleName))) {
zephir_update_property_array(this_ptr, SL("_roleInherits"), roleName, ZEPHIR_GLOBAL(global_true) TSRMLS_CC);
}
zephir_update_property_array_multi(this_ptr, SL("_roleInherits"), &roleInheritName TSRMLS_CC, SL("za"), 2, roleName);
RETURN_MM_BOOL(1);
}
示例10: PHP_METHOD
/**
* @return array
*/
PHP_METHOD(Lynx_Annotation_RegexDocParser, parseAnnotations) {
zval *_14 = NULL;
HashTable *_3, *_8;
HashPosition _2, _7;
int ZEPHIR_LAST_CALL_STATUS;
zephir_nts_static zephir_fcall_cache_entry *_1 = NULL, *_11 = NULL;
zval *docComment, *hasAnnotations = NULL, *matches, *anno = NULL, *annoName = NULL, *val = NULL, *hasParams = NULL, *params, *param = NULL, *rex, *_0 = NULL, *annotations, **_4, *_5, *regex1, *_6, **_9, *_10 = NULL, *_12, *_13 = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &docComment);
ZEPHIR_INIT_VAR(matches);
array_init(matches);
ZEPHIR_INIT_VAR(params);
array_init(params);
ZEPHIR_INIT_VAR(rex);
ZVAL_STRING(rex, "/@(\\w+)(?:\\s*(?:\\(\\s*)?(.*?)(?:\\s*\\))?)??\\s*(?:\n|\\*\\/)/", 1);
ZEPHIR_INIT_VAR(annotations);
array_init(annotations);
ZEPHIR_INIT_VAR(regex1);
ZVAL_STRING(regex1, "/(\\w+)\\s*=\\s*(\\[[^\\]]*\\]|\"[^\"]*\"|[^,)]*)\\s*(?:,|$)/", 1);
ZEPHIR_INIT_VAR(val);
ZVAL_BOOL(val, 1);
ZEPHIR_INIT_VAR(_0);
ZVAL_LONG(_0, 2);
Z_SET_ISREF_P(matches);
ZEPHIR_CALL_FUNCTION(&hasAnnotations, "preg_match_all", &_1, rex, docComment, matches, _0);
Z_UNSET_ISREF_P(matches);
zephir_check_call_status();
if (!zephir_is_true(hasAnnotations)) {
array_init(return_value);
RETURN_MM();
}
zephir_is_iterable(matches, &_3, &_2, 0, 0, "lynx/Annotation/RegexDocParser.zep", 67);
for (
; zephir_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS
; zephir_hash_move_forward_ex(_3, &_2)
) {
ZEPHIR_GET_HVALUE(anno, _4);
ZEPHIR_INIT_NVAR(annoName);
zephir_array_fetch_long(&_5, anno, 1, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 33 TSRMLS_CC);
zephir_fast_strtolower(annoName, _5);
ZEPHIR_INIT_NVAR(val);
ZVAL_BOOL(val, 1);
if (zephir_array_isset_long(anno, 2)) {
zephir_array_fetch_long(&_6, anno, 2, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 38 TSRMLS_CC);
ZEPHIR_INIT_NVAR(_0);
ZVAL_LONG(_0, 2);
Z_SET_ISREF_P(params);
ZEPHIR_CALL_FUNCTION(&hasParams, "preg_match_all", &_1, regex1, _6, params, _0);
Z_UNSET_ISREF_P(params);
zephir_check_call_status();
if (zephir_is_true(hasParams)) {
ZEPHIR_INIT_NVAR(val);
array_init(val);
zephir_is_iterable(params, &_8, &_7, 0, 0, "lynx/Annotation/RegexDocParser.zep", 46);
for (
; zephir_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS
; zephir_hash_move_forward_ex(_8, &_7)
) {
ZEPHIR_GET_HVALUE(param, _9);
zephir_array_fetch_long(&_12, param, 2, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 43 TSRMLS_CC);
ZEPHIR_CALL_SELF(&_10, "parsevalue", &_11, _12);
zephir_check_call_status();
ZEPHIR_OBS_NVAR(_13);
zephir_array_fetch_long(&_13, param, 1, PH_NOISY, "lynx/Annotation/RegexDocParser.zep", 43 TSRMLS_CC);
zephir_array_update_zval(&val, _13, &_10, PH_COPY | PH_SEPARATE);
}
} else {
ZEPHIR_INIT_NVAR(val);
zephir_array_fetch_long(&_12, anno, 2, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 47 TSRMLS_CC);
zephir_fast_trim(val, _12, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC);
if (ZEPHIR_IS_STRING(val, "")) {
ZEPHIR_INIT_NVAR(val);
ZVAL_BOOL(val, 1);
} else {
ZEPHIR_CALL_SELF(&_10, "parsevalue", &_11, val);
zephir_check_call_status();
ZEPHIR_CPY_WRT(val, _10);
}
}
}
if (zephir_array_isset(annotations, annoName)) {
zephir_array_fetch(&_6, annotations, annoName, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 58 TSRMLS_CC);
if (!(Z_TYPE_P(_6) == IS_ARRAY)) {
ZEPHIR_INIT_NVAR(_14);
array_init_size(_14, 2);
ZEPHIR_OBS_NVAR(_13);
zephir_array_fetch(&_13, annotations, annoName, PH_NOISY, "lynx/Annotation/RegexDocParser.zep", 59 TSRMLS_CC);
zephir_array_fast_append(_14, _13);
zephir_array_update_zval(&annotations, annoName, &_14, PH_COPY | PH_SEPARATE);
}
zephir_array_update_multi(&annotations, &val TSRMLS_CC, SL("za"), 2, annoName);
} else {
//.........这里部分代码省略.........
示例11: PHP_METHOD
//.........这里部分代码省略.........
ZEPHIR_CALL_METHOD(&_6$$8, iterator, "valid", NULL, 0);
zephir_check_call_status();
if (!(zephir_is_true(_6$$8))) {
break;
}
ZEPHIR_CALL_METHOD(&handler, iterator, "current", &_7, 0);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, iterator, "next", &_8, 0);
zephir_check_call_status();
if (Z_TYPE_P(handler) == IS_OBJECT) {
if (zephir_instance_of_ev(handler, zend_ce_closure TSRMLS_CC)) {
if (Z_TYPE_P(arguments) == IS_NULL) {
ZEPHIR_INIT_NVAR(arguments);
zephir_create_array(arguments, 3, 0 TSRMLS_CC);
zephir_array_fast_append(arguments, event);
zephir_array_fast_append(arguments, source);
zephir_array_fast_append(arguments, data);
}
ZEPHIR_INIT_NVAR(status);
ZEPHIR_CALL_USER_FUNC_ARRAY(status, handler, arguments);
zephir_check_call_status();
if (collect) {
zephir_update_property_array_append(this_ptr, SL("_responses"), status TSRMLS_CC);
}
if (cancelable) {
ZEPHIR_CALL_METHOD(&_9$$14, event, "isstopped", NULL, 0);
zephir_check_call_status();
if (zephir_is_true(_9$$14)) {
break;
}
}
} else {
if ((zephir_method_exists(handler, eventName TSRMLS_CC) == SUCCESS)) {
ZEPHIR_CALL_METHOD_ZVAL(&status, handler, eventName, NULL, 0, event, source, data);
zephir_check_call_status();
if (collect) {
zephir_update_property_array_append(this_ptr, SL("_responses"), status TSRMLS_CC);
}
if (cancelable) {
ZEPHIR_CALL_METHOD(&_10$$19, event, "isstopped", NULL, 0);
zephir_check_call_status();
if (zephir_is_true(_10$$19)) {
break;
}
}
}
}
}
}
} else {
zephir_is_iterable(queue, &_12$$21, &_11$$21, 0, 0, "phalcon/events/manager.zep", 353);
for (
; zephir_hash_get_current_data_ex(_12$$21, (void**) &_13$$21, &_11$$21) == SUCCESS
; zephir_hash_move_forward_ex(_12$$21, &_11$$21)
) {
ZEPHIR_GET_HVALUE(handler, _13$$21);
if (Z_TYPE_P(handler) == IS_OBJECT) {
if (zephir_instance_of_ev(handler, zend_ce_closure TSRMLS_CC)) {
if (Z_TYPE_P(arguments) == IS_NULL) {
ZEPHIR_INIT_NVAR(arguments);
zephir_create_array(arguments, 3, 0 TSRMLS_CC);
zephir_array_fast_append(arguments, event);
zephir_array_fast_append(arguments, source);
zephir_array_fast_append(arguments, data);
}
ZEPHIR_INIT_NVAR(status);
ZEPHIR_CALL_USER_FUNC_ARRAY(status, handler, arguments);
zephir_check_call_status();
if (collect) {
zephir_update_property_array_append(this_ptr, SL("_responses"), status TSRMLS_CC);
}
if (cancelable) {
ZEPHIR_CALL_METHOD(&_14$$27, event, "isstopped", NULL, 0);
zephir_check_call_status();
if (zephir_is_true(_14$$27)) {
break;
}
}
} else {
if ((zephir_method_exists(handler, eventName TSRMLS_CC) == SUCCESS)) {
ZEPHIR_CALL_METHOD_ZVAL(&status, handler, eventName, NULL, 0, event, source, data);
zephir_check_call_status();
if (collect) {
zephir_update_property_array_append(this_ptr, SL("_responses"), status TSRMLS_CC);
}
if (cancelable) {
ZEPHIR_CALL_METHOD(&_15$$32, event, "isstopped", NULL, 0);
zephir_check_call_status();
if (zephir_is_true(_15$$32)) {
break;
}
}
}
}
}
}
}
RETURN_CCTOR(status);
}
示例12: PHP_METHOD
/**
* Set an specific argument
*/
PHP_METHOD(Phalcon_Cli_Console, setArgument) {
HashTable *_3;
HashPosition _2;
int ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_1 = NULL, *_8 = NULL, *_27 = NULL;
zend_bool str, shift, _0;
zval *arguments_param = NULL, *str_param = NULL, *shift_param = NULL, *arg = NULL, *pos = NULL, *args = NULL, *opts = NULL, *handleArgs = NULL, **_4, _5$$5 = zval_used_for_init, _6$$5 = zval_used_for_init, *_7$$5 = NULL, _9$$6 = zval_used_for_init, *_10$$7 = NULL, _11$$7 = zval_used_for_init, *_12$$7 = NULL, *_13$$7 = NULL, _14$$7 = zval_used_for_init, _15$$7 = zval_used_for_init, *_16$$7 = NULL, *_17$$8 = NULL, _18$$8 = zval_used_for_init, *_19$$8 = NULL, _20$$9 = zval_used_for_init, _21$$9 = zval_used_for_init, *_22$$9 = NULL, _23$$10 = zval_used_for_init, *_24$$10 = NULL, *_25$$13, *_26$$13 = NULL, *_28$$15 = NULL, *_29$$16 = NULL, *_30$$17;
zval *arguments = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 3, &arguments_param, &str_param, &shift_param);
if (!arguments_param) {
ZEPHIR_INIT_VAR(arguments);
array_init(arguments);
} else {
arguments = arguments_param;
}
if (!str_param) {
str = 1;
} else {
if (unlikely(Z_TYPE_P(str_param) != IS_BOOL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be a bool") TSRMLS_CC);
RETURN_MM_NULL();
}
str = Z_BVAL_P(str_param);
}
if (!shift_param) {
shift = 1;
} else {
if (unlikely(Z_TYPE_P(shift_param) != IS_BOOL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'shift' must be a bool") TSRMLS_CC);
RETURN_MM_NULL();
}
shift = Z_BVAL_P(shift_param);
}
ZEPHIR_INIT_VAR(args);
array_init(args);
ZEPHIR_INIT_VAR(opts);
array_init(opts);
ZEPHIR_INIT_VAR(handleArgs);
array_init(handleArgs);
_0 = shift;
if (_0) {
_0 = ((zephir_fast_count_int(arguments TSRMLS_CC)) ? 1 : 0);
}
if (_0) {
ZEPHIR_MAKE_REF(arguments);
ZEPHIR_CALL_FUNCTION(NULL, "array_shift", &_1, 132, arguments);
ZEPHIR_UNREF(arguments);
zephir_check_call_status();
}
zephir_is_iterable(arguments, &_3, &_2, 0, 0, "phalcon/cli/console.zep", 199);
for (
; zephir_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS
; zephir_hash_move_forward_ex(_3, &_2)
) {
ZEPHIR_GET_HVALUE(arg, _4);
if (Z_TYPE_P(arg) == IS_STRING) {
ZEPHIR_SINIT_NVAR(_5$$5);
ZVAL_STRING(&_5$$5, "--", 0);
ZEPHIR_SINIT_NVAR(_6$$5);
ZVAL_LONG(&_6$$5, 2);
ZEPHIR_CALL_FUNCTION(&_7$$5, "strncmp", &_8, 133, arg, &_5$$5, &_6$$5);
zephir_check_call_status();
if (ZEPHIR_IS_LONG(_7$$5, 0)) {
ZEPHIR_SINIT_NVAR(_9$$6);
ZVAL_STRING(&_9$$6, "=", 0);
ZEPHIR_INIT_NVAR(pos);
zephir_fast_strpos(pos, arg, &_9$$6, 0 );
if (zephir_is_true(pos)) {
ZEPHIR_INIT_NVAR(_10$$7);
ZEPHIR_SINIT_NVAR(_11$$7);
ZVAL_LONG(&_11$$7, (zephir_get_numberval(pos) + 1));
ZEPHIR_INIT_NVAR(_12$$7);
zephir_substr(_12$$7, arg, zephir_get_intval(&_11$$7), 0, ZEPHIR_SUBSTR_NO_LENGTH);
zephir_fast_trim(_10$$7, _12$$7, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC);
ZEPHIR_INIT_NVAR(_13$$7);
ZEPHIR_SINIT_NVAR(_14$$7);
ZVAL_LONG(&_14$$7, 2);
ZEPHIR_SINIT_NVAR(_15$$7);
ZVAL_LONG(&_15$$7, (zephir_get_numberval(pos) - 2));
ZEPHIR_INIT_NVAR(_16$$7);
zephir_substr(_16$$7, arg, 2 , zephir_get_intval(&_15$$7), 0);
zephir_fast_trim(_13$$7, _16$$7, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC);
zephir_array_update_zval(&opts, _13$$7, &_10$$7, PH_COPY | PH_SEPARATE);
} else {
ZEPHIR_INIT_NVAR(_17$$8);
ZEPHIR_SINIT_NVAR(_18$$8);
ZVAL_LONG(&_18$$8, 2);
ZEPHIR_INIT_NVAR(_19$$8);
zephir_substr(_19$$8, arg, 2 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
zephir_fast_trim(_17$$8, _19$$8, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC);
zephir_array_update_zval(&opts, _17$$8, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE);
//.........这里部分代码省略.........
示例13: PHP_METHOD
/**
* Listens for notifications from the models manager
*/
PHP_METHOD(Phalcon_Mvc_Model_Behavior_SoftDelete, notify) {
zephir_fcall_cache_entry *_7 = NULL;
HashTable *_5;
HashPosition _4;
int ZEPHIR_LAST_CALL_STATUS;
zval *type_param = NULL, *model, *options = NULL, *value, *field, *updateModel, *message = NULL, *_0, *_1 = NULL, *_2 = NULL, *_3 = NULL, **_6;
zval *type = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 0, &type_param, &model);
if (unlikely(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(type_param) == IS_STRING)) {
zephir_get_strval(type, type_param);
} else {
ZEPHIR_INIT_VAR(type);
ZVAL_EMPTY_STRING(type);
}
if (ZEPHIR_IS_STRING(type, "beforeDelete")) {
ZEPHIR_CALL_METHOD(&options, this_ptr, "getoptions", NULL);
zephir_check_call_status();
ZEPHIR_OBS_VAR(value);
if (!(zephir_array_isset_string_fetch(&value, options, SS("value"), 0 TSRMLS_CC))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'value' is required", "phalcon/mvc/model/behavior/softdelete.zep", 51);
return;
}
ZEPHIR_OBS_VAR(field);
if (!(zephir_array_isset_string_fetch(&field, options, SS("field"), 0 TSRMLS_CC))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'field' is required", "phalcon/mvc/model/behavior/softdelete.zep", 58);
return;
}
ZEPHIR_INIT_VAR(_0);
ZVAL_BOOL(_0, 1);
ZEPHIR_CALL_METHOD(NULL, model, "skipoperation", NULL, _0);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(&_1, model, "readattribute", NULL, field);
zephir_check_call_status();
if (!ZEPHIR_IS_EQUAL(_1, value)) {
ZEPHIR_INIT_VAR(updateModel);
if (zephir_clone(updateModel, model TSRMLS_CC) == FAILURE) {
RETURN_MM();
}
ZEPHIR_CALL_METHOD(NULL, updateModel, "writeattribute", NULL, field, value);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(&_2, updateModel, "save", NULL);
zephir_check_call_status();
if (!(zephir_is_true(_2))) {
ZEPHIR_CALL_METHOD(&_3, updateModel, "getmessages", NULL);
zephir_check_call_status();
zephir_is_iterable(_3, &_5, &_4, 0, 0, "phalcon/mvc/model/behavior/softdelete.zep", 90);
for (
; zephir_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS
; zephir_hash_move_forward_ex(_5, &_4)
) {
ZEPHIR_GET_HVALUE(message, _6);
ZEPHIR_CALL_METHOD(NULL, model, "appendmessage", &_7, message);
zephir_check_call_status();
}
RETURN_MM_BOOL(0);
}
ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, field, value);
zephir_check_call_status();
}
}
ZEPHIR_MM_RESTORE();
}
示例14: PHP_METHOD
/**
* Connect: Establish connection to a database
* @param string hostname Hostname[:port] overriding datasource specs [optional]
* @param string username Username overriding datasource specs [optional]
* @param string passname Password overriding datasource specs [optional]
* @param string database Database name overriding datasource specsString [optional]
* @return boolean
*/
PHP_METHOD(ADOdb_Connection, connect) {
zend_function *_6 = NULL;
HashTable *_4;
HashPosition _3;
zval *hostname_param = NULL, *username_param = NULL, *password_param = NULL, *database_param = NULL, *options = NULL, *_0, *_1, *_2, *option = NULL, *value = NULL, **_5;
zval *hostname = NULL, *username = NULL, *password = NULL, *database = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 5, &hostname_param, &username_param, &password_param, &database_param, &options);
if (!hostname_param) {
ZEPHIR_INIT_VAR(hostname);
ZVAL_EMPTY_STRING(hostname);
} else {
zephir_get_strval(hostname, hostname_param);
}
if (!username_param) {
ZEPHIR_INIT_VAR(username);
ZVAL_EMPTY_STRING(username);
} else {
zephir_get_strval(username, username_param);
}
if (!password_param) {
ZEPHIR_INIT_VAR(password);
ZVAL_EMPTY_STRING(password);
} else {
zephir_get_strval(password, password_param);
}
if (!database_param) {
ZEPHIR_INIT_VAR(database);
ZVAL_EMPTY_STRING(database);
} else {
zephir_get_strval(database, database_param);
}
if (!options) {
ZEPHIR_INIT_VAR(options);
array_init(options);
}
_0 = zephir_fetch_nproperty_this(this_ptr, SL("connection"), PH_NOISY_CC);
if (zephir_is_true(_0)) {
RETURN_MM_BOOL(0);
}
if (hostname && Z_STRLEN_P(hostname)) {
_1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC);
zephir_call_method_p1_noret(_1, "sethostname", hostname);
}
if (username && Z_STRLEN_P(username)) {
_1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC);
zephir_call_method_p1_noret(_1, "setusername", username);
}
if (password && Z_STRLEN_P(password)) {
_1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC);
zephir_call_method_p1_noret(_1, "setpassword", password);
}
if (database && Z_STRLEN_P(database)) {
_1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC);
zephir_call_method_p1_noret(_1, "setdatabase", database);
}
ZEPHIR_INIT_VAR(_2);
_1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC);
zephir_call_static_p1(_2, "ADOdb\\Driver\\DriverManager", "create", _1);
zephir_update_property_this(this_ptr, SL("connection"), _2 TSRMLS_CC);
zephir_is_iterable(options, &_4, &_3, 0, 0);
for (
; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS
; zephir_hash_move_forward_ex(_4, &_3)
) {
ZEPHIR_GET_HMKEY(option, _4, _3);
ZEPHIR_GET_HVALUE(value, _5);
zephir_call_method_p2_cache_noret(this_ptr, "setattribute", &_6, option, value);
}
RETURN_MM_BOOL(1);
}
示例15: PHP_METHOD
/**
* Insert a row in the table with the specified data and types
* returns the number of affected rows
*/
PHP_METHOD(Lynx_DBAL_Connection, insert) {
int ZEPHIR_LAST_CALL_STATUS;
HashTable *_1;
HashPosition _0;
zval *data = NULL, *types = NULL;
zval *table_param = NULL, *data_param = NULL, *types_param = NULL, *query, *stmt = NULL, *value = NULL, *set, *columnName = NULL, *fields, **_2, *_3, *_4 = NULL, *_5, *_6 = NULL, *_7, *_8, *_9;
zval *table = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 1, &table_param, &data_param, &types_param);
if (unlikely(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(table_param) == IS_STRING)) {
zephir_get_strval(table, table_param);
} else {
ZEPHIR_INIT_VAR(table);
ZVAL_EMPTY_STRING(table);
}
data = data_param;
if (!types_param) {
ZEPHIR_INIT_VAR(types);
array_init(types);
} else {
types = types_param;
}
ZEPHIR_INIT_VAR(set);
array_init(set);
ZEPHIR_INIT_VAR(fields);
zephir_array_keys(fields, data TSRMLS_CC);
zephir_is_iterable(data, &_1, &_0, 1, 0, "lynx/DBAL/Connection.zep", 70);
for (
; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS
; zephir_hash_move_forward_ex(_1, &_0)
) {
ZEPHIR_GET_HMKEY(columnName, _1, _0);
ZEPHIR_GET_HVALUE(value, _2);
if (zephir_array_isset(types, columnName)) {
zephir_array_fetch(&_3, types, columnName, PH_NOISY | PH_READONLY, "lynx/DBAL/Connection.zep", 59 TSRMLS_CC);
if (ZEPHIR_IS_LONG(_3, 10)) {
zephir_array_append(&set, value, PH_SEPARATE, "lynx/DBAL/Connection.zep", 60);
zephir_array_unset(&data, columnName, PH_SEPARATE);
} else {
ZEPHIR_INIT_LNVAR(_4);
ZEPHIR_CONCAT_SVS(_4, ":", columnName, "");
zephir_array_append(&set, _4, PH_SEPARATE, "lynx/DBAL/Connection.zep", 63);
}
} else {
ZEPHIR_INIT_LNVAR(_4);
ZEPHIR_CONCAT_SVS(_4, ":", columnName, "");
zephir_array_append(&set, _4, PH_SEPARATE, "lynx/DBAL/Connection.zep", 66);
}
}
_5 = zephir_fetch_nproperty_this(this_ptr, SL("platform"), PH_NOISY_CC);
ZEPHIR_CALL_METHOD(&_6, _5, "wrap", NULL, table);
zephir_check_call_status();
ZEPHIR_INIT_VAR(_7);
zephir_fast_join_str(_7, SL(","), fields TSRMLS_CC);
ZEPHIR_INIT_VAR(_8);
zephir_fast_join_str(_8, SL(","), set TSRMLS_CC);
ZEPHIR_INIT_VAR(query);
ZEPHIR_CONCAT_SVSVSVS(query, "INSERT INTO ", _6, " (", _7, ") VALUES (", _8, ")");
_9 = zephir_fetch_nproperty_this(this_ptr, SL("driver"), PH_NOISY_CC);
ZEPHIR_CALL_METHOD(&stmt, _9, "prepare", NULL, query);
zephir_check_call_status();
ZEPHIR_RETURN_CALL_METHOD(stmt, "execute", NULL, data);
zephir_check_call_status();
RETURN_MM();
}