Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63062 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39718 invoked from network); 18 Sep 2012 15:08:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2012 15:08:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=Edmond@inbox.ru; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=Edmond@inbox.ru; sender-id=pass Received-SPF: pass (pb1.pair.com: domain inbox.ru designates 94.100.176.154 as permitted sender) X-PHP-List-Original-Sender: Edmond@inbox.ru X-Host-Fingerprint: 94.100.176.154 smtp17.mail.ru Received: from [94.100.176.154] ([94.100.176.154:59573] helo=smtp17.mail.ru) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/2D-07072-68E88505 for ; Tue, 18 Sep 2012 11:08:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Subject:To:Message-ID:Reply-To:From:Date; bh=MBST0wV9o+VU6F6KwOhzx0hjAIuWYzPCsq8Jzsl3CCc=; b=W287hBo6dwLxLnBKd9ovfmFESxOkQezwUg/5obcW7UYEX4Zy0CjjC9QAB34BdWuh8Xj8AWFNZ6HSXO5qJYp4AQd8xiSuDfwDam+e32XNulqWmcpzCQ98je6MlD5hXHtk; Received: from [37.229.10.82] (port=56833 helo=[192.168.1.215]) by smtp17.mail.ru with esmtpa (envelope-from ) id 1TDzPu-0007Tj-Eo for internals@lists.php.net; Tue, 18 Sep 2012 19:08:50 +0400 Date: Tue, 18 Sep 2012 18:08:41 +0300 Reply-To: "Edmond [HT]" Organization: [HT] X-Priority: 3 (Normal) Message-ID: <1941141163.20120918180841@inbox.ru> To: internals@lists.php.net In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam: Not detected X-Mras: Ok Subject: Re: [PHP-DEV] constructor hook From: Edmond@inbox.ru ("Edmond [HT]") Hello Rasmus! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RS> Hey, RS> I wonder if it would make sense to have a way to globally hook into RS> __construct() - sort of like how you can hook into the autoloaders with RS> spl_autoload_register() ... RS> This could be useful for things like dependency injection and debugging. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Programming language should have a clear behavior. But here is too much magic. Usually, DI objects are not created in a vacuum. They require a factory... may be service locator. Like this: http://snipt.org/vLae1/Traditional -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Regards, Edmond -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-