Commit Graph

87 Commits

Author SHA1 Message Date
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
George Peter Banyard
fa8d9b1183 Improve type declarations for Zend APIs
Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002
2020-08-28 15:41:27 +02:00
Nikita Popov
41c7d28c11 Add macro to get ini target address 2020-04-27 10:30:00 +02:00
Michael Voříšek
d2ba848572 Use strlen for INI_* macros
strlen() is resolved at compile time by optimizing compilers.

Prevent mistakes and allow to use INI_* macros with char * variables
which can have sizeof() == 1.

Closes GH-5174.
2020-02-17 11:11:14 +01:00
Michael Voříšek
f15b5ff353 Add const modifier for name strings
Closes GH-5173.
2020-02-13 14:44:06 +01:00
Dmitry Stogov
e14d77335c Mark "cold" functions 2019-05-29 11:48:41 +03:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
a81202ac49 Adios, yearly copyright ranges 2019-01-30 11:48:28 +01:00
Zeev Suraski
54dc07f3dc Update email addresses. We're still @Zend, but future proofing it... 2018-11-01 17:20:07 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
6c035f53f1 Separate duplicated code into a zend_ini_parse_bool() function. 2018-03-05 11:51:58 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov
dc47171523 Avoid temporary string creation and destruction. 2017-12-11 18:18:30 +03:00
Dmitry Stogov
9731a22eba Use Zend MM heap for non-persistent ini entry values. 2017-11-08 12:01:59 +03:00
Anatol Belski
793ca716fb Fix datatypes and compiler warnings
Switch to size_t

Not critical as an unsigned is already used, but fixes a couple of
warnings in other areas.

Normalize signature

It's a function with the usual compare semantics, returning a platform
specific at least produces unnecessary warnings elsewhere and is otherwise
inappropriate.

Fix return value

Drop unused var

Fix compiler warnings

Fix compiler warning

Fix var name in arginfo

Fix cast
2017-10-23 08:56:57 +02:00
Anatol Belski
853e73fb8e Reduce struct size, on 64-bit by 8 bytes each
Note, the max modifiable flag value is currently 1<<5, there is still
some space. ATM it looks unlikely, but should more flags need to be
added, the types will need to be reconsidered.
2017-07-28 20:02:26 +02:00
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
9e4310eeeb reworked ini dtor 2014-12-16 10:15:02 +01:00
Anatol Belski
eb629b70da free the right globals
That's the same as in the previous commit. In the TS mode the tsrm
cache pointer might be unavailable or point to a wrong thread, so
the exact globals passed should be freed.
2014-12-16 09:12:09 +01:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Dmitry Stogov
88d7ca44f6 Refactored INI subsystem to use zend_string* instead of char* 2014-09-01 20:57:33 +04:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Nikita Popov
08ae88157b Allocate zend_strings with correct size
For me (32bit) sizeof(zend_string) is 20, which means that the
char[1] array at the end is padded with three bytes. Thus allocating
based on sizeof(zend_string)-1 overallocates by those 3 padding bytes.

This commit fixes the allocation size, by using XtOffsetOf.
2014-04-23 19:34:51 +02:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Dmitry Stogov
a0fe8e5a91 Use better data structures (incomplete) 2014-02-18 01:41:23 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Ard Biesheuvel
050aae2860 Fixed bug #64197 (_Offsetof() macro used but not defined on ARM/Clang)
Updated the code to test for __ARMCC_VERSION instead of __arm, as
that is a more reliable indicator of whether the ARMCC compiler is
being used.
2013-02-13 12:22:50 +01:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Dmitry Stogov
8a6d73b084 improved performance of @ (silence) operator 2010-08-18 13:58:13 +00:00
Sebastian Bergmann
d2281d1dff sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php 2010-01-05 20:46:53 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Scott MacVicar
43e7784b0a Add zend_ini_string_ex so that the you can differentiate between NULL as a value and its absence, this is important for ini_get. Related to bug #42657 and #43348 2008-07-07 21:37:46 +00:00
Ilia Alshanetsky
5ea77bc64f MFB: Fixed bug #43677 (Inconsistent behaviour of include_path set with
php_value). (Patch by: manuel at mausz dot at)
2008-03-13 16:01:31 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Jani Taskinen
09b6f37f20 MFH:
- Added ".htaccess" style user-defined php.ini files support for
  CGI/FastCGI.
- Added support for special [PATH=/opt/httpd/www.example.com/] sections
  in php.ini. All directives set in these sections will not be able to be
  overridden in user-defined ini-files or during runtime in the specified
  path.

- Improved php.ini handling:
  . Added better error reporting for syntax errors in php.ini files
  . Allowed "ini-variables" to be used almost everywhere ini php.ini files
  . Allowed using alphanumeric/variable indexes in "array" ini options
  . Fixed get_cfg_var() to be able to return "array" ini options

- Fixed bug #27372 (parse error loading browscap.ini at apache startup)
- Fixed bug #42069 (parse_ini_file() allows using some non-alpha numeric
  characters)
2007-09-28 02:05:10 +00:00
Dmitry Stogov
6c810b0d4c Improved memory usage by movig constants to read only memory. (Dmitry, Pierre) 2007-09-27 18:00:48 +00:00
Jani Taskinen
338a12a018 MFH: Nuked unnecessary TSRMLS_FETCH() call 2007-09-27 16:55:25 +00:00
Jani Taskinen
2a528a158a - No need to break binary compatibility here 2007-09-07 09:55:37 +00:00
Jani Taskinen
82626c1868 MFH: - Fixed the rest of bug #41561 ( @ operator not working ) 2007-09-07 09:37:38 +00:00
Stanislav Malyshev
0ad85237ea add stage for .htaccess 2007-08-02 23:57:52 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00