Skip to content

Commit c307b0e

Browse files
committed
defined functions that will be implemented
1 parent 786da59 commit c307b0e

File tree

3 files changed

+95
-5
lines changed

3 files changed

+95
-5
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ missing
2121
mkinstalldirs
2222
modules
2323
run-tests.php
24+
tmp-php.ini
25+
tests/*.php
26+
tests/*.diff
27+
tests/*.exp
28+
tests/*.log
29+
tests/*.out

dql_tokenizer.c

+82-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,92 @@
11
#include "php_dql_tokenizer.h"
22

3+
#ifdef COMPILE_DL_DQL_TOKENIZER
4+
ZEND_GET_MODULE(dql_tokenizer)
5+
#endif
6+
7+
static PHP_FUNCTION(dql_tokenize_query)
8+
{
9+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::tokenizeQuery() instead.");
10+
}
11+
12+
static PHP_FUNCTION(dql_bracket_trim)
13+
{
14+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::bracketTrim() instead.");
15+
}
16+
17+
static PHP_FUNCTION(dql_bracket_explode)
18+
{
19+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::bracketExplode() instead.");
20+
}
21+
22+
static PHP_FUNCTION(dql_quote_explode)
23+
{
24+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::quoteExplode() instead.");
25+
}
26+
27+
static PHP_FUNCTION(dql_sql_explode)
28+
{
29+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::sqlExplode() instead.");
30+
}
31+
32+
static PHP_FUNCTION(dql_clause_explode)
33+
{
34+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::clauseExplode() instead.");
35+
}
36+
37+
static PHP_FUNCTION(dql_get_split_regexp_from_array)
38+
{
39+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::getSplitRegExpFromArray() instead.");
40+
}
41+
42+
static PHP_FUNCTION(dql_clause_explode_regexp)
43+
{
44+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::clauseExplodeRegExp() instead.");
45+
}
46+
47+
static PHP_FUNCTION(dql_clause_explode_count_brackets)
48+
{
49+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::clauseExplodeCountBrackets() instead.");
50+
}
51+
52+
static PHP_FUNCTION(dql_clause_explode_non_quoted)
53+
{
54+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::clauseExplodeNonQuoted() instead.");
55+
}
56+
57+
static PHP_FUNCTION(dql_merge_bracket_terms)
58+
{
59+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::mergeBracketTerms() instead.");
60+
}
61+
62+
static PHP_FUNCTION(dql_quoted_string_explode)
63+
{
64+
php_error_docref(NULL TSRMLS_CC, E_ERROR, "This function is not implemented. Call Doctrine_Query_Tokenizer::quotedStringExplode() instead.");
65+
}
66+
67+
static function_entry dql_tokenizer_functions[] = {
68+
PHP_FE(dql_tokenize_query, NULL)
69+
PHP_FE(dql_bracket_trim, NULL)
70+
PHP_FE(dql_bracket_explode, NULL)
71+
PHP_FE(dql_quote_explode, NULL)
72+
PHP_FE(dql_sql_explode, NULL)
73+
PHP_FE(dql_clause_explode, NULL)
74+
PHP_FE(dql_get_split_regexp_from_array, NULL)
75+
PHP_FE(dql_clause_explode_regexp, NULL)
76+
PHP_FE(dql_clause_explode_count_brackets, NULL)
77+
PHP_FE(dql_clause_explode_non_quoted, NULL)
78+
PHP_FE(dql_merge_bracket_terms, NULL)
79+
PHP_FE(dql_quoted_string_explode, NULL)
80+
{ NULL, NULL, NULL }
81+
};
82+
83+
/* entry */
384
zend_module_entry dql_tokenizer_module_entry = {
485
#if ZEND_MODULE_API_NO >= 20010901
586
STANDARD_MODULE_HEADER,
687
#endif
788
PHP_DQL_TOKENIZER_EXTNAME,
8-
NULL, /* functions */
89+
dql_tokenizer_functions,
990
NULL, /* MINIT */
1091
NULL, /* MSHUTDOWN */
1192
NULL, /* RINIT */
@@ -16,7 +97,3 @@ zend_module_entry dql_tokenizer_module_entry = {
1697
#endif
1798
STANDARD_MODULE_PROPERTIES
1899
};
19-
20-
#ifdef COMPILE_DL_DQL_TOKENIZER
21-
ZEND_GET_MODULE(dql_tokenizer)
22-
#endif

tests/test_1.phpt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--TEST--
2+
Test for fatal error in not-implemented functions
3+
--FILE--
4+
<?php
5+
dql_tokenize_query();
6+
--EXPECTF--
7+
Fatal error: dql_tokenize_query(): This function is not implemented. Call Doctrine_Query_Tokenizer::tokenizeQuery() instead. in %stest_1.php on line %d

0 commit comments

Comments
 (0)