summaryrefslogtreecommitdiffstats
path: root/system/core/Common.php
AgeCommit message (Collapse)AuthorFilesLines
2013-03-30Some cleanup related to mt_rand()vlakoff1-1/+1
- min and max values are 0 and mt_getrandmax() by default - remove useless mt_srand() seed calls
2013-03-29Documentation: fix some outdated pathsvlakoff1-1/+1
2013-03-04Fix #2301Andrey Andreev1-2/+1
2013-03-04Reverting changes to functions that have no business being used in CLI apps ↵Daniel Hunsaker1-9/+6
to begin with Signed-off-by: Daniel Hunsaker <danhunsaker@gmail.com>
2013-03-04Updated in accordance with feedback from @narfbgDaniel Hunsaker1-10/+13
- Removed commented lists of constants from the three reference conventions, replacing each with the URLs at which more information can be found. - Renamed a few constants to more closely reflect CodeIgniter conventions. - Modified a couple of lines which were in violation of the CI Style Guide. Signed-off-by: Daniel Hunsaker <danhunsaker@gmail.com>
2013-02-23Updated exit codes as constant valuesDaniel Hunsaker1-6/+10
Re-allocated exit status codes according to three references, which follow: BSD sysexits.h:http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits GNU recomendations:http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html Bash scripting:http://tldp.org/LDP/abs/html/exitcodes.html The GNU recommendations stem from and expand upon the standard C/C++ library (stdlibc) definitions, while also suggesting some best-practice conventions which happen to prevent exit status code collisions with bash, and probably other shells. The re-allocated codes are now mapped to constant values, set in *application/config/constants.php*, and used throughout the CodeIgniter core. They would additionally be used in *index.php*, but the constants file hasn't been loaded at that point, so the integer values are used instead, and a comment follows each such use with amplifying information on why that particular value was selected. Finally, the errors documentation has been updated accordingly. Signed-off-by: Daniel Hunsaker <danhunsaker@gmail.com>
2013-02-22Merge branch 'develop' of github.com:EllisLab/CodeIgniter into ↵Daniel Hunsaker1-8/+8
feature/exit-status
2013-02-21Disable autoloader call from class_exists() occurences to improve performanceAndrey Andreev1-2/+2
Note: The Driver libary tests seem to depend on that, so one occurence in CI_Loader is left until we resolve that.
2013-02-15Fix some stuff from recent pull requestsAndrey Andreev1-3/+3
2013-02-14Update system/core/Common.phpmaltzurra1-2/+1
2013-02-14Update system/core/Common.phpmaltzurra1-1/+2
2013-02-14Update system/core/Common.phpmaltzurra1-2/+2
Updated is_https() to avoid "NULL" or "0" values to set HTTPS.
2013-01-29Replace is_file() with the faster file_exists()Andrey Andreev1-2/+2
(where it makes sense) Also: - Implemented caching of configuration arrays for smileys, foreign characters and doctypes. - Implemented cascading-style loading of configuration files (except for library configs, DB and constants.php).
2013-01-28Remove unnecessary defined('ENVIRONMENT') checksAndrey Andreev1-2/+2
As suggested in issue #2134 & PR #2149
2013-01-25Updated all cases of exit() to return a valid codeDaniel Hunsaker1-7/+22
Specific codes are as follows, but can easily be changed if a different order/breakdown makes more sense: - 0: Success; everything executed as planned - 1: Configuration Error; something is wrong with/in the configuration file(s) - 2: Class Not Found; what it says - 3: Driver Method Unsupported; the method you're trying to use on a Driver doesn't exist - 4: File Not Found; 404 error - 5: Database Error; something is broken in the database somewhere - 6: Invalid Input; the user attempted to submit a request with invlaid characters in 1+ key names 7 through 26 are reserved for future use - 27: Generic Error; generated by show_error() when the status code is >= 100 28 through 127 are errors generated by user applications, normally by using show_error() with a status code below 100 128 through 254 should not be used by applications, as they are reserved by system-level functions - 255: PHP Fatal Error; automatically generated by PHP for fatal errors, and therefore not allowed for our use Status codes below 100 are shifted up by 28 to place them in the user error range. It may make more sense to have these codes left alone and instead shift the CI errors into the 101 through 127 space, but that's not what I opted for here. It would probably also be a good idea to replace the hard-coded numbers with constants or some such, but I was in a bit of a hurry when I made these changes, so I didn't look around for the best place to do this. With proper guidance, I could easily amend this commit with another that uses such constant values. Signed-off-by: Daniel Hunsaker <danhunsaker@gmail.com>
2013-01-06utilize static function variables in Common::log_message() to "cache" log ↵Ted Wood1-3/+12
threshold and Log library instance to reduce function calls
2013-01-01[ci skip] Happy new yearAndrey Andreev1-1/+1
2012-12-17Fix function_usable()Andrey Andreev1-6/+11
2012-11-09Move the Log class to system/core/Andrey Andreev1-1/+1
It is a core class after all, I guess somebody forgot it when the rest of them were moved.
2012-11-07Added function_usable() to common functionsAndrey Andreev1-0/+47
It is now used to check whether dangerous functions like eval() and exec() are available. It appears that the Suhosin extension (which is becoming popular) terminates script execution instead of returning e.g. FALSE when it has a function blacklisted. function_exists() checks are insufficient and our only option is to check the ini settings here. Filed an issue here: https://github.com/stefanesser/suhosin/issues/18 ... hopefully we'll be able to deal with this in a more elegant way in the future. (this commit supersedes PR #1809)
2012-11-01Manually apply PR #1594 (fixing phpdoc page-level generation/warnings)Andrey Andreev1-1/+2
Also partially fixes issue #1295, fixes inconsistencies in some page-level docblocks and adds include checks in language files.
2012-10-22Add is_https() as a common functionAndrey Andreev1-0/+18
2012-10-11Replace a few require() uses with require_once() (should fix issue #1872)Andrey Andreev1-2/+2
2012-10-05Merge pull request #1682 from dhinus/patch-1Andrey Andreev1-7/+6
Logging should obey error_reporting() setting
2012-10-04Compatibility with PHP 5.2.4 and enclosed ternary operationDaniel Morris1-1/+1
Signed-off-by: Daniel Morris <daniel@honestempire.com>
2012-10-04Default to HTTP/1.1 if $server_protocol is not setDaniel Morris1-1/+1
Signed-off-by: Daniel Morris <daniel@honestempire.com>
2012-10-04DRY determining server protocolDaniel Morris1-5/+1
Signed-off-by: Daniel Morris <daniel@honestempire.com>
2012-08-04fixed whitespaceFrancesco Negri1-7/+7
2012-08-04Logging should obey error_reporting() settingFrancesco Negri1-10/+9
If the php error level is not included in the current error_reporting() setting, we should not log it. Also, the log_threshold check is redundant, it's already taken care of by the write_log() method.
2012-07-30Some clean-up and style changesAndrey Andreev1-9/+9
2012-07-29refactored (crunched down) _stringify_attributesChad Furman1-1/+40
2012-07-11Fix a typo in Common.phpvlakoff1-1/+1
2012-07-04updated the changelog, fixed some whitespaceChristopher Guiney1-1/+1
2012-06-29Respect display_errors when deciding if to display an error -- useful for ↵Christopher Guiney1-1/+2
environments where you want to log errors, but not show them.
2012-06-15Add support for HTTP code 303 in set_status_header(), as suggested in pull #341Andrey Andreev1-7/+13
2012-06-09Fix defined() usage in system/core/Common.phpAndrey Andreev1-1/+1
2012-06-05Fix a magic_quotes-related bug and changed the default parameter value for ↵Andrey Andreev1-2/+2
is_php()
2012-06-05Added get_mimes() function to system/core/Commons.php.The MIMEs array from ↵Andrey Andreev1-4/+30
config/mimes.php is used by multiple core classes, libraries and helpers and each of them has implemented an own way of getting it, which is not needed and is hard to maintain. This also fixes issue #1411
2012-06-04Revert/optimize some changes from ed944a3c70a0bad158cd5a6ca5ce1f2e717aff5dAndrey Andreev1-3/+2
2012-06-02Replaced `==` with `===` and `!=` with `!==` in /system/coreAlex Bilbie1-7/+7
2012-05-31Edit to meet CI coding standardsThanasis Polychronakis1-3/+3
2012-05-31Indended code to meet CI standardsThanasis Polychronakis1-2/+6
2012-05-31Load base config first, then environment's configThanasis Polychronakis1-9/+9
2012-05-23Merge pull request #1365 from sourcejedi/e_strictPhil Sturgeon1-10/+0
If we want E_STRICT, don't suppress it.
2012-05-17Cleanup the core classesAndrey Andreev1-3/+3
2012-05-16If we want E_STRICT, don't suppress it!Alan Jenkins1-10/+0
15be8fc "Changed the 'development' environment default error reporting to included E_STRICT" Not present in any tagged release, so no need for -stable or a changlelog entry.
2012-04-23Use tabs to separate class propertiesTimothy Warren1-1/+0
2012-04-19Normalize comments in core filesTimothy Warren1-170/+171
2012-03-26Remove access description lines and fix comments in system/core/Common.phpAndrey Andreev1-94/+96
2012-03-09Bumped CodeIgniter's PHP requirement to 5.2.4.Phil Sturgeon1-1/+1
Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway...