Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug #821 minify file size is 0 #870

Closed
wants to merge 202 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
7039cd4
Possible fix for #732
sjinks Jun 27, 2013
a65f821
Test case for #732
sjinks Jun 27, 2013
9221613
Merge pull request #1 from phalcon/master
dreamsxin Jun 28, 2013
e57b142
Including the most recent version of gcccpuopt from http://www.pixelb…
mattpavelle Jul 5, 2013
e01a89b
DCE
sjinks Jul 9, 2013
c1eed29
Regenerating build 64bits [ci skip]
andresgutierrez Jul 9, 2013
7784ad5
Merge branch '1.2.0' of https://github.com/phalcon/cphalcon into 1.2.0
andresgutierrez Jul 9, 2013
68a6a2f
Regenerating build 64bits [ci skip]
andresgutierrez Jul 9, 2013
00bfa38
‘phalcon_less_equal_long’ declared ‘static’ but never defined
sjinks Jul 9, 2013
aa6ab63
‘phalcon_try_execute’ declared ‘static’ but never defined
sjinks Jul 9, 2013
ad4abf6
‘phalcon_restore_symbol_table’ declared ‘static’ but never defined
sjinks Jul 9, 2013
cddea18
functions declared ‘static’ but never defined
sjinks Jul 9, 2013
14be03d
'phalcon_alt_call_user_method_ex' declared 'static' but never defined
sjinks Jul 9, 2013
fbbc433
Compute both 32 and 64 bit hashes on the same arch
sjinks Jul 9, 2013
144aebe
Possible fix for #810
sjinks Jul 9, 2013
a0817f0
Fix for #812
sjinks Jul 9, 2013
c08a204
Merge remote-tracking branch 'upstream/1.2.1' into hash_32_64
sjinks Jul 10, 2013
45ff525
Fix for #812
sjinks Jul 9, 2013
549bdc4
Merge branch 'issue-812' of github.com:sjinks/cphalcon into issue-812
sjinks Jul 10, 2013
82e3496
Possible fix for #732
sjinks Jun 27, 2013
809297d
Test case for #732
sjinks Jun 27, 2013
b327564
Merge
sjinks Jul 10, 2013
71453c5
Merge pull request #817 from sjinks/hash_32_64
Jul 10, 2013
c95cc91
Merge pull request #818 from sjinks/issue-812
Jul 10, 2013
3f61ae4
Merge pull request #820 from sjinks/issue-732
Jul 10, 2013
5fe588d
Faster phalcon_array_isset()
sjinks Jul 11, 2013
af2298c
Use SEPARATE_ZVAL
sjinks Jul 11, 2013
6da7fb8
Faster phalcon_array_unset()
sjinks Jul 11, 2013
e63c1ab
Faster phalcon_array_update_zval()
sjinks Jul 11, 2013
821adc5
phalcon_array_fetch() is more consistent with PHP's behavior
sjinks Jul 11, 2013
6f8d778
Optimized phalcon_array_fetch_quick_string()
sjinks Jul 11, 2013
bc4ef9e
Optimized phalcon_array_fetch_long()
sjinks Jul 11, 2013
0d640f7
Doxygen comments, part 1 [ci skip]
sjinks Jul 11, 2013
4ca4f03
Doxygen comments, part 2 [ci skip]
sjinks Jul 11, 2013
e1454b8
Merge pull request #822 from sjinks/array-opt
Jul 11, 2013
126bc49
Taking advantage of existing return_value instead of allocate memory,…
Jul 11, 2013
e177ef2
Restoring merge
Jul 11, 2013
e170720
Removed unnecessary TSRMLS from kernel/array
sjinks Jul 11, 2013
b324507
Removed unnecessary TSRMLS from kernel/array
sjinks Jul 11, 2013
e26a1b0
Merge upstream/1.2.0
sjinks Jul 11, 2013
a4fd288
Fix after-merge issues
sjinks Jul 11, 2013
f690e55
Merge pull request #823 from sjinks/array_tsrmls
Jul 11, 2013
5042dbb
‘phalcon_less_equal_long’ declared ‘static’ but never defined
sjinks Jul 9, 2013
4c675c0
‘phalcon_try_execute’ declared ‘static’ but never defined
sjinks Jul 9, 2013
1c95c54
‘phalcon_restore_symbol_table’ declared ‘static’ but never defined
sjinks Jul 9, 2013
ada5263
functions declared ‘static’ but never defined
sjinks Jul 9, 2013
6bd1f2d
'phalcon_alt_call_user_method_ex' declared 'static' but never defined
sjinks Jul 9, 2013
e4d5952
Merge branch 'compiler-warnings' of github.com:sjinks/cphalcon into c…
sjinks Jul 11, 2013
a91d975
Merge pull request #825 from sjinks/compiler-warnings
Jul 11, 2013
101a689
DCE
sjinks Jul 9, 2013
72c7af8
Merge remote-tracking branch 'origin/dead-code-elimination' into dead…
sjinks Jul 11, 2013
412289e
Merge pull request #827 from sjinks/dead-code-elimination
Jul 11, 2013
8307c56
Possible fix for #810
sjinks Jul 9, 2013
7ddc7c8
Merge remote-tracking branch 'origin/issue-810' into issue-810
sjinks Jul 11, 2013
1079248
Another possible fix for #810
sjinks Jul 11, 2013
2d9b4e1
Regenerate build files for #810 [ci skip]
sjinks Jul 11, 2013
9813b6e
Merge pull request #828 from sjinks/issue-810
Jul 11, 2013
711c937
phalcon_get_current_key_w()
sjinks Jul 11, 2013
cbe8082
Drop array_merge_recursive_n() in favor of phalcon_array_merge_recurs…
sjinks Jul 11, 2013
9ec1f6d
Kill TSRMLS in phalcon_array_merge_recursive_n()
sjinks Jul 12, 2013
09d4970
Taking advantage of return_value when possible, adding Forms\ElementI…
Jul 12, 2013
36ba530
Fix #831
sjinks Jul 12, 2013
f348ec9
Test case for #831
sjinks Jul 12, 2013
78dfb6d
Restoring merge
Jul 12, 2013
e84de39
Merge pull request #830 from sjinks/faster-merge
Jul 12, 2013
bf207e7
Restoring merge (2)
Jul 12, 2013
3ba16ee
Removing unnecessary TSRMLS_CC, restoring merge
Jul 12, 2013
591b4b9
More use of return_value everywhere
Jul 12, 2013
02eaf75
Got rid of TSRMLS in kernel/string wherever possible
sjinks Jul 12, 2013
344919a
Merge pull request #833 from sjinks/string-optimization
Jul 12, 2013
47767ad
Merge branch '1.2.1' of https://github.com/phalcon/cphalcon into 1.2.1
Jul 12, 2013
499b871
Regenerating builds [ci skip]
andresgutierrez Jul 12, 2013
3e17c38
grow should be 0 when MM is not used
sjinks Jul 12, 2013
111f9d8
Do not use MM in very simple cases
sjinks Jul 12, 2013
0dff66a
Aliasing
sjinks Jul 12, 2013
1462beb
Handling exceptions ocurred executing the controller/action
Jul 12, 2013
f3a0e19
Regenerating builds [ci skip]
andresgutierrez Jul 12, 2013
2265aba
Native memory_get_usage()
sjinks Jul 2, 2013
48b244d
Use zend_zval_type_name() instead of userspace gettype()
sjinks Jul 5, 2013
98c7036
Use native json_encode() and json_decode()
sjinks Jul 12, 2013
dd3fd47
Use native session functions
sjinks Jul 12, 2013
0b66e0f
Native headers_sent()
sjinks Jul 12, 2013
af7f9aa
Use native header()
sjinks Jul 12, 2013
3975c5f
JSON - PHP 5.3 compatibility
sjinks Jul 12, 2013
286a5bf
Use native debug_backtrace()
sjinks Jul 12, 2013
b333741
phalcon_lcfirst() and phalcon_ucfirst()
sjinks Jul 12, 2013
fe07392
Use phalcon_lcfirst() instead of userspace lfirst()
sjinks Jul 12, 2013
2125937
Compatibility with PHP 5.3
sjinks Jul 12, 2013
06d223c
Bug fix, have more sleep
sjinks Jul 12, 2013
15c555f
Native ob_get_level()
sjinks Jul 12, 2013
f266875
Compatibility with PHP 5.3
sjinks Jul 12, 2013
e86e495
Updated gen-build [ci skip]
sjinks Jul 12, 2013
ca3892a
Make sure single file versions build [ci skip]
sjinks Jul 12, 2013
e7bfe24
Rebase
sjinks Jul 12, 2013
95171fb
Fix for old PHP 5.3.x
sjinks Jul 12, 2013
b01ede7
Merge pull request #836 from sjinks/native-funcs
Jul 12, 2013
b444d7c
Corrected typos that don't allow the build in Windows to proceed
niden Jul 12, 2013
36c4d0e
PR #829 fixed for 1.2.1
sjinks Jul 13, 2013
61d90f1
Unit test for #829
sjinks Jul 13, 2013
130b985
Fix clang warnings not related to this PR
sjinks Jul 13, 2013
c251b21
Updated CHANGELOG [ci skip]
sjinks Jul 13, 2013
0ca55d6
Depend on modules present at compile time
sjinks Jul 12, 2013
f2392c9
Session management abstraction
sjinks Jul 13, 2013
f4d1ee6
Use session management abstraction
sjinks Jul 13, 2013
4db3834
Forgot to commit phalcon.c
sjinks Jul 13, 2013
bce8607
Better abstraction for preg_match
sjinks Jul 13, 2013
99addf7
Updated gen-build.php
sjinks Jul 13, 2013
f3aa387
Fix for old PHP 5.3.x
sjinks Jul 13, 2013
17ef290
ifdef is safer here [ci skip]
sjinks Jul 13, 2013
d033a92
Possible fix for #838
sjinks Jul 13, 2013
c64f411
Proof of concept
sjinks Jul 10, 2013
9842af2
Rebase
sjinks Jul 13, 2013
bc09adb
Hash funcrions tailored for object handlers
sjinks Jul 13, 2013
3dc32f5
Phalcon\Config implementation using object handlers
sjinks Jul 13, 2013
09ff37c
Documented all changes in kernel/hash.c
sjinks Jul 13, 2013
a2c149d
Merge branch 'config-obj-handlers' of github.com:sjinks/cphalcon into…
sjinks Jul 13, 2013
c11f65a
Added comments
sjinks Jul 13, 2013
670e315
Merge pull request #842 from sjinks/config-obj-handlers
Jul 13, 2013
1c0552f
Merge pull request #834 from sjinks/mm
Jul 13, 2013
624cd16
Merge pull request #841 from sjinks/issue-838
Jul 13, 2013
80df871
Keep clang happy
sjinks Jul 14, 2013
48252bd
Keep the compiler happy
sjinks Jul 14, 2013
7ff15ad
Added __func__ macro for MSVC
sjinks Jul 14, 2013
367438b
Map PHALCON_ALLOC_ZVAL to ALLOC_INIT_ZVAL
sjinks Jul 14, 2013
dd11807
Keep the compiler happy
sjinks Jul 14, 2013
ad4edad
Get rid of noreturn parameter, make the code C99 compatible, remove d…
sjinks Jul 14, 2013
36eacbc
Removed more duplicated code
sjinks Jul 14, 2013
5f346f6
Bug fixes
sjinks Jul 14, 2013
a17f3b2
Bug fixes
sjinks Jul 14, 2013
e994a1a
More deduplication
sjinks Jul 14, 2013
4ce7ba8
Bug fixes
sjinks Jul 14, 2013
38a25d2
Added -Wall to ext/install
sjinks Jul 14, 2013
4e10498
Updated build/*/php_phalcon.h
sjinks Jul 14, 2013
b4c4e7e
Bug fixes in scripts/gen-build.php
sjinks Jul 14, 2013
95837fd
Bug fixes
sjinks Jul 14, 2013
ff759f1
Removed not used functions
sjinks Jul 14, 2013
1285268
Make sure the code in build/ works
sjinks Jul 14, 2013
4b96ccc
Added phalcon_call_func_params_w() and phalcon_call_method_params_w()…
sjinks Jul 14, 2013
1ece18b
Use _w calls in recursive Phalcon\Config methods
sjinks Jul 14, 2013
2de0cc7
More code deduplication
sjinks Jul 14, 2013
3a2206c
Even more code deduplication
sjinks Jul 14, 2013
a92bdca
Removed dead code
sjinks Jul 14, 2013
84469ae
Updated build/ [ci skip]
sjinks Jul 14, 2013
00b2f70
Fix code analyzer's warning
sjinks Jul 14, 2013
7522784
Config\Adapter\Json
sjinks Jul 14, 2013
f7c5911
Unit test
sjinks Jul 14, 2013
01571f9
Make sure the encoded data are always NUL-terminated to keep Zend happy
sjinks Jul 14, 2013
2978c8e
Optimized Phalcon\Logger\Formatter::getTypeString)_
sjinks Jul 14, 2013
46b871a
FirePHP log adapter and formatter
sjinks Jul 14, 2013
567fa16
Simplify .travis.yml
sjinks Jul 8, 2013
08188cf
APCu is beta
sjinks Jul 8, 2013
fe5dd7c
Force unattended install
sjinks Jul 8, 2013
d40a7ed
Simplify .travis.yml
sjinks Jul 8, 2013
4138c31
APCu is beta
sjinks Jul 8, 2013
2387212
Force unattended install
sjinks Jul 8, 2013
1a01985
Try to use parallelism wherever possible
sjinks Jul 15, 2013
a73456a
phalcon_array_unshift(), phalcon_array_values(), phalcon_array_key_ex…
sjinks Jul 15, 2013
4c863cb
Native array_unshift() in Phalcon\Mvc\View\Engine\Volt\Compiler::reso…
sjinks Jul 15, 2013
56e4e75
Typo fixed [ci skip]
sjinks Jul 15, 2013
c997e98
Apply read/modify/update optimization from #848
sjinks Jul 15, 2013
1701298
Fix errors found by Valgrind
sjinks Jul 15, 2013
cd01796
Merge pull request #844 from sjinks/config-adapter-json
Jul 15, 2013
e29a21a
Merge pull request #843 from sjinks/fcall
Jul 15, 2013
2705089
Merge pull request #845 from sjinks/logger-firephp
Jul 15, 2013
d6a3e33
Merge pull request #846 from sjinks/ci-cleanup
Jul 15, 2013
c5d6489
Merge pull request #847 from sjinks/array-funcs
Jul 15, 2013
61bde35
Merge pull request #849 from sjinks/valgrind
Jul 15, 2013
67b8c73
Merge branch 'module-deps' of git://github.com/sjinks/cphalcon into s…
niden Jul 15, 2013
4e81f8d
Merge branch 'issue-829' of git://github.com/sjinks/cphalcon into sji…
niden Jul 15, 2013
92246c2
Merge pull request #832 from sjinks/issue-831
Jul 15, 2013
a518aee
Fix merge bugs
sjinks Jul 16, 2013
9fef9ce
Fix merge bugs (2)
sjinks Jul 16, 2013
3829518
Fix merge bugs (3)
sjinks Jul 16, 2013
1915c13
Updated gen-build.php
sjinks Jul 16, 2013
f19e5a9
Use slow path for PHP 5.3 only; fix #851
sjinks Jul 16, 2013
64a7045
Merge branch 'master' of git://github.com/mattpavelle/cphalcon into m…
niden Jul 16, 2013
85052c7
Merge pull request #850 from sjinks/bug-fixes
Jul 16, 2013
335df6d
Merge pull request #852 from sjinks/issue-851
Jul 16, 2013
7da72c1
Merge pull request #2 from phalcon/1.2.1
dreamsxin Jul 17, 2013
7372cd6
Add a parameter for the function setFileToSend, showing up in the Bro…
dreamsxin Jul 17, 2013
755e49e
Add a parameter for the function setFileToSend
dreamsxin Jul 17, 2013
55fde67
Issue #858
sjinks Jul 17, 2013
f64ffe5
Use markTestSkipped() instead of echo
sjinks Jul 17, 2013
7dd3e96
Fix #861
sjinks Jul 17, 2013
0461f9c
Merge pull request #857 from dreamsxin/master
Jul 17, 2013
d551b09
Merge pull request #860 from sjinks/issue-858
Jul 17, 2013
76e5a80
Merge pull request #862 from sjinks/tests
Jul 17, 2013
7c441ea
Merge pull request #863 from sjinks/issue-861
Jul 17, 2013
db4f9ae
XCache emulation with APC
sjinks Jul 17, 2013
81e6f27
AnnotationsAdaptersTest: APC and XCache adapters
sjinks Jul 17, 2013
b5ff26d
ModelsMetadataAdaptersTest: XCache adapter
sjinks Jul 17, 2013
60d12d2
Update ext/config/adapter/ini.c
Jul 17, 2013
fa99629
Fixed dot directive parse in Config/Adapter/Ini
Jul 18, 2013
9450f14
Fix #866
sjinks Jul 18, 2013
e9bf551
Updated unit test
sjinks Jul 18, 2013
3809225
Merge pull request #865 from sjinks/tests
Jul 18, 2013
1421f27
Do not heavily depend on session
sjinks Jul 18, 2013
0a6b25b
Merge pull request #872 from kjdev/1.2.1
Jul 18, 2013
9edafa2
Merge pull request #873 from sjinks/issue-866
Jul 18, 2013
b906c43
Merge pull request #875 from sjinks/cookie-session
Jul 18, 2013
7d043f9
Update simple.c
quasipickle Jul 18, 2013
3046598
Merge pull request #879 from quasipickle/patch-1
niden Jul 18, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 48 additions & 9 deletions ext/config/adapter/ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,52 @@
*
*/

