/** * Phalcon\Forms\Element constructor * * @param string name * @param object|array options * @param array attributes */ PHP_METHOD(Phalcon_Forms_Element_Select, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *name_param = NULL, *options = NULL, *attributes = NULL; zval *name = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &name_param, &options, &attributes); zephir_get_strval(name, name_param); if (!options) { options = ZEPHIR_GLOBAL(global_null); } if (!attributes) { attributes = ZEPHIR_GLOBAL(global_null); } zephir_update_property_this(this_ptr, SL("_optionsValues"), options TSRMLS_CC); ZEPHIR_CALL_PARENT(NULL, phalcon_forms_element_select_ce, this_ptr, "__construct", &_0, 181, name, attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Forwards the execution flow to another controller/action. * * <code> * use Phalcon\Events\Event; * use Phalcon\Mvc\Dispatcher; * use App\Backend\Bootstrap as Backend; * use App\Frontend\Bootstrap as Frontend; * * // Registering modules * $modules = [ * "frontend" => [ * "className" => Frontend::class, * "path" => __DIR__ . "/app/Modules/Frontend/Bootstrap.php", * "metadata" => [ * "controllersNamespace" => "App\Frontend\Controllers", * ], * ], * "backend" => [ * "className" => Backend::class, * "path" => __DIR__ . "/app/Modules/Backend/Bootstrap.php", * "metadata" => [ * "controllersNamespace" => "App\Backend\Controllers", * ], * ], * ]; * * $application->registerModules($modules); * * // Setting beforeForward listener * $eventsManager = $di->getShared("eventsManager"); * * $eventsManager->attach( * "dispatch:beforeForward", * function(Event $event, Dispatcher $dispatcher, array $forward) use ($modules) { * $metadata = $modules[$forward["module"]]["metadata"]; * * $dispatcher->setModuleName($forward["module"]); * $dispatcher->setNamespaceName($metadata["controllersNamespace"]); * } * ); * * // Forward * $this->dispatcher->forward( * [ * "module" => "backend", * "controller" => "posts", * "action" => "index", * ] * ); * </code> * * @param array forward */ PHP_METHOD(Phalcon_Mvc_Dispatcher, forward) { zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *forward, *eventsManager = NULL, *_0, *_1$$3; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &forward); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); ZEPHIR_CPY_WRT(eventsManager, _0); if (Z_TYPE_P(eventsManager) == IS_OBJECT) { ZEPHIR_INIT_VAR(_1$$3); ZVAL_STRING(_1$$3, "dispatch:beforeForward", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _1$$3, this_ptr, forward); zephir_check_temp_parameter(_1$$3); zephir_check_call_status(); } ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_dispatcher_ce, getThis(), "forward", &_2, 323, forward); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Config\Adapter\Json constructor */ PHP_METHOD(Phalcon_Config_Adapter_Json, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *filePath_param = NULL, *_1, *_2; zval *filePath = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &filePath_param); 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); } ZEPHIR_INIT_VAR(_1); ZEPHIR_INIT_VAR(_2); zephir_file_get_contents(_2, filePath TSRMLS_CC); zephir_json_decode(_1, &(_1), _2, zephir_get_intval(ZEPHIR_GLOBAL(global_true)) TSRMLS_CC); ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_json_ce, this_ptr, "__construct", &_0, 19, _1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Pdm\Db\Adapter constructor * * @param \PDO pdo */ PHP_METHOD(Pdm_Db_Adapter_AbstractPdo, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; zval *pdo, *_1; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &pdo); if (!(zephir_instance_of_ev(pdo, php_pdo_get_dbh_ce() TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Parameter 'pdo' must be an instance of 'PDO'", "", 0); return; } ZEPHIR_CALL_PARENT(NULL, pdm_db_adapter_abstractpdo_ce, this_ptr, "__construct", &_0); zephir_check_call_status(); if (Z_TYPE_P(pdo) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(pdm_db_adapter_exception_ce, "A resource of PDO must be passed", "pdm/db/adapter/abstractpdo.zep", 51); return; } zephir_update_property_this(this_ptr, SL("pdo"), pdo TSRMLS_CC); ZEPHIR_INIT_ZVAL_NREF(_1); ZVAL_LONG(_1, 0); zephir_update_property_this(this_ptr, SL("affectedRows"), _1 TSRMLS_CC); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Mvc\Model\Resultset\Simple constructor * * @param array columnMap * @param \Phalcon\Mvc\ModelInterface|Phalcon\Mvc\Model\Row model * @param \Phalcon\Db\Result\Pdo|null result * @param \Phalcon\Cache\BackendInterface cache * @param boolean keepSnapshots */ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *columnMap, *model, *result, *cache = NULL, *keepSnapshots = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 2, &columnMap, &model, &result, &cache, &keepSnapshots); if (!cache) { cache = ZEPHIR_GLOBAL(global_null); } if (!keepSnapshots) { keepSnapshots = ZEPHIR_GLOBAL(global_null); } zephir_update_property_this(this_ptr, SL("_model"), model TSRMLS_CC); zephir_update_property_this(this_ptr, SL("_columnMap"), columnMap TSRMLS_CC); zephir_update_property_this(this_ptr, SL("_keepSnapshots"), keepSnapshots TSRMLS_CC); ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_resultset_simple_ce, this_ptr, "__construct", &_0, 367, result, cache); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Translate\Adapter\Csv constructor */ PHP_METHOD(Phalcon_Translate_Adapter_Csv, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *options_param = NULL, *_1, *_2, *_3, *_4; zval *options = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &options_param); options = options_param; ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_csv_ce, this_ptr, "__construct", &_0, 426, options); zephir_check_call_status(); if (!(zephir_array_isset_string(options, SS("content")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Parameter 'content' is required", "phalcon/translate/adapter/csv.zep", 43); return; } zephir_array_fetch_string(&_1, options, SL("content"), PH_NOISY | PH_READONLY, "phalcon/translate/adapter/csv.zep", 46 TSRMLS_CC); ZEPHIR_INIT_VAR(_2); ZVAL_LONG(_2, 0); ZEPHIR_INIT_VAR(_3); ZVAL_STRING(_3, ";", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_VAR(_4); ZVAL_STRING(_4, "\"", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, this_ptr, "_load", NULL, 427, _1, _2, _3, _4); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Translate\Adapter\NativeArray constructor */ PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *options_param = NULL, *data = NULL; zval *options = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &options_param); options = options_param; ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_nativearray_ce, this_ptr, "__construct", &_0, 422, options); zephir_check_call_status(); ZEPHIR_OBS_VAR(data); if (!(zephir_array_isset_string_fetch(&data, options, SS("content"), 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Translation content was not provided", "phalcon/translate/adapter/nativearray.zep", 46); return; } if (Z_TYPE_P(data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Translation data must be an array", "phalcon/translate/adapter/nativearray.zep", 50); return; } zephir_update_property_this(this_ptr, SL("_translate"), data TSRMLS_CC); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Cache\Backend\Mongo constructor * * @param Phalcon\Cache\FrontendInterface frontend * @param array options */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; zval *frontend, *options = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { options = ZEPHIR_GLOBAL(global_null); } if (!(zephir_array_isset_string(options, SS("mongo")))) { if (!(zephir_array_isset_string(options, SS("server")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The parameter 'server' is required", "phalcon/cache/backend/mongo.zep", 70); return; } } if (!(zephir_array_isset_string(options, SS("db")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The parameter 'db' is required", "phalcon/cache/backend/mongo.zep", 75); return; } if (!(zephir_array_isset_string(options, SS("collection")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The parameter 'collection' is required", "phalcon/cache/backend/mongo.zep", 79); return; } ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_mongo_ce, this_ptr, "__construct", &_0, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Flush Memcache data and resets internal meta-data in order to regenerate it */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, reset) { HashTable *_2$$3; HashPosition _1$$3; zval *meta = NULL, *key = NULL, *realKey = NULL, *_0$$3 = NULL, **_3$$3, *_4$$4; zephir_fcall_cache_entry *_5 = NULL; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); ZEPHIR_OBS_VAR(meta); zephir_read_property_this(&meta, this_ptr, SL("_metaData"), PH_NOISY_CC); if (Z_TYPE_P(meta) == IS_ARRAY) { ZEPHIR_INIT_VAR(_0$$3); zephir_is_iterable(meta, &_2$$3, &_1$$3, 0, 0, "phalcon/mvc/model/metadata/libmemcached.zep", 132); for ( ; zephir_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS ; zephir_hash_move_forward_ex(_2$$3, &_1$$3) ) { ZEPHIR_GET_HMKEY(key, _2$$3, _1$$3); ZEPHIR_GET_HVALUE(_0$$3, _3$$3); ZEPHIR_INIT_NVAR(realKey); ZEPHIR_CONCAT_SV(realKey, "meta-", key); _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); ZEPHIR_CALL_METHOD(NULL, _4$$4, "delete", NULL, 0, realKey); zephir_check_call_status(); } } ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_metadata_libmemcached_ce, this_ptr, "reset", &_5, 336); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Config\Adapter\Php constructor */ PHP_METHOD(Phalcon_Config_Adapter_Php, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *filePath_param = NULL, *_1 = NULL; zval *filePath = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &filePath_param); 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); } ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(&_1); if (zephir_require_zval_ret(&_1, filePath TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_php_ce, this_ptr, "__construct", &_0, 19, _1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Mvc\Model\ValidationFailed constructor * * @param Model model * @param Message[] validationMessages */ PHP_METHOD(Phalcon_Mvc_Model_ValidationFailed, __construct) { int ZEPHIR_LAST_CALL_STATUS; zval *validationMessages = NULL; zval *model, *validationMessages_param = NULL, *messageStr = NULL, *message = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &validationMessages_param); validationMessages = validationMessages_param; if (zephir_fast_count_int(validationMessages TSRMLS_CC) > 0) { ZEPHIR_OBS_VAR(message); zephir_array_fetch_long(&message, validationMessages, 0, PH_NOISY, "phalcon/mvc/model/validationfailed.zep", 51 TSRMLS_CC); ZEPHIR_CALL_METHOD(&messageStr, message, "getmessage", NULL, 0); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(messageStr); ZVAL_STRING(messageStr, "Validation failed", 1); } zephir_update_property_this(this_ptr, SL("_model"), model TSRMLS_CC); zephir_update_property_this(this_ptr, SL("_messages"), validationMessages TSRMLS_CC); ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_validationfailed_ce, this_ptr, "__construct", NULL, 0, messageStr); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * This method is automatically called in Phalcon\Db\Adapter\Pdo constructor. * Call it when you need to restore a database connection. * * @param array $descriptor * @return boolean */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, connect) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *descriptor = NULL, *dbname; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &descriptor); if (!descriptor) { ZEPHIR_CPY_WRT(descriptor, ZEPHIR_GLOBAL(global_null)); } else { ZEPHIR_SEPARATE_PARAM(descriptor); } if (Z_TYPE_P(descriptor) == IS_NULL) { ZEPHIR_OBS_NVAR(descriptor); zephir_read_property_this(&descriptor, this_ptr, SL("_descriptor"), PH_NOISY_CC); } ZEPHIR_OBS_VAR(dbname); if (!(zephir_array_isset_string_fetch(&dbname, descriptor, SS("dbname"), 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "dbname must be specified", "phalcon/db/adapter/pdo/sqlite.zep", 70); return; } zephir_array_update_string(&descriptor, SL("dsn"), &dbname, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_sqlite_ce, this_ptr, "connect", &_0, 141, descriptor); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Cache\Backend\Xcache constructor * * @param \Phalcon\Cache\FrontendInterface frontend * @param array options */ PHP_METHOD(Phalcon_Cache_Backend_Xcache, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL; zval *frontend, *options = NULL, *_0; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); } else { ZEPHIR_SEPARATE_PARAM(options); } if (Z_TYPE_P(options) != IS_ARRAY) { ZEPHIR_INIT_NVAR(options); array_init(options); } if (!(zephir_array_isset_string(options, SS("statsKey")))) { ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "_PHCX", 1); zephir_array_update_string(&options, SL("statsKey"), &_0, PH_COPY | PH_SEPARATE); } ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_xcache_ce, this_ptr, "__construct", &_1, 106, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
PHP_METHOD(Xpl_Collection_ObjectSet, addAll) { HashTable *_3$$4; HashPosition _2$$4; zephir_fcall_cache_entry *_1 = NULL, *_5 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *data, *value$$4 = NULL, *_0$$4 = NULL, **_4$$4; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); if (zephir_instance_of_ev(data, zephir_get_internal_ce(SS("splobjectstorage") TSRMLS_CC) TSRMLS_CC)) { ZEPHIR_CALL_PARENT(NULL, xpl_collection_objectset_ce, this_ptr, "addall", NULL, 0, data); zephir_check_call_status(); } else { ZEPHIR_CALL_CE_STATIC(&_0$$4, xpl_type_ce, "iterate", &_1, 15, data); zephir_check_call_status(); zephir_is_iterable(_0$$4, &_3$$4, &_2$$4, 0, 0, "xpl/collection/objectset.zep", 51); for ( ; zephir_hash_get_current_data_ex(_3$$4, (void**) &_4$$4, &_2$$4) == SUCCESS ; zephir_hash_move_forward_ex(_3$$4, &_2$$4) ) { ZEPHIR_GET_HVALUE(value$$4, _4$$4); ZEPHIR_CALL_METHOD(NULL, this_ptr, "add", &_5, 0, value$$4); zephir_check_call_status(); } } ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Mvc\Model\Transaction\Failed constructor */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, __construct) { int ZEPHIR_LAST_CALL_STATUS; zval *message_param = NULL, *record = NULL; zval *message = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &record); if (unlikely(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(message_param) == IS_STRING)) { zephir_get_strval(message, message_param); } else { ZEPHIR_INIT_VAR(message); ZVAL_EMPTY_STRING(message); } if (!record) { record = ZEPHIR_GLOBAL(global_null); } zephir_update_property_this(this_ptr, SL("_record"), record TSRMLS_CC); ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_transaction_failed_ce, this_ptr, "__construct", NULL, 0, message); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Assets\Resource\Js * * @param string path * @param boolean local * @param boolean filter * @param array attributes */ PHP_METHOD(Phalcon_Assets_Resource_Js, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *path, *local = NULL, *filter = NULL, *attributes = NULL, *_1; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &path, &local, &filter, &attributes); if (!local) { local = ZEPHIR_GLOBAL(global_true); } if (!filter) { filter = ZEPHIR_GLOBAL(global_true); } if (!attributes) { attributes = ZEPHIR_GLOBAL(global_null); } ZEPHIR_INIT_VAR(_1); ZVAL_STRING(_1, "js", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_PARENT(NULL, phalcon_assets_resource_js_ce, this_ptr, "__construct", &_0, 100, _1, path, local, filter, attributes); zephir_check_temp_parameter(_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
PHP_METHOD(Test_Scall, testCall14) { ZEPHIR_MM_GROW(); ZEPHIR_CALL_PARENT(return_value, this_ptr, "Test\\Scall", "testmethod2"); RETURN_MM(); }
/** * Phalcon\Cache\Backend\Redis constructor * * @param Phalcon\Cache\FrontendInterface frontend * @param array options */ PHP_METHOD(Phalcon_Cache_Backend_Redis, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_6 = NULL; zval *frontend, *options = NULL, *_0$$4, *_1$$5, *_2$$6, *_3$$8, *_4$$9, *_5$$10; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); } else { ZEPHIR_SEPARATE_PARAM(options); } if (Z_TYPE_P(options) != IS_ARRAY) { ZEPHIR_INIT_NVAR(options); array_init(options); } if (!(zephir_array_isset_string(options, SS("host")))) { ZEPHIR_INIT_VAR(_0$$4); ZVAL_STRING(_0$$4, "127.0.0.1", 1); zephir_array_update_string(&options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("port")))) { ZEPHIR_INIT_VAR(_1$$5); ZVAL_LONG(_1$$5, 6379); zephir_array_update_string(&options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("index")))) { ZEPHIR_INIT_VAR(_2$$6); ZVAL_LONG(_2$$6, 0); zephir_array_update_string(&options, SL("index"), &_2$$6, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("persistent")))) { zephir_array_update_string(&options, SL("persistent"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("statsKey")))) { ZEPHIR_INIT_VAR(_3$$8); ZVAL_STRING(_3$$8, "", 1); zephir_array_update_string(&options, SL("statsKey"), &_3$$8, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("auth")))) { ZEPHIR_INIT_VAR(_4$$9); ZVAL_STRING(_4$$9, "", 1); zephir_array_update_string(&options, SL("auth"), &_4$$9, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("timeout")))) { ZEPHIR_INIT_VAR(_5$$10); ZVAL_LONG(_5$$10, 0); zephir_array_update_string(&options, SL("timeout"), &_5$$10, PH_COPY | PH_SEPARATE); } ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_redis_ce, getThis(), "__construct", &_6, 124, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Assets\Resource\Css * * @param string path * @param boolean local * @param boolean filter * @param array attributes */ PHP_METHOD(Phalcon_Assets_Resource_Css, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zend_bool local, filter; zval *path_param = NULL, *local_param = NULL, *filter_param = NULL, *attributes = NULL, *_1, *_2, *_3; zval *path = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &path_param, &local_param, &filter_param, &attributes); if (unlikely(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(path_param) == IS_STRING)) { zephir_get_strval(path, path_param); } else { ZEPHIR_INIT_VAR(path); ZVAL_EMPTY_STRING(path); } if (!local_param) { local = 1; } else { local = zephir_get_boolval(local_param); } if (!filter_param) { filter = 1; } else { filter = zephir_get_boolval(filter_param); } if (!attributes) { attributes = ZEPHIR_GLOBAL(global_null); } ZEPHIR_INIT_VAR(_1); ZVAL_STRING(_1, "css", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_VAR(_2); if (local) { ZVAL_BOOL(_2, 1); } else { ZVAL_BOOL(_2, 0); } ZEPHIR_INIT_VAR(_3); if (filter) { ZVAL_BOOL(_3, 1); } else { ZVAL_BOOL(_3, 0); } ZEPHIR_CALL_PARENT(NULL, phalcon_assets_resource_css_ce, this_ptr, "__construct", &_0, 108, _1, path, _2, _3, attributes); zephir_check_temp_parameter(_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * This method is automatically called in Phalcon\Db\Adapter\Pdo constructor. * Call it when you need to restore a database connection. */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, connect) { zend_bool _3$$6; int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_5 = NULL; zval *descriptor_param = NULL, *schema = NULL, *sql = NULL, *status = NULL, *_0$$3, *_2$$6, *_4$$6; zval *descriptor = NULL, *_1$$3 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &descriptor_param); if (!descriptor_param) { ZEPHIR_INIT_VAR(descriptor); array_init(descriptor); } else { zephir_get_arrval(descriptor, descriptor_param); } if (ZEPHIR_IS_EMPTY(descriptor)) { ZEPHIR_OBS_VAR(_0$$3); zephir_read_property_this(&_0$$3, this_ptr, SL("_descriptor"), PH_NOISY_CC); zephir_get_arrval(_1$$3, _0$$3); ZEPHIR_CPY_WRT(descriptor, _1$$3); } ZEPHIR_OBS_VAR(schema); if (zephir_array_isset_string_fetch(&schema, descriptor, SS("schema"), 0 TSRMLS_CC)) { zephir_array_unset_string(&descriptor, SS("schema"), PH_SEPARATE); } else { ZEPHIR_INIT_NVAR(schema); ZVAL_STRING(schema, "", 1); } if (zephir_array_isset_string(descriptor, SS("password"))) { ZEPHIR_OBS_VAR(_2$$6); zephir_array_fetch_string(&_2$$6, descriptor, SL("password"), PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 73 TSRMLS_CC); _3$$6 = Z_TYPE_P(_2$$6) == IS_STRING; if (_3$$6) { zephir_array_fetch_string(&_4$$6, descriptor, SL("password"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 73 TSRMLS_CC); _3$$6 = zephir_fast_strlen_ev(_4$$6) == 0; } if (_3$$6) { zephir_array_update_string(&descriptor, SL("password"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); } } ZEPHIR_CALL_PARENT(&status, phalcon_db_adapter_pdo_postgresql_ce, this_ptr, "connect", &_5, 149, descriptor); zephir_check_call_status(); if (!(ZEPHIR_IS_EMPTY(schema))) { ZEPHIR_INIT_VAR(sql); ZEPHIR_CONCAT_SVS(sql, "SET search_path TO '", schema, "'"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "execute", NULL, 0, sql); zephir_check_call_status(); } RETURN_CCTOR(status); }
/** * Phalcon\Cache\Backend\Redis constructor * * @param Phalcon\Cache\FrontendInterface frontend * @param array options */ PHP_METHOD(Phalcon_Cache_Backend_Redis, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_3 = NULL; zend_bool _1; zval *frontend, *options = NULL, *_0 = NULL, *_2; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); } else { ZEPHIR_SEPARATE_PARAM(options); } if (Z_TYPE_P(options) != IS_ARRAY) { ZEPHIR_INIT_NVAR(options); array_init(options); } if (!(zephir_array_isset_string(options, SS("host")))) { ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "127.0.0.1", 1); zephir_array_update_string(&options, SL("host"), &_0, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("port")))) { ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 6379); zephir_array_update_string(&options, SL("port"), &_0, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("index")))) { ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 0); zephir_array_update_string(&options, SL("index"), &_0, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("persistent")))) { zephir_array_update_string(&options, SL("persistent"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); } _1 = !(zephir_array_isset_string(options, SS("statsKey"))); if (!(_1)) { zephir_array_fetch_string(&_2, options, SL("statsKey"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/redis.zep", 90 TSRMLS_CC); _1 = ZEPHIR_IS_EMPTY(_2); } if (_1) { ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "_PHCR", 1); zephir_array_update_string(&options, SL("statsKey"), &_0, PH_COPY | PH_SEPARATE); } ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_redis_ce, this_ptr, "__construct", &_3, 103, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Cache\Backend\Memcache constructor * * @param array options */ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, __construct) { zval _0$$4; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_2 = NULL; zval *frontend, frontend_sub, *options = NULL, options_sub, __$null, servers, _1$$5; zval *this_ptr = getThis(); ZVAL_UNDEF(&frontend_sub); ZVAL_UNDEF(&options_sub); ZVAL_NULL(&__$null); ZVAL_UNDEF(&servers); ZVAL_UNDEF(&_1$$5); ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { options = &options_sub; ZEPHIR_CPY_WRT(options, &__$null); } else { ZEPHIR_SEPARATE_PARAM(options); } if (Z_TYPE_P(options) != IS_ARRAY) { ZEPHIR_INIT_NVAR(options); array_init(options); } if (!(zephir_array_isset_string(options, SL("servers")))) { ZEPHIR_INIT_VAR(&servers); zephir_create_array(&servers, 1, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(&_0$$4); zephir_create_array(&_0$$4, 3, 0 TSRMLS_CC); add_assoc_stringl_ex(&_0$$4, SL("host"), SL("127.0.0.1")); add_assoc_long_ex(&_0$$4, SL("port"), 11211); add_assoc_long_ex(&_0$$4, SL("weight"), 1); zephir_array_update_long(&servers, 0, &_0$$4, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); zephir_array_update_string(options, SL("servers"), &servers, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SL("statsKey")))) { ZEPHIR_INIT_VAR(&_1$$5); ZVAL_STRING(&_1$$5, ""); zephir_array_update_string(options, SL("statsKey"), &_1$$5, PH_COPY | PH_SEPARATE); } ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_libmemcached_ce, getThis(), "__construct", &_2, 0, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * This method is automatically called in Phalcon\Db\Adapter\Pdo constructor. * Call it when you need to restore a database connection. * * @param array $descriptor * @return boolean */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, connect) { int ZEPHIR_LAST_CALL_STATUS; zephir_nts_static zephir_fcall_cache_entry *_3 = NULL; zend_bool _1; zval *descriptor = NULL, *schema = NULL, *sql, *_0, *_2; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &descriptor); if (!descriptor) { ZEPHIR_CPY_WRT(descriptor, ZEPHIR_GLOBAL(global_null)); } else { ZEPHIR_SEPARATE_PARAM(descriptor); } if (Z_TYPE_P(descriptor) == IS_NULL) { ZEPHIR_OBS_NVAR(descriptor); zephir_read_property_this(&descriptor, this_ptr, SL("_descriptor"), PH_NOISY_CC); } ZEPHIR_OBS_VAR(schema); if (zephir_array_isset_string_fetch(&schema, descriptor, SS("schema"), 0 TSRMLS_CC)) { zephir_array_unset_string(&descriptor, SS("schema"), PH_SEPARATE); } else { ZEPHIR_INIT_NVAR(schema); ZVAL_STRING(schema, "", 1); } if (zephir_array_isset_string(descriptor, SS("password"))) { ZEPHIR_OBS_VAR(_0); zephir_array_fetch_string(&_0, descriptor, SL("password"), PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 74 TSRMLS_CC); _1 = Z_TYPE_P(_0) == IS_STRING; if (_1) { zephir_array_fetch_string(&_2, descriptor, SL("password"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 74 TSRMLS_CC); _1 = zephir_fast_strlen_ev(_2) == 0; } if (_1) { zephir_array_update_string(&descriptor, SL("password"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); } } ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_postgresql_ce, this_ptr, "connect", &_3, descriptor); zephir_check_call_status(); if (!(ZEPHIR_IS_EMPTY(schema))) { ZEPHIR_INIT_VAR(sql); ZEPHIR_CONCAT_SVS(sql, "SET search_path TO '", schema, "'"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "execute", NULL, sql); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Cache\Backend\File constructor * * @param Phalcon\Cache\FrontendInterface frontend * @param array options */ PHP_METHOD(Phalcon_Cache_Backend_File, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_nts_static zephir_fcall_cache_entry *_4 = NULL, *_5 = NULL; zend_bool _1; zval *frontend, *options = NULL, *prefix, *safekey, *_0, *_2, *_3 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { options = ZEPHIR_GLOBAL(global_null); } if (!(zephir_array_isset_string(options, SS("cacheDir")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache directory must be specified with the option cacheDir", "phalcon/cache/backend/file.zep", 78); return; } ZEPHIR_OBS_VAR(safekey); if (zephir_array_isset_string_fetch(&safekey, options, SS("safekey"), 0 TSRMLS_CC)) { if (Z_TYPE_P(safekey) != IS_BOOL) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "safekey option should be a boolean.", "phalcon/cache/backend/file.zep", 83); return; } zephir_update_property_this(this_ptr, SL("_useSafeKey"), safekey TSRMLS_CC); } ZEPHIR_OBS_VAR(prefix); if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 0 TSRMLS_CC)) { _0 = zephir_fetch_nproperty_this(this_ptr, SL("_useSafeKey"), PH_NOISY_CC); _1 = zephir_is_true(_0); if (_1) { ZEPHIR_INIT_VAR(_2); ZVAL_STRING(_2, "/[^a-zA-Z0-9_.-]+/", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_FUNCTION(&_3, "preg_match", &_4, _2, prefix); zephir_check_temp_parameter(_2); zephir_check_call_status(); _1 = zephir_is_true(_3); } if (_1) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "FileCache prefix should only use alphanumeric characters.", "phalcon/cache/backend/file.zep", 92); return; } } ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_file_ce, this_ptr, "__construct", &_5, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Cache\Backend\File constructor */ PHP_METHOD(Phalcon_Cache_Backend_File, __construct) { zend_bool _1$$6; int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_5 = NULL; zval *options = NULL; zval *frontend, *options_param = NULL, *prefix = NULL, *safekey = NULL, *_0$$6, *_2$$6, *_3$$6, _4$$6; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &frontend, &options_param); zephir_get_arrval(options, options_param); if (!(zephir_array_isset_string(options, SS("cacheDir")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache directory must be specified with the option cacheDir", "phalcon/cache/backend/file.zep", 79); return; } ZEPHIR_OBS_VAR(safekey); if (zephir_array_isset_string_fetch(&safekey, options, SS("safekey"), 0 TSRMLS_CC)) { if (Z_TYPE_P(safekey) != IS_BOOL) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "safekey option should be a boolean.", "phalcon/cache/backend/file.zep", 84); return; } zephir_update_property_this(this_ptr, SL("_useSafeKey"), safekey TSRMLS_CC); } ZEPHIR_OBS_VAR(prefix); if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 0 TSRMLS_CC)) { _0$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_useSafeKey"), PH_NOISY_CC); _1$$6 = zephir_is_true(_0$$6); if (_1$$6) { ZEPHIR_INIT_VAR(_2$$6); ZEPHIR_INIT_VAR(_3$$6); ZEPHIR_SINIT_VAR(_4$$6); ZVAL_STRING(&_4$$6, "/[^a-zA-Z0-9_.-]+/", 0); zephir_preg_match(_3$$6, &_4$$6, prefix, _2$$6, 0, 0 , 0 TSRMLS_CC); _1$$6 = zephir_is_true(_3$$6); } if (_1$$6) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "FileCache prefix should only use alphanumeric characters.", "phalcon/cache/backend/file.zep", 93); return; } } ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_file_ce, this_ptr, "__construct", &_5, 113, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Phalcon\Cli\Dispatcher constructor */ PHP_METHOD(Phalcon_Cli_Dispatcher, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL; zval *_0; ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(_0); array_init(_0); zephir_update_property_this(this_ptr, SL("_options"), _0 TSRMLS_CC); ZEPHIR_CALL_PARENT(NULL, phalcon_cli_dispatcher_ce, this_ptr, "__construct", &_1, 124); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * 构造函数。 * * @param \DotPHP\SwooleBootstrap bootstrap */ PHP_METHOD(DotPHP_Base_SwooleBase, __construct) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *bootstrap; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &bootstrap); ZEPHIR_CALL_PARENT(NULL, dotphp_base_swoolebase_ce, this_ptr, "__construct", &_0, 10, bootstrap); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Exception, __construct) { zend_long code, ZEPHIR_LAST_CALL_STATUS; zval statement; zval *message_param = NULL, *statement_param = NULL, *code_param = NULL, *previous = NULL, previous_sub, __$null, _0; zval message; zval *this_ptr = getThis(); ZVAL_UNDEF(&message); ZVAL_UNDEF(&previous_sub); ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&statement); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &message_param, &statement_param, &code_param, &previous); if (!message_param) { ZEPHIR_INIT_VAR(&message); ZVAL_STRING(&message, ""); } else { zephir_get_strval(&message, message_param); } if (!statement_param) { ZEPHIR_INIT_VAR(&statement); array_init(&statement); } else { zephir_get_arrval(&statement, statement_param); } if (!code_param) { code = 0; } else { code = zephir_get_intval(code_param); } if (!previous) { previous = &previous_sub; previous = &__$null; } zephir_update_property_zval(this_ptr, SL("statement"), &statement); ZVAL_LONG(&_0, code); ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_view_engine_volt_exception_ce, getThis(), "__construct", NULL, 0, &message, &_0, previous); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
PHP_METHOD(Xpl_Collection_ScalarSet, add) { int ZEPHIR_LAST_CALL_STATUS; zval *value, *_0 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &value); ZEPHIR_CALL_SELF(&_0, "cast", NULL, 0, value); zephir_check_call_status(); ZEPHIR_CALL_PARENT(NULL, xpl_collection_scalarset_ce, this_ptr, "attach", NULL, 0, _0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
/** * Clear messages in the session messenger */ PHP_METHOD(Phalcon_Flash_Session, clear) { zval *_0; zephir_fcall_cache_entry *_1 = NULL; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(_0); ZVAL_BOOL(_0, 1); ZEPHIR_CALL_METHOD(NULL, this_ptr, "_getsessionmessages", NULL, 0, _0); zephir_check_call_status(); ZEPHIR_CALL_PARENT(NULL, phalcon_flash_session_ce, this_ptr, "clear", &_1, 198); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }