Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40251 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42489 invoked from network); 4 Sep 2008 12:45:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2008 12:45:42 -0000 Authentication-Results: pb1.pair.com header.from=office@kitsoftware.ro; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=office@kitsoftware.ro; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kitsoftware.ro from 81.196.12.70 cause and error) X-PHP-List-Original-Sender: office@kitsoftware.ro X-Host-Fingerprint: 81.196.12.70 smtp1.rdslink.ro Linux 2.4/2.6 Received: from [81.196.12.70] ([81.196.12.70:56067] helo=smtp.rdslink.ro) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/41-35397-178DFB84 for ; Thu, 04 Sep 2008 08:45:40 -0400 Received: (qmail 10086 invoked from network); 4 Sep 2008 12:45:35 -0000 X-Mail-Scanner: Scanned by qSheff 1.0 (http://www.enderunix.org/qsheff/) Received: from unknown (HELO AntauriPC) (86.121.161.176) by smtp1.rdslink.ro with SMTP; 4 Sep 2008 12:45:34 -0000 To: "'Stanislav Malyshev'" , "'Marcus Boerger'" Cc: "'Gregory Beaver'" , "'Lukas Kahwe Smith'" , "'PHP Internals List'" References: <0E6B0C09-99C4-4843-A8E6-0B015EB98B4E@pooteeweet.org> <48BAF947.6060708@chiaraquartet.net> <48BCF08A.7080108@zend.com> <1616152782.20080902135428@marcus-boerger.de> <48BD7186.2040009@zend.com> In-Reply-To: <48BD7186.2040009@zend.com> Date: Thu, 4 Sep 2008 15:45:05 +0300 Message-ID: <003d01c90e8c$0e8705f0$2b9511d0$@ro> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AckNHbGApCajXj+oQUqHF0tbrdIpqQBa4h7g Content-Language: en-us Subject: RE: [PHP-DEV] Re: namespace RFC From: office@kitsoftware.ro ("Catalin Zamfir Alexandru | KIT Software CAZ") Hello guys, I just had to write you guys to give you some "real-life" examples. We're working here at a PHP framework, named ALFA PHP Framework, that's rather unique in the way that it enforces strong types in every method (using classes for basic data types). We have our files organized this way: - /inc/ directory = all BASE classes, auto-loaded by a "cached" scandir (), loaded in a carefully calculated sequential order. - /mod/user_authentification - /mod/admin_cp - which are two MODULE classes that we load when we need more functionality. We selectively load any modules we need. As a benchmark, we have somewhere around 10 BASE classes, in 10 PHP files, and about 10.000 LINES, and loading them takes just 0.00024 seconds on a Core Duo machine. (0.0006 on an uniproc). We've actually gone further and we "bypass" some scandir () methods by cacheing them in the _SESSION variable, if we detected a proper user session once the platform has been loaded. We don't use __autoload because it doesn't fit our need for "carefull organized loading". My conclusion is, that any "real-life" application, well-designed would do "auto-loading" just for some base-classes, like we do here, and any other dependencies like "developer required modules", will be cached some way. We for example do a /per user caching of information, but other developers can find other mechanism to cache this information, like a DB result, or anything else. I for once disagree with "each target (like each page, MVC action, etc.) would have its own huge PHP file that has all classes used there", because real-life apps need a dynamic approach, and as said earlier, any GOOD designed app, will inherently think of a caching mechanism for it's "loading/require/include" scheme. To accomplish this we actually went for require_once on a module using an object $MOD->activateRegisteredModule ('user_authentification') - which scandirs () the array, caches the array, quickly loads them in succession. In the case of namespaces, PHP should be tunned for PHP classes loaded in succession, or, if that is a problem, make the parser add clases/code to the namespace when it detects a "namespace Something" token. Regarding the need of PHP developers to have extensive C++ knowledge, I really don't care. I come from a C++ background, and any PHP developer that doesn't understand C++ cannot be called "a developer". Guys, I work as a Software Architect in Bucharest, Romania, and the quality of PHP developers is questionable, due to the "easiness" of the PHP language. If any amount of complication is needed, do it, and stop worrying about "PHP developers". Real-life PHP developers are on this mailing-list, talking to you guys, issuing bugs, doing real-life work. Don't make sacrifices just to keep the language simple. Just go "full throttle forward!" Regards, Catalin Z. Alexandru -----Original Message----- From: Stanislav Malyshev [mailto:stas@zend.com] Sent: Tuesday, September 02, 2008 8:02 PM To: Marcus Boerger Cc: Gregory Beaver; Lukas Kahwe Smith; PHP Internals List Subject: Re: [PHP-DEV] Re: namespace RFC Hi! > My guess is that it allows for development with heavy __autload usage and > then doing deployment based on static analysis where each target page > results in one large php file generated from that analysis. So there won't > be any overhead and each script target would be a single target of its own. So each target (like each page, MVC action, etc.) would have its own huge PHP file that has all classes used there? I guess for some applications that could work, for others, more dynamic, that would fail miserably. The maintainability of such thing is also challenging. It would be nice to have some real-life examples of how such things work out - so far I have seen only theory and synthetic benchmarks, which are interesting, but not necessary what would happen on real project. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php