本文整理汇总了C++中PHALCON_CONCAT_SVSVS函数的典型用法代码示例。如果您正苦于以下问题:C++ PHALCON_CONCAT_SVSVS函数的具体用法?C++ PHALCON_CONCAT_SVSVS怎么用?C++ PHALCON_CONCAT_SVSVS使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PHALCON_CONCAT_SVSVS函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Generates the SQL to describe the table creation options
*
* @param string $table
* @param string $schema
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect_Mysql, tableOptions){
zval *table = NULL, *schema = NULL, *sql = NULL, *part_sql = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &table, &schema) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!schema) {
PHALCON_ALLOC_ZVAL_MM(schema);
ZVAL_NULL(schema);
}
PHALCON_INIT_VAR(sql);
ZVAL_STRING(sql, "SELECT TABLES.TABLE_TYPE,TABLES.AUTO_INCREMENT,TABLES.ENGINE,TABLES.TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES WHERE ", 1);
if (zend_is_true(schema)) {
PHALCON_INIT_VAR(part_sql);
PHALCON_CONCAT_SVSVS(part_sql, "TABLES.TABLE_SCHEMA = \"", schema, "\" AND TABLES.TABLE_NAME = \"", table, "\"");
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CONCAT_SVSVS(r0, "TABLES.TABLE_SCHEMA = \"", schema, "\" AND TABLES.TABLE_NAME = \"", table, "\"");
phalcon_concat_self(&sql, r0 TSRMLS_CC);
} else {
PHALCON_INIT_VAR(part_sql);
PHALCON_CONCAT_SVS(part_sql, "TABLES.TABLE_NAME = \"", table, "\"");
phalcon_concat_self(&sql, part_sql TSRMLS_CC);
}
RETURN_CTOR(sql);
}
示例2: PHP_METHOD
/**
* Escapes a column/table/schema name
*
* @param string $identifier
* @return string
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, escapeIdentifier){
zval *identifier, *domain, *name, *escaped = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &identifier) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (Z_TYPE_P(identifier) == IS_ARRAY) {
PHALCON_INIT_VAR(domain);
phalcon_array_fetch_long(&domain, identifier, 0, PH_NOISY_CC);
PHALCON_INIT_VAR(name);
phalcon_array_fetch_long(&name, identifier, 1, PH_NOISY_CC);
PHALCON_INIT_VAR(escaped);
PHALCON_CONCAT_SVSVS(escaped, "`", domain, "`.`", name, "`");
RETURN_CTOR(escaped);
}
PHALCON_INIT_NVAR(escaped);
PHALCON_CONCAT_SVS(escaped, "`", identifier, "`");
RETURN_CTOR(escaped);
}
示例3: PHP_METHOD
/**
* Generates SQL to query foreign keys on a table
*
* @param string $table
* @param string $schema
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeReferences){
zval *table = NULL, *schema = NULL, *sql = NULL, *final_sql = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &table, &schema) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!schema) {
PHALCON_ALLOC_ZVAL_MM(schema);
ZVAL_NULL(schema);
}
PHALCON_INIT_VAR(sql);
ZVAL_STRING(sql, "SELECT tc.table_name as TABLE_NAME, kcu.column_name as COLUMN_NAME, tc.constraint_name as CONSTRAINT_NAME, tc.table_catalog as REFERENCED_TABLE_SCHEMA, ccu.table_name AS REFERENCED_TABLE_NAME, ccu.column_name AS REFERENCED_COLUMN_NAME FROM information_schema.table_constraints AS tc JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name WHERE constraint_type = 'FOREIGN KEY' AND ", 1);
if (zend_is_true(schema)) {
PHALCON_INIT_VAR(final_sql);
PHALCON_CONCAT_SVSVS(final_sql, "tc.table_schema = '", schema, "' AND tc.table_name='", table, "'");
} else {
PHALCON_INIT_VAR(final_sql);
PHALCON_CONCAT_SVS(final_sql, "tc.table_name='", table, "'");
}
phalcon_concat_self(&sql, final_sql TSRMLS_CC);
RETURN_CTOR(sql);
}
示例4: PHP_METHOD
/**
* Generates SQL to delete an index from a table
*
* @param string $tableName
* @param string $schemaName
* @param string $indexName
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropIndex){
zval *table_name = NULL, *schema_name = NULL, *index_name = NULL;
zval *sql = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz", &table_name, &schema_name, &index_name) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (zend_is_true(schema_name)) {
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CONCAT_SVSVS(r0, "ALTER TABLE `", schema_name, "`.`", table_name, "` DROP INDEX ");
PHALCON_CPY_WRT(sql, r0);
} else {
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_CONCAT_SVS(r1, "ALTER TABLE `", table_name, "` DROP INDEX ");
PHALCON_CPY_WRT(sql, r1);
}
PHALCON_ALLOC_ZVAL_MM(r2);
PHALCON_CONCAT_SVS(r2, "`", index_name, "`");
phalcon_concat_self(&sql, r2 TSRMLS_CC);
PHALCON_RETURN_CTOR(sql);
}
示例5: PHP_METHOD
/**
* Escapes a column/table/schema name
*
* @param string $identifier
* @return string
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, escapeIdentifier){
zval *identifier, *domain, *name;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &identifier);
if (Z_TYPE_P(identifier) == IS_ARRAY) {
PHALCON_OBS_VAR(domain);
phalcon_array_fetch_long(&domain, identifier, 0, PH_NOISY);
PHALCON_OBS_VAR(name);
phalcon_array_fetch_long(&name, identifier, 1, PH_NOISY);
if (PHALCON_GLOBAL(db).escape_identifiers) {
PHALCON_CONCAT_SVSVS(return_value, "`", domain, "`.`", name, "`");
RETURN_MM();
}
PHALCON_CONCAT_VSV(return_value, domain, ".", name);
RETURN_MM();
}
if (PHALCON_GLOBAL(db).escape_identifiers) {
PHALCON_CONCAT_SVS(return_value, "`", identifier, "`");
RETURN_MM();
}
RETURN_CCTOR(identifier);
}
示例6: PHP_METHOD
/**
* Generates SQL to drop a view
*
* @param string $viewName
* @param string $schemaName
* @param boolean $ifExists
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect_Oracle, dropView){
zval *view_name, *schema_name, *if_exists = NULL, *view = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 2, 1, &view_name, &schema_name, &if_exists);
if (!if_exists) {
if_exists = PHALCON_GLOBAL(z_true);
}
if (zend_is_true(schema_name)) {
PHALCON_INIT_VAR(view);
PHALCON_CONCAT_SVSVS(view, "`", schema_name, "`.`", view_name, "`");
} else {
PHALCON_INIT_NVAR(view);
PHALCON_CONCAT_SVS(view, "`", view_name, "`");
}
if (zend_is_true(if_exists)) {
PHALCON_CONCAT_SV(return_value, "DROP VIEW IF EXISTS ", view);
} else {
PHALCON_CONCAT_SV(return_value, "DROP VIEW ", view);
}
PHALCON_MM_RESTORE();
}
示例7: PHP_METHOD
PHP_METHOD(Phalcon_Debug, getFileLink) {
zval **file, **line, **format;
phalcon_fetch_params_ex(3, 0, &file, &line, &format);
PHALCON_ENSURE_IS_STRING(file);
PHALCON_ENSURE_IS_STRING(line);
if (Z_TYPE_PP(format) == IS_STRING) {
char *tmp, *link;
int tmp_len, link_len;
zval z_link = zval_used_for_init;
tmp = php_str_to_str_ex(Z_STRVAL_PP(format), Z_STRLEN_PP(format), SL("%f"), Z_STRVAL_PP(file), Z_STRLEN_PP(file), &tmp_len, 1, NULL);
link = php_str_to_str_ex(tmp, tmp_len, SL("%l"), Z_STRVAL_PP(line), Z_STRLEN_PP(line), &link_len, 1, NULL);
ZVAL_STRINGL(&z_link, link, link_len, 0);
efree(tmp);
PHALCON_CONCAT_SVSVS(return_value, "<a href=\"", &z_link, "\">", *file, "</a>");
efree(link);
}
else {
RETVAL_ZVAL(*file, 1, 0);
}
}
示例8: PHP_METHOD
/**
* Generates SQL to add an index to a table
*
* @param string $tableName
* @param string $schemaName
* @param Phalcon\Db\IndexInterface $index
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addIndex){
zval *table_name, *schema_name, *index, *sql = NULL, *columns = NULL;
zval *quoted_column_list = NULL, *name = NULL;
zval *index_type = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 3, 0, &table_name, &schema_name, &index);
PHALCON_VERIFY_INTERFACE_EX(index, phalcon_db_indexinterface_ce, phalcon_db_exception_ce, 1);
PHALCON_CALL_METHOD(&name, index, "getname");
PHALCON_CALL_METHOD(&index_type, index, "gettype");
PHALCON_INIT_VAR(sql);
if (zend_is_true(schema_name)) {
if (index_type && Z_TYPE_P(index_type) == IS_STRING && Z_STRLEN_P(index_type) > 0) {
PHALCON_CONCAT_SVSVSVSVS(sql, "CREATE ", index_type, " INDEX \"", schema_name, "\".\"", name, "\" ON \"", table_name, "\" (");
} else {
PHALCON_CONCAT_SVSVSVS(sql, "CREATE INDEX \"", schema_name, "\".\"", name, "\" ON \"", table_name, "\" (");
}
} else if (index_type && Z_TYPE_P(index_type) == IS_STRING && Z_STRLEN_P(index_type) > 0) {
PHALCON_CONCAT_SVSVSVS(sql, "CREATE ", index_type, " INDEX \"", name, "\" ON \"", table_name, "\" (");
} else {
PHALCON_CONCAT_SVSVS(sql, "CREATE INDEX \"", name, "\" ON \"", table_name, "\" (");
}
PHALCON_CALL_METHOD(&columns, index, "getcolumns");
PHALCON_CALL_METHOD("ed_column_list, getThis(), "getcolumnlist", columns);
PHALCON_SCONCAT_VS(sql, quoted_column_list, ")");
RETURN_CTOR(sql);
}
示例9: PHP_METHOD
/**
* Generates SQL to drop a view
*
* @param string $viewName
* @param string $schemaName
* @param boolean $ifExists
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect_Oracle, dropView){
zval *view_name, *schema_name, *if_exists = NULL, *view = NULL;
zval *sql = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 2, 1, &view_name, &schema_name, &if_exists);
if (!if_exists) {
PHALCON_INIT_VAR(if_exists);
ZVAL_BOOL(if_exists, 1);
}
if (zend_is_true(schema_name)) {
PHALCON_INIT_VAR(view);
PHALCON_CONCAT_SVSVS(view, "`", schema_name, "`.`", view_name, "`");
} else {
PHALCON_INIT_NVAR(view);
PHALCON_CONCAT_SVS(view, "`", view_name, "`");
}
if (zend_is_true(if_exists)) {
PHALCON_INIT_VAR(sql);
PHALCON_CONCAT_SV(sql, "DROP VIEW IF EXISTS ", view);
} else {
PHALCON_INIT_NVAR(sql);
PHALCON_CONCAT_SV(sql, "DROP VIEW ", view);
}
RETURN_CTOR(sql);
}
示例10: PHP_METHOD
/**
* Generates a link to the current version documentation
*
* @return string
*/
PHP_METHOD(Phalcon_Debug, getVersion){
zval *version, *version_link;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(version);
phalcon_call_method(version, this_ptr, "getmajorversion");
PHALCON_INIT_VAR(version_link);
PHALCON_CONCAT_SVSVS(version_link, "<div class=\"version\">Phalcon Framework <a target=\"_new\" href=\"http://docs.phalconphp.com/en/", version, "/\">", version, "</a></div>");
RETURN_CTOR(version_link);
}
示例11: PHP_METHOD
/**
* Generate the label of a element added to the form including HTML
*
* @param string $name
* @param array $attributes
* @return string
*/
PHP_METHOD(Phalcon_Forms_Form, label){
zval *name, *elements, *exception_message, *element;
zval *label, *html = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &name) == FAILURE) {
RETURN_MM_NULL();
}
PHALCON_OBS_VAR(elements);
phalcon_read_property(&elements, this_ptr, SL("_elements"), PH_NOISY_CC);
if (!phalcon_array_isset(elements, name)) {
PHALCON_INIT_VAR(exception_message);
PHALCON_CONCAT_SVS(exception_message, "Element with ID=", name, " is not part of the form");
PHALCON_THROW_EXCEPTION_ZVAL(phalcon_forms_exception_ce, exception_message);
return;
}
PHALCON_OBS_VAR(element);
phalcon_array_fetch(&element, elements, name, PH_NOISY_CC);
PHALCON_INIT_VAR(label);
PHALCON_CALL_METHOD(label, element, "getlabel");
if (Z_TYPE_P(label) != IS_NULL) {
PHALCON_INIT_VAR(html);
PHALCON_CONCAT_SVSVS(html, "<label for=\"", name, "\">", label, "</label>");
} else {
PHALCON_INIT_NVAR(html);
PHALCON_CONCAT_SVSVS(html, "<label for=\"", name, "\">", name, "</label>");
}
RETURN_CTOR(html);
}
示例12: PHP_METHOD
/**
* Generate the HTML to label the element
*
* @return string
*/
PHP_METHOD(Phalcon_Forms_Element, label){
zval *label, *attributes, *name = NULL, *html = NULL;
PHALCON_MM_GROW();
PHALCON_OBS_VAR(label);
phalcon_read_property_this(&label, this_ptr, SL("_label"), PH_NOISY_CC);
PHALCON_OBS_VAR(attributes);
phalcon_read_property_this(&attributes, this_ptr, SL("_attributes"), PH_NOISY_CC);
/**
* Check if there is an 'id' attribute defined
*/
if (phalcon_array_isset_string(attributes, SS("id"))) {
PHALCON_OBS_VAR(name);
phalcon_array_fetch_string(&name, attributes, SL("id"), PH_NOISY_CC);
} else {
PHALCON_OBS_NVAR(name);
phalcon_read_property_this(&name, this_ptr, SL("_name"), PH_NOISY_CC);
}
/**
* Use the default label or leave the same name as label
*/
if (zend_is_true(label)) {
PHALCON_INIT_VAR(html);
PHALCON_CONCAT_SVSVS(html, "<label for=\"", name, "\">", label, "</label>");
} else {
PHALCON_INIT_NVAR(html);
PHALCON_CONCAT_SVSVS(html, "<label for=\"", name, "\">", name, "</label>");
}
RETURN_CTOR(html);
}
示例13: PHP_METHOD
/**
* Escapes a column/table/schema name
*
*<code>
* $escapedTable = $connection->escapeIdentifier('robots');
* $escapedTable = $connection->escapeIdentifier(array('store', 'robots'));
*</code>
*
* @param string $identifier
* @return string
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo, escapeIdentifier){
zval *identifier, *domain, *name;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &identifier);
if (Z_TYPE_P(identifier) == IS_ARRAY) {
PHALCON_OBS_VAR(domain);
phalcon_array_fetch_long(&domain, identifier, 0, PH_NOISY);
PHALCON_OBS_VAR(name);
phalcon_array_fetch_long(&name, identifier, 1, PH_NOISY);
PHALCON_CONCAT_SVSVS(return_value, "\"", domain, "\".\"", name, "\"");
RETURN_MM();
}
PHALCON_CONCAT_SVS(return_value, "\"", identifier, "\"");
RETURN_MM();
}