Re: [PHP] Will PHP ever grow up and have threading?
On Wednesday 24 March 2010 03:17:56 Tommy Pham wrote: Let's go back to my 1st e-commerce example. The manufacturers list is about 3,700. The categories is about about 2,400. The products list is right now at 500,000 and expected to be around 750,000. The site is only in English. The store owner wants to expand and be I18n: Chinese, French, German, Korean, Spanish. You see how big and complex that database gets? The store owners want to have this happens when a customer clicks on a category: * show all subcategories for that category, if any * show all products for that category, if any, * show all manufacturers, used as filtering, for that category and subcategories * show price range filter for that category * show features specifications filter for that category * show 10 top sellers for that category and related subcategories * the shopper can then select/deselect any of those filters and ability to sort by manufacturers, prices, user rating, popularity (purchased quantity) * have the ability to switch to another language translation on the fly * from the moment the shopper click on a link, the response time (when web browser saids Done in the status bar) is 5 seconds or less. Preferably 2-3 seconds. Will be using stopwatch for the timer. Now show me a website that meets those requirements and uses PHP, I'll be glad to support your argument about PHP w/o threads :) BTW, this is not even enterprise requirement. I may have another possible project where # products is over 10 million easily. With similar requirements when the user click on category. Do you think this site, which currently isn't, can run on PHP? Regards, Tommy If you design and code correctly. Yes. If you want to use someting alredy. Try TYPO3. PS: Your arguments are something about implementation not something about platform abilities. You can do this things any server side programming with enough hardware. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Will PHP ever grow up and have threading?
On Wednesday 24 March 2010 21:42:53 Tommy Pham wrote: On Wed, Mar 24, 2010 at 10:18 AM, Sancar Saran sancar.sa...@evodot.com wrote: On Wednesday 24 March 2010 03:17:56 Tommy Pham wrote: Let's go back to my 1st e-commerce example. The manufacturers list is about 3,700. The categories is about about 2,400. The products list is right now at 500,000 and expected to be around 750,000. The site is only in English. The store owner wants to expand and be I18n: Chinese, French, German, Korean, Spanish. You see how big and complex that database gets? The store owners want to have this happens when a customer clicks on a category: * show all subcategories for that category, if any * show all products for that category, if any, * show all manufacturers, used as filtering, for that category and subcategories * show price range filter for that category * show features specifications filter for that category * show 10 top sellers for that category and related subcategories * the shopper can then select/deselect any of those filters and ability to sort by manufacturers, prices, user rating, popularity (purchased quantity) * have the ability to switch to another language translation on the fly * from the moment the shopper click on a link, the response time (when web browser saids Done in the status bar) is 5 seconds or less. Preferably 2-3 seconds. Will be using stopwatch for the timer. Now show me a website that meets those requirements and uses PHP, I'll be glad to support your argument about PHP w/o threads :) BTW, this is not even enterprise requirement. I may have another possible project where # products is over 10 million easily. With similar requirements when the user click on category. Do you think this site, which currently isn't, can run on PHP? Regards, Tommy If you design and code correctly. Yes. If you want to use someting alredy. Try TYPO3. PS: Your arguments are something about implementation not something about platform abilities. You can do this things any server side programming with enough hardware. Regards Sancar Platform abilities = PHP with/without threads. Implementation = If PHP has threads, how do I implement it. If not, what work around / hacks do I need to do. Please forgive my low ability on English and you sound like. I can drive a car, if it has a diesel engine and we want Ferrari for our need. Is there any way to fit a diesel engine in Ferrari ? Your problem isn't php, You problem is your way to think... You are trying to bend php to fit your way of the building web sites. I'm sorry, things does not work like that. You are trying to represent your business logic as ENTERPRISE SOFTWARE STANDARTS. I'm sorry, it wont ! Even with provocative subject, it still business logic at large. On Large Web sites, Site has own standards which enterprise must have to obey.. (like Facebook or any other uber number cruncher you name it) Anyway... You want to build a damn huge web site with damn huge data set and damn huge requests per second. and you still want to use that SQL for primary data store for reading. ARE YOU NUTS ??? With this kind of approach, You will be in deep trouble with any language, with any Reational SQL Server. If your customers need that kind of thing. You need lots of sophisticated people which know how to handle big things under web enviroment. Good luck to you. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Will PHP ever grow up and have threading?
On Wednesday 24 March 2010 22:42:17 Rene Veerman wrote: On Wed, Mar 24, 2010 at 10:34 PM, Sancar Saran sancar.sa...@evodot.com wrote: On Wednesday 24 March 2010 21:42:53 Tommy Pham wrote: On Wed, Mar 24, 2010 at 10:18 AM, Sancar Saran sancar.sa...@evodot.com wrote: On Wednesday 24 March 2010 03:17:56 Tommy Pham wrote: Let's go back to my 1st e-commerce example. The manufacturers list is about 3,700. The categories is about about 2,400. The products list is right now at 500,000 and expected to be around 750,000. The site is only in English. The store owner wants to expand and be I18n: Chinese, French, German, Korean, Spanish. You see how big and complex that database gets? The store owners want to have this happens when a customer clicks on a category: * show all subcategories for that category, if any * show all products for that category, if any, * show all manufacturers, used as filtering, for that category and subcategories * show price range filter for that category * show features specifications filter for that category * show 10 top sellers for that category and related subcategories * the shopper can then select/deselect any of those filters and ability to sort by manufacturers, prices, user rating, popularity (purchased quantity) * have the ability to switch to another language translation on the fly * from the moment the shopper click on a link, the response time (when web browser saids Done in the status bar) is 5 seconds or less. Preferably 2-3 seconds. Will be using stopwatch for the timer. Now show me a website that meets those requirements and uses PHP, I'll be glad to support your argument about PHP w/o threads :) BTW, this is not even enterprise requirement. I may have another possible project where # products is over 10 million easily. With similar requirements when the user click on category. Do you think this site, which currently isn't, can run on PHP? Regards, Tommy If you design and code correctly. Yes. If you want to use someting alredy. Try TYPO3. PS: Your arguments are something about implementation not something about platform abilities. You can do this things any server side programming with enough hardware. Regards Sancar Platform abilities = PHP with/without threads. Implementation = If PHP has threads, how do I implement it. If not, what work around / hacks do I need to do. Please forgive my low ability on English and you sound like. I can drive a car, if it has a diesel engine and we want Ferrari for our need. Is there any way to fit a diesel engine in Ferrari ? Your problem isn't php, You problem is your way to think... You are trying to bend php to fit your way of the building web sites. I'm sorry, things does not work like that. You are trying to represent your business logic as ENTERPRISE SOFTWARE STANDARTS. I'm sorry, it wont ! Even with provocative subject, it still business logic at large. On Large Web sites, Site has own standards which enterprise must have to obey.. (like Facebook or any other uber number cruncher you name it) Anyway... You want to build a damn huge web site with damn huge data set and damn huge requests per second. and you still want to use that SQL for primary data store for reading. ARE YOU NUTS ??? With this kind of approach, You will be in deep trouble with any language, with any Reational SQL Server. If your customers need that kind of thing. You need lots of sophisticated people which know how to handle big things under web enviroment. Good luck to you. Regards how dramatic. how elitist. and btw, use of sql where other solutions (like shared mem and threading!) is exactly what i'm against. if you ppl just stop barracading, you'll see that with relatively minimal effort php can evolve with the times and make such things possible for us mere mortals. Alright. Lets think different. And please don't take things personal... If the only problem is threading... Will Python with mod wsgi solve the problem ? with this programming approach ? Regards Sancar... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ini files as config - hidden
On Friday 14 August 2009 08:31:46 pm דניאל דנון wrote: I'm building a little framework for my self, The configuration of the framework is done in an ini file, How do you suggest to hide its contents? .htaccess wont be good (or atleast only htaccess) since if its turned off The file contains mysql password and important data. How should I make sure the file stays hidden from someone who might tries to access it? Hello there, 1-) You have to parse ini file in each execution. It was negative for performance. I suggest use plain php array 2-) To hide your config put it in out of html document root. define('ROOTDIR', dirname(__FILE__).'/'); define(CONFDIR,ROOTDIR.'../config/'); require(CONFDIR.'config.php'); Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question: what are frameworks?
On Sunday 09 August 2009 02:47:37 pm Parham Doustdar wrote: Hi there, I've heard of frameworks, but I don't quite know what they are used for. I've done a little search on the internet, but even though I've been able to find different PHP frameworks, I'm not quite sure what they offer, or in what they differ, or why I shouldn't just use PHP as it is. Can someone give a little bit of explaination? Thanks! They are the different way of the programming php. PHP is the Temple Of the Shaolin, those fw programmers are master of the techniques. They are generate their way of the PHP-FU. Like kung-fu there are many ways to do things in php. From my point of view. All of them sh*t load of bloated code masterpieces. After RoR craze, Nearly every PHP developer sees the light in a one night. Then PHP Frameworks was skyrocketed. And Zend jump the bandwagon. Main point of Framework craze was not technical. PHP was loose type language, you can easily mess up your self in seconds and in the Internet you can see giantic size of spagetti code. Because of this, Java and .net programmers constantly mauls PHP as non enterprise language. So ? What is the point ? The point is, As a company owner or the project manager when you get a Certified this or that framework master, you can easily adopt a standard to your projects, plus, you can get support and more important than that you can show your badges and whistles to your customer to prove yourself as a Experienced php crafter. In simple, They says to your customer, you are in safe, these guys knows php, you can buy things from them even if they blows things up, you can find another certified master somewhere else. From my point of view. If you want to learn a Framework, I suggest you to learn a CMS/Framework, something like TYPO3. Because, after installing learning maybe certifying a framework, you have to do tons of coding to generate a usable platform. For example you have to write a session controller, have to generate a administrator interface, this that yada yada. So why you have to do all of this. Use a CMS/Framework and do just you need. Plus, TYPO3 also has same badges and whistles (if you wish) for your customers. Even in Germany it has bigger balls too. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Asterisk anyone?
On Wednesday 29 July 2009 10:18:08 pm Skip Evans wrote: Hey, I've been asked to write a simple couple of public pages that would let an Asterisk customer modify their account configuration, but the client has no idea how Asterisk stores its data, apparently not in MySQL. Anyone know of any resources for accessing Asterisk from PHP? If anyone has done this can you tell me if I'm on the right track here? http://www.voip-info.org/wiki/view/Asterisk+AGI+php#PHPTipsandExamples Hello, Asterisk's default storage was text files. You should check Trixbox. It was a Asterisk with MySQL backend. Also it has all bells and whistles. And web based management console. Even it comes packed with a centos. Your link shows how to remote asterisk console from web. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using large multi dimenstional arrays in js
Hello all, My new project needs to use large multi dimenstional php arrays in javascript. I'm not sure how to do it. Is there any lead or any one give a clue. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Periodic Actions in PHP?
On Saturday 13 June 2009 11:42:49 am Parham Doustdar wrote: Hi there, I'm going to create a small chat script with PHP. The messages you want others to see will be added to a flat file (I.E. TXT file), and read and displayed by PHP. However, I want this reading and displaying to be periodic. This means that I want PHP to check the file for new lines every,say, fifteen seconds. How may I do that? I have been unable to find any function that acts like a timer. Thanks! Please search google daemonized php Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL after oracle, still Wise?, was Web application design .......
On Tuesday 02 June 2009 11:36:28 pm optoma...@rogers.com wrote: Everybody has given Angus really great advice in this previous thread and I have learned a lot too. I hope no one mines the fork but I am in the exact same situation as Angus. If anyone could spare a bit of time regarding application infrastructure I would really appreciate it. I know there are lots of databases out there and PostgreSQL is held in high regard but the overwhelming majority of examples seem to use MySQL. Considering that Oracle has bought Sun, do you think it is still wise to use it for new applications? Oracle does not have much street cred in open source circles, maybe they'll cause trouble later and MySQL was already forking was it not? I'd like to use the same DB for a few years. I am attracted to building an application from scratch but I will never get an object relational mapper to work without a framework. If I go the scratch route, I'd better get my database done right(as was advised in the previous thread!)and getting that right probably starts with choosing the right DB. Any thoughts?-Patrick Check the popular projects (phpBB, TYPO3, Drupal) when they start to move MySQL to somewhere it time to start moving. And if you so much thinking about future DB change. Just wrote compatible sql and use multi drive layer (phpADO db). And you are problem free Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web application design considerations - a good reference ?
On Tuesday 02 June 2009 07:50:36 am Angus Mann wrote: Hi all. I'm working on a PHP project for my own personal business use. It will handle billing and invoices as well as payments and time management, bookings, appointments and a few more. I may add things like personal messaging between the various users and a customer login to check on the progress of their accounts. It is a big project and will probably take a year or so to complete in my spare time. I have made a couple of starts but I have no experience in creating such large applications and I find I often end up with spaghetti code. I've tried using session variables to keep track of where and what the program is doing but there are so many permuations and combinations I found myself writing endless streams of if's, and's and or's just to figure out what page to display. The code is not the probblem for me...it's the flow and organization of the code. Can anybody point me to a good book or tutorial that lays down the principles and gives some suggestions for integrating the many subroutines of a large application? I want to make the code readable and logical in its flow, and avoid repetition of code segments. Much appreciated. Angus Hello, Use CMS/Framework like Drupal or TYPO3 All of them have coding principles. You can follow. Plus they do tons of things. (authentication. this that) Your time may cut 3 months. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] templating engine options
On Tuesday 26 May 2009 03:48:41 am Nathan Rixham wrote: Sancar Saran wrote: ?php $content = 'No Comments'; if(isset($comments) and is_array($comments) and count($comments) 0 ) { $content = ''; foreach( $comments as $index = $comment ) : $content. = a href='. $comment-link.'.$comment-title./a; endforeach; } ? h2Comments/h2 div id=comments ?=$content? /div index.php ob_start(); require('template.php'); echo ob_get_clean(); I'm still do not understand for complex template system requirement. I just _need_ the two abstracted. php must have no html in it html template must contain no php Why it have to be very complex system. Large data array, some conditions, lots of loops, and What else ? http://www.flytag.de/ http://urlaub-finder.de/ http://airportdirekt.de/ All same system. With different css designs. yup, did this myself for a long time; here is some very old code I used to use! newCage(); $content = cage(include $file); function newCage() { ob_start(); } function cage() { $includeOutput = ob_get_contents(); ob_end_clean(); return $includeOutput; } lol Alright, my vote going to smarty. After compilation, it running on native php. And When we use TYPO3 native marker model (which fits your requirement, no php in template) I found very dull. Load template to memory, fetch part of template, generate loop for processing template, feed template keys in the loop. After some time %75 of code become template feed. Like this //--- Get Template $this-templateFileContent = $this-cObj- fileResource('fileadmin/templates/travelit_booking.html'); $strCarLoop= $this-cObj-getSubpart($this- templateFileContent,###CAR_LOOP###); $strPLoop = $this-cObj-getSubpart($this- templateFileContent,###PASSANGER_LOOP###); $strCarTable = $this-cObj-getSubpart($this- templateFileContent,###CAR_TABLE###); $strHotelBooking = $this-cObj-getSubpart($this- templateFileContent,###HOTEL_BOOKING###); $strFlightBooking = $this-cObj-getSubpart($this- templateFileContent,###FLIGHT_BOOKING###); if(isset($arrData['MW']) is_array($arrData['MW']['MWLIST']['CAR'])) { $intCarSize = sizeof($arrData['MW']['MWLIST']['CAR']); for($intX=0;$intX $intCarSize;$intX++) { $arrSubst = ''; $arrSubst['###CAR_OPTION_VALUE###'] = $arrData['MW']['MWLIST']['CAR'][$intX] [@]['GROUP'].-.$arrData['MW']['MWLIST']['CAR'][$intX][@]['ID1'].-. $arrData['MW']['MWLIST']['CAR'][$intX][@]['ID2'].-.$arrData['MW'] ['MWLIST']['CAR'][$intX][@]['NAME'].-.$arrData['MW']['MWLIST']['CAR'] [$intX][@]['PRICE']; $arrSubst['###CAR_OPTION_PRICE###'] = number_format($arrData['MW']['MWLIST'] ['CAR'][$intX][@]['PRICE'], 0, ',', '.'); $arrSubst['###CAR_OPTION_NAME###'] = $arrData['MW']['MWLIST']['CAR'][$intX] [@]['NAME']; $strCarss.= $this-cObj-substituteMarkerArrayCached($strCarLoop,$arrSubst); } } !-- ###CAR_LOOP### begin -- option value='###CAR_OPTION_VALUE###' nbsp;###CAR_OPTION_PRICEnbsp;euro;nbsp;###CAR_OPTION_NAME###/option !-- ###CAR_LOOP### end -- !-- ###CAR_TABLE### begin -- tr td colspan='5' style='text-align:center; font-size:14px;' ###BOOKING_RENT_A_CAR_LABEL### /td /tr tr td colspan='2' center###BOOKING_RENT_A_CAR_INFO###/center br/br/ centera href='#' onClick='Open_Window(http://www.sunnycars.com/b2c.docs/deu.l/single_vehicledetails.html?+getCarUrl(),SUNNY,scrollbar=yes,800,600)'img src='/fileadmin/templates/img/scar.gif' border='0' / br/br/###BOOKING_CAR_INFO_LABEL###/a/center /td td colspan='4' select name='MWTYP' size='10' option value='-'###BOOKING_I_DONT_WANT_TO_RENT_A_CAR###/option ###BOOKING_RENT_A_CAR_LOOP### /select /td /tr !-- ###CAR_TABLE### end -- Then I realize, doing some coding for data which I already have make me sick. and When you go with multi language site you will realize, every tiny bit of template have to template marker keys. And you have to do this mule job And begin to use this. table border='0' cellpadding='0' cellspacing='0' class='dtable rbook-renta- car'tbody tr
Re: [PHP] templating engine options
You're missing the point just because he threw in some old HTML styling attributes. The main issue is the overhead of added parsing layers to find where content goes in the HTML. Aren't we already using a language (PHP) that parses for place holders for dynamic content within HTML tags? Write the template in XHTML, style it with CSS, and insert content place marks with PHP short tags. Do the programming work of calculations, validation, and DB access in another script which will include the template at the appropriate time. Even create classes to hold various data sets (think JavaBeans) if you want. Adding a layer of abstraction just so your designers don't have to write ?=$var? is silly at best. At lest that's my opinion. Do whatever works for you. Mike Completely agree. A year ago, we got a IBE project. It based TYPO3 and Templavolia. After completion, it slow like hell. Then some optimization, some TYPO3 tweak. And still slow like hell. Then I realize, we got more than 20 template pieces in a page. (it was something about the travel business you have to show lots of different travel options in landing page). Anyhow, then I found a f*ckin simple thing. ob_start(); require(template.php); $output. = ob_get_clean(); With converting templates to php and opcode cache compatibility (yes your template was a php file so it was stored in the memory). things was become blazingly fast. Then we covert entire thing to php based templates. Things become much more flexible and fast. Of course there where a thin red line. Do not put writer functions in the templates. Other than that. Perfect solution. Except one condition. Your designers must have php enabled. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] templating engine options
On Tuesday 26 May 2009 01:44:43 am Nathan Rixham wrote: Stuart wrote: 2009/5/25 Robert Cummings rob...@interjinn.com: I continued the discussion with Nathan. I too have had an off-list discussion with Nathan on this topic, and a productive one at that. which would probably be a good time for me to step back in; having had a nice little inside in to both Robert and Stuarts template systems, and indeed way(s) of doing things. Also thanks to everybody else who made suggestions and gave input - it was all appreciated. I'm far from making a final decision, as I've decided to approach this by setting a few guidelines and a wishlist, then either finding / modifying something to do the job, or creating something from scratch. Both Rob and Stuarts systems were more in common than they may think, focus in both was on performance, and only making set data available to the templates (whether pushing or pulling). The syntax did differ though, and functionality aside this is probably one of the most important aspects (imho). Markup XML sits well with me (and most) because we are web developers and use it daily. PHP syntax also sits well because we also use it daily. The fact remains though that this feels like (and possibly is) a different job which requires something different. Both XHTML and PHP do their job well - just as ecma(java)script and css do theirs. However none of these technologies / languages are suited and dedicated to converting provided data in to specified output; specifically, and only, xhtml. XSL Templates are near perfect, built for the job, and very powerful - but time hasn't favoured them well; and until (if ever) a wide spread adoption happens something else needs to fill the gap. Template Specific Thoughts: Smarty, Stuarts Engine, Robs Engine, PHPLIB and many more had one common theme, they all limited the data available. My terminology of limited perhaps sounds wrong, so maybe make specified selected data available or provide access to the view will make more sense. Inline with layered and tiered application design this makes perfect sense; thus.. A template /should/ only be able to access the data made available to it, nothing else. Whether it requests the data or the data is provided is covered later. If it doesn't have all the data needed then this needs reviewed and the application needs changed to provide it. Not the template engine bastardized to accommodate a limited app. A template ~should~ have unique yet easy to understand syntax, something that complements xhtml and provides all needed functionality. (IMHO it should not be php syntax) A template engine must stick within it's role boundaries, it's not a cache engine, its not php, its not xhtml, its not for implementing functionality - it is simply and purely to do its job - take data, populate an xhtml template with it and return the result - nothing more, nothing less. Push vs Pull. This is a much bigger issue than I thought, and perhaps is the crux of the whole thing. I can see two clear approaches; Firstly, (the common one) - app passes data and a template to the template engine - template engine merges it together and passes back - app does as it pleases with data (sends it to client, caches it, fires it in an email - whatever) Secondly, (uncomment) [think modular] - app provides an api / gateway to views of data - template engine requests view(s) specified in template from app - template engine populates template modules with data sends output to I guess the first is template engine as a Util / Service - and the second is template engine as a Layer / App. There are pros and cons in each design, concentrating on the second design for now - this brings in a lot of scope which seems to fit well both practically and architecturally. The freedom to be able to specify in template that... this is template module latest posts, it is bound to the data view (or data provider) latest posts(8) whilst overall combining template (page) is comprised of modules x,y and z - here, here and here. ...really appeals to me; certainly in this scenario where you request (pull) from the application rather than make it all available. This way you only ever perform the business logic required for the information available. The counter part of making everything available incase it may be used is ridiculous (and makes me think coldfusion for some reason??). Architecturally this appears to be good - it's the presentation tier being a presentation tier, the logic tier knows nothing of the presentation tier and simply serves up what is requested. However thats only on the one side of the tier - on the other side we have a huge gaping hole where functionality should be (cache, compilation, delivery) etc, which would require another, as yet unknown layer (or 2). The abstraction and separation of concerns in this setup really appeals - but
Re: [PHP] CSS tables
Well. If you really really want to go Table less css. You have to you one of those CSS frameworks. I suggest YAML And even with YAML. You have to fix your design to IE6. My point of view positioning with DIV was time consuming process and very frustrating experience (especially with IE6). And to those pesky Table Nay sayers. Damn get over it. Did you still believe those TABLES ARE SLOW marketing buzz ? Hello we are in 2009. We got wordwide broadband access and guess what. Images and flash contend much bigger than any html and css data. And your JS generate more load than html parsing to client cpu. Yes CSS was most elegant solution and most time consuming. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 800 pound gorilla
On Monday 20 April 2009 16:48:42 Marc Christopher Hall wrote: Sun buys MySQL and now Oracle buys Sun (not final, yet). What will happen with the main db we PHP'ers have come to know and love especially since v 5 sudo apt-get install postgresql -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Frameworks / obstinate?
Probably a bit off topic and The Game is over man. Javascript coming with flank speed. Next generation JS Framworks will take html generation jobs from server side. Whole thing of Server Side MVC and other yada yada was became joke. Those server siders become JSON pushers for JS frameworks. Astrosurfing ? Yeah, just compare PHP mailing list vs Jquery Mailing list activity. And The New Game just begun... Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Frameworks / obstinate?
On Monday 23 March 2009 12:33:58 Robert Cummings wrote: On Mon, 2009-03-23 at 11:52 +0200, Sancar Saran wrote: Probably a bit off topic and The Game is over man. Javascript coming with flank speed. Next generation JS Framworks will take html generation jobs from server side. Whole thing of Server Side MVC and other yada yada was became joke. Those server siders become JSON pushers for JS frameworks. Astrosurfing ? Yeah, just compare PHP mailing list vs Jquery Mailing list activity. And The New Game just begun... Yeah, I hear C has been replaced too. Well, I did not see you to write your web app with C. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Frameworks / obstinate?
On Monday 23 March 2009 16:24:55 Robert Cummings wrote: On Mon, 2009-03-23 at 15:58 +0200, Sancar Saran wrote: On Monday 23 March 2009 12:33:58 Robert Cummings wrote: On Mon, 2009-03-23 at 11:52 +0200, Sancar Saran wrote: Probably a bit off topic and The Game is over man. Javascript coming with flank speed. Next generation JS Framworks will take html generation jobs from server side. Whole thing of Server Side MVC and other yada yada was became joke. Those server siders become JSON pushers for JS frameworks. Astrosurfing ? Yeah, just compare PHP mailing list vs Jquery Mailing list activity. And The New Game just begun... Yeah, I hear C has been replaced too. Well, I did not see you to write your web app with C. I write in C still. I have a mud I work on in my spare time... admittedly MUDs aren't a good example since they are dated... but this particular one shares C code, via compile-time macros, with associated PHP extensions to speed up certain aspects of data parsing and evaluation. My point is, just because new techniques and technoloigies come out, is in no way a boundary condition on an existing technology's lifespan or efficacy in any particular environment. The deprecation of usefulness of any technology is based on many more variables than Jquery - The New Game just began. Jquery runs in the browser, it will never replace server side data acquisition, caching, and manipulation. It will merely augment. Moreover, it is completely useless when JavaScript is disabled. Your post also made the assumption that PHP is used for web sites only. Many people are using it for other tasks too. Popularity is also not a useful metric of the demise of a language. It may just be that less people are familiar with JQuery and so there are more questions whereas PHP has been around long enough that the bulk of people interested in it have a good enough foundation in it that they don't need to ask questions. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP Well nice :), I wish to able to write C stuff for boosting PHP performance by myself too... And of course, no body will replace C or PHP. And there where a but and very big BUT. When those dynamic web thing begin to appear there where programming language named PERL. And yes it was still aroud here and Slashdot still running perl based code. BUT momentum was lost. No body expect to some ground breaking thing from PERL 6. And Server side become less interesting day by day. Collect request values, generate HTML output and push. Each new server side language or framework do same thing, this way or that way. Web Programming momentum shifting from server side to Javascript. So tellme your last PHP vs Someting else dynamic web language flamewar ? Currently JS guys are busying with fancy effects, browser behavior fix, menus, dom manuplation etc. When they fix things, their next step was content management or someting like that frameworks. Anywhow we well see. PS: Is there any shorh way to learn do someting for PHP with C (My C knowladge was 0) Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Object Context Question in object-object-variable
Hello list. I'm trying to implement someting on OO way. I got 2 classes class a { var $config = array(); var $b = ''; function __construct { $this-b = new b($this-config); } } class b { var $config = array(); function foo() { switch($this-config['bar']) { } } } some where in class a and when I call $bar = new a(); $bar-b-foo(); I got Fatal error: Using $this when not in object context in Could you givme some clue what is wrong ? I'm using Ubuntu and PHP 5.2.0-8+etch13 Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Object Context Question in object-object-variable SOLVED
On Monday 02 March 2009 20:50:56 Sancar Saran wrote: Hello list. I'm trying to implement someting on OO way. I got 2 classes class a { var $config = array(); var $b = ''; function __construct { $this-b = new b($this-config); } } class b { var $config = array(); function foo() { switch($this-config['bar']) { } } } some where in class a and when I call $bar = new a(); $bar-b-foo(); I got Fatal error: Using $this when not in object context in Could you givme some clue what is wrong ? I'm using Ubuntu and PHP 5.2.0-8+etch13 Regards Sancar Sorry guys. My Bad for this kind of operations. method must not be static. Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Opinions Please, Describing PHP as Web Framework of C and C++
Hello list. Recently we had some serious discussion on local boards. I prefer calling PHP as Web Framework of C and C++ if you had a time for this fruitless discussion. Please send your opinions. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Module Structure ideas
On Wednesday 11 February 2009 21:42:24 Ashley Sheridan wrote: On Wed, 2009-02-11 at 21:20 +0800, Virgilio Quilario wrote: Last year I began to sepearte my module files to many files for their purposes. Last time use use lots of dirs for their types someting like controllers a.cont.php b.cont.php definition a.def.php b.def.php models a.model.php b.model.php views a.view.php b.view.php Then I realize this model creates confusion when you start to debug a module. My next step was putting module files in one dir, also I want to load them into text editor with spesific order (same to including order). and I came up some ting like this a.test.def.php c.test.mdl.php e.test.cnt.php g.test.rtr.php i.test.view.php k.test.dr.js m.test.m.js o.test.css test_app.a.def.php test_app.c.mdl.php test_app.e.cnt.php test_app.g.rtr.php test_app.i.view.php test_app.k.dr.js test_app.m.js test_app.o.css test.adef.php test.cmdl.php test.ecnt.php test.grtr.php test.iview.php test.kdr.js test.m.js test.o.css My point of view the 3. option is good for me. So I want to ask this (beacause I'm using very closed working model. Just KDE and KATE) is kind of file structure may lead any kind of problems in future or diffrerent situation ? also is there any suggestion to using different methot to archive similar goals. option #3 works for me too small projects without using frameworks. for big projects, i prefer to organize my script files by type: /models /controllers /views i don't have problems with jumping around folder to folder because i keep files open in separate windows. Virgil http://www.jampmark.com Number 3 looks good. but I would tend to keep .js and .css files in their own directories respectively, as for most projects, I'll have lots of different .js files for differents tasks, and several .css files (screen, print, internet explorer, etc.) It makes it a lot easier for me, as usually (unless I'm doing AJAX work) the php and javascript won't overlap, and css is almost always completely separate. Ash www.ashleysheridan.co.uk Thanks lot. Using dirs for css and jss look more favorable. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Module Structure ideas
Hello List, Last year I began to sepearte my module files to many files for their purposes. Last time use use lots of dirs for their types someting like controllers a.cont.php b.cont.php definition a.def.php b.def.php models a.model.php b.model.php views a.view.php b.view.php Then I realize this model creates confusion when you start to debug a module. My next step was putting module files in one dir, also I want to load them into text editor with spesific order (same to including order). and I came up some ting like this a.test.def.php c.test.mdl.php e.test.cnt.php g.test.rtr.php i.test.view.php k.test.dr.js m.test.m.js o.test.css test_app.a.def.php test_app.c.mdl.php test_app.e.cnt.php test_app.g.rtr.php test_app.i.view.php test_app.k.dr.js test_app.m.js test_app.o.css test.adef.php test.cmdl.php test.ecnt.php test.grtr.php test.iview.php test.kdr.js test.m.js test.o.css My point of view the 3. option is good for me. So I want to ask this (beacause I'm using very closed working model. Just KDE and KATE) is kind of file structure may lead any kind of problems in future or diffrerent situation ? also is there any suggestion to using different methot to archive similar goals. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] long echo statement performance question
On Friday 06 February 2009 19:12:08 Frank Stanovcak wrote: I'm in the process of seperating logic from display in a section of code, and wanted to make sure I wasn't treading on a performance landmine here, so I ask you wizened masters of the dark arts this... is there a serious performance hit, or reason not to use long, ie more than 30 - 40 lines, comma conjoined echo statments... echo 'blah', $var, 'blah', $var2,...ad nauseum ... to output mixed html and php var values? If so could you refer me to a work around, or better way? Frank Seperate logic. Not the template. ?=$variable? was good for templating. With opcode cache all your template was cached. And of course you should not use write functions in templates. and if you really want to do this with echo yada yada I suggest this one. $output = ''; do someting remove echo and put $output. and end of the script do echo $output. This was the best way. Of course you can use output buffering. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Shop Management
On Friday 30 January 2009 23:14:25 Edmund Hertle wrote: 2009/1/30 Sancar Saran sancar.sa...@evodot.com Hello everyone, Maybe it was bit off topic. Recently we move our web server. Of course there where tons of WTF ??? So is there any kindof web based management system to handle. Web based projects. I'm looking for someting like this Customer -- Project 1 -- Project 2 -- Project Propeties Thanks for advice Regards Sancar Web based projects? Code projects? SVN/Git? -eddy Not really. It was someting like customer tracking. Finding 200 apache directory with no info was very frustrating experiment. Some of them are abandoned, some customers are leaved. some of them just projects but customers does not accept. I want store some info about the customer or project. Maybe categorize them. Lets call it customer documentation. I want to record something like that This was blahblah.com owned by some guy, needs this. dislikes this. Please be careful when moving or altering site. He was sychopath to check every 30 min to his 5 hit per day site. This system uses uber CMS system which needs php-tidy php-postgresql etc etc. Have to acess some blah blah service. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Shop Management
On Saturday 31 January 2009 12:43:52 Michael Kubler wrote: If it's just documentation you could use a wiki. I've found that mediawiki http://www.mediawiki.org/wiki/MediaWiki is the best (the one that wikipedia uses), although twiki isn't too bad, but the problems with wiki's are that they expect you to know how to use them, and all their crazy words and syntax. Something like Google Docs http://www.google.com/google-d-s/tour1.html is actually really sexy (can I say that about a web app that looks like a slimmed down version of office?), because it is so easy to use. You could also check out things like dotproject http://www.dotproject.net/, or google 'project management + PHP'. As a non PHP, hosted alternatively you could look into basecamp http://www.basecamphq.com/, which is designed for making project collaboration, with goals, timelines, and all sorts, although that doesn't quite sound like what you want as it isn't something you host, and you'd basically need to create a new one for each project. Michael Kubler *G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz Sancar Saran wrote: Not really. It was someting like customer tracking. Finding 200 apache directory with no info was very frustrating experiment. Some of them are abandoned, some customers are leaved. some of them just projects but customers does not accept. I want store some info about the customer or project. Maybe categorize them. Lets call it customer documentation. I want to record something like that This was blahblah.com owned by some guy, needs this. dislikes this. Please be careful when moving or altering site. He was sychopath to check every 30 min to his 5 hit per day site. This system uses uber CMS system which needs php-tidy php-postgresql etc etc. Have to acess some blah blah service. Regards Sancar Thanks, It look like, do it with wiki or do it with own code Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Web Shop Management
Hello everyone, Maybe it was bit off topic. Recently we move our web server. Of course there where tons of WTF ??? So is there any kindof web based management system to handle. Web based projects. I'm looking for someting like this Customer -- Project 1 -- Project 2 -- Project Propeties Thanks for advice Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Opinions / Votes Needed
Hello guys, It seems most of you very tallended programmers. Could you generate someting like php-- withouth OO just namespaces ? and make 95% of php programmers very happy... this Object Orgy going to blow that language which makes us productive programmers. and My vote goes to Tony... Regards...
Re: [PHP] Zend Framework...where to start? -- don't.
On Wednesday 14 January 2009 23:39:02 Daevid Vincent wrote: Not to start a Holy War (as these to framework or not to framework debates often turn into), but I personally had a horrible experience with using frameworks. I was forced to use Symfony at my last job and it was so cumbersome and slow to do even the simplest things. The whole MVC thing can be overkill. Plus the learning curve can be quite steep. Then if you want to hire other developers to work with you, you have to train them and let them ramp up on not only the framework but also your core project too! More wasted time. The pages are significantly slower than straight PHP by orders of magnitude: http://paul-m-jones.com/?p=315 The basic problem with frameworks is they try to be one thing for all people. This carries a lot of baggage with it. There's a lot of crap you end up pulling in that you don't want/need. Plus if you want to deviate at all, you either have to roll your own, or sometimes you simply just can't. They seem attractive with all their plugins and stuff, but honestly, rarely do the plugins do EXACTLY what you want, the way you want. It might be as simple as trying to change the look/feel of a button or something and you'll find out that you can't -- so now you have this website that has this section that doesn't look like the rest of your site. And if you find a bug, you have to try to either fix it yourself and then keep those changes migrated into new updates, or submit it to the developer and hope they implement them (and trust me, you can submit to them and have them rejected for all sorts of lame reasons -- even though the work has been done and you're using it!) I advise against it. Just follow good practices and use thin wrappers and functions. Don't get all OO googlie eyed and try to over-engineer and over-OO the code. OO is great for some things (like a User class) but don't start making some OO page renderer or form builder. Don't fall into the DB Abstraction trap either -- just use a wrapper around your DB calls (see attached), so you can swap out that wrapper if (and you almost never do) you change the DB. Don't be suckered by something like QuickForms -- you WILL run into limitations that you can't get around and are at their mercy. Don't buy the hype that DIV's are the magic bullet and TABLEs are poor design -- Tables are still the best and most ubiquitous way to align things in a browser agnostic way (including mobile phones, etc.) and to layout forms. I've not used Zend myself, so I can't say for certain, but the above tenements I think would still hold true. I guess I would trust the Zend one the most given they actually make PHP, but at this point in time, I would never choose to use a bloated framework. Then again, I write enterprise level and very custom applications (Saas) so maybe this doesn't apply if all you're trying to do is make yet another Blog or Photo-album or personal/corporate website or something generic/basic. I've been coding nearly 20 years and founded several $MM companies. That's my take (or rant depending on how you look at it). Daevid. http://daevid.com Hell, yes, signed to from start to end. After RoR, PHP guys (including Zend) goes nuts. Every one eat his brains to develop RoR like Framework. I wish to see fixed function parameter names, option orders, easy and strong input validation in PHP 6. And they give full effort to generate Zend Framework. Then what? It still harder than Ror... Hell yes, Compete own community. teh best way to spend your resources... Sancar Saran
Re: [PHP] Zend Framework...where to start? -- don't.
On Thursday 15 January 2009 17:45:35 Robert Cummings wrote: Hell, yes, signed to from start to end. After RoR, PHP guys (including Zend) goes nuts. Every one eat his brains to develop RoR like Framework. What are you smoking? I like my framework the way it is. I'm sure others like theirs the way it is. In no way do I try to be like RoR and probably for good reason since I hear mostly bad things about RoR. Naah, I left somoking more than 3 years ago and having problems discussing in English (still no former education). And I'm sorry, My English better than your Turkish. So please be polute about my grammar errors. :) Everyone likes own dog-meat. And, last week I meet a tiny php shop to fix their code against remote file inclusion. Their code was uber mess and one thing make me sad. Their old coder (which he doesn't know anything about current php development trends) do the job wint under 20k phtml code. (most of k was spend for html tables). maybe 5 functions and so. I'm very sure to updating his code with current trends plus some improvement under (excluding the templates) in 20k I can give the answer for 80% of web demands. And if we look someting more TYPO3 / Joomla / Drupal can do the job. For Ruby, Perl, Python, you have have a web focused frame work to get job done in faster. And that php already web focused language. we need faster, more organized, better language, not uber bloated framwork from ZEND. I wish to see fixed function parameter names Good luck with that... it's been shot down several times on the PHP internals list. , option orders, easy and strong input validation in PHP 6. Isn't the filters stuff available in PHP5 already for doing stronger validation. It's not like input validation is difficult. And they give full effort to generate Zend Framework. Huh? Then what? It still harder than Ror... What is? PHP? What are you talking about? I mean, ZEND Framework still harder to handle than RoR. Hell yes, Compete own community. teh best way to spend your resources... Internal competition only makes something better. If all you have are yes men, then the only answer you'll get is yes. Having those who dissent in opinion provides a basis for different views and approaches to problem solving. May survival of the fittest benefit all both from the perspective of getting a better final product and from the perspective of learning from mistakes along the way. Yes of course and that Zend was not M$, they not swim in to dollar filled pools. And wIth zend framework, Zend begin rivalling against CI, Symphony, Solar and other popular framework communuties. (including yours and mine). Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP Regards Sancar
Re: [PHP] setting up FTP account names via PHP
On Monday 05 January 2009 16:29:09 Merlin Morgenstern wrote: Hello everybody, I am running a real estate site where I would like to enable bulk upload via real estate software that exports an xml file into an ftp account. In order to give every user unique access I would need to generate individual ftp name and passwords for each member. I can not see how this should work. My portal is written in PHP 4.x and there every members loges in with a unique ID. The FTP Server runns on the same linux machine. How could I generate users for this FTP server with php, for example on sign up? Thank you for any help on this. Best regards, Merlin If those xml files not that big, you may consider uploading with php. Or perhaps you may find an ftp server which can use mysql database for authentication.
Re: [PHP] Architecture patterns in PHP
On Sunday 28 December 2008 01:40:01 Michael C. Yates wrote: Hey, How do you structure your web applications? I am thinking in terms of separating presentation and logic. How is that done in PHP? And how many architecture patterns are there? Thanks Micheal C. Yates Well, I use, way of Rasmus (I give that name) and please read this why http://talks.php.net/show/drupal08/0 regards Sancar
Re: [PHP] IE8 and HTML5
On Thursday 04 December 2008 10:45:21 Richard Heyes wrote: Hi, From a recent IEBlog post: http://blogs.msdn.com/ie/archive/2008/12/03/compatibility-view-improvements -to-come-in-ie8.aspx Microsoft and Standarts ? Ship load of crap... Every web developer should open class action suit against M$ because of IE and M$ should banned from to create web browser for ever... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Happy Turkey Day
On Thursday 27 November 2008 19:07:42 Daniel P. Brown wrote: On Thu, Nov 27, 2008 at 11:08 AM, tedd [EMAIL PROTECTED] wrote: Hi gang: Happy Turkey Day to all who are working on Thanksgiving. Back at you, my friend. Some on the list may not even know what Thanksgiving is, being an American holiday. I had a client last year comment that she was surprised so many people around the world work Thanksgiving Day. I didn't correct her. And some on the list may live in Turkey... Cheers :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ZendOptimizer + APC
On Tuesday 21 October 2008 19:35:53 Jochem Maas wrote: anyone know whether running ZendOptimizer + APC simultaneously still causes allsorts of problems ... I know it did in the past but I can't find any very recent stuff about the issues online. You have to buy Zend Performance platform. Thats why ZendOptimizer + APC doesn't work together. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Dev Facts
On Friday 17 October 2008 02:14:18 Nathan Rixham wrote: Evening All, I'd be /really/ interested to know who uses what! *Procedural or OOP?* Procedural in design. And code a bit different. I'm groupping my functions under classes like util, user, session etc. Each function is public static. also I got some public static arrays and strings. like k5::$config etc. This gives me some kind of name space and prevent any kind of variable chrash. *Dev OS* Kubuntu *Dev PHP Version* 5.2 *Live Server OS* Centos, RHEL, Debian *Live Server PHP Version* 4, 5.1, 5.2 *Which HTTP Server Software (+version)?* Apache 1.3 2.0 2.2 *IDE / Dev Environment* Kate, Eclipse, *Preferred Framework(s)?* nope *Do you Unit Test?* what ? *Most Used Internal PHP Class* simple xml, *Preferred OS CMS* Must use TYPO3, have own CMS/Framework *Anything else you use frequently in you're PHP'ing that's worth mentioning:* Using PHP array format for storing data to generate greater benefit opcode cache. I'm using inline coding format for templates. Much faster than traditional search and replace model and with opcode cache even more faster. ps: I'm not asking for any kind of research project, just interested and interested to know what's most common + might learn something/find some new tools/toys! pps: will reply myself as well but if I do here it'll make your intertwined replies messy! Many Regards Nathan Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Eclipse - PDT, prevent validation on some files
Hello there, sorry to bugging the list and I hope finding the answer quickly. Today I watch a youtube video which showing eclipse pdt and I want to try. It was amazing, it was so advanced after kate and if I handle one thing, I would be very happy. This thing checks every file in the project and validates it. So ? Eclipse found some veird errors (they use custom html element attirbuties or someting like that) and I can't find the way to fix it. Also it wasn't my code. My Question is Is there any way to prevent validation some files and directories under eclipse. Thanks Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SESSIONS vs. MySQL
Use memcached based session handler Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Project Leader -- Contract - San Francisco area
On Wednesday 17 September 2008 22:00:48 Dan Joseph wrote: But again, I'm not defending the guy. Let him fight for himself. :) Fight for himself ? He can't. I'm pretty sure he did not know anything about that mail. And if it was true they search microsoft oriented and this list was't very microsoft friendly. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Why MS Won't Retire Browsers -- was: Interntet Explorer 8 beater 2
Because, M$ earning money from Win GUI. No WinGUI no money. From the begining, M$ try to broke web compatibilty in every way... Sure M$ has bad records about software quality. But even ask yourself. WHY IE (especially 5 and 6) SO buggy even M$ standards. M$ isn't mr nice guy and they wont get a dime from web. They hate web and internet from begining. M$ is anti web IT company. They are too big they are to bold (or bald) to accept changing market and they got too much money on bank to do someting very very stupid. Like Windows VISTA. Don't expect anything good from M$... Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
http://blogs.zdnet.com/security/?p=1835 That was great. Human captcha resolvers. $2 per 1000 resloved captchas... ouch... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
Hello there, Actually my captchas show the world some funky coloured text... :-) I just wondering. What if we show captcha using ASCII ART format. like pre ||| ||| `||| |||`|||`````|||||` ` || ||||| ||` |. |`... | ||` .|| | | .|||||``|.|.```|.|| |. `||||| | |||.. ..`| ||| |||`` |. ```||`||.|` `||.. | ```. . .|`. ```.| |||. S ..... I ... R . I .|||.. K . ||| BUCES BBS|| ||| /pre (I'm not sure it was showed correct) Even coloured one. What is your opinions ? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP IDE needed
Whats wrong with echo ?php echo Hello World; ? index.php is there anything to satisfy your needs... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ?=class::$lang[$this-lang]['_key_']? Not working
Hello, I god very weird problem on cent os server. I use php templates on TYPO3 based system. which uses short tags some how ?=class::$lang[$this-lang]['_key_']? was not working. System works perfectly on my ubuntu machine. Another problem was. I can get $this-lang I can get print_r(class::$lang) but I cannot access them. Another weirdness was some parts of the script can get class::$lang[$this-lang]['_key_'] values Does anybody give me clue ? PS: This code 4th or 5th level deep require. Is there any ini parameter for this ? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ?=class::$lang[$this-lang]['_key_']? Fixed myBAD
Sorry to bothering list. my_bad I damn bug generated by mysef and ignited by sort order... /my_bad Sorry. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why PHP4?
Because, People believes Do not fix until broke Motto. Testing new online application may painfull. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Optimization of PHP Code
On Friday 18 July 2008 15:53:06 Manoj Singh wrote: Hello All, I am developing the web site in PHP using MYSQL database. Can you please provide me some tips to write the optimized code. Best Regards, Manoj Kumar Singh Premature optimization as root of all evil. Use less sql connection as possible. If you had opcode cache, put everthing in php code then include it. Do not use, template system, use inline php code for templates. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Optimization of PHP Code
On Friday 18 July 2008 18:43:43 Robert Cummings wrote: On Fri, 2008-07-18 at 16:47 +0300, Sancar Saran wrote: Do not use, template system, use inline php code for templates. Oh dear... you must subscribe to FUD 101. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP First of all, please remember php is template language for html. And template.php div?=$template['foo']?/div page.php ?php $template['foo']= 'bar'; include('teplate.php'); ? we can use this directly as template and if we got opcode cache (like APC), we can store entire template file in the memory, no parsing overhead, no function call, absolute noting, direct output from memory. Did you got anything better ? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pure PHP
Hello, I want to write some of my ideas about php performance and maintenance. Also you may consider this response to Robert's template systems arguments. I hope my english does not disturb too much. As a uneducated php developer, I have open mind to anything. I try lots of things. After so many projects, so many line of code here where I'm... 1-) Template systems Are usesless, they are cpu hungry, they are complex, they are bloated. Every template creator try to beat each other. And look that smarty. I wonder when they start to write their own sql interpeter. And of course I wrote one. Which can use sql, memcached and lots this that. Sure it was very good one. With memcache support it was very fast. So ? at end of the story, our html designers can't understand the system and start to wheening. Lots of code goes to junk... using inline php code for template is the best way. You can do what ever you want. Just use military grade dicipline yourself to do only read in template.php files. 2-) Using XML and other kind of txt datastructure for storing someting... Are nuts ? why you store that data in external data structure. Is PHP arrays arent powerfull enought to store someting. ? then guess what, if you use opcode cache (as APC). you dont need to spend any cycle to open, parse, check ect. (and I don't say anything exporting your data to 3rd party system. or importing data from 3rd party system) 3-) You may apply number 2 to for sql operations. If you got lots of read sql operations and if the data can store in php array. (I mean if you don't need to sql language for searching data) You may generate some kind of cache system, which produces php output combining with apc your speed up was enormus. 4-) OO programming paradigm.. I still don't believe full blown oo programming under php. And there where some areas to use php OO for fixin some design problems. Php does not have namespaces, because of this you may got variable or function name crashing. Also you can access php objects anywhere from your code. So ? With public static keywors. you can give your code a pseudo name space and you can access your data globally even doesn't write te everywhere like global $this, $that, $bleh; example class evo { public static $config = array(); // config array public static $lang= array(); // language array public static function get_module($o) { . $return $array; } } you can store data in your variables evo::$config['this'] = 'bleh'; and call them evo::$config['this']; anywhere in your code no globals no fuss no buzz. Of course there where lots of programmers around here to saying OO paradigm much more on that. I hope one the I found that much more :). for now all off them marketing buzzword for me. 5-) function options... function hede($name=hede,$this=true,$bleh=0){ } well it nice but what if I want to expand this function ? But I use that thing lots of location, shall I rewrite all of them... unh..!!!. A yes OO programming right ? but what about this. function hede($o){ } $o was an array we can store everthing what ever we want to use in the function. 6-) array in array out in the functions Well lets expand the number 5 function hede($o){ return $result; } $result was string containing our returns. But what if we want to return someting different ? So we have to create other function very similar to. And if we return data in array format, we can put anything in the array. with this we can even change behavior of the function for certain tasks function hede($o){ return $o; } Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Optimization of PHP Code
And one thing. (1). It is very convenient to pre-process static information at compile time rather than on every request (specific properties, content chunks, content relocation, etc). Additionally, it can compile to static HTML, One of my sites using 3rd party as data source (via xml). Their data may change any time, so we have to parse template files in each request. What is your suggestion ? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
On Wednesday 09 July 2008 02:23:49 tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd Monospace 9 regular 22inch wide screen 1680x1050 on linux. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Re: Re: Military Service WAS [PHP] Capitalization of variable
I hate to say this, but I am expendable. If that's what it takes to keep my country and my family safe, myself and many other men would quickly rise to take the fire. /salute -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: RE: Military Service WAS [PHP] Capitalization of variable
On Saturday 21 June 2008 16:58:24 Michelle Konzack wrote: Merhaba Sancar, Am 2008-06-20 09:21:30, schrieb Sancar Saran: The Turkish Gendarmerie (Jandarma Genel Komutanligi) ;-) How long is the service there? 15 Months. Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: Military Service WAS [PHP] Capitalization of variable
On Thursday 19 June 2008 18:25:10 Jay Blanchard wrote: [snip] I wonder how many of us on the list served. It's got to be more than just you and I, Tedd, wouldn't you think? [/snip] U.S. Air Force The Turkish Gendarmerie (Jandarma Genel Komutanligi) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] (*OT) What we are going to do about those OT's?
On Saturday 21 June 2008 00:23:04 Nitsan Bin-Nun wrote: Someone had to start some thread like this.. I think we should create another list for those OT's as Daniel suggested. Any ideas? Regards Shabat Shalom, Nitsan btw I cant see any reasonable cause to avoid OT's in the general list, but if you think its not related, so it will be better to solve this arguments and establish another list/find a solution to those OT's. Nothing, 20% 80% rule works here. So ? only 20% of posts have some real information other %80 percent of posts are just useless. And The OT posts are make us community. We are people, not god damn simbiotic answering machine... Regards Sancar. Ps You may play better football, you may lead the score at 2 - 0 and you may goal at 119 min. but at end of the match, you can't win. We are in semi finals :))) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Discussion of method -- config files
Hi tedd My final solution was. class conf { public static $vals = array(); // config array ... } conf::$vals['mysql_host'] = 'localhost'; conf::$vals['mysql_user'] = [EMAIL PROTECTED]; you can access anywhere of your script and you won't need to pollute $GLOBALS. Regards Sancar On Thursday 19 June 2008 17:04:17 tedd wrote: Hi gang: More of a question of method rather than of right or wrong -- of the two methods mentioned here, which way would be better and why? 1. Setting $GLOBALS one time as shown here. At 12:23 AM -0400 6/19/08, Robert Cummings wrote: And the variables are defined in config.php -- config.php -- ?php //Mysql vars $GLOBALS['mysql_host'] = localhost; $GLOBALS['mysql_user'] = [EMAIL PROTECTED]; $GLOBALS['mysql_pass'] = ; ? 2. Or, setting variables as shown below and including them when needed? -- config.php -- ?php //Mysql vars $localhost = 'localhost'; $mysql_user = '[EMAIL PROTECTED]'; $mysql_pass = ''; ? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Discussion of method -- config files
Well, after reaching this $GLOBALS['live']['current']['c']['modules']['traffics']['url'] = 'blah'; I change my mind to use public static variables. using conf::$vars (or someting like that) was more pratic than using $GLOBALS directly. You can set config each of your classes. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php framework vs just php?
On Wednesday 23 April 2008 21:29:40 tedd wrote: At 5:24 PM +0300 4/22/08, Sancar Saran wrote: Hello there, Is anyone looking jQuery recently ?. Thas what I call framework... Yes, and I'm programming with it. But, that's what jQuery and I call a library. Cheers, Name it whatever you want. From my point of view It works, It helps lot and it was fun to writing programs with jQuery. and When I try to use zend frame work (or name it your favorite framework). It works. It needs to read tons of docs before writing someting useful and it was [EMAIL PROTECTED]@ to writing programs with zend framework. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php framework vs just php?
On Thursday 24 April 2008 14:52:12 Eric Butera wrote: On Thu, Apr 24, 2008 at 2:42 AM, Sancar Saran [EMAIL PROTECTED] wrote: It works. It needs to read tons of docs before writing someting useful and it was [EMAIL PROTECTED]@ to writing programs with zend framework. It has tons of real unit tests to know it really works. Plus there are a lot of eyes on it from various platforms. So you're pretty much guaranteed that it is going to work out for you in the end. It has a very nice manual, better than any other attempt I've seen in our community. I think some of the api's do feel a little weird but I understand that after releasing you can't just break BC for glam. :) With all of that said... I tend to stay away from a lot of it though because it feels very heavy to use. I guess that is how it has to be when you can override/hook into so many different things (specifically the controller). Hello, I did not say to it did not work. It works certanly... And I do not know anything about overriding and hook in the controller. AND Thanks, with your answer my mind flashes I finally realize the all of those framework madness and OO nazisim. Here My Conclusion... After booming web, tons of unemployement Desktop programmer changes their jobs to create dynamic web pages to earn more food. Meanwhile some kids form lazytown doing some very interesting sites (and earn some big bucks) using some kind of scripting language named PHP. After some inspection they found interesting facts and began to scraming. OMG. OMG, those nuts writing dynamic web pages with functions only. They even don't know anything about object oriented programming. Then some of then really pissed off. Because those kiddies doing very popular sites even using some proper programming skillz... Then they create a mission for themselves to good of community. Lets teach them how to write programming with proper way And they forget someting... This was web industry. Your instances are 1 sec. In 6 month your aproach was old and dull. Somebody in somewhere doing different way to do very interesting things and you have to refactor entire thing. From My Point of View None of those frameworks can cover everything for world of HTML and WEB. And I do not remember when I was extend somebody elses classes... I'm pretty sure everone has lots of mini functions in their personal libs which does not touch and use for years. But classes ? Or frameworks I'm not sure Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Prevent Parsing some nodes in XML documents
Hello Everyone. I'm trying to use xml structure my pages. My problem was when I was embeding html into xml documents. adding ![CDATA[ html code ]] resolves problem for reading. And if I serialize any php array contains html code int xml problems repeating agin. So ? I'm asking is there any way to mark some xml nodes to prevent parsing? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php framework vs just php?
Hello there, Is anyone looking jQuery recently ?. Thas what I call framework... You are really doing tons of things with much less code. And jQuery was javaScript thingy and in php world nothing was comperable. My toughts about php frame work was; All those frameworks claim their way was perfect for making love. And I say, I'm 34 years old, and I got enough knowladge to how to make love. And with this work load I need someting to help me make love with 3 womens at a time. So ? if any of you frameworks can help me you are welcome. Otherwise please leave me alone. I had enough problems and I don't want to learn new vays to stuck around... Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: optimilize web page loading
My method was. Store into global thingy. Then echo very end of the page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Weird Zend IDE Issue
On Monday 03 March 2008 07:07:18 Steve Finkelstein wrote: Hi all, I know this isn't a forum for Zend IDE, but since there's probably a decent population here using it, I figured I'd ask away. I'm using 5.5.1 Professional on Mac OSX 10.5.2. My issue here is that all left brackets, (eg: [ ) are not showing up in the code editor. I have a screenshot of it here: http://catalyst.httpd.org/zend.png Has anyone ever experienced anything similar? Thank you, /sf Hello, My bet was, problem on highlight syntax. Please copy paste the text another editor if [ was there you may ecounter syntax higlighting error Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Call PHP script from MySQL
Hello, you may call external php script someting like that $val = asp's_fopen(http://www.example.com/calculate.php?var=password_field); php // calculate.php echo correct hash (vpopmail); ? Regards Sancar On Wednesday 20 February 2008 01:58:48 Mário Gamito wrote: Hi Nathan, Is it possible to call from within MySQL an external PHP script ? I've read MySQL Stored Procedure Programming from O'Reilly but found nothing :( I'd really like to see an example of why you need this functionality, if that'd be okay. Not to judge, just to learn :) I'm inserting values in a Linux/MySQL table from an ASP.NET/C# page. I need to insert the password field with the correct hash (vpopmail). So, after the first insert leaving the password field blank, I need to invoke a PHP script that calculates the hash and then insert it. Warm Regards, Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Hello, I vote for Typo3 template system. If you work bunch of HTML only designers this one best. If you have some php avare designers, you should go with php based + memcached template systems. Second option was much faster anything else. Just store the template into memcached and do some str_replace. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
On Tuesday 12 February 2008 16:06:04 Stut wrote: Sancar Saran wrote: Hello On Tuesday 12 February 2008 13:39:19 Stut wrote: I'll be using memcache as a simple cache. I hate sessions and avoid them for anything but the most trivial sites. The main sites I work with no longer use sessions because they add a pointless layer of complexity to any application that need to scale beyond a single machine. Maybe I'm just lucky that the applications I develop don't need to store huge amounts of temporary data during a visit, but I'm yet to come across a reason to use session data. -Stut May I ask how can you record the state ? You may. Oh, you probably want an actual answer... ok. The only 'state' I really need to keep track of is a few details about the logged in user (ID, username, etc). These get encrypted and get passed around as a single value in the same way PHP manages the session ID (cookie or embedded in the URL). The encrypted value is time limited and gets updated on each request. Clearly there is a limit to how much info can be stored like this but after some analysis of how the site worked I reached the conclusion that most of the crap that was being put into the session was not required from request to request and could be retrieved from the DB when it was needed. This has been running on a site with 1 million unique users a month for over 6 months with no issues. I now use this system with most sites I get involved in and am yet to find a valid reason to replace it with a traditional session. Part of the reason this works is that in the few parts of the site where it would make sense to use a traditional session to temporarily store data it does it in a table in the database. This is essentially a SQL-based session but with one important difference... DB hits are limited when they are needed only - i.e. when the user is using those parts of the site. With a SQL-based session you cause 2+ DB hits for each request even if you don't actually use the session. This is bad m'kay! Over the past few years I've learnt a lot about scalability and the single biggest tip I can pass on is to only do what is absolutely necessary at any given time. Sessions are the biggest barrier to being able to do that, so they had to go. Hope that answers your question. -Stut Yes Thanks much :) Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Hello For poor man's multinode, ADODB offers Sql based sessions, it was good enough for starters. Of course memcached based session storage was an option. But with this model need better implementation. Memcached was just cache, there was no offical way to backup data. (as far as I know) Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Hello On Tuesday 12 February 2008 13:39:19 Stut wrote: I'll be using memcache as a simple cache. I hate sessions and avoid them for anything but the most trivial sites. The main sites I work with no longer use sessions because they add a pointless layer of complexity to any application that need to scale beyond a single machine. Maybe I'm just lucky that the applications I develop don't need to store huge amounts of temporary data during a visit, but I'm yet to come across a reason to use session data. -Stut May I ask how can you record the state ? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
On Tuesday 12 February 2008 00:45:59 Michael McGlothlin wrote: implement session_set_save_handler() with a database, or ideally, memcache. I use memcache with a secondary db backing. Works pretty well. I use it for session data as well as any other uses I want to make of memcache. Memcache makes it fast and using the db makes it more persistent and able to handle larger chunks of data. -- Michael McGlothlin Southwest Plumbing Supply Hello I really really interesting about this SECONDARY DB BACKING. Could you lead me a document, article, ANYTHING to backing up memcached into anything ? Last time it when I was try it, it was huge disaster. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 128M need in PHP5.2.5 instead of 8M in PHP5.1.4!
On Thursday 24 January 2008 17:44:03 Luc Maltier wrote: Hello! My first message: I've just updated PHP from 5.1.4 to 5.2.5 (to solve an Apache problem when double-clicking on links). This was successful, as the problem is now solved, but I now, sometimes, get a message stating that the memory is exhausted. I modififed php.ini and set memory_limit to 16M (instead of 8M with PHP5.1.4), then 32M, then 64M, with the same message. With 128M, it works. Can this change in memory required be considered as normal? I don't think so... Is there any explanation? If you are used data which serialized by older versions this may lead memory leaks. Remove all caches etc then try. Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re[PHP] gister_globals
On Wednesday 16 January 2008 15:33:04 Jochem Maas wrote: tbt schreef: Hi, I'm a newbie to php and i would like to set register_globals to 'on' from my php script itself(eg:- index.php). Is there any way of doing this. you think you would like that. but you are wrong. register_globals is a security risk in the hands of someone who doesn't know exactly what they are doing. besides which register_globals is depreciated. also you can search the list archives for lots of posts that explain why register_globals is evil. learn how to write your script without using register_globals - ask here if you get stuck (but don't forget the manual!). Thanks Hell frezezer over. Me thinks regsiter_globals are evil too. And what about this session_start(); $_SESSION['refString'] = $_GET['refNo']; Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re[PHP] gister_globals
Hello Hell frezezer over. odd verb. but I get the message. indeed it's seem it hath freezeth nicely. Me thinks regsiter_globals are evil too. And what about this session_start(); $_SESSION['refString'] = $_GET['refNo']; what about it? 1. you mean the fact that the GET val is not sanitized? 2. or the oddness of 'refNo' becoming 'refString' (is it a string, a number, superman)? 3. or the direct use of $_SESSION and the lack of specific session cookie settings? 1. is evil, 2. is odd and 3. is a change recommendation ... if you ask me. 1. 2. Orginal Code ?php session_start(); session_register(refString); $refString = $_GET['refNo']; ? 3. Could you explain a bit or re direct me a document about this ? Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uh oh, I defined a resoruce
Hello Jochem, no not in the slightest. both those bits of code are identical for one (apart from the fact that neither are valid syntax). and whatever your trying to point out it's beside the point (I think). any possible race condition will be occuring with the code that *sets* data into memcache (or whatever). I don't claim to know everything there is no know about race-conditions but you can very easily program them into a php app that's for sure. please do some reading on the matter (e.g. google 'memcache+race+condition') - I'm quite sure you'll find some interesting material - I know I did (just now) Of course, my recent project uses heavly on memcached and race conditions are blown. So I have to implement some kind flag system to avoid race conditions. And in same project I use $GLOBALS-['mc'] for storing memcached resource object. and if I was use to store some kind of data in $GLOBALS i use $GLOBALS['data'][] = $some_data; And of course without proper handling. You can blow yourself... Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uh oh, I defined a resoruce
On Sunday 13 January 2008 16:53:42 Jochem Maas wrote: Sancar Saran schreef: Well, ADODB and TYPO3 are successfull oss procjecs which uses PHP and they utilizes globals at large. windows is a successful OS but most people would agree it's built on a foundation of cruft. success != built with good code != globals are good practice. Regards. Sancar Hello there, After some research, I found source of the Globals are evil. This was coming from common c and c++ practice. In this enviroments using globals leding to race conditions which was very hard to resolve. and uh oh, that php thing was using share nothing perspective. No race condtions. except variable crashing. From my point of view. After 8 years of php programming only one time face the variable crashing. And that was a local variable called $i. Of course your millage was vary... Regards Sancar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uh oh, I defined a resoruce
On Sunday 13 January 2008 21:42:28 Jochem Maas wrote: no race conditions occur in code written in php? true that there is no direct race conditions that can occur as a direct result of running code but obviously you've never dealt with multi-user systems using a databse backend, or file-writing based tools used in a web-environment (e.g. template output caching) or anything that uses shared memory or trying to guanrantee that a command-line script runs as a singleton. to name but a few examples that can most definitely be prone to race-conditions. Hmmm interesting so you mean $GLOBALS['language'] = memcached-get('language'); race condition prone than function hede() { global $language $language = memcached-get('language'); } Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uh oh, I defined a resoruce
Well, ADODB and TYPO3 are successfull oss procjecs which uses PHP and they utilizes globals at large. Regards. Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Byte Size of an array
Hello, I just wonder to how can I find a memory size of an array. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way for PHP page
On Wednesday 02 January 2008 09:17:50 Alain Roger wrote: Hi, i would like to improve my coding quality when i use PHP code and for that i would request your help. in my web developer experience, i have to confess that i've never succeeded in spliting PHP code from HTML code. i mean that all my web pages consist of PHP code mixed with HTML code (for rendering pages). Some developers tell it's possible to write only PHP code for web page. i agree with them but only when those PHP pages do not render web elements (write text, display pictures, display formular, ...). the purpose of my post is to know if i can really (at 100%) split client code (display images, write text,...) from server code (move or copy data to DB, create connection objects,...) so what do you think about that ? Hello, I believe TYPO3 has good implementation about splitting code and template. And to archieve clean php code. 1-) Left html ?php echo $this; ?/html model development 2-) Find good template engine. (no not that smarty, it was too big) 3-) use strict dicipline to move html to outside of the code. Also if you can use the php based template files you can lift off the template overhead. like. template.php $strPage = html head. title.$strPageTitle./title /head body table tr td.$strLeftBlock./td td.$strRigthBlock./td /tr /table /body /html; process.php $strPageTitle = getPageTitle($_REQUEST['page']); $strLeftBlock = getPageBlock($_REQUEST['page'],'left'); $strRightBlock = getPageBlock($_REQUEST['page'],'right'); include('template.php'); echo $strPage; regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opinion about the using $GLOBALS directly
Hello Tedd, Here my opinoins First of all, I ask this question to is there any technical dead end for using $GLOBALS directly. It seems not. And I believe other arguments was closely connected to coding style. I'm self learner, I learn evrything about computers, programming (that means PHP) and English by myself. Because of this time to time I found my self into very alien position for others. On Monday 24 December 2007 19:13:07 tedd wrote: At 4:18 PM +0200 12/19/07, Sancar Saran wrote: that said, avoid globals like the plague - sometimes you may come up with a situation where using a global is really necessary - such situations should be the exception rather than the rule, often if your thinking of using a global there is another way of doing it. jmho And this is why I'm asking here, WHY I should avoid globals like plague ? Every one says bad. Alright, but no one says WHY ? Hi: I'm a little late to this thread (been busy), but this is why I rarely use globals and have not used them in php. One of the fundamentals of programming I've learned is to reduce problem/solution to their most basic form. Simply, you see a problem and you solve it by dividing the problem it into smaller parts and then writing code to solve the small parts. Eventually, all the small solutions come together to solve the larger problem. Absolutely. I learn this from very hard way. (rewriting the code :)) Certainly, and it seems even logical, that you can use a global variable to communicate between the different parts and everything should work -- IF -- that's all there was to it. But, if you have to debug the code OR if you want to use a portion of that solution to solve a different problem, then you can have difficulties. For example: [1] If you have to debug the code, there's not a really good way to look at a function and see if a variable in it is a global or not -- therein lies a problem, you don't readily know. In other languages I adopted a naming convention that used g as the first letter of a Global variable, like gThisIsMyGolbalVariable -- that way at least I knew the variable was global. But, even then I didn't know where the global was defined or where it might be changed -- it was just an unknown in my function that I had to consider. $GLOBALS['myVariable'] directly solves the problem. [2] If you want to reused a portion of the code, then you have to also accommodate the global. This makes transporting your code from one application to another problematic because you never know IF your function replies on a global or not. If you never use globals, then that's never a problem. If is there any possibility to use the function with some other variables I use it to. So, my advice is to not use globals, but rather make the functions independent from globals. That way you troubleshoot them easier and can cut/paste them into other solutions without having to worry if some part of that function relies on something who knows where. That's my reasons why I avoid globals. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Here Some basic list for my $GLOBALS usage. $GLOBALS['db'] = my Adodb object $GLOBALS['mc'] = my Memcached object $GLOBALS['l'] = my Language keys $GLOBALS['d'] = my debug pool. $GLOBALS['c'] = my config array. And someting like that. A very basic function for pooling debugs. function addDebug($_sDebugVal) { $GLOBALS['d']['_DMSG'][] = $_sDebugVal; } usage addDebug($MyVar); or addDebug(print_r($arrayFoo,true)); end of page getDebug() { return $GLOBALS['l']['_debug_messages_'].br/pre.implode(\n. $GLOBALS['d']['_DMSG'])./pre; } Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opinion about the using $GLOBALS directly
example code // current code //--- Set DB $GLOBALS['db'] = NewADOConnection($GLOBALS['c']['db']['type'].'://'. $GLOBALS['c']['db']['user'].':'.$GLOBALS['c']['db']['pass'].'@'.$GLOBALS['c'] ['db']['host'].'/'.$GLOBALS['c']['db']['name']); $ADODB_FETCH_MODE = ADODB_FETCH_NUM; // Fastest Get Method function getGalaxy() { $sqlGGal = SELECT * FROM .$GLOBALS['c']['db']['pref'].universe WHERE planet_type = 'planet' AND planet_galaxy = '1' AND planet_owner_id = 'null' ORDER BY planet_id ASC; $GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC; $resGGAL = $GLOBALS['db']-Execute($sqlGGal); return $resGal; } Other Suggestions function getGalaxy() { $dbPrefix = $GLOBALS['c']['db']['pref']; $db = $GLOBALS['db']; $sqlGGal = SELECT * FROM .$dbPrefix.universe WHERE planet_type = 'planet' AND planet_galaxy = '1' AND planet_owner_id = 'null' ORDER BY planet_id ASC; $GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC; $resGGAL = $db-Execute($sqlGGal); return $resGal; } or function getGalaxy() { $dbConfig = Zend_Registry::get('dbConfig'); $dbPrefix = $dbConfig['prefix']; $db = NewADOConnection($dbConfig['type'].'://'. $dbConfig['user'].':'. $dbConfig['pass'].'@'.$dbConfig['host'].'/'.$dbConfig['name']); $sqlGGal = SELECT * FROM .$dbPrefix.universe WHERE planet_type = 'planet' AND planet_galaxy = '1' AND planet_owner_id = 'null' ORDER BY planet_id ASC; $GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC; $resGGAL = $db-Execute($sqlGGal); $db-Close(); return $resGal; } Etc etc. From my point of view first one was more usable. Anyhow dont worry. It seems PHP 5.3.0 supporting _NAMESPACE_ :) Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opinion about the using $GLOBALS directly
Hello All, Thanks for joining the conversation. It seems there where no real technical dead end for using $GLOBALS directly. Using $GLOBALS directly very similar to coding standarts. It just up to you. Also I try explain my enviroment a liddle bit. First of all my function declarationgs gonna like this // Set Shorcut Variables $arrConf = $GLOBALS['_LIVE']['_CONF']; $arrStat = $GLOBALS['_LIVE']['_STAT']; $arrDomSet = $GLOBALS['_LIVE']['_DOMN'][$GLOBALS['_LIVE']['_STAT']['curDom']] ['settings']; $arrLang = $GLOBALS['_LIVE']['_LANG'][$arrStat['language']]; $rootDir = $arrConf['rootDir']; $webDir= $arrConf['webDir']; $arrDb = $arrConf['_DB']; $arrDbg= $GLOBALS['_LIVE']['_DEBG']; It grows and grows. And some times in small functions, function declarations become larger than the function actual code. Most of those GLOBALS usage are read only (like configuration variables, or stored language keys) or need to update anywhere in the system. And unde one condition it may become problem. If 3rd party users develop some code under my enviroment and if there where some change about GLOBALS['name'] or PHP core developers may change GLOBALS to GLB (or someting like that) there may problem to update 3rd party code. To prevent this, putting some variable translation functions for 3rd party developers was good idea. Other than this for my point of view it was very useful. Thank you very much all of you. Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Opinion about the using $GLOBALS directly
Hello list. I want know to you opinions about using $GLOBALS directly. like $GLOBALS['myString'] = 'test'; $GLOBALS['myArray']['this'] = 'this'; $GLOBALS['myArray']['that'] = 'that'; $GLOBALS['myClassObj] = new SomeClass; Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opinion about the using $GLOBALS directly
Hello Jochem, Thanks for response, I'm using this aproach maybe more than one year. I did not get any problems. there is no real difference between 'global $foo' and $GLOBALS['foo'], and the second is probably more maintainance friendly (as Rob pionted out) Yes you are right writing global $foo in 25+ functions a bit problematic. that said, avoid globals like the plague - sometimes you may come up with a situation where using a global is really necessary - such situations should be the exception rather than the rule, often if your thinking of using a global there is another way of doing it. jmho And this is why I'm asking here, WHY I should avoid globals like plague ? Every one says bad. Alright, but no one says WHY ? I try to use alternative ways. But maintenance, complexty and speed costs much too high. I did not see any benefit. Robert Cummings says to you may confusing to setting variable. I have some debugging methots to detect this. And Of course I did not use someting like for($GLOBALS['i']=0; And I use GLOBALS for everything for I need someting more than once. (Db pointer or config array etc). Thanks for response Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP on .NET DLR
Hello there, Once upon a time I try to ignite PHP community to develop some kind of client side php, which failed, because lack of interest (or because of javascript). In open source world everthing boosted from personal interest. Hi, Thanks for chipping in. Silverlight is not a fad, because it is simply an outgrowth of a platform that is 10 year old--the .NET. Technology wise, it is merely java applets in XAML format. But it provides people already working on .NET an easy way to create the gui. Silverlight's most important feature is that it is based on MS's greatest strength--the Desktop. You mean enterprise mumbo jumbo (read as over engineered perfect world (theorically)) My point of wiev Php can deal on enterprise sector with proper handling. (read as we had tons of big bad busy websites based on php) And it doesn't mean PHP have to respond windows desktop development language requests. Recapitulating: a) We have a 10 year old platform the .NET, which while not optimal presently, is still being used by a large number of developers. Hmmm I believe LAMP much older than this, so what is the point ? and you thing after inroducing php for windows desktop all of those developers penitent to their c# or vb sins ? b) Now, MS has finally given them something that can leverage MS's 25 year Desktop experience. Hell who cares Ms Desktop Monopoly ?. Because of MS Desktop Monopoly we had that IE thing. Probably because of IE thing coming of Ajax maybe late 5 years. Entire Web Thingy wants to broke MS Desktop Monoply. Of course if MS supports PHP in .NET enviroment for Desktop applications would be nice and ask yourself is Why MS had to do this... ? PHP was one of the strudiest Open Source project which MS cannot deal. c) PHP can _trivially_ take advantage of both of them--all that's needed is to have the community show interest in phalanger, and not let it die. Also, the DLR makes porting Dynamic languages very trivial. IT only took MS a couple of months to get Ruby on DLR. If I want to develop big bad nasty desktop thing why should I use PHP and or what is PHP GTK populartiy... I did not remember anthing big written in php for Desktop. d) Ruby--now with silverlight--has everything that PHP has--cross platform, dynamic, web ready, and now it has become even more compelling, because of PHP community's hostility towards the DLR. Ruby has Rails, ruby has iron oh no ruby has now silver light. It seems Ruby does not mean anything by himself. We just had PHP and it seems more than enough to developing dynamic web sites under LAMP enviroment. e) There are a 1000 other benefits to getting PHP on dotnet. One is that many VB folks who are used to the procedural style of the old VB6, would start loving PHP and will move to it, considering how complex and different VB.net is from VB6. PHP on .NET has a 1000 reasons. Phalanger is already there. Why are you letting it die? Thanks again for your input. Basically. Most of us want to generate bad websites to generate some revnue, Some of us want develop very nasty web applications to replace desktop applications. Or Developing desktop application was not fun only for bread. Deskop development area infested by M$ tools and M$ tranied developers. We cannot compete against MS with MS rules. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Articles or News Management Systems
Thanks :) It was helpfull, very intersting cms design plus it gives lots of idea bout document management. Also, I had my own cms design alredy, and it was very capable. Probably I ask wrong question. Maybe I ask is there any standarts or examples for document management system. For example, How can store the document elements. ? Shall I do secondary store for document in xml format ? What is the best possible way to store document elements to gether. (Images, Flash files, probably pdf and word docs? For example /category/subcat/subcat/documentTitle/document.xml /category/subcat/subcat/documentTitle/document.xml /category/subcat/subcat/documentTitle/document.xml /category/subcat/subcat/documentTitle/document.xml On Wednesday 08 August 2007 03:49:25 Chris wrote: Sancar Saran wrote: Hello List, I'm going to add some kind of articles system into my cms. General aim of this articles system have unlimited branches (or sub categories), each branch may own editors or writers. I'm looking for current imlementations of this kind of systems. Does anyone suggest a system to have good abilities about this issue also I'm looking for any standats about this issue. There are no standards for this stuff - each cms has it's own idea about how to implement cascading permissions (if they have them at all - most have general permissions and don't limit per category/subcategory). One I know that does is http://matrix.squiz.net/ - however the installation is painful and trying to understand the app interface is even worse. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Articles or News Management Systems -- Full Message
Sorry, I made mistake to send half message Thanks :) It was helpfull, very intersting cms design plus it gives lots of idea bout document management. Also, I had my own cms design alredy, and it was very capable. Probably I ask wrong question. Maybe I ask is there any standarts or examples for document management system. For example, How can store the document elements. ? Shall I do secondary store for document in xml format ? What is the best possible way to store document elements to gether. (Images, Flash files, probably pdf and word docs? For example /category/subcat/subcat/documentTitle/document.xml /category/subcat/subcat/documentTitle/gfx1.jpg /category/subcat/subcat/documentTitle/gfx2.jpg /category/subcat/subcat/documentTitle/pdf1.pdf Or Shall I use full sql based storege (for binary content ?) My current focus was creating and managing documents. Displaying them also another mini project. Regards Sancar On Wednesday 08 August 2007 03:49:25 Chris wrote: Sancar Saran wrote: Hello List, I'm going to add some kind of articles system into my cms. General aim of this articles system have unlimited branches (or sub categories), each branch may own editors or writers. I'm looking for current imlementations of this kind of systems. Does anyone suggest a system to have good abilities about this issue also I'm looking for any standats about this issue. There are no standards for this stuff - each cms has it's own idea about how to implement cascading permissions (if they have them at all - most have general permissions and don't limit per category/subcategory). One I know that does is http://matrix.squiz.net/ - however the installation is painful and trying to understand the app interface is even worse. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Articles or News Management Systems
Hello List, I'm going to add some kind of articles system into my cms. General aim of this articles system have unlimited branches (or sub categories), each branch may own editors or writers. I'm looking for current imlementations of this kind of systems. Does anyone suggest a system to have good abilities about this issue also I'm looking for any standats about this issue. It seems there where JSR-170 spesification about content reposity. I do not find anything than RFC (which is beyond my understandability). Is there any other documentation (php implementation(it seems there where phpcr.org and I cannot connect it)) And Or is here any suggestion or wish list about this kind of system... Regars Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Authentication script working in firefox but strange results in ie7
Hello , Those code doesn't mean anything to client browser, you may session cookie problem. Please check php.net online manual about it. Regards Sancar On Saturday 04 August 2007 18:20:49 Brian Seymour wrote: I mostly use Firefox but still I check to make sure everything works in IE7 and other browsers equally as well. I had strange results here. I have a simple login form(user/pass field and submit button). I have the actual login request script in a common php file. I have an Authentication class that handles my auth stuff. With the code the way it is, it works perfectly in firefox. However, in IE7 when you log in it shows the restricted stuff but as soon as you navigate anywhere else you no longer have access. If you login again then it works fine just like the first time you logged in using firefox. Now if you change $_SESSION['uid']== to !isset($_SESSION['uid']) then it works perfectly on both browsers. Anyhow, rifle through the code -- just something to think about. Anybody else have a similar issue before? Web Code: Restricted stuff: ?php if ($_SESSION['uid']==){ $ops-postLogin($e); }else{ ? Logged in stuff(Restricted stuff) ?php } ? Common snippet: if ($_POST[action]==login){ $auth = new Authentication($host,$user,$pass,dbname,http://aerocore.net/;); if ($auth-verifyCreds($_POST['username'],$_POST['password'],base_contributor s ,id)) { $_SESSION['uid'] = $auth-retId; $auth-failSafe(); break; } } Authentication: class Authentication extends SQL { public $errorMsg; public $retId; public $clean = array(); public $fail; public function __construct($host,$user,$pass,$dbname = null,$fail) { parent::__construct($host,$user,$pass,$dbname = null); $this-fail=$fail; } public function failSafe() { header(Location: {$this-fail}); } final public function sanitizeLoginCreds($user, $pass) { $this-clean['username']=strip_tags($user); $this-clean['password']=strip_tags($pass); if (!ctype_alnum($this-clean['username'])){ $this-clean['username']=; } if (!ctype_alnum($this-clean['password'])){ $this-clean['password']=; } } final public function verifyCreds($user, $pass, $table, $retVal = null) { $this-sanitizeLoginCreds($user,$pass); //$this-result = $this-query(SELECT * FROM $table where username='{$this-clean[username]}' and password='{$this-clean[password]}'); if ($this-fetchNumRows(SELECT * FROM $table where username='{$this-clean[username]}' and password='{$this-clean[password]}') == 0) { $this-errorMsg = Incorrect Username/Password Combo; $this-failSafe(); return false; } else { if (isset($retVal)) { $this-retId = $this-fetchArray(SELECT * FROM $table where username='{$this-clean[username]}' and password='{$this-clean[password]}'); $this-retId = $this-retId[$retVal]; } return true; } } final public function secureLogout() { $_SESSION = array(); session_destroy(); $this-failSafe(); } public function __destruct(){} } Brian Seymour Zend Certified Engineer AeroCoreProductions http://www.aerocore.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I'm prepared to feel like an idiot... But I just simply need the answer :)
On Wednesday 01 August 2007 17:46:44 Brad Bonkoski wrote: Hi, Please Check php.ini of cli. They are different. Maybe there where problem in php.ini Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Authentication
On Friday 27 July 2007 20:51:51 Dan Shirah wrote: All, I looked on PHP.net but I couldn't not find anything suitable to answer my question. Within PHP, is there a way to pull the name of the user that is currently logged into the PC? I know with some of the _SERVER functions you can pull the IP of the machine and other data, is there a function within this family that would work? Thanks, Dan Not sure and not tested. If my memory correct there where some options in AD login scripts to update dns records of current machine. So if you can update logged machine dns records with containing current user information. You may retreive that information from dns. Otherwise (except Activex solutions) there is no other way to pull this kind of information from client. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pirate PHP books online?
This is sucks, Those publishers ripping the authors then they blame the pirates... Real steal was %95 of book prices Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pirate PHP books online?
On Monday 23 July 2007 12:20:50 David Powers wrote: Sancar Saran wrote: Those publishers ripping the authors then they blame the pirates... Real steal was %95 of book prices No, the author gets 10% of what the publisher gets. If you look at prices on Amazon or other online bookstores, you'll see that 35-40% discount is common. So, a $40 book often sells for $26 or less. Delivery within the same country is frequently free, so that's a cost that gets deducted. Amazon also pays a commission to websites with affiliate links. So the publisher ends up with less than $20. Publishing a book involves a lot of people: not just the author, but at least one technical reviewer, editor, copy editor, indexer, compositor (who lays out the pages), designer, and printer. Printed books also need to be transported and stored. The costs quickly mount up. EBooks are cheaper to produce because there's no cost for printing or storage, but a professionally produced eBook still takes a huge amount of human effort. Unfortunately, an eBook is very easy for a pirate to rip off. The danger with piracy is that authors will be discouraged from writing, and in the end everyone will be worse off. David Powers It was still ripping, They got 18 USD you got 2 USD. This is sucks. I'm not sure author of Harry Potter acceps same condition. You made everyone rich except yourself... Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pirate PHP books online?
Hmmm PHP: Order of Objects PHP: Deadly functions Oh never mind. I think we still missing the point main purpose of those books spreading the information. The other things have to come second. Only editor was you. Without you all of them useless. I thing they set up good game here. You believe all this mumbo jumbo to generate and bring your content to people. Ironically publishers can't bring your content much more people than pirates. On Monday 23 July 2007 14:00:31 David Powers wrote: Sancar Saran wrote: It was still ripping, They got 18 USD you got 2 USD. Out of that $18, the publisher has to pay the editor, copy editor, technical reviewer, compositor, printer, etc, etc. Unless the book sells several thousand copies, the publisher normally makes a loss. I'm not sure author of Harry Potter acceps same condition. The Harry Potter books have sold an estimated 325 million copies. Even if the author gets only 10 cents a book, that adds up to $32.5 million. I'm sure she gets a lot more than 10 cents a book, but it's the number of books sold that makes the real difference, not the amount per book. Harry Potter also generates a lot of money through Hollywood movie rights. It's hard to imagine the same with a book about PHP. ;-) You made everyone rich except yourself... I don't mind others making money out of my books, as long as they have contributed to them in a positive way. Publishing books involves a lot of people. They all need to be paid. The publisher takes a gamble, paying everybody up front before a single copy is sold. Since most books make a loss, it's reasonable for the publisher to take a share of the profit of successful books. As far as an author is concerned, the deal lies in royalties. The more books you sell, the more you get. I also get a higher share of the profit if the book sells more than a specified amount. David Powers Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Performance and System Load
Hi, What is your desired performance level on what kind of hardware. Have look memcached, General performance tip do not include more than 10 files a page load. I had CMS project too. Sometimes it uses 10 MB of php memory (generally uses 3 mb of php memory). It uses Memcached in every way possible. Uses php Adodb for sql connection. Uses SQL based sessions. Except the external libs (adobs, php sniffer, phpmailer etc) no object method used. Also we had language, template support. Generally be able to pump 5-7 pages per second on intel PII 350 mhz 320 mb ram IDE hdd. If I remove XSS detector (auto check for every member of $_REQUEST array). It can reach 9 - 10 pages per second. My Experiences Looping around sql is bad. Reading large flatfiles bad. Processing large texts are bad (Templating, Lots of preg replaces). If any of those operation was write once read many, store to memcached, then use it. Another simple performance tip. Most of for examples of php look like this for($x=0;$xsizeof($arrSometing);$x++) This is bad. In every cycle you call sizeof this was good $intSize = sizeof($arrSometing); for($x=0;$x$intSize;$x++) if u use. for($x=0;$x$intSiz;++$x). You may gain another %10 to determine costs of your functions use xdebug and kcachegrind. Hope Helps. Regards Sancar On Friday 20 July 2007 10:25:47 Sascha Braun, CEO @ ejackup.com wrote: Dear People, I developed a very large Application, which has at the moment strong performace problems, while pages are loaded. At the moment I am trying to lower the number of filesystem calls as much as I can. I was able allready to lower the rate of filesystem calls from round about 260 calls, which normaly included database calls each time as well. Now a page loads with round about 36 Filesystem and database calls, so a improvement could really get established. Now, as I might have imagined, the next problem is the object model of the application which was very flexible in the past two years. But now over time, for example the content management class grew up to 400 Kb which is for a web application hell of a lot. But it seems it is the only class at that enormous size. I am using the PHP5 autoload functionality exclusive, so no other way of loading classes is getting used. No I started to come in mind of, splitting the cms class into smaller potions. Will it really improve the page load, or will the object ini- tialisations of the new appearing mass of classes have the same effect as a class, stored in the eaccelator cache with a memory consumtion round about 400 Kb? Another question is, that I started to include my application framework over a symlink placed in every webspace directory. I've read somewhere that linux needs time to resolve a symlinks target. Can this be a real performance issue? All datasets as well as images, modules and all application relevant informations are loaded from that symlinked place at the moment. The webserver does only contain the webspace filesystem structure as well as 5 line of PHP Code dummies, for every document in the content management system, to avoid the usage of mod_rewrite. It would be really wonderfull, to be able to discuss my questions with you people here :)) Best Regards, Sascha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best technique to get the ID of the last inserted value
On Friday 20 July 2007 21:10:28 Marcelo Wolfgang wrote: Hi all, I'm a newbie in PHP, and I want to know what's the best technique you guys use when you need to get the id of the last inserted value in the database. My first thought is to do a SELECT on the db and get the last id, but I know that if I have two almost simultaneous connections I may get the wrong one, so that's the why of my question. TIA Marcelo Wolfgang Hi, Insert temp then update . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Performance and System Load
Hi, I had lots of loop in my code. My gain was %4 to %6 and I say may gain another %10. Of course your millage was different than me Regards Sancar On Saturday 21 July 2007 01:03:45 Richard Lynch wrote: On Fri, July 20, 2007 4:16 am, Colin Guthrie wrote: Sancar Saran wrote: Another simple performance tip. Most of for examples of php look like this for($x=0;$xsizeof($arrSometing);$x++) This is bad. In every cycle you call sizeof this was good $intSize = sizeof($arrSometing); for($x=0;$x$intSize;$x++) if u use. for($x=0;$x$intSiz;++$x). You may gain another %10 to determine costs of your functions use xdebug and kcachegrind. I've always used pre-increment in loops like you suggest as it was an ingrained part of my C/C++ learning from a performance perspective. I wasn't sure if the same was true in PHP but you seem to suggest it is, so I feel justified now :) I don't really care if one uses pre or post, but I just benchmarked this, and I don't really think it makes a 10% win. And I had to crank it up to 10 MILLION to get any kind of realistic measurable time in the first place. How often do you have a PHP loop that runs to 10 MILLION iterations?! Note that I did three with pre before post tests and three post before pre tests to even out any caching effects. Test environment details at the bottom. [EMAIL PROTECTED] ~/junk $ cat pre.php post.php ?php for ($i = 0; $i 1000; ++$i); ? ?php for ($i = 0; $i 1000; $i++); ? [EMAIL PROTECTED] ~/junk $ time php -q pre.php ; time php -q post.php real0m5.422s user0m5.350s sys 0m0.070s real0m5.397s user0m5.330s sys 0m0.070s [EMAIL PROTECTED] ~/junk $ time php -q pre.php ; time php -q post.php real0m5.164s user0m5.090s sys 0m0.070s real0m5.310s user0m5.230s sys 0m0.080s [EMAIL PROTECTED] ~/junk $ time php -q pre.php ; time php -q post.php real0m5.093s user0m5.030s sys 0m0.070s real0m5.387s user0m5.300s sys 0m0.080s [EMAIL PROTECTED] ~/junk $ time php -q post.php ; time php -q pre.php real0m5.429s user0m5.340s sys 0m0.070s real0m5.140s user0m5.060s sys 0m0.080s [EMAIL PROTECTED] ~/junk $ time php -q post.php ; time php -q pre.php real0m5.348s user0m5.270s sys 0m0.070s real0m5.101s user0m5.030s sys 0m0.070s [EMAIL PROTECTED] ~/junk $ time php -q post.php ; time php -q pre.php real0m5.376s user0m5.300s sys 0m0.080s real0m5.009s user0m4.910s sys 0m0.100s [EMAIL PROTECTED] ~/junk $ php -v PHP 4.4.7 (cli) (built: May 8 2007 09:49:19) Copyright (c) 1997-2007 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies [EMAIL PROTECTED] ~/junk $ uname -a Linux ch10106cus002 2.6.18-hardened-r6 #2 SMP Tue Apr 17 09:15:05 CDT 2007 i686 Dual Core AMD Opteron(tm) Processor 270 AuthenticAMD GNU/Linux [EMAIL PROTECTED] ~/junk $ Perhaps the OP meant that not doing the count() / sizeof() on every iteration was a 10% win? Now *THAT* I can believe! -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
I believe, we are here for solving problems. Pirating has very very long history. Even Julius Ceasar (hope I wrote correct) can't defeat them. On other way modern life style steals other species resources. Does anyone feel guilty about this ? Also you may want know, more than 4 billion of human poplulation of world can live with 10 USD per day, 2 billion of them only earn 2 USD per day. Yes this is sad, and fixing this is beyond the our abilities. So could we start to focus more resolvable topics please ? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pirate PHP books online?
http://www.thepiratebay.org On Monday 16 July 2007 14:42:25 Dotan Cohen wrote: On 16/07/07, Austin C [EMAIL PROTECTED] wrote: Dont be so harsh. I used to torrent PHP books, and everyone I turrented, I ended up buying from a book store so I could take it with me. So, that kind of stuff actually helped me. But, ive stopped torrenting now. I guess that I'm naive. I've gotten a few what's the address requests, but none from authors... So I'll just delete the address and not pass it on. Like said earlier in the thread, it can be easily googled. As everybody (including M$, excluding RIAA) seems to support the pirates with they won't buy it anyways I guess that I really am a sucker for being the one who pays for the books. I'm paying for everybody, no? So, suckers, I'm with you now, and I'll start pirating again. Anyone know where I can pick up a copy of Ubuntu pirated? I still refuse to use Windows, even for free... Dotan Cohen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Announcing Xaja, a PHP Reverse Ajax framework
On Saturday 14 July 2007 15:01:13 David Négrier wrote: Hi I just watching your screen cast, it has very good ideas. I wonder does any other language has same kind of aproach. Later or sooner this kind of aproach become must in web business. Regards Sancar. Indeed, Xaja relies on the keeping of an open connexion between the server and the browser. In fact, it uses, the Comet approach (which is a pain to implement in Javascript because the IE code and the Firefox code are completely different). (more information here: http://www.thecodingmachine.com/cmsDoc/xaja/trunk/architecture.html) The whole idea behind Xaja is to built a complete framework on top of the Comet-like javascript library that will enable the developer to write as few Javascript as possible. So, indeed, through the XajaController object, we are implementing a data driven programming library on top of the classical request/response HTTP protocol. Regarding performances: Indeed, since a connexion is kept open for each browser, this consumes a few connexions on the server (that's not a big problem). Each process also takes some memory. Xaja is still in an early stage of development and I haven't had the opportunity to run a full performance test, but basically, right now, I can tell that a simple applications takes 5 Mo of RAM per client. Which means that for 100 concurrent users, you need 500 Mo of RAM on your server. Now, the vast majority of the servers have less than 100 concurrent users, and at this early point in the development cycle of Xaja, I wouldn't recommend installing Xaja on a server that has more than 100 concurrent users! ;) Regards, David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Persistent Objects
On Sunday 15 July 2007 19:58:09 Wesley Acheson wrote: Hi, At work we use Java so one thing is annoying me. Is there really no way to create a persistent object in PHP? As far as my understanding goes each object will be recreated on each and every request. The reason I was asking is I wanted to create a form object that would be used as follows. which would require recreating the from stuff three times at least Once for a JS file. Once for a HTML output. And once for Server side validation) Please note that the following is just an example off the top of my head the code to do this hasn't been written yet and the exact implemantation may be different. It would be much better to only create the object once. Hi, Normally you have to recrate your objects in every request. IN php universe everything was each request. Unless you do someting manually. Best way was shared memory storages, like memcached. you can use Memcached to store your objects (I'm note sure to store object in real or serialized). If you havent access memcached in your hosting you may try serialized object in sql or flat file. Also you can store our session with memcached or sql too. Also there where another shared memory storage around there (I forgot its name, plesae search archives of the list) It has much more capabilites than memcached and it has no packages (a bit difficult the install). Also if you have any php opcode chace please use it was very helpfull (especially APC) Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php