Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81099 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15769 invoked from network); 25 Jan 2015 00:30:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2015 00:30:37 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.182 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.182 mail-qc0-f182.google.com Received: from [209.85.216.182] ([209.85.216.182:37442] helo=mail-qc0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/90-11456-B2934C45 for ; Sat, 24 Jan 2015 19:30:35 -0500 Received: by mail-qc0-f182.google.com with SMTP id l6so2816081qcy.13 for ; Sat, 24 Jan 2015 16:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=96I3KpfGNTvgQn4EARCYBCIa1nq7SwfPHUpaO52nV/E=; b=LogcuD/Ysz7eQcXpa/vZhArlwCLpEpJGvqr4ekQvVtkcd0ooC+2meX0q4rT6VKZNBK yScnX8Hajkjtp2g5CHxdRZ2h93oAg5SbcBZk8IrrgdqiUoQnrZLS/TKZ3ehnBDmt/6A3 CE2D9BAmMivxBu6EKQc64w7V2hy6/3iuaIPDsg2vfPmj4TixCkJJVbUIHMYJ+r/d2uD2 gpQ+0JkjTQkndlEJnrUQvA7V9QHTe6Oi7QWZn26GgkrLNBmUIuGhbGZySb7Dedi3IbDU JrIk8H0m0jc1bOgF/8/5PBsS3ZisQdsJXXgnm5zV5N2AO3ae2ZRHrCQXyzTZHL3jznVC noXA== X-Received: by 10.229.190.6 with SMTP id dg6mr14638773qcb.16.1422145832366; Sat, 24 Jan 2015 16:30:32 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Sat, 24 Jan 2015 16:29:52 -0800 (PST) Date: Sun, 25 Jan 2015 09:29:52 +0900 X-Google-Sender-Auth: zOz_9-kKtvH0Tf5H5xGyI-XcdVE Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11336798283b86050d6f21d3 Subject: Deprecating all INI set/get functions and use ini_set/get() From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11336798283b86050d6f21d3 Content-Type: text/plain; charset=UTF-8 Hi all, I would like to propose INI set/get function deprecation, raise E_DEPRECATED, and make PHP_INI_MH() use the CODING_STANDARDS. For example, session module has following INI set/get functions - http://php.net/manual/en/function.session-save-path.php - http://php.net/manual/en/function.session-module-name.php - http://php.net/manual/en/function.session-cache-expire.php - http://php.net/manual/en/function.session-cache-limiter.php - http://php.net/manual/en/function.session-name.php There are 5 PHP functions for session module alone. Some of them include runtime check, but these checks can be done with PHP_INI_MH() by using state parameter. In fact, runtime check should be done in PHP_INI_MH() to avoid bugs. Use of ini_set/get() has following pros and cons Pros - Less API, hence simpler API. - Modules will be less buggy. i.e. PHP_INI_MH() must handle "state" properly, but it tends to be forgotten, 3rd party modules especially. - Consistent coding style/API across modules, both internal and script. - Reduced documentations. INI descriptions are only in INI section. - Less documentations, hence less documentation bugs. - Better documentation. All user needs to know will be in INI section. - Awareness of INI setting use. Users are better to know they are using INI. i.e. All INI values has the same limitations, INI_SYSTEM/INI_PERDIR/INI_USER, stage limitations if any. - (Please point it out more advantages) Cons - Existing code modifications. (It's E_DEPRECATED. User may ignore.) - (Please point it out more disadvantages) Comments are appreciated. Regards, P.S. Enum for PHP_INI_MH() "stage" parameter type is better in PHP7. IMO. -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11336798283b86050d6f21d3--