static inline void phalcon_config_adapter_ini_update_zval_directive(zval **arr, zval *section, zval *directive, zval **value, int flags TSRMLS_DC) {
zval *temp1 = NULL, *temp2 = NULL, *index = NULL;
int i, n;

n = zend_hash_num_elements(Z_ARRVAL_P(directive));

if (Z_TYPE_PP(arr) == IS_ARRAY) {
phalcon_array_fetch(&temp1, *arr, section, PH_SILENT);
if (Z_REFCOUNT_P(temp1) > 1) {
phalcon_array_update_zval(arr, section, &temp1, PH_COPY | PH_CTOR);
}
if (Z_TYPE_P(temp1) != IS_ARRAY) {
convert_to_array(temp1);
phalcon_array_update_zval(arr, section, &temp1, PH_COPY);
}

for (i = 0; i < n - 1; i++) {
phalcon_array_fetch_long(&index, directive, i, PH_NOISY);

phalcon_array_fetch(&temp2, temp1, index, PH_SILENT);
if (Z_REFCOUNT_P(temp2) > 1) {
phalcon_array_update_zval(&temp1, index, &temp2, PH_COPY | PH_CTOR);
}
if (Z_TYPE_P(temp2) != IS_ARRAY) {
convert_to_array(temp2);
phalcon_array_update_zval(&temp1, index, &temp2, PH_COPY);
}
zval_ptr_dtor(&index);

if (temp1 != NULL) {
zval_ptr_dtor(&temp1);
}
temp1 = temp2;
temp2 = NULL;
}

phalcon_array_fetch_long(&index, directive, n - 1, PH_NOISY);
phalcon_array_update_zval(&temp1, index, value, PH_COPY);

zval_ptr_dtor(&index);

if (temp1 != NULL) {
zval_ptr_dtor(&temp1);
}
}
}

/**
* Phalcon\Config\Adapter\Ini initializer
Expand All @@ -91,8 +137,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct){

zval *file_path, *process_sections, *ini_config;
zval *exception_message, *config, *directives = NULL;
zval *section = NULL, *value = NULL, *key = NULL, *directive_parts = NULL, *left_part = NULL;
zval *right_part = NULL;
zval *section = NULL, *value = NULL, *key = NULL, *directive_parts = NULL;
HashTable *ah0, *ah1;
HashPosition hp0, hp1;
zval **hd;
Expand Down Expand Up @@ -156,13 +201,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct){
if (phalcon_memnstr_str(key, SL("."))) {
PHALCON_INIT_NVAR(directive_parts);
phalcon_fast_explode_str(directive_parts, SL("."), key);

PHALCON_OBS_NVAR(left_part);
phalcon_array_fetch_long(&left_part, directive_parts, 0, PH_NOISY);

PHALCON_OBS_NVAR(right_part);
phalcon_array_fetch_long(&right_part, directive_parts, 1, PH_NOISY);
phalcon_array_update_zval_zval_zval_multi_3(&config, section, left_part, right_part, &value, 0);
phalcon_config_adapter_ini_update_zval_directive(&config, section, directive_parts, &value, 0 TSRMLS_CC);
} else {
phalcon_array_update_multi_2(&config, section, key, &value, 0);
}
Expand Down
31 changes: 31 additions & 0 deletions unit-tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,5 +253,36 @@ public function testIssue829()

$this->assertEquals($actual, $expected);
}

public function testIniConfigDirective()
{
$config = new \Phalcon\Config\Adapter\Ini('unit-tests/config/directive.ini');
$actual = $config->toArray();
$expected = array(
'test' => array(
'parent' => array(
'property' => 1,
'property2' => 'yeah',
'property3' => array('baseuri' => '/phalcon/'),
'property4' => array(
'models' => array('metadata' => 'memory'),
),
'property5' => array(
'database' => array(
'adapter' => 'mysql',
'host' => 'localhost',
'username' => 'user',
'password' => 'passwd',
'name' => 'demo'),
),
'property6' => array(
'test' => array('a', 'b', 'c'),
),
),
),
);

$this->assertEquals($actual, $expected);
}
}

13 changes: 13 additions & 0 deletions unit-tests/config/directive.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[test]
parent.property = On
parent.property2 = "yeah"
parent.property3.baseuri = /phalcon/
parent.property4.models.metadata = memory
parent.property5.database.adapter = mysql
parent.property5.database.host = localhost
parent.property5.database.username = user
parent.property5.database.password = passwd
parent.property5.database.name = demo
parent.property6.test[] = a
parent.property6.test[] = b
parent.property6.test[] = c