Hi guys,<br><br>LifeType really is a great service, however, it's very slow, I like Lifetype and really I wish the best for it and for you guys.<br><br>If you don't mind, I have some suggestions:<br>1) <span style="color: rgb(204, 0, 0);">
about __autoload</span>: I think it's a great idea, and it will increase lifetype performance if you use it in a correct way, something like this:
<br><br><?php<br>$importList = array();<br><br>//This will not load class directly from classes path, just load it when you need it<br>function import($classPath) {<br> global $importList;<br> $classFullPath = APP_PATH.str_replace('.', '/', $classPath);
<br> $className = basename($classFullPath);<br> $importList[$className] = $classFullPath.'.php';<br> if(!file_exists($importList[$className])) {<br> throw new Exception('File Doesn\'t Exists ['.$importList[$className].']');
<br> }<br>}<br><br>//Catch unloaded classes<br>function __autoload($className) {<br> global $importList;<br><br> if(isset($importList[$className])) {<br> include $importList[$className];<br> } else {<br>
throw new Exception("Invalid Class Name [$className]");<br> }<br> return $className;<br>}<br>?><br><br>and about load a classes just use it like this<br>import('class.action.admin.AdminAddPostAction
');<br><br>and keep your class file name exactly like ClassName.<br><br>2) <span style="color: rgb(204, 0, 0);">using the cache</span>: smarty cache is great, but I think it's used in a wrong way,<br>in each request, you already load [local files] and plugins and ... , which will not be used if the template is cached.
<br><br>3) <span style="color: rgb(204, 0, 0);">loading operations[controllers maps]</span>: you can store this array elements in temp file and run a binary search on this array to get incoming operation action.<br><br>Regards,
<br> Ahmad<br><br><div class="gmail_quote">On Nov 9, 2007 1:47 PM, Mark Wu <<a href="mailto:markplace@gmail.com" target="_blank">markplace@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Actually, I saw that post several days ago .....<br><br>I was frustrated when you try to use __autoload :( , it is really makes the<br>LifeType so so slow in windows platform ...because it increse thousands<br>file_exist() execution time.
<br><br>I think we should mix the PHP4 skill in PHP5 implementation at this moment,<br>or it will cause our system to get very bad performance.<br><br>Actually, I really like __get, __set and __call in PHP5, we can use it to
<br>redeuce the complexity of our dbobjects....<br><br>For example, we can add a new property like $description without add new<br>getter and setter method. And we still can use getDescription() method to<br>get property $description ... that's magic function for ...
<br><br>But, you know, it slow ....<br><font color="#888888"><br>Mark<br></font><div><div></div><div><br>> -----Original Message-----<br>> From: <a href="mailto:plog-svn-bounces@devel.lifetype.net" target="_blank">
plog-svn-bounces@devel.lifetype.net
</a><br>> [mailto:<a href="mailto:plog-svn-bounces@devel.lifetype.net" target="_blank">plog-svn-bounces@devel.lifetype.net</a>] On Behalf Of<br>> Oscar Renalias<br>> Sent: Friday, November 09, 2007 7:35 PM<br>> To: LifeType Developer List
<br>> Subject: [pLog-svn] This is not fair<br>><br>> It doesn't help if PHP implements lots of nice OOP features<br>> (that I was planning to use one day, such as Array iterators, "magic"<br>> accessors via __get and __set, and so on) if by using them we
<br>> incur in some pretty annoyingly high performance overheads... See for<br>> yourselves:<br>><br>> <a href="http://www.garfieldtech.com/blog/magic-benchmarks" target="_blank">http://www.garfieldtech.com/blog/magic-benchmarks
</a><br>><br>> I just wanted to vent my frustrations about this topic with you... :)<br>><br>> Oscar<br>> _______________________________________________<br>> pLog-svn mailing list<br>> <a href="mailto:pLog-svn@devel.lifetype.net" target="_blank">
pLog-svn@devel.lifetype.net</a><br>> <a href="http://limedaley.com/mailman/listinfo/plog-svn" target="_blank">http://limedaley.com/mailman/listinfo/plog-svn</a><br><br>_______________________________________________<br>
pLog-svn mailing list<br><a href="mailto:pLog-svn@devel.lifetype.net" target="_blank">pLog-svn@devel.lifetype.net</a><br><a href="http://limedaley.com/mailman/listinfo/plog-svn" target="_blank">http://limedaley.com/mailman/listinfo/plog-svn
</a><br></div></div></blockquote></div><br>