From chsnyder at gmail.com Sun Jan 1 14:59:27 2006 From: chsnyder at gmail.com (csnyder) Date: Sun, 1 Jan 2006 14:59:27 -0500 Subject: [nycphp-talk] [OT] number of files in a directory? In-Reply-To: References: <20051224184241.AEAC8670C20@mailspool3.panix.com> Message-ID: On 12/31/05, Marc Antony Vose wrote: > Hey all: > > First of all: Happy New Year! > > Secondly: I am rebuilding a site that was coded somewhat sloppily, > and they have product images all stored in one directory (a script > that I am not writing auto-uploads them to the web server from > elsewhere). Presently, this directory contains about 33,000 files. > It will be more like 75,000 when the site launches, if things remain > the same. > > The question is: should I be worried about this, or was this only a > problem several years ago? (I remember people at one time attempting > to not put too many files in one place.) > > If I should be worried, what could happen? Will we ever reach a hard > limit of files per directory? > > Is it better if each product instead has its own directory inside > there (i.e., 75,000 directories), each with as many files as we need > inside, or is that just the same problem? > > Cheers, > > -- > Marc Antony Vose > http://www.suzerain.com/ > Beyond possible performance issues, another thing to consider is scalability. If you're going to have 75,000 images at launch, how many will there be in 3 years? At the very least, having a year- or year-and-month-based directory structure will allow you to add new storage as it becomes necessary. So images/2005/ and images/2006/ can be on one partition, while images/2007/ is on another. -- Chris Snyder http://chxo.com/ From arzala at gmail.com Mon Jan 2 00:32:17 2006 From: arzala at gmail.com (Anirudh Zala) Date: Mon, 02 Jan 2006 11:02:17 +0530 Subject: [nycphp-talk] [OT] number of files in a directory? In-Reply-To: References: <20051224184241.AEAC8670C20@mailspool3.panix.com> Message-ID: Hi, # First of all, do not use word [OT] while discussing such important issues here, because this kind of problems/queries can be part of any programming environment. Seeing [OT] as subject of your query, will reduce chance of your replies upto 50%. # Anwyay straight to your point: => Never, as per my thinking, use only 1 location to store all your images or dynamic contents. Because it increases chance of serving your images slower, and it enhances threat of stealing them from your website without your information. => Another thing from your usage point of view is that: Storing all images at only 1 place will slow down serving your images to users, because I am sure you will have usage of php functions like "is_file" or "file_exists" in your script to check whether images actually exists or not before showing them to users. Reason is that when you have almost 100, 000 images at 1 place then above function will take lot of time then scanning 1000 or 5000 images if you store 1000 images in 100 folders approx. => Hence split number of images to be stored in each directory by 1000 or so, or consider usage of PRODUCT ID etc. i.e if you have 100 products, then strcture of your directory system will look like below. \..... \images \1 \RECORDID_SOME>10CHARACTERHASH.EXT (i.e 123456_aswe34567bg.jpg) \2 \RECORDID_SOME>10CHARACTERHASH.EXT (i.e 7890_aswertgyuionjui.jpg) \3 \....... \4 \....... .... => As above strcture says; under your main images folder "images", create folder according to "PRODUCT ID" and store images of number records by "RECORDID_SOME>10DIGITHASH.EXT". In your table/s of records, you will have unique "RECORDID" for your each record. We also need > 10 character hash as suffix of your images, so that stealers can not ever guess how many images you have in particular folder and if they want to hoover it by automatic script, they can't find what and where to search. But make sure that you will have approx 1000 to 5000 images in each product folder (i.e 1,2,3 etc). If you think number of images will exceed than that, then use slightly different strcuture, like factors of 100s. i.e 1_100, 101_200, 201_300 etc. But make sure that RECORDIF must fall in between factor of 100s i.e if your image name is like "7890_aswertgyuionjui.jpg" them it should go under "7801_7900" folder only. => Also disable Directory Index of main image folder "images" so that your server will not expose your whole directory structure to anyone who tries to access that folder directly from browser. Instead, server will generate error 403 (access forbidden). => Please note that by above implementation, do not worry if number of folder reaches > 1000, but numebr of files must be smaller or almost same in each folder, because going into any of 1000 folder and displaying any image from there is far more faster, when server is Linux as you said earlier, than displaying same image from haystack of 1000 X 1000 images. => Another suggestion is, if your website is going to have faster movement of records like at a time only 50000 records are active but millions of records are sold or inactive and your vistors/users are surfing with those 50000 records mainly, then split location of images into 2 categories like "images" and "sold_images" so that total number of images in your active images will not exceed certain number, and your website will give consistent performance even if number of records or visitors are increasing. # Other extra suggestions: => If you are using NAS using technologies like NFS etc. then beware of using function like "is_dir" or "file_exists" or any other funcion which check existance of file/folder. So try to avoid using those functions when you have lot of images or folders are to be first checked and only then to be displayed while storing those images on NAS. Because checking above items on same hard drive is very much faster than checking on remote drive. => When you have lot of images are to be served, then Bandwidth becomes important issue to be taken into account. Because images can not almost be compressed while sending them to browser for display. Hence they will use full bandiwdth that it needs. In this situation, if you do not need those images to be printed, keep resolution of images upto 72 only, because images to be shown on monitor can be displayed well with 72 resolution than for printing. By this way you can save lot of disk space. But if you need to offer those images for printing as well then you will need to keep 2 versions of images, however only if you have enough storage capacity, 1: for showing in browser only with resolution of 72 and 2: for printing with higher resolution that you require.. => Finally, of course, "Keep your city clean". So design a backend script that can match number of records in your database and images required for that. So if records are not there in your db, then no need to keep those images. Hope these guidelines will help you in solving most of your queries for image storing. Thanks, Anirudh Zala On Sun, 01 Jan 2006 06:23:38 +0530, Marc Antony Vose wrote: > Hey all: > > First of all: Happy New Year! > > Secondly: I am rebuilding a site that was coded somewhat sloppily, > and they have product images all stored in one directory (a script > that I am not writing auto-uploads them to the web server from > elsewhere). Presently, this directory contains about 33,000 files. > It will be more like 75,000 when the site launches, if things remain > the same. > > The question is: should I be worried about this, or was this only a > problem several years ago? (I remember people at one time attempting > to not put too many files in one place.) > > If I should be worried, what could happen? Will we ever reach a hard > limit of files per directory? > > Is it better if each product instead has its own directory inside > there (i.e., 75,000 directories), each with as many files as we need > inside, or is that just the same problem? > > Cheers, > -- ----------------------------------------------------- Anirudh Zala (Production Manager) ASPL, http://www.aspl.in Ph: +91 281 245 1894 arzala at gmail.com ----------------------------------------------------- From hendler at simmons.edu Mon Jan 2 10:10:20 2006 From: hendler at simmons.edu (Jonathan) Date: Mon, 02 Jan 2006 10:10:20 -0500 Subject: [nycphp-talk] importing 650,000 records In-Reply-To: <20051231125412.6ccc2a96@wit.genoverly.home> References: <8d9a42800512310951t2289fec9q29b5a9b295b9b659@mail.gmail.com> <20051231125412.6ccc2a96@wit.genoverly.home> Message-ID: <43B9425C.3030402@simmons.edu> This import happens once? While a direct MySQL solution will be more reliable and faster - wouldn't using prepared statements through PHP/ADODB speed up the import? More importantly, I agree you shouldn't have any indexes until after the import is complete. An index slows down inserts increasingly as the size of the DB increases. michael wrote: >On Sat, 31 Dec 2005 12:51:02 -0500 >Joseph Crawford wrote: > > > >>Hey everyone. >> >>I have a client who has a comma delimited file each line being a new >>record. currently i am trying to import this data into their new >>system. The file is 40mb in size and contains 650,000 records. >> >> >> > >Why use php? Just use mysql to import the file. > > > From mitch.pirtle at gmail.com Mon Jan 2 11:26:19 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 2 Jan 2006 11:26:19 -0500 Subject: [nycphp-talk] [OT] number of files in a directory? In-Reply-To: References: <20051224184241.AEAC8670C20@mailspool3.panix.com> Message-ID: <330532b60601020826l5457205et70dbf5d608ee726c@mail.gmail.com> Perhaps more important than the number of inodes available is the filesystem that the images are stored on. ReiserFS is really good at one approach, and XFS is good with an entirely different approach. Some filesystems are great at thousands of directories, and others are great at thousands of files in one directory. So you do need to take that factor into consideration - and ask what types of filesystems are available to you on your hosted machine. -- Mitch Pirtle Joomla! Core Developer Open Source Matters From max.goldberg at gmail.com Mon Jan 2 19:36:58 2006 From: max.goldberg at gmail.com (max goldberg) Date: Mon, 2 Jan 2006 19:36:58 -0500 Subject: [nycphp-talk] [OT] number of files in a directory? In-Reply-To: References: <20051224184241.AEAC8670C20@mailspool3.panix.com> Message-ID: <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> I started a site a couple years ago which had a similar problem. Users can create pages and each page had one or many assets. At first I just did /content/page_id/assets.ext, after I got to 32,000 directories, it stopped working. At that point I moved to a system where I had 250 directories like, 0, 1000, 2000, 3000, etc. Each of those directories had 1000 sub directories in them, each named after the page_id. After I got to around 300,000 sub directories and a little over a million files, I moved to a completely md5 based system. I tried to avoid keeping track of files in the database as it tends to get messy, but I suppose it's inevitable. The benefits of an md5 system for me outweigh a non md5 system. This may not be the case for you but the main drawing points to me were: 1) Lowered server I/O, there were quite a few duplicated files. Each time two identical files were read, they were pulled from two different spots on the disk. My site quickly grew to using huge amounts of I/O. (around 15,000-20,000 hits a minute on the content server). This definitely helped out for me as some files were duplicated over 1,000 times. 2) Made it a lot easier to keep track of what was being used and what wasn't. Without a DB back end I couldn't tell which files I could delete and which I needed to keep without writing a script that basically checked every directory for a matching entry in the database. 3) Lowered disk space. Again duplicate files. 4) Allowed me to ban certain images and other files, mass delete things that had a certain md5 attached to it. This is very useful if you will ever need to moderate or have troublesome users. The downside is that you have to make sure your code really keeps track of your file system and you aren't accessing it by hand. Another thing you might worry about using md5 is collisions. If this is a mission critical system, you may want to avoid md5 as it is possible (but somewhat unlikely) you will encounter collisions. I've read anyone with a decent computer can create an md5 collision in about an hour, so that's something to keep in mind. The way I structured my file system was three levels of single character directories. /content/a-f0-9/a-f0-9/a-f0-9/filename.ext (4096 directories (16*16*16)) This way I can take any asset md5 and figure out it's location on the file system without database access, and leaves ample room for expansion, as well as moving large (or small) chunks to other servers. At this point I am using this system for over a million files and most of the sub directories only have a few hundred files in them tops. If you decided to use a single directory approach you will most likely run into quite a few problems. I remember when I had around 15-20,000 files, everything I did in that directory became extra slow. With the setup I'm using now I don't really get any lag. Hope that helped. -Max On 12/31/05, Marc Antony Vose wrote: > > Hey all: > > First of all: Happy New Year! > > Secondly: I am rebuilding a site that was coded somewhat sloppily, > and they have product images all stored in one directory (a script > that I am not writing auto-uploads them to the web server from > elsewhere). Presently, this directory contains about 33,000 files. > It will be more like 75,000 when the site launches, if things remain > the same. > > The question is: should I be worried about this, or was this only a > problem several years ago? (I remember people at one time attempting > to not put too many files in one place.) > > If I should be worried, what could happen? Will we ever reach a hard > limit of files per directory? > > Is it better if each product instead has its own directory inside > there (i.e., 75,000 directories), each with as many files as we need > inside, or is that just the same problem? > > Cheers, > > -- > Marc Antony Vose > http://www.suzerain.com/ > > Imagination is more important than knowledge. > -- Albert Einstein > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Mon Jan 2 19:57:13 2006 From: tedd at sperling.com (tedd) Date: Mon, 2 Jan 2006 19:57:13 -0500 Subject: [nycphp-talk] [OT] number of files in a directory? In-Reply-To: <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> References: <20051224184241.AEAC8670C20@mailspool3.panix.com> <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> Message-ID: >I started a site a couple years ago which had a similar problem. >Users can create pages and each page had one or many assets. > >At first I just did /content/page_id/assets.ext, after I got to >32,000 directories, it stopped working. At that point I moved to a >system where I had 250 directories like, 0, 1000, 2000, 3000, etc. >Each of those directories had 1000 sub directories in them, each >named after the page_id. After I got to around 300,000 sub >directories and a little over a million files, I moved to a >completely md5 based system. > >I tried to avoid keeping track of files in the database as it tends >to get messy, but I suppose it's inevitable. The benefits of an md5 >system for me outweigh a non md5 system. This may not be the case >for you but the main drawing points to me were: > >1) Lowered server I/O, there were quite a few duplicated files. Each >time two identical files were read, they were pulled from two >different spots on the disk. My site quickly grew to using huge >amounts of I/O. (around 15,000-20,000 hits a minute on the content >server). This definitely helped out for me as some files were >duplicated over 1,000 times. > >2) Made it a lot easier to keep track of what was being used and >what wasn't. Without a DB back end I couldn't tell which files I >could delete and which I needed to keep without writing a script >that basically checked every directory for a matching entry in the >database. > >3) Lowered disk space. Again duplicate files. > >4) Allowed me to ban certain images and other files, mass delete >things that had a certain md5 attached to it. This is very useful if >you will ever need to moderate or have troublesome users. > >The downside is that you have to make sure your code really keeps >track of your file system and you aren't accessing it by hand. >Another thing you might worry about using md5 is collisions. If this >is a mission critical system, you may want to avoid md5 as it is >possible (but somewhat unlikely) you will encounter collisions. I've >read anyone with a decent computer can create an md5 collision in >about an hour, so that's something to keep in mind. > >The way I structured my file system was three levels of single >character directories. > >/content/a-f0-9/a-f0-9/a-f0-9/filename.ext (4096 directories (16*16*16)) > >This way I can take any asset md5 and figure out it's location on >the file system without database access, and leaves ample room for >expansion, as well as moving large (or small) chunks to other >servers. At this point I am using this system for over a million >files and most of the sub directories only have a few hundred files >in them tops. > >If you decided to use a single directory approach you will most >likely run into quite a few problems. I remember when I had around >15-20,000 files, everything I did in that directory became extra >slow. With the setup I'm using now I don't really get any lag. > >Hope that helped. >-Max > > This topic is beginning to sound like a problem that a binary tree might provide a solution. Anyone have any references for php b-trees? tedd -- -------------------------------------------------------------------------------- http://sperling.com/ From keremtuzemen at gmail.com Mon Jan 2 20:21:12 2006 From: keremtuzemen at gmail.com (Kerem Tuzemen) Date: Mon, 2 Jan 2006 20:21:12 -0500 Subject: [nycphp-talk] [OT] number of files in a directory? References: <20051224184241.AEAC8670C20@mailspool3.panix.com> <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> Message-ID: <002701c61003$fca9a380$7c7ba8c0@OKTPresario> Hi Folks, Have you ever considered using reiserfs? I would highly recommend it, especially if you are dealing with small files. Take a look at : http://www.namesys.com/ or google around for reiserfs They have good documentation and a bunch of benchmarks. I am not sure if the version 4 of reiserfs is stable yet, it's been a while since I read the site thoroughly. But to my experience (I am currently using it in production on a very busy server serving around 2 million php pages with an average of 10 photos per page - guess where the photos are stored) it provides quite a solution with its version 3 which comes standard with most of the linux distros. Just enable it with kernel parameters, format your partition with reiserfs and you're ready to go. I hope this helps to everybody who look for a similar solution. Cheers, Kerem Tuzemen [Shameless plug] Ex NewYorker trapped in DC who is looking for a job in the NYC [/Shameless plug] ----- Original Message ----- From: max goldberg To: NYPHP Talk Sent: Monday, January 02, 2006 7:36 PM Subject: Re: [nycphp-talk] [OT] number of files in a directory? I started a site a couple years ago which had a similar problem. Users can create pages and each page had one or many assets. At first I just did /content/page_id/assets.ext, after I got to 32,000 directories, it stopped working. At that point I moved to a system where I had 250 directories like, 0, 1000, 2000, 3000, etc. Each of those directories had 1000 sub directories in them, each named after the page_id. After I got to around 300,000 sub directories and a little over a million files, I moved to a completely md5 based system. I tried to avoid keeping track of files in the database as it tends to get messy, but I suppose it's inevitable. The benefits of an md5 system for me outweigh a non md5 system. This may not be the case for you but the main drawing points to me were: 1) Lowered server I/O, there were quite a few duplicated files. Each time two identical files were read, they were pulled from two different spots on the disk. My site quickly grew to using huge amounts of I/O. (around 15,000-20,000 hits a minute on the content server). This definitely helped out for me as some files were duplicated over 1,000 times. 2) Made it a lot easier to keep track of what was being used and what wasn't. Without a DB back end I couldn't tell which files I could delete and which I needed to keep without writing a script that basically checked every directory for a matching entry in the database. 3) Lowered disk space. Again duplicate files. 4) Allowed me to ban certain images and other files, mass delete things that had a certain md5 attached to it. This is very useful if you will ever need to moderate or have troublesome users. The downside is that you have to make sure your code really keeps track of your file system and you aren't accessing it by hand. Another thing you might worry about using md5 is collisions. If this is a mission critical system, you may want to avoid md5 as it is possible (but somewhat unlikely) you will encounter collisions. I've read anyone with a decent computer can create an md5 collision in about an hour, so that's something to keep in mind. The way I structured my file system was three levels of single character directories. /content/a-f0-9/a-f0-9/a-f0-9/filename.ext (4096 directories (16*16*16)) This way I can take any asset md5 and figure out it's location on the file system without database access, and leaves ample room for expansion, as well as moving large (or small) chunks to other servers. At this point I am using this system for over a million files and most of the sub directories only have a few hundred files in them tops. If you decided to use a single directory approach you will most likely run into quite a few problems. I remember when I had around 15-20,000 files, everything I did in that directory became extra slow. With the setup I'm using now I don't really get any lag. Hope that helped. -Max On 12/31/05, Marc Antony Vose < suzerain at suzerain.com> wrote: Hey all: First of all: Happy New Year! Secondly: I am rebuilding a site that was coded somewhat sloppily, and they have product images all stored in one directory (a script that I am not writing auto-uploads them to the web server from elsewhere). Presently, this directory contains about 33,000 files. It will be more like 75,000 when the site launches, if things remain the same. The question is: should I be worried about this, or was this only a problem several years ago? (I remember people at one time attempting to not put too many files in one place.) If I should be worried, what could happen? Will we ever reach a hard limit of files per directory? Is it better if each product instead has its own directory inside there (i.e., 75,000 directories), each with as many files as we need inside, or is that just the same problem? Cheers, -- Marc Antony Vose http://www.suzerain.com/ Imagination is more important than knowledge. -- Albert Einstein _______________________________________________ New York PHP Talk Mailing List AMP Technology Supporting Apache, MySQL and PHP http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org ------------------------------------------------------------------------------ _______________________________________________ New York PHP Talk Mailing List AMP Technology Supporting Apache, MySQL and PHP http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From smanes at magpie.com Mon Jan 2 20:26:51 2006 From: smanes at magpie.com (Steve Manes) Date: Mon, 02 Jan 2006 20:26:51 -0500 Subject: [nycphp-talk] [OT] number of files in a directory? In-Reply-To: <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> References: <20051224184241.AEAC8670C20@mailspool3.panix.com> <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> Message-ID: <43B9D2DB.8000100@magpie.com> max goldberg wrote: > The downside is that you have to make sure your code really keeps track > of your file system and you aren't accessing it by hand. Another thing > you might worry about using md5 is collisions. If this is a mission > critical system, you may want to avoid md5 as it is possible (but > somewhat unlikely) you will encounter collisions. I've read anyone with > a decent computer can create an md5 collision in about an hour, so > that's something to keep in mind. Yeah, this is probably the best the solution. To avoid collisions what you want to do is assign a unique database ID to every asset, use that ID to create the MD5 hash, then store the asset with a filename containing that unique ID. That should eliminate collisions. The worst that can happen is that you'll have two different files in the same directory but with different filenames, which is cool. A function like this could be used to both plant the file in the MD5 filesystem and extract its path later on based on that unique ID: function get_upload_target($file_id) { $hash_id = md5($file_id); $subdir = substr($hash_id, 0, 3) . '/' . substr($hash_id, 3, 3); return $subdir; } Use case: someone uploads the file "mykitty.jpg" and it's inserted into the database as id=1234. get_upload_target(1234) returns: 81d/c9b The file is then written as $ASSET_DIR/81d/c9b/1234 Or 1234.jpg, or 1234.mykitty.jpg, whatever. I like to give the file a recognizable file type extension. To extract that file later, just run the ID through get_upload_target() again to build the filesystem path. From arzala at gmail.com Tue Jan 3 00:42:04 2006 From: arzala at gmail.com (Anirudh Zala) Date: Tue, 03 Jan 2006 11:12:04 +0530 Subject: [nycphp-talk] [OT] number of files in a directory? In-Reply-To: <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> References: <20051224184241.AEAC8670C20@mailspool3.panix.com> <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> Message-ID: On Tue, 03 Jan 2006 06:06:58 +0530, max goldberg wrote: > I started a site a couple years ago which had a similar problem. Users can > create pages and each page had one or many assets. > > At first I just did /content/page_id/assets.ext, after I got to 32,000 > directories, it stopped working. At that point I moved to a system where I > had 250 directories like, 0, 1000, 2000, 3000, etc. Each of those > directories had 1000 sub directories in them, each named after the page_id. > After I got to around 300,000 sub directories and a little over a million > files, I moved to a completely md5 based system. > > I tried to avoid keeping track of files in the database as it tends to get > messy, but I suppose it's inevitable. The benefits of an md5 system for me > outweigh a non md5 system. This may not be the case for you but the main > drawing points to me were: Sometimes you must need to store those values related to images into database because you need to store various information of images like size, height, width, original file name etc, for which DB storage is inevitable. I also prefer to store various image information like size, height, width into db directly to display it anywhere rather than finding those values on the fly using functions like "getimagesize()" etc. But if you think you will not need those information regarding images and you just need to display it, then you can avoid usage of DB. > > 1) Lowered server I/O, there were quite a few duplicated files. Each time > two identical files were read, they were pulled from two different spots on > the disk. My site quickly grew to using huge amounts of I/O. (around > 15,000-20,000 hits a minute on the content server). This definitely helped > out for me as some files were duplicated over 1,000 times. > > 2) Made it a lot easier to keep track of what was being used and what > wasn't. Without a DB back end I couldn't tell which files I could delete and > which I needed to keep without writing a script that basically checked every > directory for a matching entry in the database. > > 3) Lowered disk space. Again duplicate files. > > 4) Allowed me to ban certain images and other files, mass delete things that > had a certain md5 attached to it. This is very useful if you will ever need > to moderate or have troublesome users. > > The downside is that you have to make sure your code really keeps track of > your file system and you aren't accessing it by hand. Another thing you > might worry about using md5 is collisions. If this is a mission critical > system, you may want to avoid md5 as it is possible (but somewhat unlikely) > you will encounter collisions. I've read anyone with a decent computer can > create an md5 collision in about an hour, so that's something to keep in > mind. > I don't understand how can there be collisions with generating randome hash? Consider below method to generate 16 digit random hash. $hash=substr(md5(md5(time().rand().$GLOBALS['REMOTE_ADDR'].microtime()).time()),0,16); Can you ever get duplicate hash by above method? I don't think so. However usage of "md5()" only might do that. However main purpose of using hash value in filename is to avoid stealing of them because by this way stealers can't directly downaload images by guessing directory and file name structure of your website. Moreover in file name like \RECORDID_SOME>10CHARACTERHASH.EXT (i.e 123456_aswe34567bg.jpg) where we use combination of "primary column ID 123456" of particualr record that is attached to this image and above mentioned 10 to 16 digit hash will solve both of our purposes. Since RECORDID is always unique, you will never have duplication of images, that is for sure. > The way I structured my file system was three levels of single character > directories. > > /content/a-f0-9/a-f0-9/a-f0-9/filename.ext (4096 directories (16*16*16)) > > This way I can take any asset md5 and figure out it's location on the file > system without database access, and leaves ample room for expansion, as well > as moving large (or small) chunks to other servers. At this point I am using > this system for over a million files and most of the sub directories only > have a few hundred files in them tops. This is another good mechanism of storing large number of files efficiently. But I would like to know a real example of this "filename.ext". I assume if it is just like "ASSET.ext" i.e 1.jpg, 1234.jpg, 4567.jpg then I would say that your system is prone to stealing of your images. md5 or another kind of hash, here, gives you protection against it since stealers can't guess exact file name of your images and even if they try hard, they wont get benefited much. > > If you decided to use a single directory approach you will most likely run > into quite a few problems. I remember when I had around 15-20,000 files, > everything I did in that directory became extra slow. With the setup I'm > using now I don't really get any lag. > > Hope that helped. > -Max > > > > > > > > > > > > > > On 12/31/05, Marc Antony Vose wrote: >> >> Hey all: >> >> First of all: Happy New Year! >> >> Secondly: I am rebuilding a site that was coded somewhat sloppily, >> and they have product images all stored in one directory (a script >> that I am not writing auto-uploads them to the web server from >> elsewhere). Presently, this directory contains about 33,000 files. >> It will be more like 75,000 when the site launches, if things remain >> the same. >> >> The question is: should I be worried about this, or was this only a >> problem several years ago? (I remember people at one time attempting >> to not put too many files in one place.) >> >> If I should be worried, what could happen? Will we ever reach a hard >> limit of files per directory? >> >> Is it better if each product instead has its own directory inside >> there (i.e., 75,000 directories), each with as many files as we need >> inside, or is that just the same problem? >> >> Cheers, >> >> -- >> Marc Antony Vose >> http://www.suzerain.com/ >> >> Imagination is more important than knowledge. >> -- Albert Einstein >> _______________________________________________ >> New York PHP Talk Mailing List >> AMP Technology >> Supporting Apache, MySQL and PHP >> http://lists.nyphp.org/mailman/listinfo/talk >> http://www.nyphp.org >> > -- ----------------------------------------------------- Anirudh Zala (Production Manager) ASPL, http://www.aspl.in Ph: +91 281 245 1894 arzala at gmail.com ----------------------------------------------------- From max.goldberg at gmail.com Tue Jan 3 00:55:05 2006 From: max.goldberg at gmail.com (max goldberg) Date: Tue, 3 Jan 2006 00:55:05 -0500 Subject: [nycphp-talk] [OT] number of files in a directory? In-Reply-To: References: <20051224184241.AEAC8670C20@mailspool3.panix.com> <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> Message-ID: <87e6ded30601022155t6dc0fb14j1f805748be9e1760@mail.gmail.com> I was trying to explain that I use a straight md5 sum of each file (the contents) as the file name, to keep from storing and serving duplicate files. When a user uploads a file that already exists in my system, it discards it and just links to the previously uploaded version. I have no concern about people "stealing" my images as filename has relatively little to do with it. The files are stored with a 32 character md5 and a filetype extension. I guess it really depends on what your major goals are. On 1/3/06, Anirudh Zala wrote: > > On Tue, 03 Jan 2006 06:06:58 +0530, max goldberg > wrote: > > > I started a site a couple years ago which had a similar problem. Users > can > > create pages and each page had one or many assets. > > > > At first I just did /content/page_id/assets.ext, after I got to 32,000 > > directories, it stopped working. At that point I moved to a system where > I > > had 250 directories like, 0, 1000, 2000, 3000, etc. Each of those > > directories had 1000 sub directories in them, each named after the > page_id. > > After I got to around 300,000 sub directories and a little over a > million > > files, I moved to a completely md5 based system. > > > > I tried to avoid keeping track of files in the database as it tends to > get > > messy, but I suppose it's inevitable. The benefits of an md5 system for > me > > outweigh a non md5 system. This may not be the case for you but the main > > drawing points to me were: > > Sometimes you must need to store those values related to images into > database because you need to store various information of images like size, > height, width, original file name etc, for which DB storage is inevitable. I > also prefer to store various image information like size, height, width into > db directly to display it anywhere rather than finding those values on the > fly using functions like "getimagesize()" etc. But if you think you will not > need those information regarding images and you just need to display it, > then you can avoid usage of DB. > > > > > 1) Lowered server I/O, there were quite a few duplicated files. Each > time > > two identical files were read, they were pulled from two different spots > on > > the disk. My site quickly grew to using huge amounts of I/O. (around > > 15,000-20,000 hits a minute on the content server). This definitely > helped > > out for me as some files were duplicated over 1,000 times. > > > > 2) Made it a lot easier to keep track of what was being used and what > > wasn't. Without a DB back end I couldn't tell which files I could delete > and > > which I needed to keep without writing a script that basically checked > every > > directory for a matching entry in the database. > > > > 3) Lowered disk space. Again duplicate files. > > > > 4) Allowed me to ban certain images and other files, mass delete things > that > > had a certain md5 attached to it. This is very useful if you will ever > need > > to moderate or have troublesome users. > > > > The downside is that you have to make sure your code really keeps track > of > > your file system and you aren't accessing it by hand. Another thing you > > might worry about using md5 is collisions. If this is a mission critical > > system, you may want to avoid md5 as it is possible (but somewhat > unlikely) > > you will encounter collisions. I've read anyone with a decent computer > can > > create an md5 collision in about an hour, so that's something to keep in > > mind. > > > > I don't understand how can there be collisions with generating randome > hash? Consider below method to generate 16 digit random hash. > > > $hash=substr(md5(md5(time().rand().$GLOBALS['REMOTE_ADDR'].microtime()).time()),0,16); > > Can you ever get duplicate hash by above method? I don't think so. However > usage of "md5()" only might do that. However main purpose of using hash > value in filename is to avoid stealing of them because by this way stealers > can't directly downaload images by guessing directory and file name > structure of your website. Moreover in file name like > > \RECORDID_SOME>10CHARACTERHASH.EXT (i.e 123456_aswe34567bg.jpg) > > where we use combination of "primary column ID 123456" of particualr > record that is attached to this image and above mentioned 10 to 16 digit > hash will solve both of our purposes. Since RECORDID is always unique, you > will never have duplication of images, that is for sure. > > > The way I structured my file system was three levels of single character > > directories. > > > > /content/a-f0-9/a-f0-9/a-f0-9/filename.ext (4096 directories (16*16*16)) > > > > This way I can take any asset md5 and figure out it's location on the > file > > system without database access, and leaves ample room for expansion, as > well > > as moving large (or small) chunks to other servers. At this point I am > using > > this system for over a million files and most of the sub directories > only > > have a few hundred files in them tops. > > This is another good mechanism of storing large number of files > efficiently. But I would like to know a real example of this "filename.ext". > I assume if it is just like "ASSET.ext" i.e 1.jpg, 1234.jpg, 4567.jpg then > I would say that your system is prone to stealing of your images. md5 or > another kind of hash, here, gives you protection against it since stealers > can't guess exact file name of your images and even if they try hard, they > wont get benefited much. > > > > > If you decided to use a single directory approach you will most likely > run > > into quite a few problems. I remember when I had around 15-20,000 files, > > everything I did in that directory became extra slow. With the setup I'm > > using now I don't really get any lag. > > > > Hope that helped. > > -Max > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 12/31/05, Marc Antony Vose wrote: > >> > >> Hey all: > >> > >> First of all: Happy New Year! > >> > >> Secondly: I am rebuilding a site that was coded somewhat sloppily, > >> and they have product images all stored in one directory (a script > >> that I am not writing auto-uploads them to the web server from > >> elsewhere). Presently, this directory contains about 33,000 files. > >> It will be more like 75,000 when the site launches, if things remain > >> the same. > >> > >> The question is: should I be worried about this, or was this only a > >> problem several years ago? (I remember people at one time attempting > >> to not put too many files in one place.) > >> > >> If I should be worried, what could happen? Will we ever reach a hard > >> limit of files per directory? > >> > >> Is it better if each product instead has its own directory inside > >> there (i.e., 75,000 directories), each with as many files as we need > >> inside, or is that just the same problem? > >> > >> Cheers, > >> > >> -- > >> Marc Antony Vose > >> http://www.suzerain.com/ > >> > >> Imagination is more important than knowledge. > >> -- Albert Einstein > >> _______________________________________________ > >> New York PHP Talk Mailing List > >> AMP Technology > >> Supporting Apache, MySQL and PHP > >> http://lists.nyphp.org/mailman/listinfo/talk > >> http://www.nyphp.org > >> > > > > > > -- > ----------------------------------------------------- > Anirudh Zala (Production Manager) > ASPL, http://www.aspl.in > Ph: +91 281 245 1894 > arzala at gmail.com > ----------------------------------------------------- > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From suzerain at suzerain.com Tue Jan 3 02:18:31 2006 From: suzerain at suzerain.com (Marc Antony Vose) Date: Tue, 3 Jan 2006 02:18:31 -0500 Subject: [nycphp-talk] [OT] number of files in a directory? In-Reply-To: <43B9D2DB.8000100@magpie.com> References: <20051224184241.AEAC8670C20@mailspool3.panix.com> <87e6ded30601021636x62bcef2av3cbbe3055b1feaa1@mail.gmail.com> <43B9D2DB.8000100@magpie.com> Message-ID: Hey y'all: Thanks for the thoughtful notes. As usual, people here have given me entirely new ways to think about things. In my case, I'm not accepting uploads from web site visitors; all these images are coming from the owner of the site. They are a store that sells one-of-a-kind rare items, and at any given time there will be an inventory of ~75,000. Each item in the inventory will have something like 6-10 images, each used for different purposes (for example, we will be displaying rotatable versions of the products via Flash). However, they've indicated a future desire to be able to offer people order histories, and so forth, so for the time being sold items will be kept in the system. So the probability of getting into the millions pretty quickly with images is definitely there. It seems, then, like the most sensible idea for me is to create md5() hashed directories based on the product ID number (rather than image ID number), as I don't think it's necessary for me to store information about every image in the database. So, if I translated the product ID number into something like IMAGES_DIR/ab5/81d I could then store inside that directory any images which are needed for the particular product. Something like: 12345_signature.jpg 12345_rotate_1.jpg 12345_rotate_2.jpg 12345_rotate_3.jpg 12345_rotate_4.jpg 12345_rotate_5.jpg 12345_rotate_6.jpg 12345_thumb.jpg I suppose it is probable under this scenario that two different products will end up with the same path, since we're only using the first 6 characters of the hash. but it shouldn't really matter as long as I have the images keyed with the product ID as well. Anyone see any major red flags with this strategy? Cheers, Marc >max goldberg wrote: > > The downside is that you have to make sure your code really keeps track >> of your file system and you aren't accessing it by hand. Another thing >> you might worry about using md5 is collisions. If this is a mission >> critical system, you may want to avoid md5 as it is possible (but >> somewhat unlikely) you will encounter collisions. I've read anyone with >> a decent computer can create an md5 collision in about an hour, so >> that's something to keep in mind. > >Yeah, this is probably the best the solution. To avoid collisions what >you want to do is assign a unique database ID to every asset, use that >ID to create the MD5 hash, then store the asset with a filename >containing that unique ID. That should eliminate collisions. The worst >that can happen is that you'll have two different files in the same >directory but with different filenames, which is cool. > >A function like this could be used to both plant the file in the MD5 >filesystem and extract its path later on based on that unique ID: > >function get_upload_target($file_id) { > $hash_id = md5($file_id); > $subdir = substr($hash_id, 0, 3) . > '/' . > substr($hash_id, 3, 3); > return $subdir; > } > >Use case: someone uploads the file "mykitty.jpg" and it's inserted into >the database as id=1234. get_upload_target(1234) returns: > > 81d/c9b > >The file is then written as $ASSET_DIR/81d/c9b/1234 > >Or 1234.jpg, or 1234.mykitty.jpg, whatever. I like to give the file a >recognizable file type extension. > >To extract that file later, just run the ID through get_upload_target() >again to build the filesystem path. From hendler at simmons.edu Tue Jan 3 14:18:14 2006 From: hendler at simmons.edu (Jonathan) Date: Tue, 03 Jan 2006 14:18:14 -0500 Subject: [nycphp-talk] problems loading a custom, shared extension In-Reply-To: <002201c60440$b8865ff0$6501a8c0@MZ> References: <002201c60440$b8865ff0$6501a8c0@MZ> Message-ID: <43BACDF6.5030908@simmons.edu> An HTML attachment was scrubbed... URL: From 1j0lkq002 at sneakemail.com Fri Jan 6 00:45:59 2006 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Thu, 05 Jan 2006 21:45:59 -0800 Subject: [nycphp-talk] C++,C#,Java, Python, Ruby, and finally .. PHP5 In-Reply-To: <43BACDF6.5030908@simmons.edu> References: <002201c60440$b8865ff0$6501a8c0@MZ> <43BACDF6.5030908@simmons.edu> Message-ID: <20721-23697@sneakemail.com> Just thought it worth highlighting how Bruce Eckel (C++ standards guy, long time C/Java expert author) wrote an article in December about technical aspects of Ruby/Rails evangelism entitled "the Departure of the Hyper Enthusiasts". He touched on C/C++, Java, Python, Ruby, and Perl, comparing and contrastng them as solutions. He ends up picking PHP5 because: " I'm going to find something drop-dead simple to solve my drop-dead simple problems. Probably PHP5, which actually includes most of Java and C++ syntax, amazingly enough, and I wonder if that isn't what made IBM adopt it." http://www.artima.com/forums/flat.jsp?forum=106&thread=141312 I paid very-serious-money to learn C++ from Bruce many years ago, and repeated with an intro Java course when it took over. As an advanced instructor he's been around the block with the details... he's not just a talking head. So it is interesting to me when he abandons Zope and Python for his web app because he wants a simple solution to the common problem of web-based database driven application. He loves Python, but chooses PHP over Rails and python for the MVC app that is driving Rails popularity. I could have told him that :-) On the other hand, is this a sign of PHP's new corporate love affair, and can we now expect traveling PHP trainers pursuing "enterprise application development with PHP" gigs? -=john andrews (holding on to his hat) htp://www.seo-fun.com From ken at secdat.com Fri Jan 6 06:52:11 2006 From: ken at secdat.com (Kenneth Downs) Date: Fri, 6 Jan 2006 06:52:11 -0500 (EST) Subject: [nycphp-talk] C++,C#,Java, Python, Ruby, and finally .. PHP5 In-Reply-To: <20721-23697@sneakemail.com> References: <002201c60440$b8865ff0$6501a8c0@MZ> <43BACDF6.5030908@simmons.edu> <20721-23697@sneakemail.com> Message-ID: <36185.38.117.147.25.1136548331.squirrel@38.117.147.25> Well I don't have his clout but i picked it for the same reason. I wrote my company's basic app first in C#, then converted it to Java, then PHP. PHP wants to help me work, Java wants to tell me what to believe. > Just thought it worth highlighting how Bruce Eckel (C++ standards guy, > long time C/Java expert author) wrote an article in December about > technical aspects of Ruby/Rails evangelism entitled "the Departure of > the Hyper Enthusiasts". He touched on C/C++, Java, Python, Ruby, and > Perl, comparing and contrastng them as solutions. He ends up picking > PHP5 because: > > " I'm going to find something drop-dead simple to solve my drop-dead > simple problems. Probably PHP5, which actually includes most of Java and > C++ syntax, amazingly enough, and I wonder if that isn't what made IBM > adopt it." > > http://www.artima.com/forums/flat.jsp?forum=106&thread=141312 > > I paid very-serious-money to learn C++ from Bruce many years ago, and > repeated with an intro Java course when it took over. As an advanced > instructor he's been around the block with the details... he's not just > a talking head. So it is interesting to me when he abandons Zope and > Python for his web app because he wants a simple solution to the common > problem of web-based database driven application. He loves Python, but > chooses PHP over Rails and python for the MVC app that is driving Rails > popularity. > > I could have told him that :-) > > On the other hand, is this a sign of PHP's new corporate love affair, > and can we now expect traveling PHP trainers pursuing "enterprise > application development with PHP" gigs? > > -=john andrews (holding on to his hat) > htp://www.seo-fun.com > > > > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From jonbaer at jonbaer.com Fri Jan 6 12:23:34 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 6 Jan 2006 12:23:34 -0500 Subject: [nycphp-talk] C++,C#,Java, Python, Ruby, and finally .. PHP5 In-Reply-To: <36185.38.117.147.25.1136548331.squirrel@38.117.147.25> References: <002201c60440$b8865ff0$6501a8c0@MZ> <43BACDF6.5030908@simmons.edu> <20721-23697@sneakemail.com> <36185.38.117.147.25.1136548331.squirrel@38.117.147.25> Message-ID: <012D1F4E-A10E-48BF-8340-69DCC50714CA@jonbaer.com> It was pretty funny to listen how DHH of RoR called PHP "the devil" in the Chicago presentation .. http://www.djangoproject.com/snakesandrubies/ I think much of what he disliked is reflective of pre-OO PHP, I think in a nutshell someone just beat everyone to a clean clear ActiveRecord API and tons of videocasts :-) Im currently playing around w/ Trails (java), Rails, and CakePHP and so far I think the DRY comfort in Rails is the best for now (opinion) but still wait to see what the Zend framework will offer. Is there any further word on it? I think someone I overheard @ B&N the other day put it nicely that there shouldn't have to be books upon books about PHP database connectivity, security, etc (Java same problem) that make up the actual language and the reason for Rails pickup is that it is a clear concise path in which "you don't have to worry about that stuff". Something which makes up for our fast-paced XP environments we have today. - Jon On Jan 6, 2006, at 6:52 AM, Kenneth Downs wrote: > Well I don't have his clout but i picked it for the same reason. > > I wrote my company's basic app first in C#, then converted it to Java, > then PHP. PHP wants to help me work, Java wants to tell me what to > believe. > >> Just thought it worth highlighting how Bruce Eckel (C++ standards >> guy, >> long time C/Java expert author) wrote an article in December about >> technical aspects of Ruby/Rails evangelism entitled "the Departure of >> the Hyper Enthusiasts". He touched on C/C++, Java, Python, Ruby, and >> Perl, comparing and contrastng them as solutions. He ends up picking >> PHP5 because: >> >> " I'm going to find something drop-dead simple to solve my drop-dead >> simple problems. Probably PHP5, which actually includes most of >> Java and >> C++ syntax, amazingly enough, and I wonder if that isn't what made >> IBM >> adopt it." >> >> http://www.artima.com/forums/flat.jsp?forum=106&thread=141312 >> >> I paid very-serious-money to learn C++ from Bruce many years ago, and >> repeated with an intro Java course when it took over. As an advanced >> instructor he's been around the block with the details... he's not >> just >> a talking head. So it is interesting to me when he abandons Zope and >> Python for his web app because he wants a simple solution to the >> common >> problem of web-based database driven application. He loves Python, >> but >> chooses PHP over Rails and python for the MVC app that is driving >> Rails >> popularity. >> >> I could have told him that :-) >> >> On the other hand, is this a sign of PHP's new corporate love affair, >> and can we now expect traveling PHP trainers pursuing "enterprise >> application development with PHP" gigs? >> >> -=john andrews (holding on to his hat) >> htp://www.seo-fun.com >> >> >> >> >> _______________________________________________ >> New York PHP Talk Mailing List >> AMP Technology >> Supporting Apache, MySQL and PHP >> http://lists.nyphp.org/mailman/listinfo/talk >> http://www.nyphp.org >> > > > -- > Kenneth Downs > Secure Data Software > 631-379-0010 > ken at secdat.com > PO Box 708 > East Setauket, NY 11733 > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From mike.n at zend.com Fri Jan 6 13:05:35 2006 From: mike.n at zend.com (Mike Naberezny) Date: Fri, 06 Jan 2006 10:05:35 -0800 Subject: [nycphp-talk] C++,C#,Java, Python, Ruby, and finally .. PHP5 In-Reply-To: <012D1F4E-A10E-48BF-8340-69DCC50714CA@jonbaer.com> References: <002201c60440$b8865ff0$6501a8c0@MZ> <43BACDF6.5030908@simmons.edu> <20721-23697@sneakemail.com> <36185.38.117.147.25.1136548331.squirrel@38.117.147.25> <012D1F4E-A10E-48BF-8340-69DCC50714CA@jonbaer.com> Message-ID: <43BEB16F.3020808@zend.com> Jon Baer wrote: > I think someone I overheard @ B&N the other day put it nicely that > there shouldn't have to be books upon books about PHP database > connectivity, security, etc (Java same problem) that make up the > actual language and the reason for Rails pickup is that it is a clear > concise path in which "you don't have to worry about that stuff". You're just as likely to forget to call escapehtml() or h() in Rails as you are htmlentities() in PHP. Just because the PHP security community tries very hard to raise awareness through books and lectures doesn't make PHP any less secure than anything else, or mean that Rails or other solutions are more secure. Developers need to pay constant attention to security practices regardless of the platform. You always need to "worry about that stuff". Mike From cliff at pinestream.com Fri Jan 6 14:07:30 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 6 Jan 2006 14:07:30 -0500 Subject: [nycphp-talk] Static Methods Usage Message-ID: <000a01c612f4$716c7010$0aa8a8c0@cliff> As I refactor my code yet again, I am torn about whether to make wide-spread use of static methods (in PHP 5) when appropriate. The manual says: "Declaring class members or methods as static makes them accessible without needing an instantiation of the class....In fact static method calls are resolved at compile time." I presume this makes static method calls faster. But by enough to make it worthwhile? Thoughts? Opinions? Suggestions? From andrew at plexpod.com Fri Jan 6 14:47:59 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 6 Jan 2006 14:47:59 -0500 Subject: [nycphp-talk] Static Methods Usage In-Reply-To: <000a01c612f4$716c7010$0aa8a8c0@cliff> References: <000a01c612f4$716c7010$0aa8a8c0@cliff> Message-ID: <20060106194759.GU26280@desario.homelinux.net> On Fri, Jan 06, 2006 at 02:07:30PM -0500, Cliff Hirsch wrote: > As I refactor my code yet again, I am torn about whether to make > wide-spread use of static methods (in PHP 5) when appropriate. > > The manual says: > > "Declaring class members or methods as static makes them accessible > without needing an instantiation of the class....In fact static method > calls are resolved at compile time." > > I presume this makes static method calls faster. But by enough to make > it worthwhile? Thoughts? Opinions? Suggestions? If all your methods are static then you're OO code is not too much different than prcocedural code. So, the answer is to use them when appropriate. Here's a basic guideline: - Use static methods when the code in them does not refer to instance data ($this). - Use regular methods when they need to operate on instance data. Example: class Human { private $Name = ''; public function GetName() { return $this->Name; } public function SetName($Name) { $this->Name = $Name; } public static function GetLatinName() { return 'Homo Sapien'; } } HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From krook at us.ibm.com Fri Jan 6 15:25:09 2006 From: krook at us.ibm.com (Daniel Krook) Date: Fri, 6 Jan 2006 15:25:09 -0500 Subject: [nycphp-talk] Static Methods Usage In-Reply-To: <20060106194759.GU26280@desario.homelinux.net> Message-ID: Cliff & Andrew, > On Fri, Jan 06, 2006 at 02:07:30PM -0500, Cliff Hirsch wrote: > > As I refactor my code yet again, I am torn about whether to make > > wide-spread use of static methods (in PHP 5) when appropriate. ... > > If all your methods are static then you're OO code is not too much > different than prcocedural code. So, the answer is to use them when > appropriate. I disagree that extensive use of static methods makes your OOP code equivalent to procedural code (meaning that you'd want to avoid it). While it's true that you can essentially just create function namespaces when you do this, conceptually you're still binding operations under an object with distinct responsibilities. I tend to use static methods for read only operations on particular other objects. For example: $dogs = DogManager::getLatestAdoptableDogs(); foreach ($dogs as $dog) { echo $dog->firstName; } When I need to write to a database I like to use a singleton* instance of that manager to make sure that only one update is happening on a shared connection at any given time. For example: $dog = new Dog($someData); $dm = DogManager::getInstance(); $dogId = $dm->saveDog($dog); $dm->createAdoptionRecord($dogId, $humanId); In any case, I tend to do much of this without consideration for performance. Logically organized code with intuitive responsibilities takes higher precedence in my mind, so I would encourage you to use static methods in your new code. HTH, -Dan *Information on PHP 5 Singletons: http://www.sitepoint.com/article/coming-soon-webserver-near/9 Daniel Krook, Content Tools Developer Global Production Services - Tools, ibm.com http://bluepages.redirect.webahead.ibm.com/ http://blogpages.redirect.webahead.ibm.com/ http://bookmarks.redirect.webahead.ibm.com/ From andrew at plexpod.com Fri Jan 6 16:15:47 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 6 Jan 2006 16:15:47 -0500 Subject: [nycphp-talk] Static Methods Usage In-Reply-To: References: <20060106194759.GU26280@desario.homelinux.net> Message-ID: <20060106211547.GV26280@desario.homelinux.net> On Fri, Jan 06, 2006 at 03:25:09PM -0500, Daniel Krook wrote: > Cliff & Andrew, > > > On Fri, Jan 06, 2006 at 02:07:30PM -0500, Cliff Hirsch wrote: > > > As I refactor my code yet again, I am torn about whether to make > > > wide-spread use of static methods (in PHP 5) when appropriate. > ... > > > > If all your methods are static then you're OO code is not too much > > different than prcocedural code. So, the answer is to use them when > > appropriate. > > > I disagree that extensive use of static methods makes your OOP code > equivalent to procedural code (meaning that you'd want to avoid it). While > it's true that you can essentially just create function namespaces when > you do this, conceptually you're still binding operations under an object > with distinct responsibilities. I agree. From Cliff's original note I had somehow gotten the impression that Cliff thought they were speedier therefore should be used everywhere, though now I realize that is incorrect. I did not mean to never use them, just not to make *every* method static because its slightly faster. They are extremely useful and valuable in everyday code. > I tend to use static methods for read only operations on particular other > objects. For example: > $dogs = DogManager::getLatestAdoptableDogs(); > > foreach ($dogs as $dog) { > echo $dog->firstName; > } > > When I need to write to a database I like to use a singleton* instance of > that manager to make sure that only one update is happening on a shared > connection at any given time. For example: > $dog = new Dog($someData); > > $dm = DogManager::getInstance(); > $dogId = $dm->saveDog($dog); > $dm->createAdoptionRecord($dogId, $humanId); Great examples. Singletons and factory methods are great places for static methods. Note that such methods won't usually use the $this variable, thus my guideline. Though, consider it a guide - not a hard rule. > In any case, I tend to do much of this without consideration for > performance. Logically organized code with intuitive responsibilities > takes higher precedence in my mind, so I would encourage you to use static > methods in your new code. Agreed. I'd like to add that well-designed OO comes with practice. You'll refactor code, and make it better, and learn. Next time you code something similar, you'll recognize the pattern and do it the better way first. Wash, rinse, repeat. Regards, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From cliff at pinestream.com Fri Jan 6 16:36:54 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 6 Jan 2006 16:36:54 -0500 Subject: [nycphp-talk] Static Methods Usage In-Reply-To: <20060106211547.GV26280@desario.homelinux.net> Message-ID: <001a01c61309$52852a10$0aa8a8c0@cliff> I think part of my confusion is mixing static and object methods in one class while envisioning the future. As an example, I have this call: Class::Method(...) The method in Class then calls another method in the same Class as $this->anothermethod Bad, bad, bad The call must be self::anothermethod I guess the point is that any static method in a class better use self:: to call other methods in the same class. And when that's all deciphered, luck would have it that I'll probably decide how handy it would be to add a few private properties... -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Andrew Yochum Sent: Friday, January 06, 2006 4:16 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Static Methods Usage On Fri, Jan 06, 2006 at 03:25:09PM -0500, Daniel Krook wrote: > Cliff & Andrew, > > > On Fri, Jan 06, 2006 at 02:07:30PM -0500, Cliff Hirsch wrote: > > > As I refactor my code yet again, I am torn about whether to make > > > wide-spread use of static methods (in PHP 5) when appropriate. > ... > > > > If all your methods are static then you're OO code is not too much > > different than prcocedural code. So, the answer is to use them when > > appropriate. > > > I disagree that extensive use of static methods makes your OOP code > equivalent to procedural code (meaning that you'd want to avoid it). While > it's true that you can essentially just create function namespaces when > you do this, conceptually you're still binding operations under an object > with distinct responsibilities. I agree. From Cliff's original note I had somehow gotten the impression that Cliff thought they were speedier therefore should be used everywhere, though now I realize that is incorrect. I did not mean to never use them, just not to make *every* method static because its slightly faster. They are extremely useful and valuable in everyday code. > I tend to use static methods for read only operations on particular > other > objects. For example: > $dogs = DogManager::getLatestAdoptableDogs(); > > foreach ($dogs as $dog) { > echo $dog->firstName; > } > > When I need to write to a database I like to use a singleton* instance > of > that manager to make sure that only one update is happening on a shared > connection at any given time. For example: > $dog = new Dog($someData); > > $dm = DogManager::getInstance(); > $dogId = $dm->saveDog($dog); $dm->createAdoptionRecord($dogId, > $humanId); Great examples. Singletons and factory methods are great places for static methods. Note that such methods won't usually use the $this variable, thus my guideline. Though, consider it a guide - not a hard rule. > In any case, I tend to do much of this without consideration for > performance. Logically organized code with intuitive responsibilities > takes higher precedence in my mind, so I would encourage you to use static > methods in your new code. Agreed. I'd like to add that well-designed OO comes with practice. You'll refactor code, and make it better, and learn. Next time you code something similar, you'll recognize the pattern and do it the better way first. Wash, rinse, repeat. Regards, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 _______________________________________________ New York PHP Talk Mailing List AMP Technology Supporting Apache, MySQL and PHP http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org From codebowl at gmail.com Fri Jan 6 16:51:57 2006 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 6 Jan 2006 16:51:57 -0500 Subject: [nycphp-talk] MySQL Query Help Message-ID: <8d9a42800601061351m663179dcl896c7725e2272a83@mail.gmail.com> Hello guys, I have a sql query that basically copies data from one table to another, here is the query use mydb; update Vtems left join feed on Vtems.MCN=feed.mcn set VItems.Inventory= case (VItems.V_ID) when 'CN3' then feed.cn3quan when 'CN4' then feed.cn4quan when 'CN5' then feed.cn5quan when 'CN6' then feed.cn6quan when 'CN7' then feed.cn7quan when 'CN8' then feed.cn8quan when 'CN9' then feed.cn9quan when 'CN10' then feed.cn10quan when 'CN11' then feed.cn11quan when 'CN16' then feed.cn16quan else '' end ,VItems.ItemCst = feed.unitcost, VItems.ItemPrce = feed.unitcost commit; We have a php cron job which executes and runs this query, however it takes anywhere between 4-8 hours for this to run on 50,000 records, now this number will also grow and we have determined that the left join is what is slowing it down. What i need to know is do you have any suggestions on a better method for doing this that would speed it up considerably. I know we could run this on the mysql command line and we have tried. It seems to take just as long on the command line as the php cron, however we are also wishing to implement emails when there are errors etc.. The avg time is 6 hours on the production server to complete the import. Thanks, -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. 1-802-671-2021 codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From codebowl at gmail.com Fri Jan 6 16:53:37 2006 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 6 Jan 2006 16:53:37 -0500 Subject: [nycphp-talk] MySQL Query Help In-Reply-To: <8d9a42800601061353j66678c1ey1dc766c00b355054@mail.gmail.com> References: <8d9a42800601061351m663179dcl896c7725e2272a83@mail.gmail.com> <8d9a42800601061353j66678c1ey1dc766c00b355054@mail.gmail.com> Message-ID: <8d9a42800601061353q57015406u3e97628c6ec590ed@mail.gmail.com> I would also like to note that the production server is this 2 x 2.8 Ghz processors with 2 GB memory, and nothing lese other than the mail server on it Thanks, -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. 1-802-671-2021 codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffrey.knight at gmail.com Fri Jan 6 17:02:05 2006 From: jeffrey.knight at gmail.com (Jeffrey Knight) Date: Fri, 6 Jan 2006 17:02:05 -0500 Subject: [nycphp-talk] MySQL Query Help In-Reply-To: <8d9a42800601061351m663179dcl896c7725e2272a83@mail.gmail.com> References: <8d9a42800601061351m663179dcl896c7725e2272a83@mail.gmail.com> Message-ID: I take it that Vtems.MCN and feed.mcn are indexed? Jeff New York, NY On 1/6/06, Joseph Crawford wrote: > Hello guys, > > I have a sql query that basically copies data from one table to another, > here is the query > > use mydb; > update Vtems left join feed on Vtems.MCN=feed.mcn > set VItems.Inventory= case (VItems.V_ID) > when 'CN3' then feed.cn3quan > when 'CN4' then feed.cn4quan > when 'CN5' then feed.cn5quan > when 'CN6' then feed.cn6quan > when 'CN7' then feed.cn7quan > when 'CN8' then feed.cn8quan > when 'CN9' then feed.cn9quan > when 'CN10' then feed.cn10quan > when 'CN11' then feed.cn11quan > when 'CN16' then feed.cn16quan > else '' end > ,VItems.ItemCst = feed.unitcost, > VItems.ItemPrce = feed.unitcost > commit; > > > We have a php cron job which executes and runs this query, however it takes > anywhere between 4-8 hours for this to run on 50,000 records, now this > number will also grow and we have determined that the left join is what is > slowing it down. What i need to know is do you have any suggestions on a > better method for doing this that would speed it up considerably. > > I know we could run this on the mysql command line and we have tried. It > seems to take just as long on the command line as the php cron, however we > are also wishing to implement emails when there are errors etc.. The avg > time is 6 hours on the production server to complete the import. > > Thanks, > -- > Joseph Crawford Jr. > Zend Certified Engineer > Codebowl Solutions, Inc. > 1-802-671-2021 > codebowl at gmail.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > > From Consult at CovenantEDesign.com Fri Jan 6 17:33:55 2006 From: Consult at CovenantEDesign.com (CED) Date: Fri, 6 Jan 2006 17:33:55 -0500 Subject: [nycphp-talk] MySQL Query Help References: <8d9a42800601061351m663179dcl896c7725e2272a83@mail.gmail.com> Message-ID: <009f01c61311$473f4b60$1519a8c0@ced> lol Indexes are for panzies! ----- Original Message ----- From: "Jeffrey Knight" To: "NYPHP Talk" Cc: Sent: Friday, January 06, 2006 5:02 PM Subject: Re: [nycphp-talk] MySQL Query Help I take it that Vtems.MCN and feed.mcn are indexed? Jeff New York, NY On 1/6/06, Joseph Crawford wrote: > Hello guys, > > I have a sql query that basically copies data from one table to another, > here is the query > > use mydb; > update Vtems left join feed on Vtems.MCN=feed.mcn > set VItems.Inventory= case (VItems.V_ID) > when 'CN3' then feed.cn3quan > when 'CN4' then feed.cn4quan > when 'CN5' then feed.cn5quan > when 'CN6' then feed.cn6quan > when 'CN7' then feed.cn7quan > when 'CN8' then feed.cn8quan > when 'CN9' then feed.cn9quan > when 'CN10' then feed.cn10quan > when 'CN11' then feed.cn11quan > when 'CN16' then feed.cn16quan > else '' end > ,VItems.ItemCst = feed.unitcost, > VItems.ItemPrce = feed.unitcost > commit; > > > We have a php cron job which executes and runs this query, however it takes > anywhere between 4-8 hours for this to run on 50,000 records, now this > number will also grow and we have determined that the left join is what is > slowing it down. What i need to know is do you have any suggestions on a > better method for doing this that would speed it up considerably. > > I know we could run this on the mysql command line and we have tried. It > seems to take just as long on the command line as the php cron, however we > are also wishing to implement emails when there are errors etc.. The avg > time is 6 hours on the production server to complete the import. > > Thanks, > -- > Joseph Crawford Jr. > Zend Certified Engineer > Codebowl Solutions, Inc. > 1-802-671-2021 > codebowl at gmail.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > > _______________________________________________ New York PHP Talk Mailing List AMP Technology Supporting Apache, MySQL and PHP http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org From ken at secdat.com Fri Jan 6 18:43:35 2006 From: ken at secdat.com (Kenneth Downs) Date: Fri, 6 Jan 2006 18:43:35 -0500 (EST) Subject: [nycphp-talk] MySQL Query Help In-Reply-To: <8d9a42800601061351m663179dcl896c7725e2272a83@mail.gmail.com> References: <8d9a42800601061351m663179dcl896c7725e2272a83@mail.gmail.com> Message-ID: <37048.38.117.147.25.1136591015.squirrel@38.117.147.25> I'll bet you'll see major speedup with two items: 1) Indexes required: VItems.mcn, VItems.V_ID, VItems.mcn 2) Break up the command into multiple commands, varying for CN3, CN4 etc: update VItems set VItems.Inventory= feed.cn3quan ,VItems.ItemCst = feed.unitcost ,VItems.ItemPrce = feed.unitcost from feed where VItems.MCN=feed.mcn and VItems.V_ID = 'CN3' (Disclaimer: I don't use MySQL so you may have to tweak the SQL for syntactical variations). Here is why this should work. FIRST, Transaction performance goes *exponentially* as the number of rows in the transaction. Consider 10 transactions of 5000 rows each, you get (5000^2) * 10 = 2.5e8 "units" of time. But one transaction of (50,000^2) or 2.5e9 "units" of time, 10 times as long! SECOND, It's really easy to test. If the theory is right, the first command will take 1/10 of 1/10 of the total time, or 1/10 of ( 1/10 of 4 hours ) = 2.4 minutes. This is of course only a rule of thumb, but at least it won't take 4 hours to find out :) THIRD. If this works, the best thing to do is cut the cron job down to every five minutes. I'm assuming you clear the "feeds" table every time you finish the job, so if you go every 5 minutes the transactions are always very tiny. You could possibly go back to one command in that case. On a totally different track, we call this entire operation a "transpose". In particular it is a de-normalizing transpose, turning a normalized feed into a denormalized feed. These are always bad, and this will give you trouble forever. If you have control over the database and can get rid of this your life would be much better for it. Hope this helps. > Hello guys, > > I have a sql query that basically copies data from one table to another, > here is the query > > use mydb; > update Vtems left join feed on Vtems.MCN=feed.mcn > set VItems.Inventory= case (VItems.V_ID) > when 'CN3' then feed.cn3quan > when 'CN4' then feed.cn4quan > when 'CN5' then feed.cn5quan > when 'CN6' then feed.cn6quan > when 'CN7' then feed.cn7quan > when 'CN8' then feed.cn8quan > when 'CN9' then feed.cn9quan > when 'CN10' then feed.cn10quan > when 'CN11' then feed.cn11quan > when 'CN16' then feed.cn16quan > else '' end > ,VItems.ItemCst = feed.unitcost, > VItems.ItemPrce = feed.unitcost > commit; > > > We have a php cron job which executes and runs this query, however it > takes > anywhere between 4-8 hours for this to run on 50,000 records, now this > number will also grow and we have determined that the left join is what is > slowing it down. What i need to know is do you have any suggestions on a > better method for doing this that would speed it up considerably. > > I know we could run this on the mysql command line and we have tried. It > seems to take just as long on the command line as the php cron, however we > are also wishing to implement emails when there are errors etc.. The avg > time is 6 hours on the production server to complete the import. > > Thanks, > -- > Joseph Crawford Jr. > Zend Certified Engineer > Codebowl Solutions, Inc. > 1-802-671-2021 > codebowl at gmail.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From lists at zaunere.com Fri Jan 6 20:35:20 2006 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 6 Jan 2006 20:35:20 -0500 Subject: [nycphp-talk] problems loading a custom, shared extension In-Reply-To: <43BACDF6.5030908@simmons.edu> Message-ID: <000a01c6132a$a14efba0$6501a8c0@MZ> Jonathan wrote on Tuesday, January 03, 2006 2:18 PM: > Following up... the shared object now loads and works properly! > > Hans, thanks for the tip - it proved to be correct. > In php4 the only error on loading the extension was that it wasn't a > valid PHP extension. > Under php 5 a better error appears warning precisely : > > "PHP Warning: PHP Startup: (null): Unable to initialize module > Module compiled with module API=20050922, debug=1, thread-safety=0 > PHP compiled with module API=20041030, debug=0, thread-safety=0 > These options need to match." Great - good to hear it worked... > In running the function in a loop it is 3x faster than php functionality > I am replacing. Interesting - figured it'd be faster, but then again, depending on what it's doing and the rest of the application, I could understand these findings. > However, when testing with apache ab to more accurately simulate real > world conditions it is the same speed as the php functionality I am > replacing. I load the extension in the php.ini file which is about twice > as fast as using dl() to load the extension. Heh - don't let certain people hear that :) > I've learned from this exercise that PHP is written to be fast. > Any obvious reason that an extension function run a loop is faster than > an extension which is loaded through the INI? You mean why the .ini loaded extension is faster than dl() loaded? It's hard to say actualy. AFAIK, while the dl() might take a little longer, once it's loaded, it should run the same. Now there is the age old debate about the consequence of shared code, PIC, dynamically loaded .so and all that good voodoo, but at the end of the day, I think the computer is the only one who really knows. That said, I try to "hardwire" things where possible, rather than loading on the fly (extensions, userland PHP, etc) as I've generally found more reliable behavior, let alone performance. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From codebowl at gmail.com Sat Jan 7 17:47:52 2006 From: codebowl at gmail.com (Joseph Crawford) Date: Sat, 7 Jan 2006 17:47:52 -0500 Subject: [nycphp-talk] file_exists() Message-ID: <8d9a42800601071447w3a161994qc1681c19b11562ce@mail.gmail.com> Guys, I have linked directory in my base directory and i have tried the physical path to the files too, however file_exists always returns false. if i ls the dir and grep for the filename it is there any ideas why this would happen? -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. 1-802-671-2021 codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken at secdat.com Sat Jan 7 19:13:32 2006 From: ken at secdat.com (Kenneth Downs) Date: Sat, 7 Jan 2006 19:13:32 -0500 (EST) Subject: [nycphp-talk] file_exists() In-Reply-To: <8d9a42800601071447w3a161994qc1681c19b11562ce@mail.gmail.com> References: <8d9a42800601071447w3a161994qc1681c19b11562ce@mail.gmail.com> Message-ID: <37556.38.117.147.25.1136679212.squirrel@38.117.147.25> Think file_exists() only searches the directory from which execution began, not necessarily the directory of the current script or the include path. There are a few extra routines in the online docs that provide extended versions of file_exists. > Guys, > > I have linked directory in my base directory and i have tried the physical > path to the files too, however file_exists always returns false. > > if i ls the dir and grep for the filename it is there > > any ideas why this would happen? > > -- > Joseph Crawford Jr. > Zend Certified Engineer > Codebowl Solutions, Inc. > 1-802-671-2021 > codebowl at gmail.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From tedd at sperling.com Sat Jan 7 21:02:08 2006 From: tedd at sperling.com (tedd) Date: Sat, 7 Jan 2006 21:02:08 -0500 Subject: [nycphp-talk] file_exists() In-Reply-To: <8d9a42800601071447w3a161994qc1681c19b11562ce@mail.gmail.com> References: <8d9a42800601071447w3a161994qc1681c19b11562ce@mail.gmail.com> Message-ID: >Guys, > >I have linked directory in my base directory and i have tried the >physical path to the files too, however file_exists always returns >false. > >if i ls the dir and grep for the filename it is there > >any ideas why this would happen? > >-- >Joseph Crawford Jr. Joesph: Are you sure about the path? Try writing a file and then check if it's there. tedd -- -------------------------------------------------------------------------------- http://sperling.com/ From amir.aavani at gmail.com Mon Jan 9 07:33:16 2006 From: amir.aavani at gmail.com (Amir Aavani) Date: Mon, 9 Jan 2006 16:03:16 +0330 Subject: [nycphp-talk] Saving variable value Message-ID: Dear Friends, I want to know how PHP, apache act when the server receive a new request. For example, consider a user enter www.test.com/index.php, is it true that apache run the "php index.php" or something like this. I developed a web-site which needs to retrieve some data from database on every request. These data are dynamic and retrieving them from database take a long time. The point is that these data are altering every for example 2 hours. I have a solution to this problem but I want to know is there is any better solution. I tried to write a IndexGenerator.php which is generate all possible output for index.php with different parameter. And on every request I send the content of the generated file on the disk to clients. The exact thing I want to know is that is there any way in php/apache, by which I can save the value of a variable and retrieve it on a different request. Amir -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at genoverly.net Mon Jan 9 08:19:52 2006 From: lists at genoverly.net (michael) Date: Mon, 9 Jan 2006 08:19:52 -0500 Subject: [nycphp-talk] Saving variable value In-Reply-To: References: Message-ID: <20060109081952.35c55e6a@wit.genoverly.home> On Mon, 9 Jan 2006 16:03:16 +0330 Amir Aavani wrote: > I developed a web-site which needs to retrieve some data from > database on every request. These data are dynamic and retrieving them > from database take a long time. If retrieving the the data is what takes a long time then it sounds like the database may need some tuning, not the app. Indexing is known to help. Perhaps a 'datamart' style table would help too.. for example, summarize the data down to the elements the web is looking for. This can be done automagically with procedures/triggers on the underlying base tables, with a scheduler in the OS or the DB, or with whatever routine that runs every 2 hours that updates the data.. The web app could then call a faster/simpler select. -- Michael From lamolist at cyberxdesigns.com Mon Jan 9 09:18:05 2006 From: lamolist at cyberxdesigns.com (Hans Kaspersetz) Date: Mon, 09 Jan 2006 09:18:05 -0500 Subject: [nycphp-talk] Saving variable value In-Reply-To: References: Message-ID: <43C2709D.50503@cyberxdesigns.com> Sounds like it might be a good candidate for query caching or page caching. http://pear.php.net/manual/en/package.caching.cache-lite.php This is a PEAR library that offers page and data caching. http://adodb.sourceforge.net/ This is an abstraction layer but it offers Query caching. Hans Kaspersetz http://www.cyberxdesigns.com Amir Aavani wrote: > Dear Friends, > > I want to know how PHP, apache act when the server receive a new request. > For example, consider a user enter www.test.com/index.php, is it true > that apache run the "php index.php" or something like this. > > I developed a web-site which needs to retrieve some data from database > on every request. These data are dynamic and retrieving them from > database take a long time. > > The point is that these data are altering every for example 2 hours. I > have a solution to this problem but I want to know is there is any > better solution. > > I tried to write a IndexGenerator.php which is generate all possible > output for index.php with different parameter. And on every request I > send the content of the generated file on the disk to clients. > > The exact thing I want to know is that is there any way in php/apache, > by which I can save the value of a variable and retrieve it on a > different request. > > Amir > >------------------------------------------------------------------------ > >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org > From chris.weyl at gmail.com Mon Jan 9 11:37:06 2006 From: chris.weyl at gmail.com (Chris Weyl) Date: Mon, 9 Jan 2006 11:37:06 -0500 Subject: [nycphp-talk] documentation generation? Message-ID: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> Hey all -- I just had a colleague ask about alternatives to phpDocumenter, which I've been using for some time now. Does anyone have any recommendations? What do people use in documenting their code/project? -Chris From tgales at tgaconnect.com Mon Jan 9 11:46:02 2006 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 09 Jan 2006 11:46:02 -0500 Subject: [nycphp-talk] documentation generation? In-Reply-To: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> References: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> Message-ID: <43C2934A.2090906@tgaconnect.com> Chris Weyl wrote: > Hey all -- > > I just had a colleague ask about alternatives to phpDocumenter, which > I've been using for some time now. Does anyone have any > recommendations? What do people use in documenting their > code/project? I like Doxygen for somethings. Have a look at the following: http://www.mambodemo.net/listings/ -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From ken at secdat.com Mon Jan 9 11:50:35 2006 From: ken at secdat.com (Kenneth Downs) Date: Mon, 9 Jan 2006 11:50:35 -0500 (EST) Subject: [nycphp-talk] documentation generation? In-Reply-To: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> References: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> Message-ID: <38325.38.117.147.25.1136825435.squirrel@38.117.147.25> Here is a contrary opinion: Don't automate documentation. I'm a big fan of automation and automate absolutely everything, always have, and have had great success doing so. But no automatic documentation solution ever satisified me, and I've tried them all, commercial, open-source, and home-grown. I finally came to the conclusion that good documentation contains a lot of stuff that you just can't put into the source code, like example code, perhaps pictures, links, cross-references and so forth. Because this information is different *in-kind* from the details you put into source-code-based documentation, it should be created in a different mental context as part of a different effort. Once you are doing this, then maintaining auto-doc stuff in the source code means you are putting it into two places, which is bad, so you drop the docs in the source code because they are the less important. > Hey all -- > > I just had a colleague ask about alternatives to phpDocumenter, which > I've been using for some time now. Does anyone have any > recommendations? What do people use in documenting their > code/project? > > -Chris > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From danielc at analysisandsolutions.com Mon Jan 9 11:51:11 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 9 Jan 2006 11:51:11 -0500 Subject: [nycphp-talk] documentation generation? In-Reply-To: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> References: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> Message-ID: <20060109165111.GA24479@panix.com> Heya: On Mon, Jan 09, 2006 at 11:37:06AM -0500, Chris Weyl wrote: > > I just had a colleague ask about alternatives to phpDocumenter What's wrong with phpDocumentor? --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From mitch.pirtle at gmail.com Mon Jan 9 11:51:43 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 9 Jan 2006 11:51:43 -0500 Subject: [nycphp-talk] documentation generation? In-Reply-To: <43C2934A.2090906@tgaconnect.com> References: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> <43C2934A.2090906@tgaconnect.com> Message-ID: <330532b60601090851y44e682a9n5cb204770474cd8a@mail.gmail.com> On 1/9/06, Tim Gales wrote: > Chris Weyl wrote: > > Hey all -- > > > > I just had a colleague ask about alternatives to phpDocumenter, which > > I've been using for some time now. Does anyone have any > > recommendations? What do people use in documenting their > > code/project? > > I like Doxygen for somethings. > > Have a look at the following: > http://www.mambodemo.net/listings/ And we just generated the 1.1 API documentation with phpDocumentor, found at http://api.joomla.org. To compare the two, that is an interesting comparison... ;-) -- Mitch Pirtle Joomla! Core Developer Open Source Matters From chris.weyl at gmail.com Mon Jan 9 13:01:10 2006 From: chris.weyl at gmail.com (Chris Weyl) Date: Mon, 9 Jan 2006 13:01:10 -0500 Subject: [nycphp-talk] documentation generation? In-Reply-To: <20060109165111.GA24479@panix.com> References: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> <20060109165111.GA24479@panix.com> Message-ID: <7dd7ab490601091001x4349d868y75ac9d41d5fb6f65@mail.gmail.com> On 1/9/06, Daniel Convissor wrote: > On Mon, Jan 09, 2006 at 11:37:06AM -0500, Chris Weyl wrote: > > > > I just had a colleague ask about alternatives to phpDocumenter > > What's wrong with phpDocumentor? I think it's just curiosity as to what else is out there. And, not being able to answer concretely, it aroused my curiosity as well :) -Chris From randalrust at gmail.com Mon Jan 9 15:10:41 2006 From: randalrust at gmail.com (Randal Rust) Date: Mon, 9 Jan 2006 15:10:41 -0500 Subject: [nycphp-talk] PHP and Oracle Message-ID: I'm taking a stab at connecting to our Oracle database so that I can build a prototype of something, based on our actual data structure. I have enabled the Oracle extension in the .ini file (and verified it by viewind the information with phpInfo() ), but I keep getting this error: Fatal error: Call to undefined function oci_connect() in C:\web\oracle\test.php on line 12 It seems that the extension is not working. Any thoughts? It's probably not all that difficult, I'm just not used to the way Oracle does it's connection thing. TIA. -- Randal Rust R.Squared Communications www.r2communications.com From dirn at dirnonline.com Mon Jan 9 15:14:54 2006 From: dirn at dirnonline.com (Andy Dirnberger) Date: Mon, 9 Jan 2006 15:14:54 -0500 Subject: [nycphp-talk] PHP and Oracle In-Reply-To: Message-ID: <009a01c61559$5c0b39b0$9565a8c0@andyabs> Make sure you are using the php_oci8 extension and not the php_oracle extension. DiRN -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Randal Rust Sent: Monday, January 09, 2006 3:11 PM To: NYPHP Talk Subject: [nycphp-talk] PHP and Oracle I'm taking a stab at connecting to our Oracle database so that I can build a prototype of something, based on our actual data structure. I have enabled the Oracle extension in the .ini file (and verified it by viewind the information with phpInfo() ), but I keep getting this error: Fatal error: Call to undefined function oci_connect() in C:\web\oracle\test.php on line 12 It seems that the extension is not working. Any thoughts? It's probably not all that difficult, I'm just not used to the way Oracle does it's connection thing. TIA. -- Randal Rust R.Squared Communications www.r2communications.com _______________________________________________ New York PHP Talk Mailing List AMP Technology Supporting Apache, MySQL and PHP http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org From max at neuropunks.org Mon Jan 9 19:21:34 2006 From: max at neuropunks.org (Max Gribov) Date: Mon, 09 Jan 2006 19:21:34 -0500 Subject: [nycphp-talk] PHP forum apps Message-ID: <43C2FE0E.7010304@neuropunks.org> Hello all, quick question about forum software, does anyone have their favorite or most trusted one? I looked at phpBB, but their security record is a little scary, and vBulletin isnt free.. Anything else out there worth checking out? I've heard of plenty of others, but having a recommendation from this list would be a lot cooler than freshmeat reviews : ) Thank you! max From lists at zaunere.com Mon Jan 9 23:22:38 2006 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 9 Jan 2006 23:22:38 -0500 Subject: [nycphp-talk] Saving variable value In-Reply-To: Message-ID: <002501c6159d$7ef8c840$6501a8c0@MZ> Hi Amir, Amir Aavani wrote on Monday, January 09, 2006 7:33 AM: > Dear Friends, > > I want to know how PHP, apache act when the server receive a new request. > For example, consider a user enter www.test.com/index.php, is it true > that apache run the "php index.php" or something like this. Long story short, yes. In a typical configuration, a file ending with .php will be parsed and executed by PHP. > I developed a web-site which needs to retrieve some data from database on > every request. These data are dynamic and retrieving them from database > take a long time. > > The point is that these data are altering every for example 2 hours. I > have a solution to this problem but I want to know is there is any better > solution. There could be a huge number of solutions, depending on the application and environment. To speed up database queries, consider tuning and indexing of the database. Or, if the dataset/schema is very large and involves complex processing, then you'll need to implement a caching or data massaging scenario. > I tried to write a IndexGenerator.php which is generate all possible > output for index.php with different parameter. And on every request I > send the content of the generated file on the disk to clients. This would be in line with a caching implementation. > The exact thing I want to know is that is there any way in php/apache, by > which I can save the value of a variable and retrieve it on a different > request. There are, and they are called sessions, but it's likely not what you need for this particular case. You could, however, use a session to store the currently viewed file of data, and then change the session as needed to display other types of data. Best, --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From lists at zaunere.com Mon Jan 9 23:35:38 2006 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 9 Jan 2006 23:35:38 -0500 Subject: [nycphp-talk] Static Methods Usage In-Reply-To: <000a01c612f4$716c7010$0aa8a8c0@cliff> Message-ID: <002601c6159f$51c053a0$6501a8c0@MZ> Cliff Hirsch wrote on Friday, January 06, 2006 2:08 PM: > As I refactor my code yet again, I am torn about whether to make > wide-spread use of static methods (in PHP 5) when appropriate. > > The manual says: > > "Declaring class members or methods as static makes them accessible > without needing an instantiation of the class....In fact static method > calls are resolved at compile time." > > I presume this makes static method calls faster. But by enough to make > it worthwhile? Thoughts? Opinions? Suggestions? As others have mentioned, I wouldn't consider the use of static methods simply because of performance. If performance is such a concern, then pure procedural code - and no OO - will beat out static methods. Instead, static methods should be considered conceptually. They provide functionality that can be executed without an object. Said another way, they provide functionality that is object agnostic. In other words, they are class specific, rather than object specific. This is particularly relevant when doing operations that aren't associated with a particular class instance - or object. A good example is the singleton pattern. Static methods are a must in this case, since you want to be able to work with a class without concern for a particular instance of that class, ie, "global" use of a class, rather than a "local" instance of that class, or in other words, an object. It's akin to static variables in a function - regardless of the function call, you need a variable to remain with the same data - static methods and properties provide a way to access class functionality and data, regardless of the particular object that's in use. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From amir.aavani at gmail.com Tue Jan 10 01:28:52 2006 From: amir.aavani at gmail.com (Amir Aavani) Date: Tue, 10 Jan 2006 09:58:52 +0330 Subject: [nycphp-talk] Saving variable value Message-ID: Hi Hans , Can I store the an object(class) in a session? I though session's can only hold string values! or you mean I have to add ToString and LoadFromString function to my class. >There are, and they are called sessions, but it's likely not what you need >for this particular case. You could, however, use a session to store the >currently viewed file of data, and then change the session as needed to >display other types of data. > >Best, > Also, Is it a good idea that php parse every .php file. why not generating something smaller and simpler to be parsed, for example generating a .php.parsed file ( which is a binary file instead of textile) for every .php, in which "for" strings replaced with code "1", "while" replaced with "2" and ... , something like Java bytecodes. I think this may be result in faster execution. It may be usefully if you don't want the web-host to use or change your codes. Why not using a multi thread application, a main thread which accepts requests from apache and this thread itself create new threads for every new request and can share its variables to these thread? -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.aavani at gmail.com Tue Jan 10 01:47:11 2006 From: amir.aavani at gmail.com (Amir Aavani) Date: Tue, 10 Jan 2006 10:17:11 +0330 Subject: [nycphp-talk] Saving variable value Message-ID: Yes, your right but consider a web-site with high request rate. Asking query from database is a time consuming process? and this (asking query for every request) may cause some error (too many open connection to database at same time or ....). michael wrote: On Mon, 9 Jan 2006 16:03:16 +0330 Amir Aavani wrote: I developed a web-site which needs to retrieve some data from database on every request. These data are dynamic and retrieving them from database take a long time. If retrieving the the data is what takes a long time then it sounds like the database may need some tuning, not the app. Indexing is known to help. Perhaps a 'datamart' style table would help too.. for example, summarize the data down to the elements the web is looking for. This can be done automagically with procedures/triggers on the underlying base tables, with a scheduler in the OS or the DB, or with whatever routine that runs every 2 hours that updates the data.. The web app could then call a faster/simpler select. -------------- next part -------------- An HTML attachment was scrubbed... URL: From yournway at gmail.com Tue Jan 10 06:53:18 2006 From: yournway at gmail.com (Alberto dos Santos) Date: Tue, 10 Jan 2006 11:53:18 +0000 Subject: [nycphp-talk] updating from a table Message-ID: Hello list. I have he following situation I need to manage: Given a table datagrid output, I want to export just a couple of records to a file. No problem about exporting the records to a file, my issue is how to export just a few of them. I thought about having an extra column with a checkbox, with some code, and trap that on the process. How can I trap all that dinamically and encapsulate the data onto a variable to export? TIA. -- Alberto dos Santos -------------- next part -------------- An HTML attachment was scrubbed... URL: From list at harveyk.com Tue Jan 10 07:49:54 2006 From: list at harveyk.com (harvey) Date: Tue, 10 Jan 2006 07:49:54 -0500 Subject: [nycphp-talk] PHP forum apps In-Reply-To: <43C2FE0E.7010304@neuropunks.org> References: <43C2FE0E.7010304@neuropunks.org> Message-ID: <7.0.0.16.2.20060110074917.04935db8@harveyk.com> I've tried punBB and it seems pretty good so far At 07:21 PM 1/9/2006, you wrote: >Hello all, >quick question about forum software, does anyone have their favorite or >most trusted one? >I looked at phpBB, but their security record is a little scary, and >vBulletin isnt free.. >Anything else out there worth checking out? I've heard of plenty of >others, but having a recommendation from this list would be a lot cooler >than freshmeat reviews : ) > >Thank you! > >max > >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org From codebowl at gmail.com Tue Jan 10 08:04:55 2006 From: codebowl at gmail.com (Joseph Crawford) Date: Tue, 10 Jan 2006 08:04:55 -0500 Subject: [nycphp-talk] PHP forum apps In-Reply-To: <7.0.0.16.2.20060110074917.04935db8@harveyk.com> References: <43C2FE0E.7010304@neuropunks.org> <7.0.0.16.2.20060110074917.04935db8@harveyk.com> Message-ID: <8d9a42800601100504l495eb827n3c44ccb941dfaea2@mail.gmail.com> www.k4bb.org is a nice one written in PHP 5 ;) -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. 1-802-671-2021 codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From randalrust at gmail.com Tue Jan 10 08:12:11 2006 From: randalrust at gmail.com (Randal Rust) Date: Tue, 10 Jan 2006 08:12:11 -0500 Subject: [nycphp-talk] PHP and Oracle In-Reply-To: <009a01c61559$5c0b39b0$9565a8c0@andyabs> References: <009a01c61559$5c0b39b0$9565a8c0@andyabs> Message-ID: On 1/9/06, Andy Dirnberger wrote: > Make sure you are using the php_oci8 extension and not the php_oracle > extension. Ah, that was it. I had the oracle.dll uncommented instead of oci8. -- Randal Rust R.Squared Communications www.r2communications.com From chsnyder at gmail.com Tue Jan 10 10:11:27 2006 From: chsnyder at gmail.com (csnyder) Date: Tue, 10 Jan 2006 10:11:27 -0500 Subject: [nycphp-talk] documentation generation? In-Reply-To: <38325.38.117.147.25.1136825435.squirrel@38.117.147.25> References: <7dd7ab490601090837s61b01201h890454fe003e3a56@mail.gmail.com> <38325.38.117.147.25.1136825435.squirrel@38.117.147.25> Message-ID: On 1/9/06, Kenneth Downs wrote: > Here is a contrary opinion: Don't automate documentation. I'm a big fan > of automation and automate absolutely everything, always have, and have > had great success doing so. But no automatic documentation solution ever > satisified me, and I've tried them all, commercial, open-source, and > home-grown. > > I finally came to the conclusion that good documentation contains a lot of > stuff that you just can't put into the source code, like example code, > perhaps pictures, links, cross-references and so forth. Because this > information is different *in-kind* from the details you put into > source-code-based documentation, it should be created in a different > mental context as part of a different effort. Once you are doing this, > then maintaining auto-doc stuff in the source code means you are putting > it into two places, which is bad, so you drop the docs in the source code > because they are the less important. But actually there is a need for both kinds of documentation. The autodoc is the authoritative source for information about your objects' interfaces, and maintaining *lightweight* documentation in the code provides immediate benefits to core developers -- especially if you use a smart IDE that can parse the autodoc and provide hints as you write. Once your API is mature, you can use a wiki or cms to build developer documentation, which contains conceptual descriptions, code samples, useful patterns, and diagrams -- illustrated with deep links to the autodoc. It's not about putting the same information in two places; it's about having the details handled automatically in one place, so you can concentrate on the big picture in another. -- Chris Snyder http://chxo.com/ From craig at juxtadigital.com Tue Jan 10 11:07:15 2006 From: craig at juxtadigital.com (Craig Thomas) Date: Tue, 10 Jan 2006 11:07:15 -0500 Subject: [nycphp-talk] mktime() Message-ID: <43C3DBB3.8010102@juxtadigital.com> Hi all, Am I nuts or does this look odd: mktime()){ print mktime(0,0,0,0,0,$i). " >" .mktime() ; } else{ print mktime(0,0,0,0,0,$i). " <" .mktime() ; } print "
"; } ?> -- Craig From craig at juxtadigital.com Tue Jan 10 11:09:55 2006 From: craig at juxtadigital.com (Craig Thomas) Date: Tue, 10 Jan 2006 11:09:55 -0500 Subject: [nycphp-talk] mktime() In-Reply-To: <43C3DBB3.8010102@juxtadigital.com> References: <43C3DBB3.8010102@juxtadigital.com> Message-ID: <43C3DC53.1040905@juxtadigital.com> Craig Thomas wrote: > Hi all, > > Am I nuts or does this look odd: > > > for($i=1971;$i<=2099;$i++){ > > print $i. ": "; > > if(mktime(0,0,0,0,0,$i) > mktime()){ > print mktime(0,0,0,0,0,$i). " >" .mktime() ; > } > else{ > print mktime(0,0,0,0,0,$i). " <" .mktime() ; > } > print "
"; > > } > > ?> > Doh! I need to read closer: http://us2.php.net/manual/en/function.mktime.php "The number of the year, may be a two or four digit value, with values between 0-69 mapping to 2000-2069 and 70-100 to 1970-2000. On systems where time_t is a 32bit signed integer, as most common today, the valid range for year is somewhere between 1901 and 2038, although this limitation is overcome as of PHP 5.1.0." Sorry, -- Craig From kenrbnsn at rbnsn.com Tue Jan 10 11:13:41 2006 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Tue, 10 Jan 2006 11:13:41 -0500 Subject: [nycphp-talk] mktime() In-Reply-To: <43C3DBB3.8010102@juxtadigital.com> References: <43C3DBB3.8010102@juxtadigital.com> Message-ID: <20060110111341.k6k4dulzhxs888kg@www.rbnsn.com> Quoting Craig Thomas : > Hi all, > > Am I nuts or does this look odd: > > > for($i=1971;$i<=2099;$i++){ PHP time breaks after 2037 (or is it 2031) when the number of seconds since 1/1/1970 overflows the integer that's holding the number. Ken From danielc at analysisandsolutions.com Tue Jan 10 12:53:33 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 10 Jan 2006 12:53:33 -0500 Subject: [nycphp-talk] PHP forum apps In-Reply-To: <43C2FE0E.7010304@neuropunks.org> References: <43C2FE0E.7010304@neuropunks.org> Message-ID: <20060110175333.GA13029@panix.com> On Mon, Jan 09, 2006 at 07:21:34PM -0500, Max Gribov wrote: > Hello all, > quick question about forum software, does anyone have their favorite or > most trusted one? http://fudforum.org/forum/ by Ilia Alshanetsky, a member of the PHP Security Consortium. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jeff.loiselle at gmail.com Tue Jan 10 15:34:35 2006 From: jeff.loiselle at gmail.com (Jeff Loiselle) Date: Tue, 10 Jan 2006 15:34:35 -0500 Subject: [nycphp-talk] [OT] UML Software Message-ID: <4b1887110601101234h30e137fn4187cc06e430f7db@mail.gmail.com> Can anyone recommend good, free UML diagram software? --- Jeff Loiselle Web Developer, Musician, and Observer http://jeff.loiselles.com From mwithington at PLMresearch.com Tue Jan 10 15:38:10 2006 From: mwithington at PLMresearch.com (Mark Withington) Date: Tue, 10 Jan 2006 15:38:10 -0500 Subject: [nycphp-talk] [OT] UML Software Message-ID: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358013557F1@network.PLMresearch.com> Poseidon for UML maybe? I can't remember if this is still free. -------------------------- Mark L. Withington PLMresearch "eBusiness for the Midsize Enterprise" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 http://www.PLMresearch.com AIM/MSN/Skype: PLMresearch Yahoo: PLMresearch2000 mwithington at plmresearch.com Public Key: http://www.plmresearch.com/keys/MLW_public_key.asc Calendar: http://www.plmresearch.com/calendar.php > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Jeff Loiselle > Sent: Tuesday, January 10, 2006 3:35 PM > To: NYPHP Talk > Subject: [nycphp-talk] [OT] UML Software > > > Can anyone recommend good, free UML diagram software? > > --- > Jeff Loiselle > Web Developer, Musician, and Observer > http://jeff.loiselles.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From tgales at tgaconnect.com Tue Jan 10 15:46:00 2006 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 10 Jan 2006 15:46:00 -0500 Subject: [nycphp-talk] [OT] UML Software In-Reply-To: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358013557F1@network.PLMresearch.com> References: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358013557F1@network.PLMresearch.com> Message-ID: <43C41D08.3030300@tgaconnect.com> Mark Withington wrote: > Poseidon for UML maybe? I can't remember if this is still free. They have a 'community edition' http://gentleware.com/edcompare.0.html in response to: >>Subject: [nycphp-talk] [OT] UML Software >> >> >>Can anyone recommend good, free UML diagram software? >> >>--- >>Jeff Loiselle >>Web Developer, Musician, and Observer >>http://jeff.loiselles.com -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From felix.shnir at gmail.com Tue Jan 10 16:10:10 2006 From: felix.shnir at gmail.com (Felix Shnir) Date: Tue, 10 Jan 2006 16:10:10 -0500 Subject: [nycphp-talk] [OT] UML Software In-Reply-To: <4b1887110601101234h30e137fn4187cc06e430f7db@mail.gmail.com> References: <4b1887110601101234h30e137fn4187cc06e430f7db@mail.gmail.com> Message-ID: Try Argo UML. Its pretty good. http://argouml.tigris.org/ 2006/1/10, Jeff Loiselle : > Can anyone recommend good, free UML diagram software? > > --- > Jeff Loiselle > Web Developer, Musician, and Observer > http://jeff.loiselles.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From list at harveyk.com Tue Jan 10 16:32:11 2006 From: list at harveyk.com (harvey) Date: Tue, 10 Jan 2006 16:32:11 -0500 Subject: [nycphp-talk] Document management software for site Message-ID: <7.0.0.16.2.20060110162615.04ab3ee0@usa.com> Hello NYphp, I've got a client who needs a site that will basically just be nicely organized "articles". The issue is that the creation and order of categories, subcategories, and articles might change as new content is created and added to the site. (The articles do not have dates). I've been looking for simple to implement and use document management software. Some that look interesting are: - opencms.org - word-press.net - ez.no My needs are pretty simple: - add/edit/change order of categories and subcategories (probably at least three levels deep), - add/edit/change order of documents to any cat/subcat (nearly 100% of docs will be 100% text only), - automatically generate navigation and subnavigation - allow customization of design (very basic design is totally fine) - create page of article summaries within a cat/subcat (nice to have, not necesary) - text/keyword search (nice to have, not necessary) Any suggestions? A few PHP scripts that read the contents of properly organized folders would probably work for some of the above. I've written a few that get close to what I want on a folder by folder basis. But the main issue is that I don't know how the PHP would order the documents other than alphabetically/numerically. But the docs should be able to be displayed in any order, regardless of their names... And in any case, a nicely done software package would probably be better if/as the site grows in complexity and needs... Thanks! Harvey From jonbaer at jonbaer.com Tue Jan 10 16:38:44 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 10 Jan 2006 16:38:44 -0500 Subject: [nycphp-talk] Document management software for site In-Reply-To: <7.0.0.16.2.20060110162615.04ab3ee0@usa.com> References: <7.0.0.16.2.20060110162615.04ab3ee0@usa.com> Message-ID: Try Joomla! http://www.joomla.org - Jon On Jan 10, 2006, at 4:32 PM, harvey wrote: > Hello NYphp, > > I've got a client who needs a site that will basically just be nicely > organized "articles". > > The issue is that the creation and order of categories, > subcategories, and articles > might change as new content is created and added to the site. (The > articles do not have dates). > > I've been looking for simple to implement and use document > management software. > Some that look interesting are: > - opencms.org > - word-press.net > - ez.no > > My needs are pretty simple: > - add/edit/change order of categories and subcategories (probably at > least three levels deep), > - add/edit/change order of documents to any cat/subcat (nearly 100% > of docs will be 100% text only), > - automatically generate navigation and subnavigation > - allow customization of design (very basic design is totally fine) > - create page of article summaries within a cat/subcat (nice to have, > not necesary) > - text/keyword search (nice to have, not necessary) > > Any suggestions? > > A few PHP scripts that read the contents of properly organized > folders would probably work for some of the above. > I've written a few that get close to what I want on a folder by > folder basis. > But the main issue is that I don't know how the PHP would order the > documents other than alphabetically/numerically. > But the docs should be able to be displayed in any order, regardless > of their names... > And in any case, a nicely done software package would probably be > better if/as the site grows in complexity and needs... > > Thanks! > Harvey > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From list at harveyk.com Tue Jan 10 17:42:53 2006 From: list at harveyk.com (harvey) Date: Tue, 10 Jan 2006 17:42:53 -0500 Subject: [nycphp-talk] Document management software for site In-Reply-To: References: <7.0.0.16.2.20060110162615.04ab3ee0@usa.com> Message-ID: <7.0.0.16.2.20060110174229.04a95f00@harveyk.com> Thanks, I did a quick review, and that might do pretty well... At 04:38 PM 1/10/2006, you wrote: >Try Joomla! > >http://www.joomla.org > >- Jon > >On Jan 10, 2006, at 4:32 PM, harvey wrote: > > > Hello NYphp, > > > > I've got a client who needs a site that will basically just be nicely > > organized "articles". > > > > The issue is that the creation and order of categories, > > subcategories, and articles > > might change as new content is created and added to the site. (The > > articles do not have dates). > > > > I've been looking for simple to implement and use document > > management software. > > Some that look interesting are: > > - opencms.org > > - word-press.net > > - ez.no > > > > My needs are pretty simple: > > - add/edit/change order of categories and subcategories (probably at > > least three levels deep), > > - add/edit/change order of documents to any cat/subcat (nearly 100% > > of docs will be 100% text only), > > - automatically generate navigation and subnavigation > > - allow customization of design (very basic design is totally fine) > > - create page of article summaries within a cat/subcat (nice to have, > > not necesary) > > - text/keyword search (nice to have, not necessary) > > > > Any suggestions? > > > > A few PHP scripts that read the contents of properly organized > > folders would probably work for some of the above. > > I've written a few that get close to what I want on a folder by > > folder basis. > > But the main issue is that I don't know how the PHP would order the > > documents other than alphabetically/numerically. > > But the docs should be able to be displayed in any order, regardless > > of their names... > > And in any case, a nicely done software package would probably be > > better if/as the site grows in complexity and needs... > > > > Thanks! > > Harvey > > > > _______________________________________________ > > New York PHP Talk Mailing List > > AMP Technology > > Supporting Apache, MySQL and PHP > > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org > > > >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org From lists at genoverly.net Tue Jan 10 18:08:41 2006 From: lists at genoverly.net (michael) Date: Tue, 10 Jan 2006 18:08:41 -0500 Subject: [nycphp-talk] Document management software for site In-Reply-To: <7.0.0.16.2.20060110162615.04ab3ee0@usa.com> References: <7.0.0.16.2.20060110162615.04ab3ee0@usa.com> Message-ID: <20060110180841.764634d0@wit.genoverly.home> On Tue, 10 Jan 2006 16:32:11 -0500 harvey wrote: > My needs are pretty simple: > - add/edit/change order of categories and subcategories (probably at > least three levels deep), > - add/edit/change order of documents to any cat/subcat (nearly 100% > of docs will be 100% text only), > - automatically generate navigation and subnavigation > - allow customization of design (very basic design is totally fine) > - create page of article summaries within a cat/subcat (nice to have, > not necesary) > - text/keyword search (nice to have, not necessary) > > Any suggestions? I've done something very similar for another user group site. We store some backend data on the documents in a database. Each document has a unique key. Next to that key in the table are foreign keys from a lookup tables that contains headings, subheadings, page order, showit/noshowit flags, etc. The document can be stored in the db or as a reference to a file. The public web page queries the db and arranges the nav and documents according to how each document is associated with the look up tables. I built a little admin interface to edit the lookup tables to re-arrange the page as needed - on the fly. Granted, this is pretty simple.. but works well, has a very low overhead, is very flexible, and did not take too much time to set up. I had the added bonus of using my own css so it blends well. -- Michael From lists at zaunere.com Tue Jan 10 22:52:11 2006 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 10 Jan 2006 22:52:11 -0500 Subject: [nycphp-talk] Saving variable value In-Reply-To: Message-ID: <001c01c61662$6798c8b0$6501a8c0@MZ> Hi Amir, Amir Aavani wrote on Tuesday, January 10, 2006 1:29 AM: > Hi Hans , > > Can I store the an object(class) in a session? > I though session's can only hold string values! > or you mean I have to add ToString and LoadFromString function to my > class. You can store almost anything in a PHP session. Be sure to read up session and object behavior in these cases though: http://us3.php.net/manual/en/ref.session.php http://us3.php.net/manual/en/function.serialize.php Objects are serialized when they are stored in sessions and the __sleep/__wakeup magic methods become relevant. > > There are, and they are called sessions, but it's likely not what you > > need for this particular case. You could, however, use a session to > > store the currently viewed file of data, and then change the session as > > needed to display other types of data. > > > > Best, > > > Also, Is it a good idea that php parse every .php file. why not > generating something smaller and simpler to be parsed, for example > generating a .php.parsed file ( which is a binary file instead of > textile) for every .php, in which "for" strings replaced with code "1", > "while" replaced with "2" and ... , something like Java bytecodes. I > think this may be result in faster execution. It may be usefully if you > don't want the web-host to use or change your codes. There are a number of accellerators out there that do this type of thing. However, in the large majority of web sites, you won't have the performance needs, especially if the application is written well. PHP isn't nearly as heavy as Java in this respect. > Why not using a multi thread application, a main thread which accepts > requests from apache and this thread itself create new threads for every > new request and can share its variables to these thread? Threading in PHP is still an issue that's commonly under discussion. For someone looking to get started in PHP and write basic applications, let's save that discussion for another time. Long story short, PHP is a process based language. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From greggurevich at gmail.com Wed Jan 11 00:20:52 2006 From: greggurevich at gmail.com (Greg Gurevich) Date: Wed, 11 Jan 2006 00:20:52 -0500 Subject: [nycphp-talk] Advice on Cake vs Symfony Message-ID: I have been programming PHP for years, recently I am starting to look at different frameworks to start using in new products I am basically going with either Cake or Symfony, I wanted to know if anyone on the board has experience with either and which one you guys would recommend. Thanks, Greg From yournway at gmail.com Wed Jan 11 04:02:24 2006 From: yournway at gmail.com (Alberto dos Santos) Date: Wed, 11 Jan 2006 09:02:24 +0000 Subject: [nycphp-talk] Advice on Cake vs Symfony In-Reply-To: References: Message-ID: try Qcodo, www.qcodo.com, it generates code instead of just parsing it at runtime, it's stable and OO oriented and based on PHP5 and comes complete with a presentation layer. The more I use it, the more I love it. (not an affiliate, though...) On 11/01/06, Greg Gurevich wrote: > > I have been programming PHP for years, recently I am starting to look > at different frameworks to start using in new products I am basically > going with either Cake or Symfony, I wanted to know if anyone on the > board has experience with either and which one you guys would > recommend. > Thanks, > Greg > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Alberto dos Santos Consultor em TI IT Consultant http://www.yournway.com A internet ? sua maneira. The Internet your own way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitch.pirtle at gmail.com Wed Jan 11 11:43:37 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Wed, 11 Jan 2006 11:43:37 -0500 Subject: [nycphp-talk] PHP forum apps In-Reply-To: <43C2FE0E.7010304@neuropunks.org> References: <43C2FE0E.7010304@neuropunks.org> Message-ID: <330532b60601110843h7900cd7ct273b2de82e5848b7@mail.gmail.com> On 1/9/06, Max Gribov wrote: > Hello all, > quick question about forum software, does anyone have their favorite or > most trusted one? I'm a huge fan of SMF from www.simplemachines.org, which has excellent performance, good features, and a strong security history. That's what we use to power the community forums for Joomla! and those are some busy forums ;-) -- Mitch Pirtle Joomla! Core Developer Open Source Matters From mitch.pirtle at gmail.com Wed Jan 11 11:48:05 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Wed, 11 Jan 2006 11:48:05 -0500 Subject: [nycphp-talk] Document management software for site In-Reply-To: <7.0.0.16.2.20060110174229.04a95f00@harveyk.com> References: <7.0.0.16.2.20060110162615.04ab3ee0@usa.com> <7.0.0.16.2.20060110174229.04a95f00@harveyk.com> Message-ID: <330532b60601110848w6de078bdg8b8ab55e2cff4241@mail.gmail.com> On 1/10/06, harvey wrote: > Thanks, I did a quick review, and that might do pretty well... > > > At 04:38 PM 1/10/2006, you wrote: > > >Try Joomla! > > > >http://www.joomla.org That's one brownie point for Jon ;-) Also, there's DocMan, the Mambo/Joomla! document management component: http://www.mambodocman.com/ One of the DocMan developers is a core developer on Joomla!, and development has really picked up lately and some really new and exciting releases are on the way. If you want document management (and not just content management) I'd take a look at DocMan. -- Mitch Pirtle Joomla! Core Developer Open Source Matters From jonbaer at jonbaer.com Wed Jan 11 12:24:06 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 11 Jan 2006 12:24:06 -0500 Subject: [nycphp-talk] [OT] UML Software In-Reply-To: <4b1887110601101234h30e137fn4187cc06e430f7db@mail.gmail.com> References: <4b1887110601101234h30e137fn4187cc06e430f7db@mail.gmail.com> Message-ID: <8BC6750B-77E0-458C-8655-1A6E321E5C1A@jonbaer.com> The MySQL Workbench looks very promising (that is if you are using MySQL) ... http://www.openwin.org/mike/video/WorkbenchAlphaDemo/ WorkbenchAlphaDemo.html Might be good to send an email to them if you need a feature or two, (ie format export). I personally like DbVisualizer once you get all your drivers in place. http://www.minq.se/products/dbvis/ - Jon On Jan 10, 2006, at 3:34 PM, Jeff Loiselle wrote: > Can anyone recommend good, free UML diagram software? > > --- > Jeff Loiselle > Web Developer, Musician, and Observer > http://jeff.loiselles.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From lamolist at cyberxdesigns.com Wed Jan 11 12:44:21 2006 From: lamolist at cyberxdesigns.com (Hans Kaspersetz) Date: Wed, 11 Jan 2006 12:44:21 -0500 Subject: [nycphp-talk] PHP-Java-Bridge Compile Problem. Message-ID: <43C543F5.1040107@cyberxdesigns.com> This maybe slightly off topic but the normal channels have not been responsive. I am trying to compile from source php-java-bridge on FreeBSD 5.3 and it is dieing during the configure process. I know we have some BSD gurus on this list and I was hoping for a little help. More information about the bridge including instructions can be found at: http://php-java-bridge.sourceforge.net/ The details: FreeBSD 5.3 Sun Java sdk1.5.0 Apache 2.0.53 PHP 4.3.11 php-java-bridge-2.0.8 I downloaded the file and untared it into: /usr/local/php-java-bridge-2.0.8 I ran: phpize && ./configure --disable-servlet --with-java=/opt/IBMJava2-14 && make CFLAGS="-m32" I get the following after a bunch of output. I can provide the config.log if you like. ---snip output-- configure: creating ./config.status config.status: creating config.h configure: configuring in server configure: running /usr/local/bin/bash './configure.gnu' --prefix=/usr/local '--disable-servlet' '--with-java=/opt/IBMJava2-14' --cache-file=/dev/null --srcdir=. ./configure.gnu: line 5: aclocal: command not found ./configure.gnu: line 6: autoheader: command not found ./configure.gnu: line 7: autoconf: command not found ./configure.gnu: line 8: libtoolize: command not found ./configure.gnu: line 10: automake: command not found ./configure: Can't open ./configure: No such file or directory configure: error: /usr/local/bin/bash './configure.gnu' failed for server bsdmachine# ----- End of screen data --- I think my --with-java=/opt/foo is wrong. I imagine I need one that signifies that I am using Sun Java. Beyond that, I am totally lost. Please help, I have been pulling my hair out over this. I am sure you need more information, just me know what you need. Thanks, Hans From andrew at plexpod.com Wed Jan 11 12:43:53 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Wed, 11 Jan 2006 12:43:53 -0500 Subject: [nycphp-talk] PHP-Java-Bridge Compile Problem. In-Reply-To: <43C543F5.1040107@cyberxdesigns.com> References: <43C543F5.1040107@cyberxdesigns.com> Message-ID: <20060111174352.GH26280@desario.homelinux.net> On Wed, Jan 11, 2006 at 12:44:21PM -0500, Hans Kaspersetz wrote: > This maybe slightly off topic but the normal channels have not been > responsive. > > I am trying to compile from source php-java-bridge on FreeBSD 5.3 and it > is dieing during the configure process. I know we have some BSD gurus > on this list and I was hoping for a little help. > > More information about the bridge including instructions can be found > at: http://php-java-bridge.sourceforge.net/ > > The details: > > FreeBSD 5.3 > Sun Java sdk1.5.0 > Apache 2.0.53 > PHP 4.3.11 > php-java-bridge-2.0.8 > > I downloaded the file and untared it into: > /usr/local/php-java-bridge-2.0.8 > > I ran: phpize && ./configure --disable-servlet > --with-java=/opt/IBMJava2-14 && make CFLAGS="-m32" > > I get the following after a bunch of output. I can provide the > config.log if you like. > > ---snip output-- > configure: creating ./config.status > config.status: creating config.h > configure: configuring in server > configure: running /usr/local/bin/bash > './configure.gnu' --prefix=/usr/local > '--disable-servlet' '--with-java=/opt/IBMJava2-14' > --cache-file=/dev/null --srcdir=. > ./configure.gnu: line 5: aclocal: command not found > ./configure.gnu: line 6: autoheader: command not found > ./configure.gnu: line 7: autoconf: command not found > ./configure.gnu: line 8: libtoolize: command not found > ./configure.gnu: line 10: automake: command not found > ./configure: Can't open ./configure: No such file or > directory > configure: error: /usr/local/bin/bash './configure.gnu' > failed for server > bsdmachine# > > > ----- End of screen data --- > > I think my --with-java=/opt/foo is wrong. I imagine I need one that > signifies that I am using Sun Java. Beyond that, I am totally lost. > Please help, I have been pulling my hair out over this. > > I am sure you need more information, just me know what you need. > > Thanks, > Hans Looks like your missing GNU autoconf. You'll probably need M4 also. HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From jonbaer at jonbaer.com Wed Jan 11 16:01:31 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 11 Jan 2006 16:01:31 -0500 Subject: [nycphp-talk] PHP-Java-Bridge Compile Problem. In-Reply-To: <20060111174352.GH26280@desario.homelinux.net> References: <43C543F5.1040107@cyberxdesigns.com> <20060111174352.GH26280@desario.homelinux.net> Message-ID: <212139D4-2E6E-4CD4-947F-6EEC9A98C65D@jonbaer.com> Looks like pathing is a little messed up ... What does "echo $PATH" show? Does BSD put bash out like "/usr/local/bin/bash"? You should be able to see all of the tools: >> aclocal: command not found >> ./configure.gnu: line 6: autoheader: command not found >> ./configure.gnu: line 7: autoconf: command not found >> ./configure.gnu: line 8: libtoolize: command not found >> ./configure.gnu: line 10: automake: command not found try "which aclocal" and adjust the PATH if needed. I also think (not sure) you should have it untarred under your PHP src's ext path ... /ext for the extension to compile correctly. If you look at (head /usr/bin/phpize) you can see the variable declarations needed (prefix,etc). - Jon On Jan 11, 2006, at 12:43 PM, Andrew Yochum wrote: > On Wed, Jan 11, 2006 at 12:44:21PM -0500, Hans Kaspersetz wrote: >> This maybe slightly off topic but the normal channels have not been >> responsive. >> >> I am trying to compile from source php-java-bridge on FreeBSD 5.3 >> and it >> is dieing during the configure process. I know we have some BSD >> gurus >> on this list and I was hoping for a little help. >> >> More information about the bridge including instructions can be found >> at: http://php-java-bridge.sourceforge.net/ >> >> The details: >> >> FreeBSD 5.3 >> Sun Java sdk1.5.0 >> Apache 2.0.53 >> PHP 4.3.11 >> php-java-bridge-2.0.8 >> >> I downloaded the file and untared it into: >> /usr/local/php-java-bridge-2.0.8 >> >> I ran: phpize && ./configure --disable-servlet >> --with-java=/opt/IBMJava2-14 && make CFLAGS="-m32" >> >> I get the following after a bunch of output. I can provide the >> config.log if you like. >> >> ---snip output-- >> configure: creating ./config.status >> config.status: creating config.h >> configure: configuring in server >> configure: running /usr/local/bin/bash >> './configure.gnu' --prefix=/usr/local >> '--disable-servlet' '--with-java=/opt/IBMJava2-14' >> --cache-file=/dev/null --srcdir=. >> ./configure.gnu: line 5: aclocal: command not found >> ./configure.gnu: line 6: autoheader: command not found >> ./configure.gnu: line 7: autoconf: command not found >> ./configure.gnu: line 8: libtoolize: command not found >> ./configure.gnu: line 10: automake: command not found >> ./configure: Can't open ./configure: No such file or >> directory >> configure: error: /usr/local/bin/bash './configure.gnu' >> failed for server >> bsdmachine# >> >> >> ----- End of screen data --- >> >> I think my --with-java=/opt/foo is wrong. I imagine I need one that >> signifies that I am using Sun Java. Beyond that, I am totally lost. >> Please help, I have been pulling my hair out over this. >> >> I am sure you need more information, just me know what you need. >> >> Thanks, >> Hans > > Looks like your missing GNU autoconf. You'll probably need M4 also. > > HTH, > Andrew > > -- > Andrew Yochum > Plexpod > andrew at plexpod.com > 718-360-0879 > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From lamolist at cyberxdesigns.com Thu Jan 12 09:01:24 2006 From: lamolist at cyberxdesigns.com (Hans Kaspersetz) Date: Thu, 12 Jan 2006 09:01:24 -0500 Subject: [nycphp-talk] PHP-Java-Bridge Compile Problem. In-Reply-To: <212139D4-2E6E-4CD4-947F-6EEC9A98C65D@jonbaer.com> References: <43C543F5.1040107@cyberxdesigns.com> <20060111174352.GH26280@desario.homelinux.net> <212139D4-2E6E-4CD4-947F-6EEC9A98C65D@jonbaer.com> Message-ID: <43C66134.7000108@cyberxdesigns.com> Definitely was a path problem. I added my gnu-autotool directory to my PATH and things got much better. My automake, autoconf, ect were not in the PATH. Andrew pointed me in the right direction. I now have a new problem that I am working on: checking for pthreads_cflags... -pthread checking for pthreads_lib... configure: error: host_alias is not set. Make sure to run config.guess configure: error: /usr/local/bin/bash './configure.gnu' failed for server bsdmachine# ./config.guess i386-unknown-freebsd5.3 bsdmachine# I have been directed to clean the source directory and untar a fresh copy. As soon as I am done with the next client meeting, I will do that. If anyone else has intelegent direction on this one, please chime in. I thought I saw a libtoolize error earlier in the process and I added libtoolize to the path but that didn't clean up the problem. 1 step at a time. Hans Jon Baer wrote: >Looks like pathing is a little messed up ... > >What does "echo $PATH" show? >Does BSD put bash out like "/usr/local/bin/bash"? > >You should be able to see all of the tools: > > >>>aclocal: command not found >>>./configure.gnu: line 6: autoheader: command not found >>>./configure.gnu: line 7: autoconf: command not found >>>./configure.gnu: line 8: libtoolize: command not found >>>./configure.gnu: line 10: automake: command not found >>> >>> From volcimaster at gmail.com Thu Jan 12 16:20:57 2006 From: volcimaster at gmail.com (Warren Myers) Date: Thu, 12 Jan 2006 16:20:57 -0500 Subject: [nycphp-talk] odbc connection question Message-ID: Do I need to reset/reinitialize the connection before every query, or can I just use one connection and run multiple queries in succession from it? Thanks. Warren -- http://warrenmyers.com "God may not play dice with the universe, but something strange is going on with the prime numbers." --Paul Erd?s "It's not possible. We are the type of people who have everything in our favor going against us." --Ben Jarhvi, Short Circuit 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Fri Jan 13 10:11:17 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 13 Jan 2006 10:11:17 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions Message-ID: <001401c61853$9e3edd30$0aa8a8c0@cliff> What PHP shopping cart would you recommend? I need a cart where I can heavily customize the presentation layer, payment methodology and fulfillment methodology (that about covers it all!). One that either provides rich back-end functionality or has good hooks into a back-end system would be nice too. I'm torn between OSCommerce and the OSCommerce fork Zen Cart. Comments? Suggestions? Other carts I should look at? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From mwithington at PLMresearch.com Fri Jan 13 10:16:32 2006 From: mwithington at PLMresearch.com (Mark Withington) Date: Fri, 13 Jan 2006 10:16:32 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions Message-ID: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE35801355801@network.PLMresearch.com> Cliff, did you check out josCommerce ( www.josCommerce.com ) it's a port of osCommerce to Joomla. -------------------------- Mark L. Withington PLMresearch "eBusiness for the Midsize Enterprise" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 http://www.PLMresearch.com AIM/MSN/Skype: PLMresearch Yahoo: PLMresearch2000 mwithington at plmresearch.com Public Key: http://www.plmresearch.com/keys/MLW_public_key.asc Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Cliff Hirsch Sent: Friday, January 13, 2006 10:11 AM To: talk at lists.nyphp.org Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions What PHP shopping cart would you recommend? I need a cart where I can heavily customize the presentation layer, payment methodology and fulfillment methodology (that about covers it all!). One that either provides rich back-end functionality or has good hooks into a back-end system would be nice too. I'm torn between OSCommerce and the OSCommerce fork Zen Cart. Comments? Suggestions? Other carts I should look at? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Fri Jan 13 10:23:09 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 13 Jan 2006 10:23:09 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions In-Reply-To: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE35801355801@network.PLMresearch.com> Message-ID: <002901c61855$4278fd30$0aa8a8c0@cliff> Mark: I figured you'd throw in a comment! I have looked at it, but I don't use Joomla. It's for a full-custom ap, so I'm not sure if it would be appropriate. Unless I decided to use Joomla as my Framework, which ir probably overkill. Perhaps just osCommerce? But from what I have gathered, the presentation layer is really embedded in the code. Cliff _______________________________ Pinestream Communications, Inc. Publisher of Semiconductor Times & Telecom Trends 52 Pine Street, Weston, MA 02493 USA Tel: 781.647.8800, Fax: 781.647.8825 http://www.pinestream.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mark Withington Sent: Friday, January 13, 2006 10:17 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Favorite PHP Shopping cart suggestions Cliff, did you check out josCommerce (www.josCommerce.com) it's a port of osCommerce to Joomla. -------------------------- Mark L. Withington PLMresearch "eBusiness for the Midsize Enterprise" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 http://www.PLMresearch.com AIM/MSN/Skype: PLMresearch Yahoo: PLMresearch2000 mwithington at plmresearch.com Public Key: http://www.plmresearch.com/keys/MLW_public_key.asc Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Cliff Hirsch Sent: Friday, January 13, 2006 10:11 AM To: talk at lists.nyphp.org Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions What PHP shopping cart would you recommend? I need a cart where I can heavily customize the presentation layer, payment methodology and fulfillment methodology (that about covers it all!). One that either provides rich back-end functionality or has good hooks into a back-end system would be nice too. I'm torn between OSCommerce and the OSCommerce fork Zen Cart. Comments? Suggestions? Other carts I should look at? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew at plexpod.com Fri Jan 13 10:30:58 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 13 Jan 2006 10:30:58 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions In-Reply-To: <001401c61853$9e3edd30$0aa8a8c0@cliff> References: <001401c61853$9e3edd30$0aa8a8c0@cliff> Message-ID: <20060113153057.GX26280@desario.homelinux.net> On Fri, Jan 13, 2006 at 10:11:17AM -0500, Cliff Hirsch wrote: > What PHP shopping cart would you recommend? I need a cart where I can > heavily customize the presentation layer, payment methodology and > fulfillment methodology (that about covers it all!). One that either > provides rich back-end functionality or has good hooks into a back-end > system would be nice too. > > I'm torn between OSCommerce and the OSCommerce fork Zen Cart. Comments? > Suggestions? Other carts I should look at? X-Cart is fairly good. It provides the same functionality that osC does, and then some out of the box. The code is clean and easy to maintain (upgrades & customizations) since there is a full separation of templates from code and upgrades are available as patches. The hooks are decent in all the necessary places - shipping, payment, etc. However, the code is procedural, and sometimes no use of functions or spliting of big functions and this, IMO, results in reptition, therefore unreusable code. Add-ons/modules are available from both X-Cart and third parties. It is not open source, but full source is provided, and the licensing is inexpensive. Some of the third party add-ons/modules are encoded making customization & repurposing of them next to impossible. (I'd even offered one vendor around 50x the license price for the source only to be refused) osC is just a nightmare IMO. The functionality is great and the community around it is large and supportive. Customization is a PITA as the HTML is embedded in tons of spahetti code. The community contributions are sometimes great and sometimes terrible. Many incompatibilities can arise as you customize your installation with contributions. Any kind of customizations - look and feel or functionality - often make upgrades seriously difficult. I can't speak for Zen Cart, but have heard it is better than osC. On the whole, I have not found a solution that I've been 100% satisfied with yet, but X-Cart is certainly my pick for now. Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From jonbaer at jonbaer.com Fri Jan 13 10:38:13 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 13 Jan 2006 10:38:13 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions In-Reply-To: <002901c61855$4278fd30$0aa8a8c0@cliff> References: <002901c61855$4278fd30$0aa8a8c0@cliff> Message-ID: <83DD6F88-A73C-4DEA-810D-BD251D533A4D@jonbaer.com> As a side note to using osCommerce, I had to set it up once around a dozen times, before you do install you might want to grab a pad and go through all the plug ins available for the base install, it does not have a defined plug-in architecture, if you download a contrib package look at the readme to see what I mean. Then when you need to upgrade your base installation for whatever reason, look out :-) I would think that even if a framework is overkill its probably worth it for that reason alone. On Jan 13, 2006, at 10:23 AM, Cliff Hirsch wrote: > Mark: > > I figured you'd throw in a comment! I have looked at it, but I > don't use > Joomla. It's for a full-custom ap, so I'm not sure if it would be > appropriate. Unless I decided to use Joomla as my Framework, which ir > probably overkill. Perhaps just osCommerce? But from what I have > gathered, the presentation layer is really embedded in the code. > > Cliff > _______________________________ > Pinestream Communications, Inc. > Publisher of Semiconductor Times & Telecom Trends > 52 Pine Street, Weston, MA 02493 USA > Tel: 781.647.8800, Fax: 781.647.8825 > http://www.pinestream.com > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] > On Behalf Of Mark Withington > Sent: Friday, January 13, 2006 10:17 AM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] Favorite PHP Shopping cart suggestions > > > Cliff, did you check out josCommerce (www.josCommerce.com) it's a port > of osCommerce to Joomla. > > > -------------------------- > Mark L. Withington > PLMresearch > "eBusiness for the Midsize Enterprise" > PO Box 1354 > Plymouth, MA 02362 > o: 800-310-3992 ext. 704 > f: 508-746-4973 > v: 508-746-2383 > m: 508-801-0181 > http://www.PLMresearch.com > AIM/MSN/Skype: PLMresearch > Yahoo: PLMresearch2000 > mwithington at plmresearch.com > Public Key: http://www.plmresearch.com/keys/MLW_public_key.asc > Calendar: http://www.plmresearch.com/calendar.php > > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Cliff Hirsch > Sent: Friday, January 13, 2006 10:11 AM > To: talk at lists.nyphp.org > Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions > > > What PHP shopping cart would you recommend? I need a cart where I can > heavily customize the presentation layer, payment methodology and > fulfillment methodology (that about covers it all!). One that either > provides rich back-end functionality or has good hooks into a back-end > system would be nice too. > > I'm torn between OSCommerce and the OSCommerce fork Zen Cart. > Comments? > Suggestions? Other carts I should look at? > > Cliff > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From hendler at simmons.edu Fri Jan 13 10:40:57 2006 From: hendler at simmons.edu (Jonathan) Date: Fri, 13 Jan 2006 10:40:57 -0500 Subject: [nycphp-talk] problems loading a custom, shared extension In-Reply-To: <000a01c6132a$a14efba0$6501a8c0@MZ> References: <000a01c6132a$a14efba0$6501a8c0@MZ> Message-ID: <43C7CA09.90404@simmons.edu> An HTML attachment was scrubbed... URL: From cliff at pinestream.com Fri Jan 13 11:09:06 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 13 Jan 2006 11:09:06 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions In-Reply-To: <20060113153057.GX26280@desario.homelinux.net> Message-ID: <007401c6185b$ade51580$0aa8a8c0@cliff> Sounds like there's no easy answer. X-Cart seems interesting. I need to investigate Zen Cart further, as I have heard that they have been working hard to break out the presentation layer. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Andrew Yochum Sent: Friday, January 13, 2006 10:31 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Favorite PHP Shopping cart suggestions On Fri, Jan 13, 2006 at 10:11:17AM -0500, Cliff Hirsch wrote: > What PHP shopping cart would you recommend? I need a cart where I can > heavily customize the presentation layer, payment methodology and > fulfillment methodology (that about covers it all!). One that either > provides rich back-end functionality or has good hooks into a back-end > system would be nice too. > > I'm torn between OSCommerce and the OSCommerce fork Zen Cart. > Comments? Suggestions? Other carts I should look at? X-Cart is fairly good. It provides the same functionality that osC does, and then some out of the box. The code is clean and easy to maintain (upgrades & customizations) since there is a full separation of templates from code and upgrades are available as patches. The hooks are decent in all the necessary places - shipping, payment, etc. However, the code is procedural, and sometimes no use of functions or spliting of big functions and this, IMO, results in reptition, therefore unreusable code. Add-ons/modules are available from both X-Cart and third parties. It is not open source, but full source is provided, and the licensing is inexpensive. Some of the third party add-ons/modules are encoded making customization & repurposing of them next to impossible. (I'd even offered one vendor around 50x the license price for the source only to be refused) osC is just a nightmare IMO. The functionality is great and the community around it is large and supportive. Customization is a PITA as the HTML is embedded in tons of spahetti code. The community contributions are sometimes great and sometimes terrible. Many incompatibilities can arise as you customize your installation with contributions. Any kind of customizations - look and feel or functionality - often make upgrades seriously difficult. I can't speak for Zen Cart, but have heard it is better than osC. On the whole, I have not found a solution that I've been 100% satisfied with yet, but X-Cart is certainly my pick for now. Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 _______________________________________________ New York PHP Talk Mailing List AMP Technology Supporting Apache, MySQL and PHP http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org From darren at axess.de Fri Jan 13 11:14:08 2006 From: darren at axess.de (Darren Cooper) Date: Fri, 13 Jan 2006 17:14:08 +0100 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions Message-ID: <48675DD7C7776748A240F70DFC385A9D049000@xservernew.AXSS.local> Hi Cliff, We use X-cart and like it, it's has a lot of optional extra functions and is smarty base, the web master mode is excellent for quick changes and findin gthe right template or label. (available in the demo area) The have also launched a newer product called lite commerce which I think is a revamped version with much tighter and cleaner code but I don't have much hands on experience with this. Mit freundlichem Gru? Darren Cooper ****************** AXESS New Media GmbH ****************** Kaiser Friedrich Promenade 89 Tel: +49 (0)6172 676-141 61348 Bad Homburg Fax: +49 (0)6172 676-155 http://www.axess.de mailto:d.cooper at axess.de ********************************************************** -----Urspr?ngliche Nachricht----- Von: Cliff Hirsch [mailto:cliff at pinestream.com] Gesendet: Freitag, 13. Januar 2006 16:11 An: talk at lists.nyphp.org Betreff: [nycphp-talk] Favorite PHP Shopping cart suggestions What PHP shopping cart would you recommend? I need a cart where I can heavily customize the presentation layer, payment methodology and fulfillment methodology (that about covers it all!). One that either provides rich back-end functionality or has good hooks into a back-end system would be nice too. I'm torn between OSCommerce and the OSCommerce fork Zen Cart. Comments? Suggestions? Other carts I should look at? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From mwithington at PLMresearch.com Fri Jan 13 11:16:47 2006 From: mwithington at PLMresearch.com (Mark Withington) Date: Fri, 13 Jan 2006 11:16:47 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions Message-ID: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358D6A6E6@network.PLMresearch.com> Yes...in osCommerce the Presentation layer _is_ the Business Logic ;-) [just a guess] I think the intent of osCommerce is to provide a just-add-water shopping cart. Unfortunately, following that path will yield the traditional "osCommerce look" - as we all know walking down the halls of our favorite shopping mall (an oxymoron?) the "look" is what retail is all about. Couple of things to keep in mind with osCommerce: 1. To my knowledge, they still require register_globals on 2. You should be sure to configure is with cookies only (e.g. don't use the session number in the URL) as I think this is more secure. Cheers, Mark -------------------------- Mark L. Withington PLMresearch "eBusiness for the Midsize Enterprise" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 http://www.PLMresearch.com AIM/MSN/Skype: PLMresearch Yahoo: PLMresearch2000 mwithington at plmresearch.com Public Key: http://www.plmresearch.com/keys/MLW_public_key.asc Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Cliff Hirsch Sent: Friday, January 13, 2006 10:23 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Favorite PHP Shopping cart suggestions Mark: I figured you'd throw in a comment! I have looked at it, but I don't use Joomla. It's for a full-custom ap, so I'm not sure if it would be appropriate. Unless I decided to use Joomla as my Framework, which ir probably overkill. Perhaps just osCommerce? But from what I have gathered, the presentation layer is really embedded in the code. Cliff _______________________________ Pinestream Communications, Inc. Publisher of Semiconductor Times & Telecom Trends 52 Pine Street, Weston, MA 02493 USA Tel: 781.647.8800, Fax: 781.647.8825 http://www.pinestream.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mark Withington Sent: Friday, January 13, 2006 10:17 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Favorite PHP Shopping cart suggestions Cliff, did you check out josCommerce (www.josCommerce.com ) it's a port of osCommerce to Joomla. -------------------------- Mark L. Withington PLMresearch "eBusiness for the Midsize Enterprise" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 http://www.PLMresearch.com AIM/MSN/Skype: PLMresearch Yahoo: PLMresearch2000 mwithington at plmresearch.com Public Key: http://www.plmresearch.com/keys/MLW_public_key.asc Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Cliff Hirsch Sent: Friday, January 13, 2006 10:11 AM To: talk at lists.nyphp.org Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions What PHP shopping cart would you recommend? I need a cart where I can heavily customize the presentation layer, payment methodology and fulfillment methodology (that about covers it all!). One that either provides rich back-end functionality or has good hooks into a back-end system would be nice too. I'm torn between OSCommerce and the OSCommerce fork Zen Cart. Comments? Suggestions? Other carts I should look at? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Fri Jan 13 11:17:16 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 13 Jan 2006 11:17:16 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions In-Reply-To: <48675DD7C7776748A240F70DFC385A9D049000@xservernew.AXSS.local> Message-ID: <008101c6185c$d2a58ac0$0aa8a8c0@cliff> You said the magic words -- Smarty-based. Our project uses Smarty and its a great way to separate presentation from logic. As soon as we see too much "logic" creeping into a Smarty .tpl file, we know we're doing something wrong. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Darren Cooper Sent: Friday, January 13, 2006 11:14 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Favorite PHP Shopping cart suggestions Hi Cliff, We use X-cart and like it, it's has a lot of optional extra functions and is smarty base, the web master mode is excellent for quick changes and findin gthe right template or label. (available in the demo area) The have also launched a newer product called lite commerce which I think is a revamped version with much tighter and cleaner code but I don't have much hands on experience with this. Mit freundlichem Gru? Darren Cooper ****************** AXESS New Media GmbH ****************** Kaiser Friedrich Promenade 89 Tel: +49 (0)6172 676-141 61348 Bad Homburg Fax: +49 (0)6172 676-155 http://www.axess.de mailto:d.cooper at axess.de ********************************************************** -----Urspr?ngliche Nachricht----- Von: Cliff Hirsch [mailto:cliff at pinestream.com] Gesendet: Freitag, 13. Januar 2006 16:11 An: talk at lists.nyphp.org Betreff: [nycphp-talk] Favorite PHP Shopping cart suggestions What PHP shopping cart would you recommend? I need a cart where I can heavily customize the presentation layer, payment methodology and fulfillment methodology (that about covers it all!). One that either provides rich back-end functionality or has good hooks into a back-end system would be nice too. I'm torn between OSCommerce and the OSCommerce fork Zen Cart. Comments? Suggestions? Other carts I should look at? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Fri Jan 13 11:23:18 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 13 Jan 2006 11:23:18 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions In-Reply-To: <1F3CD8DDFB6A9B4C9B8DD06E4A7DE358D6A6E6@network.PLMresearch.com> Message-ID: <009701c6185d$aa2ed960$0aa8a8c0@cliff> register_globals on turned me off as well. But where do you draw the line? Has anyone tried setting their php.ini to E-ALL or even better yet E-STRICT for shits and giggles? Fagetaboutit. PHPMyAdmin barfs and I'm sure many other open source aps do to. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mark Withington Sent: Friday, January 13, 2006 11:17 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Favorite PHP Shopping cart suggestions Yes...in osCommerce the Presentation layer _is_ the Business Logic ;-) [just a guess] I think the intent of osCommerce is to provide a just-add-water shopping cart. Unfortunately, following that path will yield the traditional "osCommerce look" - as we all know walking down the halls of our favorite shopping mall (an oxymoron?) the "look" is what retail is all about. Couple of things to keep in mind with osCommerce: 1. To my knowledge, they still require register_globals on 2. You should be sure to configure is with cookies only (e.g. don't use the session number in the URL) as I think this is more secure. Cheers, Mark -------------------------- Mark L. Withington PLMresearch "eBusiness for the Midsize Enterprise" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 http://www.PLMresearch.com AIM/MSN/Skype: PLMresearch Yahoo: PLMresearch2000 mwithington at plmresearch.com Public Key: http://www.plmresearch.com/keys/MLW_public_key.asc Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Cliff Hirsch Sent: Friday, January 13, 2006 10:23 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Favorite PHP Shopping cart suggestions Mark: I figured you'd throw in a comment! I have looked at it, but I don't use Joomla. It's for a full-custom ap, so I'm not sure if it would be appropriate. Unless I decided to use Joomla as my Framework, which ir probably overkill. Perhaps just osCommerce? But from what I have gathered, the presentation layer is really embedded in the code. Cliff _______________________________ Pinestream Communications, Inc. Publisher of Semiconductor Times & Telecom Trends 52 Pine Street, Weston, MA 02493 USA Tel: 781.647.8800, Fax: 781.647.8825 http://www.pinestream.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mark Withington Sent: Friday, January 13, 2006 10:17 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Favorite PHP Shopping cart suggestions Cliff, did you check out josCommerce (www.josCommerce.com) it's a port of osCommerce to Joomla. -------------------------- Mark L. Withington PLMresearch "eBusiness for the Midsize Enterprise" PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 http://www.PLMresearch.com AIM/MSN/Skype: PLMresearch Yahoo: PLMresearch2000 mwithington at plmresearch.com Public Key: http://www.plmresearch.com/keys/MLW_public_key.asc Calendar: http://www.plmresearch.com/calendar.php -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Cliff Hirsch Sent: Friday, January 13, 2006 10:11 AM To: talk at lists.nyphp.org Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions What PHP shopping cart would you recommend? I need a cart where I can heavily customize the presentation layer, payment methodology and fulfillment methodology (that about covers it all!). One that either provides rich back-end functionality or has good hooks into a back-end system would be nice too. I'm torn between OSCommerce and the OSCommerce fork Zen Cart. Comments? Suggestions? Other carts I should look at? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken at secdat.com Fri Jan 13 14:18:07 2006 From: ken at secdat.com (Kenneth Downs) Date: Fri, 13 Jan 2006 14:18:07 -0500 (EST) Subject: [nycphp-talk] An Email Architecture Puzzle Message-ID: <40687.38.117.147.25.1137179887.squirrel@38.117.147.25> OK, here's a brain teaser. I've got my own answer in mind for this, but I'd be really curious to see if anyone else has any ideas. The problem is simple: All emails flowing through a certain domain must be tracked and associated with a job in a database. The following rules apply: 1) Must not require re-inventing an SMTP server, or any C coding in an existing SMTP server. By the same token we don't want to re-invent webmail and force everyone to use it. Solution must be in pure PHP, though may use any plug-in or extension system that an SMTP server provides that allows coding in PHP. 2) Must require minimal if not zero change in habits for users. For instace, requiring users to put complicated codes into their emails won't work because people won't do it. 3) Some kind of pool of un-matchable emails should be available to an admin who then matches them to jobs. 4) Every email should slot into a job, and replies should be sortable into threads by UI software. So how would you do that? -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From andrew at plexpod.com Fri Jan 13 14:27:35 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 13 Jan 2006 14:27:35 -0500 Subject: [nycphp-talk] An Email Architecture Puzzle In-Reply-To: <40687.38.117.147.25.1137179887.squirrel@38.117.147.25> References: <40687.38.117.147.25.1137179887.squirrel@38.117.147.25> Message-ID: <20060113192735.GZ26280@desario.homelinux.net> On Fri, Jan 13, 2006 at 02:18:07PM -0500, Kenneth Downs wrote: > OK, here's a brain teaser. I've got my own answer in mind for this, but > I'd be really curious to see if anyone else has any ideas. > > The problem is simple: All emails flowing through a certain domain must > be tracked and associated with a job in a database. The following rules > apply: > > 1) Must not require re-inventing an SMTP server, or any C coding in an > existing SMTP server. By the same token we don't want to re-invent > webmail and force everyone to use it. Solution must be in pure PHP, > though may use any plug-in or extension system that an SMTP server > provides that allows coding in PHP. > > 2) Must require minimal if not zero change in habits for users. For > instace, requiring users to put complicated codes into their emails won't > work because people won't do it. > > 3) Some kind of pool of un-matchable emails should be available to an > admin who then matches them to jobs. > > 4) Every email should slot into a job, and replies should be sortable into > threads by UI software. > > So how would you do that? Configure your SMTP server or procmail to filter all email through a PHP script. Parse, munge (like adding a tracking number to the subject), store it in your DB & pass it through to the recipient. This is much the same way many spam filters and email-based help desk apps work... and CLEW. HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From cliff at pinestream.com Fri Jan 13 16:10:50 2006 From: cliff at pinestream.com (cliff) Date: Fri, 13 Jan 2006 16:10:50 -0500 Subject: [nycphp-talk] Line break string evaulation help Message-ID: <20060113211050.M23232@pinestream.com> define('NEWLINE', "\n"); define ("EMAILFOOTER", NEWLINE. 'blah, blah, blah.'.NEWLINE. 'blah, blah, blah.'.NEWLINE. 'To login, click on the following link: '.URL); This works fine when viewing an email generated by this code in a browser- based email client, but fails to break lines in Microsoft Outlook on XP. What am I doing wrong? Cliff From andrew at plexpod.com Fri Jan 13 16:10:01 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 13 Jan 2006 16:10:01 -0500 Subject: [nycphp-talk] Line break string evaulation help In-Reply-To: <20060113211050.M23232@pinestream.com> References: <20060113211050.M23232@pinestream.com> Message-ID: <20060113211000.GD26280@desario.homelinux.net> On Fri, Jan 13, 2006 at 04:10:50PM -0500, cliff wrote: > define('NEWLINE', "\n"); > > define ("EMAILFOOTER", NEWLINE. > 'blah, blah, blah.'.NEWLINE. > 'blah, blah, blah.'.NEWLINE. > 'To login, click on the following link: '.URL); > > This works fine when viewing an email generated by this code in a browser- > based email client, but fails to break lines in Microsoft Outlook on XP. > What am I doing wrong? Try "\r\n", which is a carriage return + line feed (\x0D\xOA)- the windows/dos style. See: http://en.wikipedia.org/wiki/CRLF HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From cliff at pinestream.com Fri Jan 13 16:18:47 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 13 Jan 2006 16:18:47 -0500 Subject: [nycphp-talk] Line break string evaulation help In-Reply-To: <20060113211000.GD26280@desario.homelinux.net> Message-ID: <000b01c61886$f1471690$0aa8a8c0@cliff> Thanks. The wiki is an eye opener. How can something so simple end up so convoluted?! -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Andrew Yochum Sent: Friday, January 13, 2006 4:10 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Line break string evaulation help On Fri, Jan 13, 2006 at 04:10:50PM -0500, cliff wrote: > define('NEWLINE', "\n"); > > define ("EMAILFOOTER", NEWLINE. > 'blah, blah, blah.'.NEWLINE. > 'blah, blah, blah.'.NEWLINE. > 'To login, click on the following link: '.URL); > > This works fine when viewing an email generated by this code in a > browser- based email client, but fails to break lines in Microsoft > Outlook on XP. What am I doing wrong? Try "\r\n", which is a carriage return + line feed (\x0D\xOA)- the windows/dos style. See: http://en.wikipedia.org/wiki/CRLF HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 _______________________________________________ New York PHP Talk Mailing List AMP Technology Supporting Apache, MySQL and PHP http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org From edwardpotter at gmail.com Fri Jan 13 16:19:19 2006 From: edwardpotter at gmail.com (edward potter) Date: Fri, 13 Jan 2006 16:19:19 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions In-Reply-To: <001401c61853$9e3edd30$0aa8a8c0@cliff> References: <001401c61853$9e3edd30$0aa8a8c0@cliff> Message-ID: hmmm, put my first "shop online" in '95. It was perl. Later moved to CF (yipes), then php. Last client, I just set up oscommerce, pretty much worked out of the box. Not the prettiest, but the client is making his $'s. Hate to say it, but ecommerce can get pretty boring pretty quickly. Did a Zen install the other day, a real no-brainer to setup. A new one here, really barebones: "f you are looking for a simple set of PHP scripts to get a jump start on your next shopping cart project, hopefully you'll find Couffin useful." http://www.auberger.com/page/3/ I was thinking of doing something like this in Ruby, been in PHP land for so long, ready to play a bit with a new language. thanks, ed :-) On 1/13/06, Cliff Hirsch wrote: > > What PHP shopping cart would you recommend? I need a cart where I can > heavily customize the presentation layer, payment methodology and > fulfillment methodology (that about covers it all!). One that either > provides rich back-end functionality or has good hooks into a back-end > system would be nice too. > > I'm torn between OSCommerce and the OSCommerce fork Zen Cart. Comments? > Suggestions? Other carts I should look at? > > Cliff > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > > From tgales at tgaconnect.com Fri Jan 13 16:28:45 2006 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 13 Jan 2006 16:28:45 -0500 Subject: [nycphp-talk] Line break string evaulation help In-Reply-To: <20060113211050.M23232@pinestream.com> References: <20060113211050.M23232@pinestream.com> Message-ID: <43C81B8D.3090706@tgaconnect.com> cliff writes: > define('NEWLINE', "\n"); > > define ("EMAILFOOTER", NEWLINE. > 'blah, blah, blah.'.NEWLINE. > 'blah, blah, blah.'.NEWLINE. > 'To login, click on the following link: '.URL); > > This works fine when viewing an email generated by this code in a browser- > based email client, but fails to break lines in Microsoft Outlook on XP. > What am I doing wrong? Windows typically expects a carriage linefeed combination to signify the end of a line of text. -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From morgan at forsalebyowner.com Fri Jan 13 16:40:11 2006 From: morgan at forsalebyowner.com (Morgan Craft) Date: Fri, 13 Jan 2006 16:40:11 -0500 Subject: [nycphp-talk] Advice on Cake vs Symfony In-Reply-To: References: Message-ID: <43C81E3B.6090800@forsalebyowner.com> From what I've read of the manual for cake it doesn't look like it parses, but generates code similar to ruby on rails. Anyone have any experience with this MVC? I myself have been tinkering with my own framework, but I'm thinking perhaps it might be better to throw my cards in you develop with one that is already established. Alberto dos Santos wrote: > try Qcodo, www.qcodo.com , it generates code > instead of just parsing it at runtime, it's stable and OO oriented and > based on PHP5 and comes complete with a presentation layer. > The more I use it, the more I love it. (not an affiliate, though...) > > On 11/01/06, *Greg Gurevich* > wrote: > > I have been programming PHP for years, recently I am starting > to look > at different frameworks to start using in new products I am > basically > going with either Cake or Symfony, I wanted to know if anyone > on the > board has experience with either and which one you guys would > recommend. > Thanks, > Greg > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > > > > > -- > Alberto dos Santos > Consultor em TI > IT Consultant > > http://www.yournway.com > A internet ? sua maneira. > The Internet your own way. > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From jwinter at gmail.com Fri Jan 13 17:16:32 2006 From: jwinter at gmail.com (Joe Winter) Date: Fri, 13 Jan 2006 17:16:32 -0500 Subject: [nycphp-talk] Favorite PHP Shopping cart suggestions In-Reply-To: <007401c6185b$ade51580$0aa8a8c0@cliff> References: <20060113153057.GX26280@desario.homelinux.net> <007401c6185b$ade51580$0aa8a8c0@cliff> Message-ID: <4cf2bee00601131416y416fcd35x15f694fd66d24111@mail.gmail.com> On 1/13/06, Cliff Hirsch wrote: > Sounds like there's no easy answer. X-Cart seems interesting. I haven't used either, but what hasn't been mentioned is that X-Cart isn't open sourced and Zen Cart is GPL. Joe W. From jonbaer at jonbaer.com Fri Jan 13 17:38:51 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 13 Jan 2006 17:38:51 -0500 Subject: [nycphp-talk] An Email Architecture Puzzle In-Reply-To: <40687.38.117.147.25.1137179887.squirrel@38.117.147.25> References: <40687.38.117.147.25.1137179887.squirrel@38.117.147.25> Message-ID: <4678E828-422B-4AC7-AADF-A6D03E81733D@jonbaer.com> This may be complete overkill for what you need but for a bot/AI/auto- respond project I used phpcap to trap all inbound "requests" (110) and outbound "responses" (25) traffic + placed them into a database by timestamp and subject (which created the "threads") ... http://alcane.newffr.com/phpcap/ (im not sure if this extension is maintained anymore or will work w/ latest libpcap) It was just smarter handling of the traffic since snort (www.snort.org) did not do what was neeed. The benefit was that the emails were not touched. (You can regex keywords on domain,to,from,cc,subject,body) to ~tag emails. - Jon On Jan 13, 2006, at 2:18 PM, Kenneth Downs wrote: > OK, here's a brain teaser. I've got my own answer in mind for > this, but > I'd be really curious to see if anyone else has any ideas. > > The problem is simple: All emails flowing through a certain domain > must > be tracked and associated with a job in a database. The following > rules > apply: > > 1) Must not require re-inventing an SMTP server, or any C coding in an > existing SMTP server. By the same token we don't want to re-invent > webmail and force everyone to use it. Solution must be in pure PHP, > though may use any plug-in or extension system that an SMTP server > provides that allows coding in PHP. > > 2) Must require minimal if not zero change in habits for users. For > instace, requiring users to put complicated codes into their emails > won't > work because people won't do it. > > 3) Some kind of pool of un-matchable emails should be available to an > admin who then matches them to jobs. > > 4) Every email should slot into a job, and replies should be > sortable into > threads by UI software. > > So how would you do that? > > -- > Kenneth Downs > Secure Data Software > 631-379-0010 > ken at secdat.com > PO Box 708 > East Setauket, NY 11733 > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From jonbaer at jonbaer.com Fri Jan 13 21:17:21 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 13 Jan 2006 21:17:21 -0500 Subject: [nycphp-talk] New MySQL features (5.1.x) Message-ID: <8BED0E40-F5B5-4FEF-8D7A-C311179F2246@jonbaer.com> I know this is a PHP list but has anyone noticed the last 2 added features to MySQL 5.1.5 and 5.1.6? (Both of which don't seem to be available in alpha yet) 5) XML/XPath support: http://dev.mysql.com/tech-resources/articles/mysql-5.1-xml.html 6) Events http://dev.mysql.com/tech-resources/articles/event-feature.html I find these to be very cool and useful but is it or would it be the general consensus that as it matures (along w/ routines/functions) that these type of procedures will run faster and optimized at the db level? Without the need for php/ruby/python/java? Do other commerical rdbms offer both options? - Jon From tgales at tgaconnect.com Fri Jan 13 22:32:31 2006 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 13 Jan 2006 22:32:31 -0500 Subject: [nycphp-talk] New MySQL features (5.1.x) In-Reply-To: <8BED0E40-F5B5-4FEF-8D7A-C311179F2246@jonbaer.com> References: <8BED0E40-F5B5-4FEF-8D7A-C311179F2246@jonbaer.com> Message-ID: <43C870CF.7050406@tgaconnect.com> Jon Baer wrote: > I know this is a PHP list but has anyone noticed the last 2 added > features to MySQL 5.1.5 and 5.1.6? (Both of which don't seem to be > available in alpha yet) > > 5) XML/XPath support: > http://dev.mysql.com/tech-resources/articles/mysql-5.1-xml.html > > 6) Events > http://dev.mysql.com/tech-resources/articles/event-feature.html > > I find these to be very cool and useful but is it or would it be the > general consensus that as it matures (along w/ routines/functions) > that these type of procedures will run faster and optimized at the db > level? Without the need for php/ruby/python/java? > > Do other commerical rdbms offer both options? > If you agree that scheduling is pretty much the same thing as the 'event feature', then yes -- ---- MS Sql 2005 has a native xml type which supports xpath. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sql2k5xml.asp and SQL Server agent http://www.microsoft.com/technet/prodtechnol/sql/2005/evaluate/newsqlagent.mspx ---- Sybase ASE 12.5.1 has the 'ASE XML Engine' http://www.sybase.com/content/1026308/xml_wp2.pdf and a scheduler http://www.sybase.com/detail?id=1026304 ----- Oracle 9i/10g has 'native xml support' http://www.oracle.com/technology/tech/xml/xmldb/index.html 10g has a scheduler http://www.oracle.com/technology/products/database/scheduler/htdocs/scheduler_fov.html ----- PostgresSQL: http://www.throwingbeans.org/tech/postgresql_and_xml.html http://people.planetpostgresql.org/dpage/index.php?/archives/4-Its-Alive!.html -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From jonbaer at jonbaer.com Fri Jan 13 23:18:29 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Fri, 13 Jan 2006 23:18:29 -0500 Subject: [nycphp-talk] New MySQL features (5.1.x) In-Reply-To: <43C870CF.7050406@tgaconnect.com> References: <8BED0E40-F5B5-4FEF-8D7A-C311179F2246@jonbaer.com> <43C870CF.7050406@tgaconnect.com> Message-ID: <70E5B20E-105C-4CDB-A930-0D55AC88E70E@jonbaer.com> Excellent overview/snapshot, thanks for the links Tim, very helpful! - Jon On Jan 13, 2006, at 10:32 PM, Tim Gales wrote: > > ----- > PostgresSQL: > > http://www.throwingbeans.org/tech/postgresql_and_xml.html > > http://people.planetpostgresql.org/dpage/index.php?/archives/4-Its- > Alive!.html > > -- > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From randalrust at gmail.com Sat Jan 14 12:48:41 2006 From: randalrust at gmail.com (Randal Rust) Date: Sat, 14 Jan 2006 12:48:41 -0500 Subject: [nycphp-talk] Accessing a method from one class in another Message-ID: Coming from a procedural background, I've been able to move to the OOP way of doing things, but I am far from really mastering it, and making things as reusable as I probably can. One thing that always bugs me is how I access the DB object in all of the other classes. I always include and instantiate the DB this way: include 'class_db.php'; $db = new DB; $db = $db->conn;//the db object is generated with the help of ADODB Then, in my other classes, like class_content(), I pass the $db to each method, like this: function addContent($db, $type) function viewContent($db, $rec) function updateContent($db, $rec) This works OK when I'm dealing with the DB object, but there are a couple of other classes, like class_image that I need to access in other classes as well. It doesn't make sense to have this... function addContent($db, $image, $type) ...so that I can have access to all of the methods for class_image inside of class_content. What is it that I'm not grasping? -- Randal Rust R.Squared Communications www.r2communications.com From ken at secdat.com Sat Jan 14 13:01:02 2006 From: ken at secdat.com (Kenneth Downs) Date: Sat, 14 Jan 2006 13:01:02 -0500 (EST) Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: References: Message-ID: <37396.38.117.147.25.1137261662.squirrel@38.117.147.25> There are two real issues here. But, these are obscured by the OO factor. First off, OO does not make code any more re-usable than procedural code, you just use it differently. The problem you are hitting would be the same if you were using procedural code, which is A) Variable scoping and B) organizining of subroutines. So first you have to tackle the issue of scoping the connection to the DB. I myself use a global connection handle that is opened at request start and closed at request end. This has the benefit of being simplest correct way in my context. But if this is not appropriate to your context, the you will have to obtain the handle and then pass it around to those routines that need it. The next issue is proper decomposition of the subroutines. This again is the same in OO vs. Procedural. Perhaps there should be data retrieval routines that pull information from a database, and separate rendering routines that turn retrieved data into HTML. Then its more clear that you hand the DB handle to the data retrieval routines and they give you back data, and then you hand that data to rendering routines. Hope this helps. > Coming from a procedural background, I've been able to move to the OOP > way of doing things, but I am far from really mastering it, and making > things as reusable as I probably can. One thing that always bugs me is > how I access the DB object in all of the other classes. > > I always include and instantiate the DB this way: > > include 'class_db.php'; > $db = new DB; > $db = $db->conn;//the db object is generated with the help of ADODB > > Then, in my other classes, like class_content(), I pass the $db to > each method, like this: > > function addContent($db, $type) > function viewContent($db, $rec) > function updateContent($db, $rec) > > This works OK when I'm dealing with the DB object, but there are a > couple of other classes, like class_image that I need to access in > other classes as well. It doesn't make sense to have this... > > function addContent($db, $image, $type) > > ...so that I can have access to all of the methods for class_image > inside of class_content. > > What is it that I'm not grasping? > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From randalrust at gmail.com Sat Jan 14 13:16:19 2006 From: randalrust at gmail.com (Randal Rust) Date: Sat, 14 Jan 2006 13:16:19 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: <37396.38.117.147.25.1137261662.squirrel@38.117.147.25> References: <37396.38.117.147.25.1137261662.squirrel@38.117.147.25> Message-ID: On 1/14/06, Kenneth Downs wrote: > So first you have to tackle the issue of scoping the connection to the DB. > I myself use a global connection handle that is opened at request start > and closed at request end. Here is what my connection class looks like: conn =& ADONewConnection('mysql'); if($ip=$_SERVER['REMOTE_ADDR']=='127.0.0.1'){ $conn=$this->conn->PConnect('localhost','','','osboc'); } else { //$conn=$this->conn->PConnect('localhost','','',''); $conn=$this->conn->PConnect('localhost','','','_'); } return $conn; } } ?> > But if this is not appropriate to your context, the > you will have to obtain the handle and then pass it around to those > routines that need it. Which is what I'm doing now. Whether or not it's appropriate, I don't know. I just know that it works. > Perhaps there should be data retrieval > routines that pull information from a database, and separate rendering > routines that turn retrieved data into HTML. I try as much as I can to keep my methods from producing HTML, but most of them strictly make calls to the DB and return information, or return something based on the action of another method. -- Randal Rust R.Squared Communications www.r2communications.com From danielc at analysisandsolutions.com Sat Jan 14 18:04:37 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 14 Jan 2006 18:04:37 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: References: Message-ID: <20060114230436.GA6891@panix.com> Hey Randal: On Sat, Jan 14, 2006 at 12:48:41PM -0500, Randal Rust wrote: > I always include and instantiate the DB this way: > > include 'class_db.php'; > $db = new DB; > $db = $db->conn;//the db object is generated with the help of ADODB > > Then, in my other classes, like class_content(), I pass the $db to > each method, like this: > > function addContent($db, $type) Easiest thing to do is in the class_content class, have a property named $db and set it in the constructor. Or, have all your classes extend from the DB class. class foo { public $db = null; public function __construct() { include PATH . '/include/class_db.inc'; $this->db = new DB; } } --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Sat Jan 14 18:07:18 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 14 Jan 2006 18:07:18 -0500 Subject: [nycphp-talk] An Email Architecture Puzzle In-Reply-To: <20060113192735.GZ26280@desario.homelinux.net> References: <40687.38.117.147.25.1137179887.squirrel@38.117.147.25> <20060113192735.GZ26280@desario.homelinux.net> Message-ID: <20060114230718.GB6891@panix.com> Hey Folks: On Fri, Jan 13, 2006 at 02:27:35PM -0500, Andrew Yochum wrote: > > Configure your SMTP server or procmail to filter all email through a PHP > script. Exactly what I was going to say. Procmail is a great thing. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From cliff at pinestream.com Mon Jan 16 09:07:04 2006 From: cliff at pinestream.com (cliff) Date: Mon, 16 Jan 2006 09:07:04 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: <20060114230436.GA6891@panix.com> References: <20060114230436.GA6891@panix.com> Message-ID: <20060116140704.M66993@pinestream.com> Extending the core db class is a great idea. Instead of having to include $db in ever function argument, I have been using $db in a global context as previously mentioned. If typing $GLOBAL {'db'] gets old, you can also set up a constructor in each class: class foo { private $db public function __construct() { $this->db = $GLOBAL['db]; // reference to global db object } public function addContent($type) {} } On Sat, 14 Jan 2006 18:04:37 -0500, Daniel Convissor wrote > Hey Randal: > > On Sat, Jan 14, 2006 at 12:48:41PM -0500, Randal Rust wrote: > > I always include and instantiate the DB this way: > > > > include 'class_db.php'; > > $db = new DB; > > $db = $db->conn;//the db object is generated with the help of ADODB > > > > Then, in my other classes, like class_content(), I pass the $db to > > each method, like this: > > > > function addContent($db, $type) > > Easiest thing to do is in the class_content class, have a property > named $db and set it in the constructor. Or, have all your classes > extend from the DB class. > > class foo { > public $db = null; > > public function __construct() { > include PATH . '/include/class_db.inc'; > $this->db = new DB; > } > } > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From list at harveyk.com Mon Jan 16 09:20:34 2006 From: list at harveyk.com (harvey) Date: Mon, 16 Jan 2006 09:20:34 -0500 Subject: [nycphp-talk] Document management software for site In-Reply-To: <330532b60601110848w6de078bdg8b8ab55e2cff4241@mail.gmail.co m> References: <7.0.0.16.2.20060110162615.04ab3ee0@usa.com> <7.0.0.16.2.20060110174229.04a95f00@harveyk.com> <330532b60601110848w6de078bdg8b8ab55e2cff4241@mail.gmail.com> Message-ID: <7.0.0.16.2.20060116091741.04abe698@harveyk.com> Joomla looks really slick, but it seems like you can only go two levels deep (main categories, subcategories) and I might need to go deeper Mambodocman looks good also, but seems more for managing downloadable docs rather than web pages I've been fooling around with Etomite which looks like it will do nicely for my needs At 11:48 AM 1/11/2006, Mitch Pirtle wrote: >On 1/10/06, harvey wrote: > > Thanks, I did a quick review, and that might do pretty well... > > > > > > At 04:38 PM 1/10/2006, you wrote: > > > > >Try Joomla! > > > > > >http://www.joomla.org > >That's one brownie point for Jon ;-) > >Also, there's DocMan, the Mambo/Joomla! document management component: > http://www.mambodocman.com/ > >One of the DocMan developers is a core developer on Joomla!, and >development has really picked up lately and some really new and >exciting releases are on the way. > >If you want document management (and not just content management) I'd >take a look at DocMan. > >-- >Mitch Pirtle >Joomla! Core Developer >Open Source Matters >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org From list at harveyk.com Mon Jan 16 09:22:44 2006 From: list at harveyk.com (harvey) Date: Mon, 16 Jan 2006 09:22:44 -0500 Subject: [nycphp-talk] PHP forum apps In-Reply-To: <330532b60601110843h7900cd7ct273b2de82e5848b7@mail.gmail.co m> References: <43C2FE0E.7010304@neuropunks.org> <330532b60601110843h7900cd7ct273b2de82e5848b7@mail.gmail.com> Message-ID: <7.0.0.16.2.20060116092117.04a86a18@harveyk.com> I just implemented SMF (based on the recommendation below) and I like it. Install was straightforward, works nicely "out of the box", very easy to integrate into my site design, fairly easy to modify the template code if needed... At 11:43 AM 1/11/2006, you wrote: >On 1/9/06, Max Gribov wrote: > > Hello all, > > quick question about forum software, does anyone have their favorite or > > most trusted one? > >I'm a huge fan of SMF from www.simplemachines.org, which has excellent >performance, good features, and a strong security history. > >That's what we use to power the community forums for Joomla! and those >are some busy forums ;-) > >-- >Mitch Pirtle >Joomla! Core Developer >Open Source Matters >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org From randalrust at gmail.com Mon Jan 16 09:40:10 2006 From: randalrust at gmail.com (Randal Rust) Date: Mon, 16 Jan 2006 09:40:10 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: <20060116140704.M66993@pinestream.com> References: <20060114230436.GA6891@panix.com> <20060116140704.M66993@pinestream.com> Message-ID: On 1/16/06, cliff wrote: > you can also set up a constructor in each class: What is the effect though if you need access to two objects, and both of them create the db connection in their respective constructor? -- Randal Rust R.Squared Communications www.r2communications.com From linux_rocks1 at yahoo.com Mon Jan 16 14:50:04 2006 From: linux_rocks1 at yahoo.com (Linux Rocks) Date: Mon, 16 Jan 2006 11:50:04 -0800 (PST) Subject: [nycphp-talk] Which Linux text editor? Message-ID: <20060116195004.75216.qmail@web35910.mail.mud.yahoo.com> Hello all: What is a good and easy to use text editor to write PHP for linux? Something similar to EditPad with colors and automatic completion tags... Thanks. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From henry at beewh.com Mon Jan 16 14:57:56 2006 From: henry at beewh.com (Henry Ponce) Date: Mon, 16 Jan 2006 16:57:56 -0300 Subject: [nycphp-talk] Which Linux text editor? In-Reply-To: <20060116195004.75216.qmail@web35910.mail.mud.yahoo.com> References: <20060116195004.75216.qmail@web35910.mail.mud.yahoo.com> Message-ID: <200601161657.56935.henry@beewh.com> I use JEdit to code. www.jedit.org Henry On Monday 16 January 2006 16:50, Linux Rocks wrote: > Hello all: > > What is a good and easy to use text editor to write > PHP for linux? Something similar to EditPad with > colors and automatic completion tags... > > Thanks. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From ken at secdat.com Mon Jan 16 14:57:46 2006 From: ken at secdat.com (Kenneth Downs) Date: Mon, 16 Jan 2006 14:57:46 -0500 (EST) Subject: [nycphp-talk] Which Linux text editor? In-Reply-To: <20060116195004.75216.qmail@web35910.mail.mud.yahoo.com> References: <20060116195004.75216.qmail@web35910.mail.mud.yahoo.com> Message-ID: <42105.38.117.147.25.1137441466.squirrel@38.117.147.25> You will of course get many answers... I like jedit because: -> Has syntax coloring, of course -> Very intuitive handling of multiple windows -> Can parse PHP and highlight errors -> Has intellisense (which admittedly I never tried to get working) -> Easy to install -> Lots of plugins -> Pretty easy to write your own syntax coloring, which I need -> Session memory, opens all files that were open last time -> Has webdav extension, but I've never used it -> Can "HTML-ize" text, excellent for code snippets in docs. -> And of course that difficult-to-describe-just-feels-right quality > Hello all: > > What is a good and easy to use text editor to write > PHP for linux? Something similar to EditPad with > colors and automatic completion tags... > > Thanks. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From yournway at gmail.com Mon Jan 16 15:36:01 2006 From: yournway at gmail.com (Alberto dos Santos) Date: Mon, 16 Jan 2006 20:36:01 +0000 Subject: [nycphp-talk] Which Linux text editor? In-Reply-To: <42105.38.117.147.25.1137441466.squirrel@38.117.147.25> References: <20060116195004.75216.qmail@web35910.mail.mud.yahoo.com> <42105.38.117.147.25.1137441466.squirrel@38.117.147.25> Message-ID: try editplus. -> light -> fast -> code coloring -> etc... On 16/01/06, Kenneth Downs wrote: > You will of course get many answers... > > I like jedit because: > -> Has syntax coloring, of course > -> Very intuitive handling of multiple windows > -> Can parse PHP and highlight errors > -> Has intellisense (which admittedly I never tried to get working) > -> Easy to install > -> Lots of plugins > -> Pretty easy to write your own syntax coloring, which I need > -> Session memory, opens all files that were open last time > -> Has webdav extension, but I've never used it > -> Can "HTML-ize" text, excellent for code snippets in docs. > -> And of course that difficult-to-describe-just-feels-right quality > > > Hello all: > > > > What is a good and easy to use text editor to write > > PHP for linux? Something similar to EditPad with > > colors and automatic completion tags... > > > > Thanks. > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > _______________________________________________ > > New York PHP Community Talk Mailing List > > Show Your Participation > > http://www.nyphp.org/show_participation.php > > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org > > > > > -- > Kenneth Downs > Secure Data Software > 631-379-0010 > ken at secdat.com > PO Box 708 > East Setauket, NY 11733 > > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Alberto dos Santos Consultor em TI IT Consultant http://www.yournway.com A internet ? sua maneira. The Internet your own way. From mitch.pirtle at gmail.com Mon Jan 16 15:49:39 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 16 Jan 2006 15:49:39 -0500 Subject: [nycphp-talk] Which Linux text editor? In-Reply-To: <20060116195004.75216.qmail@web35910.mail.mud.yahoo.com> References: <20060116195004.75216.qmail@web35910.mail.mud.yahoo.com> Message-ID: <330532b60601161249n4f3f4ac9q54fc3145a9cee827@mail.gmail.com> On 1/16/06, Linux Rocks wrote: > > What is a good and easy to use text editor to write > PHP for linux? Something similar to EditPad with > colors and automatic completion tags... If I am in KDE I use Quanta. If I am in GNOME I use bluefish. If I am in Windows I use PSPad. Regardless of operating system, I usually use eclipse ;-) -- Mitch Pirtle Joomla! Core Developer Open Source Matters From cliff at pinestream.com Mon Jan 16 18:01:58 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 16 Jan 2006 18:01:58 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: Message-ID: <001c01c61af0$da9ca510$6502a8c0@HirschLaptop> Nothing, if the db connection object is created as a singleton. Otherwise, you would generate multiple connections. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Randal Rust Sent: Monday, January 16, 2006 9:40 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Accessing a method from one class in another On 1/16/06, cliff wrote: > you can also set up a constructor in each class: What is the effect though if you need access to two objects, and both of them create the db connection in their respective constructor? -- Randal Rust R.Squared Communications www.r2communications.com _______________________________________________ New York PHP Community Talk Mailing List Show Your Participation http://www.nyphp.org/show_participation.php http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org From Consult at CovenantEDesign.com Mon Jan 16 18:20:49 2006 From: Consult at CovenantEDesign.com (CED) Date: Mon, 16 Jan 2006 18:20:49 -0500 Subject: [nycphp-talk] Accessing a method from one class in another References: <001c01c61af0$da9ca510$6502a8c0@HirschLaptop> Message-ID: <002701c61af3$7edc4de0$1519a8c0@ced> You create an object for DB called for when accessing objects that need that particular connection... Ahh AOP seems so applicable here. =D -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Randal Rust Sent: Monday, January 16, 2006 9:40 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Accessing a method from one class in another On 1/16/06, cliff wrote: > you can also set up a constructor in each class: What is the effect though if you need access to two objects, and both of them create the db connection in their respective constructor? -- Randal Rust R.Squared Communications www.r2communications.com _______________________________________________ New York PHP Community Talk Mailing List Show Your Participation http://www.nyphp.org/show_participation.php http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org _______________________________________________ New York PHP Community Talk Mailing List Show Your Participation http://www.nyphp.org/show_participation.php http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org From cweyl at alumni.drew.edu Mon Jan 16 21:26:37 2006 From: cweyl at alumni.drew.edu (Chris Weyl) Date: Mon, 16 Jan 2006 21:26:37 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: <002701c61af3$7edc4de0$1519a8c0@ced> References: <001c01c61af0$da9ca510$6502a8c0@HirschLaptop> <002701c61af3$7edc4de0$1519a8c0@ced> Message-ID: <7dd7ab490601161826rb88813bg98c6867f23535a8@mail.gmail.com> On 1/16/06, CED wrote: > You create an object for DB called for when accessing objects that need that > particular connection... Ahh AOP seems so applicable here. =D When I only need a single db connection (e.g. the db/userid/passwd are the same for all acceses), I actually tend to just add to my base class (from which all other classes derive at some level: class Base { ... public static $dbh = NULL; .... public static function get_dbh() { if (self::$dbh == NULL) self::$dbh = //connection code here// return self::$dbh; } } That way, I only ever have to open the connection to the database once, and can keep on reusing the same object no matter where I am by calling Base::get_dbh(). You get the idea. Come to think of it, this wouldn't even need to be in your base class, if such a thing doesn't work nicely for you; you could stick it in a standalone class of its own, and just access the static methods. -Chris From mikko.rantalainen at peda.net Tue Jan 17 07:32:21 2006 From: mikko.rantalainen at peda.net (Mikko Rantalainen) Date: Tue, 17 Jan 2006 14:32:21 +0200 Subject: [nycphp-talk] Which Linux text editor? In-Reply-To: <42105.38.117.147.25.1137441466.squirrel@38.117.147.25> References: <20060116195004.75216.qmail@web35910.mail.mud.yahoo.com> <42105.38.117.147.25.1137441466.squirrel@38.117.147.25> Message-ID: <43CCE3D5.1080900@peda.net> Kenneth Downs wrote: > You will of course get many answers... > > I like jedit because: > -> Has syntax coloring, of course +1 > -> Very intuitive handling of multiple windows -1 far from perfect IMO. Though, I use BufferTabs plugin which may trigger some bugs. Or perhaps it's my window manager (IceWM)? > -> Can parse PHP and highlight errors +1 (look for PHPParserPlugin) > -> Has intellisense (which admittedly I never tried to get working) In fact it has multiple implementations as plugins. All the implementations I've used collide with some other plugin I'm using and those other plugins are more important for me. > -> Easy to install Well, it's java based and some stuff works better with some VMs and some other stuff works better with some other VM. For example, Sun Java 1.6 (mustang) is much faster under linux than any older version but jEdit has some problems reading the keyboard correctly with it (e.g. try binding something to alt+ctrl+o and watch an extra "o" appear when you try that key combination). I use following flags for java to deal with memory requirements: -Xms4M -Xmx256M. > -> Pretty easy to write your own syntax coloring, which I need +1 > -> Session memory, opens all files that were open last time Also try BufferLocal plugin. It remembers some extra stuff on per-file basis. I haven't yet tried eclipse for a long enough time to say anything final about it but I guess jEdit is the only real choice. (Of course, if you *already* know vi or emacs, then by all means use those. OTOH, if you're not familiar with either, I'm not too sure if they are worth the effort... There are other very good editors, too.) I'd also suggest trying OpenIt and Tags plugins. -- Mikko From jharrop at gmail.com Tue Jan 17 15:19:43 2006 From: jharrop at gmail.com (Jason Harrop) Date: Wed, 18 Jan 2006 07:19:43 +1100 Subject: [nycphp-talk] XAMPP (PHP 5.1.1) on Windows and Tidy - crashes Message-ID: <142396750601171219pded8e4bl2a6c640e39b30480@mail.gmail.com> Hi I'm trying to use Tidy as bundled with XAMPP on Windows. I've enabled it in php.ini, thus: extension=php_tidy.dll And that much seems ok: Tidy support enabled libTidy Release 1st July 2004 Extension Version 2.0 ($Id: tidy.c,v 1.71 2005/11/14 21:52:27 tony2001 Exp $) However, using it in php crashes Apache. Similarly, i get an unhandled Win32 exception in php.exe [2488] when i try: C:\Program Files\XAMPP\xampp>php\php -c apache\bin\php.ini htdocs\cleanhtml5.php ^Z using the example code from http://www.coggeshall.org/oss/tidy/ Any ideas? Also, any idea where there are user mailing lists for XAMPP? thanks cheers Jason From dmintz at davidmintz.org Tue Jan 17 15:59:51 2006 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 17 Jan 2006 15:59:51 -0500 (EST) Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: <20060114230436.GA6891@panix.com> References: <20060114230436.GA6891@panix.com> Message-ID: If you're using PHP 5, one nice thing about the good old singleton is you can get your instance from any scope. $db = MyDatabaseClass::getInstance() ; //// from MyDatabaseClass private static $instance = null; public static function getInstance() { if (is_null(self::$instance)) { // this uses PEAR and relies on an __autoload self::$instance = DB::connect("$driver://$user:$password@$host/$db"); if (DB::isError(self::$instance)){ trigger_error('could not connect to database',E_USER_ERROR); } self::$instance->setFetchMode(DB_FETCHMODE_ASSOC); // et cetera } return self::$instance; } --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From dmintz at davidmintz.org Tue Jan 17 16:00:51 2006 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 17 Jan 2006 16:00:51 -0500 (EST) Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: References: <20060114230436.GA6891@panix.com> Message-ID: Ooops, sorry, I should've read the whole thread first. --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From ken at secdat.com Tue Jan 17 16:03:06 2006 From: ken at secdat.com (Kenneth Downs) Date: Tue, 17 Jan 2006 16:03:06 -0500 (EST) Subject: [nycphp-talk] [OT]: Sigblock In-Reply-To: References: <20060114230436.GA6891@panix.com> Message-ID: <44956.38.117.147.25.1137531786.squirrel@38.117.147.25> I like that sigblock. Reminds me of Edward Murrow, who they quoted on the Golden Globes last night "We cannot defend liberty abroad while abandoning it at home." > > The right of the people to be secure in their > persons, houses, papers, and effects, against > unreasonable searches and seizures, shall not be > violated, and no Warrants shall issue, but upon > probable cause, supported by Oath or affirmation, > and particularly describing the place to be > searched, and the persons or things to be seized. > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From IAlsoAgree at stny.rr.com Tue Jan 17 20:20:03 2006 From: IAlsoAgree at stny.rr.com (IAlsoAgree at stny.rr.com) Date: Tue, 17 Jan 2006 20:20:03 -0500 Subject: [nycphp-talk] Question Using If's and Possible Arrays Message-ID: <16de35f16d689d.16d689d16de35f@nyroc.rr.com> I have a question about using if statements with variables that are sometimes arrays and sometimes not arrays. I have a function that returns either the contents of a database row or false. For example: $variable = callfunction() In this case, callfunction would either return the contents of a row in a database or simply false. Lets assume that, for instances of this question, callfunction returns false and $variable is now equal to false. function callfunction() { return false; } If I then use: if ($variable['alias']) Will the if statement result in false because that is the only value of $variable (noting that $variable has NOT been initiated as an array, this is the first time it has been refrenced as an array)? -Joe From danielc at analysisandsolutions.com Tue Jan 17 20:36:00 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 17 Jan 2006 20:36:00 -0500 Subject: [nycphp-talk] Question Using If's and Possible Arrays In-Reply-To: <16de35f16d689d.16d689d16de35f@nyroc.rr.com> References: <16de35f16d689d.16d689d16de35f@nyroc.rr.com> Message-ID: <20060118013600.GA3818@panix.com> Joe: On Tue, Jan 17, 2006 at 08:20:03PM -0500, IAlsoAgree at stny.rr.com wrote: > function callfunction() > { > return false; > } > > $variable = callfunction() > > if ($variable['alias']) You made a nearly perfect test case. Why don't you run it and see what happens? You'd have your answer already. --Dan PS: You'll find that you need to check for "if ($variable)" first. -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From dcech at phpwerx.net Tue Jan 17 20:40:08 2006 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 17 Jan 2006 20:40:08 -0500 Subject: [nycphp-talk] Question Using If's and Possible Arrays In-Reply-To: <16de35f16d689d.16d689d16de35f@nyroc.rr.com> References: <16de35f16d689d.16d689d16de35f@nyroc.rr.com> Message-ID: <43CD9C78.1060104@phpwerx.net> As you may have found out, the value of $variable['alias'] will be NULL. I'm not sure the internal reason for this, but it should never be an issue because you should have a line checking the return of callfunction and acting appropriately if it's not what's expected. Something like: function callfunction() { return false; } $variable = callfunction(); if (!is_array($variable)) { echo 'there was an error'; } if ($variable['alias']) { do_something(); } else { do_something_else(); } Of course if you were using pear errors you would be able to change it to: function callfunction() { return PEAR::raiseError('error message',1); } $variable = callfunction(); if (PEAR::isError($variable)) { echo 'there was an error: '.$variable->getMessage(); } if ($variable['alias']) { do_something(); } else { do_something_else(); } Hope this helps, Dan IAlsoAgree at stny.rr.com wrote: > I have a question about using if statements with variables that are > sometimes arrays and sometimes not arrays. > > I have a function that returns either the contents of a database row or > false. > For example: > $variable = callfunction() > > In this case, callfunction would either return the contents of a row in > a database or simply false. > > Lets assume that, for instances of this question, callfunction returns > false and $variable is now equal to false. > function callfunction() > { > return false; > } > > If I then use: > if ($variable['alias']) > > Will the if statement result in false because that is the only value of > $variable (noting that $variable has NOT been initiated as an array, > this is the first time it has been refrenced as an array)? > > -Joe From IAlsoAgree at stny.rr.com Tue Jan 17 20:48:04 2006 From: IAlsoAgree at stny.rr.com (IAlsoAgree at stny.rr.com) Date: Tue, 17 Jan 2006 20:48:04 -0500 Subject: [nycphp-talk] Question Using If's and Possible Arrays Message-ID: <16df09416dde47.16dde4716df094@nyroc.rr.com> Meh... me and lazyness. Actually I've been working on my first big project with PHP and I'm still caught up in the functions I'm writing. For anyone who is interested, I tested the following code: function returnfalse() { return false; } function returntrue() { return true; } $i = returntrue(); if ($i['private']) { echo ("

As true statement returns true.

"); } else { echo ("

As true statement returns false.

"); } if ($i) { echo ("

As true statement returns true.

"); } else { echo ("

As true statement returns false.

"); } $i = returnfalse(); if ($i['private']) { echo ("

Statment returned as true.

"); } else { echo ("

Statment returned as false.

"); } if ($i) { echo ("

Statement returned as true.

"); } else { echo ("

Statement returned as false.

"); } The script returned (as expected): As true statement returns false. As true statement returns true. Statment returned as false. Statement returned as false. -Joe ----- Original Message ----- From: Daniel Convissor Date: Tuesday, January 17, 2006 8:36 pm Subject: Re: [nycphp-talk] Question Using If's and Possible Arrays > Joe: > > On Tue, Jan 17, 2006 at 08:20:03PM -0500, IAlsoAgree at stny.rr.com > wrote:> function callfunction() > > { > > return false; > > } > > > > $variable = callfunction() > > > > if ($variable['alias']) > > You made a nearly perfect test case. Why don't you run it and see > what > happens? You'd have your answer already. > > --Dan > > PS: You'll find that you need to check for "if ($variable)" first. > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From ken at secdat.com Tue Jan 17 21:01:44 2006 From: ken at secdat.com (Kenneth Downs) Date: Tue, 17 Jan 2006 21:01:44 -0500 (EST) Subject: [nycphp-talk] Question Using If's and Possible Arrays In-Reply-To: <16de35f16d689d.16d689d16de35f@nyroc.rr.com> References: <16de35f16d689d.16d689d16de35f@nyroc.rr.com> Message-ID: <38441.38.117.147.25.1137549704.squirrel@38.117.147.25> PHP has a construct for this: if ( ($variable=callfunction()) === false) { .. nothing happens } else { ....processing here... } the triple equals sign means "matches on type and value". So you can distinguish between these two kinds of cases: if (0==false) { echo "this code will execute"; } if (0===false) { echo "this code will not execute"; } > I have a question about using if statements with variables that are > sometimes arrays and sometimes not arrays. > > I have a function that returns either the contents of a database row or > false. > For example: > $variable = callfunction() > > In this case, callfunction would either return the contents of a row in > a database or simply false. > > Lets assume that, for instances of this question, callfunction returns > false and $variable is now equal to false. > function callfunction() > { > return false; > } > > If I then use: > if ($variable['alias']) > > Will the if statement result in false because that is the only value of > $variable (noting that $variable has NOT been initiated as an array, > this is the first time it has been refrenced as an array)? > > -Joe > > > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From cliff at pinestream.com Tue Jan 17 21:25:08 2006 From: cliff at pinestream.com (cliff) Date: Tue, 17 Jan 2006 21:25:08 -0500 Subject: [nycphp-talk] Question Using If's and Possible Arrays In-Reply-To: <16df09416dde47.16dde4716df094@nyroc.rr.com> References: <16df09416dde47.16dde4716df094@nyroc.rr.com> Message-ID: <20060118022508.M78954@pinestream.com> What level of error reporting did you use - E_ALL? I believe using an index that does not exist generates an e-notice warning. I also often use false as a return value. If a valid return isn't an array, just remember that null, and the # 0, also evaluate as false. The safest bet is to use === to match the type. On Tue, 17 Jan 2006 20:48:04 -0500, IAlsoAgree wrote > Meh... me and lazyness. Actually I've been working on my first big > project with PHP and I'm still caught up in the functions I'm writing. > > For anyone who is interested, I tested the following code: > function returnfalse() > { > return false; > } > function returntrue() > { > return true; > } > > $i = returntrue(); > > if ($i['private']) > { > echo ("

As true statement returns true.

"); > } > else > { > echo ("

As true statement returns false.

"); > } > > if ($i) > { > echo ("

As true statement returns true.

"); > } > else > { > echo ("

As true statement returns false.

"); > } > > $i = returnfalse(); > > if ($i['private']) > { > echo ("

Statment returned as true.

"); > } > else > { > echo ("

Statment returned as false.

"); > } > > if ($i) > { > echo ("

Statement returned as true.

"); > } > else > { > echo ("

Statement returned as false.

"); > } > > The script returned (as expected): > As true statement returns false. > > As true statement returns true. > > Statment returned as false. > > Statement returned as false. > > -Joe > > ----- Original Message ----- > From: Daniel Convissor > Date: Tuesday, January 17, 2006 8:36 pm > Subject: Re: [nycphp-talk] Question Using If's and Possible Arrays > > > Joe: > > > > On Tue, Jan 17, 2006 at 08:20:03PM -0500, IAlsoAgree at stny.rr.com > > wrote:> function callfunction() > > > { > > > return false; > > > } > > > > > > $variable = callfunction() > > > > > > if ($variable['alias']) > > > > You made a nearly perfect test case. Why don't you run it and see > > what > > happens? You'd have your answer already. > > > > --Dan > > > > PS: You'll find that you need to check for "if ($variable)" first. > > > > -- > > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > > data intensive web and database programming > > http://www.AnalysisAndSolutions.com/ > > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > > _______________________________________________ > > New York PHP Community Talk Mailing List > > Show Your Participation > > http://www.nyphp.org/show_participation.php > > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org From danielc at analysisandsolutions.com Tue Jan 17 21:42:57 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 17 Jan 2006 21:42:57 -0500 Subject: [nycphp-talk] Question Using If's and Possible Arrays In-Reply-To: <20060118022508.M78954@pinestream.com> References: <16df09416dde47.16dde4716df094@nyroc.rr.com> <20060118022508.M78954@pinestream.com> Message-ID: <20060118024257.GA8770@panix.com> Hey Joe: On Tue, Jan 17, 2006 at 09:25:08PM -0500, cliff wrote: > What level of error reporting did you use - E_ALL? I believe using an index > that does not exist generates an e-notice warning. Exactly what I was going to say. On your development machine, set your error reporting to E_ALL. You'll save your self tons of headaches and embarrassment in the long run. --Dan PS: So will snipping out unnecessary parts of prior postings. -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From enolists at gmail.com Wed Jan 18 03:06:48 2006 From: enolists at gmail.com (Mark Armendariz) Date: Wed, 18 Jan 2006 00:06:48 -0800 Subject: [nycphp-talk] An Email Architecture Puzzle In-Reply-To: <20060113192735.GZ26280@desario.homelinux.net> Message-ID: <00c201c61c06$2301cd60$6500a8c0@enobrev> I'd worked on a similar app a few years ago for a customer service application. I've been wanting to re-implement it for my own projects, though time's been lacking. Basically, the best way I could figure was to use the email addresses as your filters. Set up a database of jobs. Each job has a begin date and end date. Each job also has a list of the email addresses of those involved in the job. Forward all the emails to a php script (or perl or whatever, I used php). Now, the script will look at all email addresses in the message (to, from, cc, etc), check them against the jobs db. If the address matches an address associated with a job and has been sent between the beginning and end dates of said job, it should be so associated. Then mark / filter / process your messages from there, whether it be adding tracking info to the subject / message body for client-side filtering or forwarding it / storing it in the database, etc. Also, have a cache of unrecognized email addresses in case some haven't been associated with a job and should have. A tagging system might work better (rather than 'folder' organization) as there's times when email messages or address might be associated with multiple jobs. Good luck! Mark > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Andrew Yochum > Sent: Friday, January 13, 2006 11:28 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] An Email Architecture Puzzle > > On Fri, Jan 13, 2006 at 02:18:07PM -0500, Kenneth Downs wrote: > > OK, here's a brain teaser. I've got my own answer in mind > for this, > > but I'd be really curious to see if anyone else has any ideas. > > > > The problem is simple: All emails flowing through a certain domain > > must be tracked and associated with a job in a database. The > > following rules > > apply: > > > > 1) Must not require re-inventing an SMTP server, or any C > coding in an > > existing SMTP server. By the same token we don't want to re-invent > > webmail and force everyone to use it. Solution must be in > pure PHP, > > though may use any plug-in or extension system that an SMTP server > > provides that allows coding in PHP. > > > > 2) Must require minimal if not zero change in habits for > users. For > > instace, requiring users to put complicated codes into their emails > > won't work because people won't do it. > > > > 3) Some kind of pool of un-matchable emails should be > available to an > > admin who then matches them to jobs. > > > > 4) Every email should slot into a job, and replies should > be sortable > > into threads by UI software. > > > > So how would you do that? > > Configure your SMTP server or procmail to filter all email > through a PHP script. Parse, munge (like adding a tracking > number to the subject), store it in your DB & pass it through > to the recipient. This is much the same way many spam > filters and email-based help desk apps work... > and CLEW. > > HTH, > Andrew > > > -- > Andrew Yochum > Plexpod > andrew at plexpod.com > 718-360-0879 > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From ken at secdat.com Wed Jan 18 06:01:40 2006 From: ken at secdat.com (Kenneth Downs) Date: Wed, 18 Jan 2006 06:01:40 -0500 (EST) Subject: [nycphp-talk] An Email Architecture Puzzle In-Reply-To: <00c201c61c06$2301cd60$6500a8c0@enobrev> References: <20060113192735.GZ26280@desario.homelinux.net> <00c201c61c06$2301cd60$6500a8c0@enobrev> Message-ID: <38539.38.117.147.25.1137582100.squirrel@38.117.147.25> > > A tagging system might work better (rather than 'folder' organization) as > there's times when email messages or address might be associated with > multiple jobs. > Yes, we never do any hierarchical if we can avoid it. The email will go into a table and marked as part of a job, a task, and a conversation. -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From randalrust at gmail.com Wed Jan 18 08:37:20 2006 From: randalrust at gmail.com (Randal Rust) Date: Wed, 18 Jan 2006 08:37:20 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: References: <20060114230436.GA6891@panix.com> Message-ID: On 1/17/06, David Mintz wrote: > If you're using PHP 5, one nice thing about the good old singleton is you > can get your instance from any scope. Unfortunately, no. The shared hosting environment I am in has not yet moved to 5. -- Randal Rust R.Squared Communications www.r2communications.com From randalrust at gmail.com Wed Jan 18 08:58:30 2006 From: randalrust at gmail.com (Randal Rust) Date: Wed, 18 Jan 2006 08:58:30 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: <20060114230436.GA6891@panix.com> References: <20060114230436.GA6891@panix.com> Message-ID: On 1/14/06, Daniel Convissor wrote: > Easiest thing to do is in the class_content class, have a property named > $db and set it in the constructor. That was actually what I used to do. What I didn't like about it was that everytime I had to make a call to a method in the $db class, I was writing.... $this->db->conn->Execute($sql) $this->db->connErrorMsg() ...and so on. Instantiating the DB outside of the class, and then passing it as an argument allowed me to shorten things to... $db->Execute($sql) $db->ErrorMsg() > Or, have all your classes extend from the DB class. I tried working with that some yesterday, but for some reason I couldn't quite get it to work. For the time being, I think I'm OK passing the DB as an argument. No one has really said that there is anything 'wrong' with that approach. I guess my options are: - set a global variable, which has to be passed to each method - pass it as an argument to each method (pretty much the same as global, but no chance of it being overwritten) - instantiate it in the constructor, like I do with my other helper methods - create a singleton, which I haven't quite figured out yet -- Randal Rust R.Squared Communications www.r2communications.com From ken at secdat.com Wed Jan 18 09:15:57 2006 From: ken at secdat.com (Kenneth Downs) Date: Wed, 18 Jan 2006 09:15:57 -0500 (EST) Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: References: <20060114230436.GA6891@panix.com> Message-ID: <45922.38.117.147.25.1137593757.squirrel@38.117.147.25> > > I guess my options are: > > - set a global variable, which has to be passed to each method By the KISS principle, this is the simplest and is also effective. Therefore any more complicated solution would have to be defended, no? -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From randalrust at gmail.com Wed Jan 18 09:33:07 2006 From: randalrust at gmail.com (Randal Rust) Date: Wed, 18 Jan 2006 09:33:07 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: <45922.38.117.147.25.1137593757.squirrel@38.117.147.25> References: <20060114230436.GA6891@panix.com> <45922.38.117.147.25.1137593757.squirrel@38.117.147.25> Message-ID: On 1/18/06, Kenneth Downs wrote: > > - set a global variable, which has to be passed to each method > By the KISS principle, this is the simplest and is also effective. > Therefore any more complicated solution would have to be defended, no? Good point. Not being trained as a programmer, I think that sometimes I over-analyze my solutions. The reality is, more often than not, I find that the solutions I come up with on my own are pretty solid. I follow the discussions here pretty closely, and find that I do things just about the same way most others do them. -- Randal Rust R.Squared Communications www.r2communications.com From list at harveyk.com Wed Jan 18 12:49:07 2006 From: list at harveyk.com (harvey) Date: Wed, 18 Jan 2006 12:49:07 -0500 Subject: [nycphp-talk] Paypal Pro and Shopping Carts Message-ID: <7.0.0.16.2.20060118124826.07998420@usa.com> Hello.... ZenCart does not seem to have Paypal Pro integrated or any modules for it. OScommerce does have a Paypal Pro contribution for integrating it. Has anyone used OScommerce with Paypal Pro? Or CREloaded with PayPal Pro? Any issues with either? Thanks...... From corey at domanistudios.com Wed Jan 18 12:50:36 2006 From: corey at domanistudios.com (Corey Szopinski) Date: Wed, 18 Jan 2006 12:50:36 -0500 Subject: [nycphp-talk] [JOB] PHP Developer Message-ID: Web Developer/Programmer Domani Studios (www.domanistudios.com) is looking for a web developer to help us create award-winning online projects. We work primarily with luxury and lifestyle clients such as Geffen Records, Estee Lauder, W Hotels, and Mini Cooper. We're looking for an ethusiastic mid-level developer to work in our Brooklyn office. You will work primarily on adding content mangement tools (cms), business logic, and e-commerce features to our projects. Location: Brooklyn (onsite - please do not apply unless you are willing to work in our office) Responsibilities - Work with graphic designers and other developers to design, build and test online software. - Build databases, configure server, write code, develop APIs - Troubleshoot existing software - Documentation of code - Bring up smart ideas, and help make them a reality Requirements - Strong communication skills - Ability to work with a team - Strong desire to keep learning, pushing the envelope - Experience with E-commerce - Knowledge of design patterns - Deep knowledge (3-4 yrs) of PHP, MySQL, HTML, CSS, Javascript, DNS, XML - Extra points for knowing AS 2 (or 3!), C#, AJAX, SQL Server, Perl, Ruby, Shell, Java, Flash Media Server, online games, blogs etc - Super extra points for knowing Linux systems administration stuff (sendmail, apache, grep, sed, and awk) Compensation: The salary is competitive and commesurate with experience. To get the ball rolling, send your cover letter, salary requirement and resume to jobs at domanistudios.com. -------- Corey Szopinski Director of Technology DOMANI STUDIOS corey at domanistudios.com 55 Washington St. Suite 822 Brooklyn, NY 11201 718-797-4470 x116 From jeffrey.knight at gmail.com Wed Jan 18 12:57:02 2006 From: jeffrey.knight at gmail.com (Jeffrey Knight) Date: Wed, 18 Jan 2006 12:57:02 -0500 Subject: [nycphp-talk] [JOB] PHP Developer In-Reply-To: References: Message-ID: Nice animation on your site http://domanistudios.com ! And great to see a shop in brooklyn . On 1/18/06, Corey Szopinski wrote: > Web Developer/Programmer > > Domani Studios (www.domanistudios.com) is looking for a web developer > to help us create award-winning online projects. We work primarily > with luxury and lifestyle clients such as Geffen Records, Estee > Lauder, W Hotels, and Mini Cooper. We're looking for an ethusiastic > mid-level developer to work in our Brooklyn office. You will work > primarily on adding content mangement tools (cms), business logic, > and e-commerce features to our projects. > > Location: Brooklyn (onsite - please do not apply unless you are > willing to work in our office) > > Responsibilities > - Work with graphic designers and other developers to design, build > and test online software. > - Build databases, configure server, write code, develop APIs > - Troubleshoot existing software > - Documentation of code > - Bring up smart ideas, and help make them a reality > > > Requirements > - Strong communication skills > - Ability to work with a team > - Strong desire to keep learning, pushing the envelope > - Experience with E-commerce > - Knowledge of design patterns > - Deep knowledge (3-4 yrs) of PHP, MySQL, HTML, CSS, Javascript, DNS, > XML > - Extra points for knowing AS 2 (or 3!), C#, AJAX, SQL Server, Perl, > Ruby, Shell, Java, Flash Media Server, online games, blogs etc > - Super extra points for knowing Linux systems administration stuff > (sendmail, apache, grep, sed, and awk) > > > Compensation: > The salary is competitive and commesurate with experience. > > To get the ball rolling, send your cover letter, salary requirement > and resume to jobs at domanistudios.com. > > -------- > Corey Szopinski > Director of Technology > > DOMANI STUDIOS > corey at domanistudios.com > 55 Washington St. Suite 822 > Brooklyn, NY 11201 > 718-797-4470 x116 > > > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From cweyl at alumni.drew.edu Wed Jan 18 13:38:37 2006 From: cweyl at alumni.drew.edu (Chris Weyl) Date: Wed, 18 Jan 2006 13:38:37 -0500 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: <45922.38.117.147.25.1137593757.squirrel@38.117.147.25> References: <20060114230436.GA6891@panix.com> <45922.38.117.147.25.1137593757.squirrel@38.117.147.25> Message-ID: <7dd7ab490601181038x1b8db0bbg3e744199d2cb9d37@mail.gmail.com> On 1/18/06, Kenneth Downs wrote: > > > > I guess my options are: > > > > - set a global variable, which has to be passed to each method > > By the KISS principle, this is the simplest and is also effective. > Therefore any more complicated solution would have to be defended, no? Not always. For a very simple app, maybe... but let's say you start using a php-based library, say, something PEAR or otherwise, that also uses a db connection (or other common object/var that needs wide access), that also uses a global called $db, or $dbh, or $file, or... This kind of bug can be subtle and hard to track down, particularly if the person maintaining the code is no longer the person who wrote it. Also, using a singleton with a static accessor allows checks to be implemented once. The example functions show that you can check for a null object in one place; implementing other checks/code in there is also possible. -Chris From rolan at omnistep.com Wed Jan 18 13:52:40 2006 From: rolan at omnistep.com (Rolan Yang) Date: Wed, 18 Jan 2006 13:52:40 -0500 Subject: [nycphp-talk] Paypal Pro and Shopping Carts In-Reply-To: <7.0.0.16.2.20060118124826.07998420@usa.com> References: <7.0.0.16.2.20060118124826.07998420@usa.com> Message-ID: <43CE8E78.8030808@omnistep.com> The Paypal pro works with OSCommerce. You might run into some issues with the testing sandbox though. It's tricky and some things aren't clearly explained in the Paypal documentation. ~Rolan harvey wrote: > Hello.... > > ZenCart does not seem to have Paypal Pro integrated or any modules for it. > > OScommerce does have a Paypal Pro contribution for integrating it. > > Has anyone used OScommerce with Paypal Pro? > > Or CREloaded with PayPal Pro? > > Any issues with either? > > Thanks...... > From jeff.knight at gmail.com Wed Jan 18 13:59:32 2006 From: jeff.knight at gmail.com (Jeff Knight) Date: Wed, 18 Jan 2006 12:59:32 -0600 Subject: [nycphp-talk] [JOB] PHP Developer In-Reply-To: References: Message-ID: <2ca9ba910601181059p2973e37dj8fe990bc3c0ed4f7@mail.gmail.com> It is a little unnerving having two of us here, but just keep making positive comments and nobody will have trouble telling us apart. On 1/18/06, Jeffrey Knight wrote: > Nice animation on your site http://domanistudios.com ! From ken at secdat.com Wed Jan 18 14:01:27 2006 From: ken at secdat.com (Kenneth Downs) Date: Wed, 18 Jan 2006 14:01:27 -0500 (EST) Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: <7dd7ab490601181038x1b8db0bbg3e744199d2cb9d37@mail.gmail.com> References: <20060114230436.GA6891@panix.com> <45922.38.117.147.25.1137593757.squirrel@38.117.147.25> <7dd7ab490601181038x1b8db0bbg3e744199d2cb9d37@mail.gmail.com> Message-ID: <46128.38.117.147.25.1137610887.squirrel@38.117.147.25> > On 1/18/06, Kenneth Downs wrote: >> > >> > I guess my options are: >> > >> > - set a global variable, which has to be passed to each method >> >> By the KISS principle, this is the simplest and is also effective. >> Therefore any more complicated solution would have to be defended, no? > > Not always. Always. Involving two completely different connection systems, your own and PEAR's, is not a trivial design decision, either for you or for that unnamed person who will code after you. The number one mistake that programmers make is abstracting against cases that *might* happen but which are not on the table right now. There is a huge difference between a clean elegant design that is simple and *extensible* and a clunky ugly horrible design that tries to account for everything that might ever happen anywhere. In any event, if you go to a two-connection system then by the KISS principle you want to find the simplest possible solution for that context. Going to a two-connection system is itself rather questionable under the KISS principle, if you are that worried about it perhaps we should use PEAR to start off? > For a very simple app, maybe... but let's say you start > using a php-based library, say, something PEAR or otherwise, that also > uses a db connection (or other common object/var that needs wide > access), that also uses a global called $db, or $dbh, or $file, or... > This kind of bug can be subtle and hard to track down, particularly if > the person maintaining the code is no longer the person who wrote it. > > Also, using a singleton with a static accessor allows checks to be > implemented once. The example functions show that you can check for a > null object in one place; implementing other checks/code in there is > also possible. > > -Chris > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From mitch.pirtle at gmail.com Wed Jan 18 14:08:39 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Wed, 18 Jan 2006 14:08:39 -0500 Subject: [nycphp-talk] [JOB] PHP Developer In-Reply-To: <2ca9ba910601181059p2973e37dj8fe990bc3c0ed4f7@mail.gmail.com> References: <2ca9ba910601181059p2973e37dj8fe990bc3c0ed4f7@mail.gmail.com> Message-ID: <330532b60601181108xb8922a3od64499c104f05131@mail.gmail.com> On 1/18/06, Jeff Knight wrote: > It is a little unnerving having two of us here, but just keep making > positive comments and nobody will have trouble telling us apart. > > On 1/18/06, Jeffrey Knight wrote: > > Nice animation on your site http://domanistudios.com ! That may be true, but to keep the confusion to a minimum I recommend we start calling you Ebenezer instead. -- Mitch, not to be confused with the "other" Mitch LOL From jknight at oceansuit.com Wed Jan 18 15:08:03 2006 From: jknight at oceansuit.com (jknight at oceansuit.com) Date: Wed, 18 Jan 2006 14:08:03 -0600 (CST) Subject: [nycphp-talk] [JOB] PHP Developer In-Reply-To: <330532b60601181108xb8922a3od64499c104f05131@mail.gmail.com> References: <2ca9ba910601181059p2973e37dj8fe990bc3c0ed4f7@mail.gmail.com> <330532b60601181108xb8922a3od64499c104f05131@mail.gmail.com> Message-ID: <11728.69.38.167.2.1137614883.squirrel@oceansuit.com> I switched email addresses -- two people with the same name is confusing enough, both with firstName.lastName at gmail.com is too much. > On 1/18/06, Jeff Knight wrote: >> It is a little unnerving having two of us here, but just keep making >> positive comments and nobody will have trouble telling us apart. >> >> On 1/18/06, Jeffrey Knight wrote: >> > Nice animation on your site http://domanistudios.com ! > > That may be true, but to keep the confusion to a minimum I recommend > we start calling you Ebenezer instead. > > -- Mitch, not to be confused with the "other" Mitch LOL > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From jeff.knight at gmail.com Wed Jan 18 14:13:39 2006 From: jeff.knight at gmail.com (Jeff Knight) Date: Wed, 18 Jan 2006 13:13:39 -0600 Subject: [nycphp-talk] [JOB] PHP Developer In-Reply-To: <330532b60601181108xb8922a3od64499c104f05131@mail.gmail.com> References: <2ca9ba910601181059p2973e37dj8fe990bc3c0ed4f7@mail.gmail.com> <330532b60601181108xb8922a3od64499c104f05131@mail.gmail.com> Message-ID: <2ca9ba910601181113v6ffed6e2g7ee96c176a61a1e4@mail.gmail.com> On 1/18/06, Mitch Pirtle wrote: > That may be true, but to keep the confusion to a minimum I recommend > we start calling you Ebenezer instead. Bah... was thinking maybe just Jeff!, I hear adding an exclamation point at the end really jazzes up a product. From codebowl at gmail.com Wed Jan 18 14:19:56 2006 From: codebowl at gmail.com (Joseph Crawford) Date: Wed, 18 Jan 2006 14:19:56 -0500 Subject: [nycphp-talk] [JOB] PHP Developer In-Reply-To: <2ca9ba910601181113v6ffed6e2g7ee96c176a61a1e4@mail.gmail.com> References: <2ca9ba910601181059p2973e37dj8fe990bc3c0ed4f7@mail.gmail.com> <330532b60601181108xb8922a3od64499c104f05131@mail.gmail.com> <2ca9ba910601181113v6ffed6e2g7ee96c176a61a1e4@mail.gmail.com> Message-ID: <8d9a42800601181119n2fef1680k787f8d90d6f61724@mail.gmail.com> LOL does sex appeal really work on getting web clients? last part of the animation is just funny ;) -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. 1-802-671-2021 codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at trachtenberg.com Wed Jan 18 14:37:54 2006 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Wed, 18 Jan 2006 14:37:54 -0500 (EST) Subject: [nycphp-talk] Paypal Pro and Shopping Carts In-Reply-To: <43CE8E78.8030808@omnistep.com> References: <7.0.0.16.2.20060118124826.07998420@usa.com> <43CE8E78.8030808@omnistep.com> Message-ID: I have been told that ProOSC has Paypal Pro modules for ZenCart. I think they're calling them PayPal Express Checkout. http://postosc.com/ My sources also say that they know of merchants using them successfully, but I don't have any examples to share. -adam On Wed, 18 Jan 2006, Rolan Yang wrote: > The Paypal pro works with OSCommerce. You might run into some issues > with the testing sandbox though. > It's tricky and some things aren't clearly explained in the Paypal > documentation. > > ~Rolan > > harvey wrote: > > Hello.... > > > > ZenCart does not seem to have Paypal Pro integrated or any modules for it. > > > > OScommerce does have a Paypal Pro contribution for integrating it. > > > > Has anyone used OScommerce with Paypal Pro? > > > > Or CREloaded with PayPal Pro? > > > > Any issues with either? > > > > Thanks...... > > > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- adam at trachtenberg.com | http://www.trachtenberg.com author of o'reilly's "upgrading to php 5" and "php cookbook" avoid the holiday rush, buy your copies today! From 1j0lkq002 at sneakemail.com Wed Jan 18 15:12:36 2006 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Wed, 18 Jan 2006 12:12:36 -0800 Subject: [nycphp-talk] [JOB] PHP Developer In-Reply-To: <2ca9ba910601181059p2973e37dj8fe990bc3c0ed4f7@mail.gmail.com> References: <2ca9ba910601181059p2973e37dj8fe990bc3c0ed4f7@mail.gmail.com> Message-ID: <11643-42676@sneakemail.com> Jeff Knight jeff.knight-at-gmail.com |nyphp dev/internal group use| wrote: >It is a little unnerving having two of us here, but just keep making >positive comments and nobody will have trouble telling us apart. > >On 1/18/06, Jeffrey Knight wrote: > > >>Nice animation on your site http://domanistudios.com ! >> >> au contrare... everytime it causes agita.... was that a real positive comment, or was that laced with some deep cynical sarcasm that I completely missed? Or... perhaps it was the *other* Jeff Knight. Doh! What ever happened to that putamare gal anyway? From dmintz at davidmintz.org Wed Jan 18 15:52:30 2006 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 18 Jan 2006 15:52:30 -0500 (EST) Subject: [nycphp-talk] command line warning "...these options need to match" Message-ID: Anybody know what this means? When I run a php script from the command line, I get: PHP Warning: PHP Startup: \uffff\uffff: Unable to initialize module Module compiled with module API=20041030, debug=0, thread-safety=0 PHP compiled with module API=20050922, debug=0, thread-safety=0 These options need to match in Unknown on line 0 ...followed by the otherwise normal output of the script. My version: PHP 5.1.1 (cli) (built: Dec 27 2005 15:28:52) Copyright (c) 1997-2005 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2005 Zend Technologies with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v2.6.1, Copyright (c) 1998-2006, by Zend Technologies with Zend Debugger v5.1.0, Copyright (c) 1999-2006, by Zend Technologies Would it do any good just to re-compile and re-install? Thanks --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From krook at us.ibm.com Wed Jan 18 16:13:13 2006 From: krook at us.ibm.com (Daniel Krook) Date: Wed, 18 Jan 2006 16:13:13 -0500 Subject: [nycphp-talk] PEAR DB ODBC broken after 5.0.4 -> 5.1.1 Message-ID: Hey folks, A site of mine has not been able to connect to DB2 with PEAR since I upgraded to PHP 5.1.1 from 5.0.4. I upgraded a similar machine with the same versions of all software and its DB2 connection works as expected. Both machines had PHP compiled with '--with-ibm-db2=/home/db2inst1/sqllib' and have the same ODBC settings in php.ini. This code: include_once('DB.php'); $db =& DB::connect('odbc://' . DB_USER . ':' . DB_PASS . '@' . DB_HOST . '/' . DB_NAME); if (DB::isError($db)) die($db->toString()); Returns: [db_error: message="DB Error: connect failed" code=-24 mode=return level=notice prefix="" info=" [nativecode=?????~ \%?A?.] ** odbc://username:password at 127.0.0.1/database"] The database server is up, and I can connect to it on the command line and select rows. I've also tried setting the port number explicitly. Here's the output of print_r($db), though it's not giving me anything more detailed than "DB Error: connect failed" http://krook.org/etc/print_r.txt Even more interesting, if I refresh the page a few times, the load average steadily increases and the processor is eventually consumed by httpd processes to the point where I have to restart Apache. Any thoughts on where I might be going wrong? Thanks in advance, -Dan Daniel Krook, Content Tools Developer Global Production Services - Tools, ibm.com http://bluepages.redirect.webahead.ibm.com/ http://blogpages.redirect.webahead.ibm.com/ http://bookmarks.redirect.webahead.ibm.com/ From tgales at tgaconnect.com Wed Jan 18 16:32:56 2006 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 18 Jan 2006 16:32:56 -0500 Subject: [nycphp-talk] command line warning "...these options need to match" In-Reply-To: References: Message-ID: <43CEB408.8010802@tgaconnect.com> David Mintz wrote: > Anybody know what this means? When I run a php script from the command > line, I get: > > PHP Warning: PHP Startup: \uffff\uffff: Unable to initialize module > Module compiled with module API=20041030, debug=0, thread-safety=0 > PHP compiled with module API=20050922, debug=0, thread-safety=0 > These options need to match > in Unknown on line 0 > > ...followed by the otherwise normal output of the script. ... > > Would it do any good just to re-compile and re-install? If you don't have any problems (in the error_log ) when using PHP as a module, then maybe you're using different ini files. also try: php -v php5 -v -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From hendler at simmons.edu Wed Jan 18 16:36:20 2006 From: hendler at simmons.edu (Jonathan) Date: Wed, 18 Jan 2006 16:36:20 -0500 Subject: [nycphp-talk] command line warning "...these options need to match" In-Reply-To: References: Message-ID: <43CEB4D4.4050307@simmons.edu> I get these errors when I compile from C into a .so extension from different versions of PHP. It might not be your php script causing the error - but a shared object you are loading (or ADODB c library for example) through a dl() function or in the .ini. \uffff I don't know what that is- hex for nothing? Anyway , thats a php 5 warning message - and some extension being loaded is from php4. Hope that helps. - Jonathan Hendler David Mintz wrote: >Anybody know what this means? When I run a php script from the command >line, I get: > >PHP Warning: PHP Startup: \uffff\uffff: Unable to initialize module >Module compiled with module API=20041030, debug=0, thread-safety=0 >PHP compiled with module API=20050922, debug=0, thread-safety=0 >These options need to match > in Unknown on line 0 > >...followed by the otherwise normal output of the script. My version: > >PHP 5.1.1 (cli) (built: Dec 27 2005 15:28:52) Copyright (c) 1997-2005 The >PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2005 Zend Technologies > with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend >Technologies > with Zend Optimizer v2.6.1, Copyright (c) 1998-2006, by Zend >Technologies > with Zend Debugger v5.1.0, Copyright (c) 1999-2006, by Zend >Technologies > >Would it do any good just to re-compile and re-install? > >Thanks > >--- >David Mintz >http://davidmintz.org/ > >Amendment IV > >The right of the people to be secure in their >persons, houses, papers, and effects, against >unreasonable searches and seizures, shall not be >violated, and no Warrants shall issue, but upon >probable cause, supported by Oath or affirmation, >and particularly describing the place to be >searched, and the persons or things to be seized. >_______________________________________________ >New York PHP Community Talk Mailing List >Show Your Participation >http://www.nyphp.org/show_participation.php >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org > > From list at harveyk.com Wed Jan 18 17:24:42 2006 From: list at harveyk.com (harvey) Date: Wed, 18 Jan 2006 17:24:42 -0500 Subject: [nycphp-talk] Paypal Pro and Shopping Carts In-Reply-To: References: <7.0.0.16.2.20060118124826.07998420@usa.com> <43CE8E78.8030808@omnistep.com> Message-ID: <7.0.0.16.2.20060118170007.079dc9f8@harveyk.com> Seems like Paypal Express Checkout is somewhere in between the 'normal' Paypal (where you leave the shopping site and go to Paypal for payment) and Pro (where everything happens on the shopping site). http://www.paypal.com/cgi-bin/webscr?cmd=_help-ext&eloc=2226&loc=2193&unique_id=790089&source_page=_home&flow= BUT, I did some more scrounging around and found this: http://zenatdesign.com/payment/index.php Seems like they make a bunch of Paypal Pro plugins... At 02:37 PM 1/18/2006, Adam Maccabee Trachtenberg wrote: >I have been told that ProOSC has Paypal Pro modules for ZenCart. I >think they're calling them PayPal Express Checkout. > >http://postosc.com/ > >My sources also say that they know of merchants using them >successfully, but I don't have any examples to share. > >-adam > >On Wed, 18 Jan 2006, Rolan Yang wrote: > > > The Paypal pro works with OSCommerce. You might run into some issues > > with the testing sandbox though. > > It's tricky and some things aren't clearly explained in the Paypal > > documentation. > > > > ~Rolan > > > > harvey wrote: > > > Hello.... > > > > > > ZenCart does not seem to have Paypal Pro integrated or any > modules for it. > > > > > > OScommerce does have a Paypal Pro contribution for integrating it. > > > > > > Has anyone used OScommerce with Paypal Pro? > > > > > > Or CREloaded with PayPal Pro? > > > > > > Any issues with either? > > > > > > Thanks...... > > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > Show Your Participation > > http://www.nyphp.org/show_participation.php > > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org > > > >-- >adam at trachtenberg.com | http://www.trachtenberg.com >author of o'reilly's "upgrading to php 5" and "php cookbook" >avoid the holiday rush, buy your copies today! >_______________________________________________ >New York PHP Community Talk Mailing List >Show Your Participation >http://www.nyphp.org/show_participation.php >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org From rolan at omnistep.com Wed Jan 18 17:59:00 2006 From: rolan at omnistep.com (Rolan Yang) Date: Wed, 18 Jan 2006 17:59:00 -0500 Subject: [nycphp-talk] Paypal Pro and Shopping Carts In-Reply-To: <7.0.0.16.2.20060118170007.079dc9f8@harveyk.com> References: <7.0.0.16.2.20060118124826.07998420@usa.com> <43CE8E78.8030808@omnistep.com> <7.0.0.16.2.20060118170007.079dc9f8@harveyk.com> Message-ID: <43CEC834.8030504@omnistep.com> That's interesting. He's charging $39.95 for the OScommerce module. There are 2 free modules for Paypal website payments pro in the "contributions" section of oscommerce.com ~Rolan harvey wrote: > Seems like Paypal Express Checkout is somewhere in between the > 'normal' Paypal (where you leave the shopping site and go to Paypal > for payment) and Pro (where everything happens on the shopping site). > http://www.paypal.com/cgi-bin/webscr?cmd=_help-ext&eloc=2226&loc=2193&unique_id=790089&source_page=_home&flow= > > BUT, I did some more scrounging around and found this: > http://zenatdesign.com/payment/index.php > > Seems like they make a bunch of Paypal Pro plugins... > > > From mikko.rantalainen at peda.net Thu Jan 19 09:17:49 2006 From: mikko.rantalainen at peda.net (Mikko Rantalainen) Date: Thu, 19 Jan 2006 16:17:49 +0200 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: References: <20060114230436.GA6891@panix.com> Message-ID: <43CF9F8D.7030109@peda.net> Randal Rust wrote: > [...] I > was writing.... > > $this->db->conn->Execute($sql) > $this->db->connErrorMsg() > > Instantiating the DB outside of the class, and then passing it as an > argument allowed me to shorten things to... > > $db->Execute($sql) > $db->ErrorMsg() Why not just do $db =& $this->db->conn; and then just proceed with the above? It's pretty close to the total length of adding $db as an function argument if you consider that caller must also type the code to pass the DB handle. After saying that, yes, the singleton pattern sounds like a valid alternative. -- Mikko From mikko.rantalainen at peda.net Thu Jan 19 09:21:36 2006 From: mikko.rantalainen at peda.net (Mikko Rantalainen) Date: Thu, 19 Jan 2006 16:21:36 +0200 Subject: [nycphp-talk] Accessing a method from one class in another In-Reply-To: References: <20060114230436.GA6891@panix.com> Message-ID: <43CFA070.8080509@peda.net> David Mintz wrote: > If you're using PHP 5, one nice thing about the good old singleton is you > can get your instance from any scope. > > $db = MyDatabaseClass::getInstance() ; > > //// from MyDatabaseClass > > private static $instance = null; > > public static function getInstance() { > > if (is_null(self::$instance)) { > // this uses PEAR and relies on an __autoload > self::$instance = DB::connect("$driver://$user:$password@$host/$db"); > if (DB::isError(self::$instance)){ > trigger_error('could not connect to database',E_USER_ERROR); > } > self::$instance->setFetchMode(DB_FETCHMODE_ASSOC); > // et cetera > } > return self::$instance; > } If you only have PHP4, you can still do something like this //// from MyDatabaseClass function &getInstance() { static $instance = 0; if (!$instance) { // this uses PEAR and relies on an __autoload $instance = DB::connect("$driver://$user:$password@$host/$db"); if (DB::isError($instance)){ trigger_error('could not connect to database',E_USER_ERROR); } $instance->setFetchMode(DB_FETCHMODE_ASSOC); // et cetera } return $instance; } (the above is untested but should work, you might need to adjust the code that connects to database). -- Mikko From cliff at pinestream.com Thu Jan 19 11:11:06 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 19 Jan 2006 11:11:06 -0500 Subject: [nycphp-talk] Fault tolerant server architecture Message-ID: <004a01c61d12$f466c330$0aa8a8c0@cliff> Ok, so this may be a bit off topic, but I am trying to determine a cost effective architecture for a classic PHP/MySQL site that is fault tolerant and can scale-out if needed. At one extreme I view the minimum configuration as a simple dedicated server. But being a bit paranoid, at the other extreme, I have been getting quotes for a configuration that uses a Firewall, load balancer, two web servers, and two database servers (one master, one slave for backups). Of course with additional backups (local & offsite), RAID, hot swap power supplies, etc. I skipped the armed guards, tasers, and off planet options. And so far, I am ignoring the people that are telling me that if I want to be really serious, I should use Oracle, not MySQL. If I could stick this in my basement, the price wouldn't even be so bad. But that's not realistic. With a managed service provider, the charge is thousands per month. With co-location -- don't know. Haven't priced it and then I need a sysadmin anyway. Co-lo isn't cheap either. I would be funding this out of my own pocket. Am I nuts? What are other people doing to ensure availability at a reasonable price point? -------------- next part -------------- An HTML attachment was scrubbed... URL: From edwardpotter at gmail.com Thu Jan 19 11:30:14 2006 From: edwardpotter at gmail.com (edward potter) Date: Thu, 19 Jan 2006 11:30:14 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <004a01c61d12$f466c330$0aa8a8c0@cliff> References: <004a01c61d12$f466c330$0aa8a8c0@cliff> Message-ID: hmmm, wow, i can do it all for you for 25G a month. (off course I'd just put it all on dreamhost for $9.95 a month) and U would never know! :-) ummmm, doesn't google use MySQL INSTEAD of Oracle for all their Ad serving, that's what I heard, and how much bigger can u get then google? We're reaching the point where bandwidth is going to zero $ and software is going to zero $ and phone calls are just about zero $. Yipes, lets hope us coders don't go to zero $/hr too __ as the boss moves a robot into my cubicle! In the words of Mark Cuban, who is a billionaire WHO GETS it (great blog by the way): "Anyone with $500 bucks and a $10 server can take on google". And he has an amazing track record! http://www.blogmaverick.com :-) -ed On 1/19/06, Cliff Hirsch wrote: > > Ok, so this may be a bit off topic, but I am trying to determine a cost > effective architecture for a classic PHP/MySQL site that is fault tolerant > and can scale-out if needed. > > At one extreme I view the minimum configuration as a simple dedicated > server. > > But being a bit paranoid, at the other extreme, I have been getting quotes > for a configuration that uses a Firewall, load balancer, two web servers, > and two database servers (one master, one slave for backups). Of course with > additional backups (local & offsite), RAID, hot swap power supplies, etc. I > skipped the armed guards, tasers, and off planet options. And so far, I am > ignoring the people that are telling me that if I want to be really serious, > I should use Oracle, not MySQL. > > If I could stick this in my basement, the price wouldn't even be so bad. But > that's not realistic. With a managed service provider, the charge is > thousands per month. With co-location -- don't know. Haven't priced it and > then I need a sysadmin anyway. Co-lo isn't cheap either. > > I would be funding this out of my own pocket. Am I nuts? What are other > people doing to ensure availability at a reasonable price point? > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > > > From cliff at pinestream.com Thu Jan 19 11:38:04 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 19 Jan 2006 11:38:04 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: Message-ID: <005a01c61d16$b8bfa050$0aa8a8c0@cliff> Yeah, it's mainly the Wall Street camp that seems to be wedded to Oracle. But if you can get a 1-2% management fee, why not? You have to show something for underperforming the market. But servers do crash. Disk drives do die. Power supplies do go poof. -----Original Message----- hmmm, wow, i can do it all for you for 25G a month. (off course I'd just put it all on dreamhost for $9.95 a month) and U would never know! :-) ummmm, doesn't google use MySQL INSTEAD of Oracle for all their Ad serving, that's what I heard, and how much bigger can u get then google? We're reaching the point where bandwidth is going to zero $ and software is going to zero $ and phone calls are just about zero $. Yipes, lets hope us coders don't go to zero $/hr too __ as the boss moves a robot into my cubicle! In the words of Mark Cuban, who is a billionaire WHO GETS it (great blog by the way): "Anyone with $500 bucks and a $10 server can take on google". And he has an amazing track record! http://www.blogmaverick.com From jonbaer at jonbaer.com Thu Jan 19 11:40:04 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 19 Jan 2006 11:40:04 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <004a01c61d12$f466c330$0aa8a8c0@cliff> References: <004a01c61d12$f466c330$0aa8a8c0@cliff> Message-ID: <4914CD7D-F603-4157-AC26-92BCBC1305F4@jonbaer.com> Ahhhh yes, I wish there was an AA for people who were victims of the "if you are serious you need to use Oracle" trap. :-) On Jan 19, 2006, at 11:11 AM, Cliff Hirsch wrote: > Ok, so this may be a bit off topic, but I am trying to determine a > cost > effective architecture for a classic PHP/MySQL site that is fault > tolerant and can scale-out if needed. > > At one extreme I view the minimum configuration as a simple dedicated > server. > > But being a bit paranoid, at the other extreme, I have been getting > quotes for a configuration that uses a Firewall, load balancer, two > web > servers, and two database servers (one master, one slave for backups). > Of course with additional backups (local & offsite), RAID, hot swap > power supplies, etc. I skipped the armed guards, tasers, and off > planet > options. And so far, I am ignoring the people that are telling me that > if I want to be really serious, I should use Oracle, not MySQL. > > If I could stick this in my basement, the price wouldn't even be so > bad. > But that's not realistic. With a managed service provider, the > charge is > thousands per month. With co-location -- don't know. Haven't priced it > and then I need a sysadmin anyway. Co-lo isn't cheap either. > > I would be funding this out of my own pocket. Am I nuts? What are > other > people doing to ensure availability at a reasonable price point? > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From corey at domanistudios.com Thu Jan 19 12:01:01 2006 From: corey at domanistudios.com (Corey Szopinski) Date: Thu, 19 Jan 2006 12:01:01 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <004a01c61d12$f466c330$0aa8a8c0@cliff> References: <004a01c61d12$f466c330$0aa8a8c0@cliff> Message-ID: <5FA87BFC-C95F-4EC0-86E2-F014E1FFE901@domanistudios.com> If I were you, I'd start out with a virtual root system with a hosting company that can scale you up quickly (within days), to bigger and better hardware. I've had my eye on these guys for a while: http://www.linode.com/ although mediatemple.net (and nearly everyone else for that matter) is offering VPS. At least with this option you can get your idea up and running, even paying for multiple vps accounts and running them as distributed servers, or database master/slave machines, or reverse proxy servers, etc.. and not kill yourself with financing it all. MySQL vs Oracle: MySQL is highly tuned for selects and using the SQL_CACHE directive is a cheap and easy way to really boost the performance of any app. Oracle is a pig that's simply not necessary for 90% of websites. -corey On Jan 19, 2006, at 11:11 AM, Cliff Hirsch wrote: > Ok, so this may be a bit off topic, but I am trying to determine a > cost effective architecture for a classic PHP/MySQL site that is > fault tolerant and can scale-out if needed. > > At one extreme I view the minimum configuration as a simple > dedicated server. > > But being a bit paranoid, at the other extreme, I have been getting > quotes for a configuration that uses a Firewall, load balancer, two > web servers, and two database servers (one master, one slave for > backups). Of course with additional backups (local & offsite), > RAID, hot swap power supplies, etc. I skipped the armed guards, > tasers, and off planet options. And so far, I am ignoring the > people that are telling me that if I want to be really serious, I > should use Oracle, not MySQL. > > If I could stick this in my basement, the price wouldn't even be so > bad. But that's not realistic. With a managed service provider, the > charge is thousands per month. With co-location -- don't know. > Haven't priced it and then I need a sysadmin anyway. Co-lo isn't > cheap either. > > I would be funding this out of my own pocket. Am I nuts? What are > other people doing to ensure availability at a reasonable price point? Corey Szopinski Director of Technology DOMANI STUDIOS corey at domanistudios.com 55 Washington St. Suite 822 Brooklyn, NY 11201 718-797-4470 x116 From cliff at pinestream.com Thu Jan 19 12:09:48 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 19 Jan 2006 12:09:48 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <5FA87BFC-C95F-4EC0-86E2-F014E1FFE901@domanistudios.com> Message-ID: <007201c61d1b$27894d70$0aa8a8c0@cliff> Interesting. I wonder how secure VPS is. Does it truly eliminate the problems related to share hosting, like session access, etc.? And interesting that they use RAID 1, not RAID 5. -----Original Message----- If I were you, I'd start out with a virtual root system with a hosting company that can scale you up quickly (within days), to bigger and better hardware. I've had my eye on these guys for a while: http://www.linode.com/ although mediatemple.net (and nearly everyone else for that matter) is offering VPS. At least with this option you can get your idea up and running, even paying for multiple vps accounts and running them as distributed servers, or database master/slave machines, or reverse proxy servers, etc.. and not kill yourself with financing it all. From corey at domanistudios.com Thu Jan 19 12:16:54 2006 From: corey at domanistudios.com (Corey Szopinski) Date: Thu, 19 Jan 2006 12:16:54 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <007201c61d1b$27894d70$0aa8a8c0@cliff> References: <007201c61d1b$27894d70$0aa8a8c0@cliff> Message-ID: <76807C46-C482-43C9-8E5C-85AD71E6C200@domanistudios.com> Well, I assume everything is completely isolated, running in a virtualized program space. Here's what the User-mode Linux project page says: > User-Mode Linux is a safe, secure way of running Linux versions and > Linux processes. Run buggy software, experiment with new Linux > kernels or distributions, and poke around in the internals of > Linux, all without risking your main Linux setup. > User-Mode Linux gives you a virtual machine that may have more > hardware and software virtual resources than your actual, physical > computer. Disk storage for the virtual machine is entirely > contained inside a single file on your physical machine. You can > assign your virtual machine only the hardware access you want it to > have. With properly limited access, nothing you do on the virtual > machine can change or damage your real computer, or its software. -corey On Jan 19, 2006, at 12:09 PM, Cliff Hirsch wrote: > Interesting. I wonder how secure VPS is. Does it truly eliminate the > problems related to share hosting, like session access, etc.? And > interesting that they use RAID 1, not RAID 5. Corey Szopinski Director of Technology DOMANI STUDIOS corey at domanistudios.com 55 Washington St. Suite 822 Brooklyn, NY 11201 718-797-4470 x116 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hendler at simmons.edu Thu Jan 19 12:53:53 2006 From: hendler at simmons.edu (Jonathan) Date: Thu, 19 Jan 2006 12:53:53 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <007201c61d1b$27894d70$0aa8a8c0@cliff> References: <007201c61d1b$27894d70$0aa8a8c0@cliff> Message-ID: <43CFD231.5040401@simmons.edu> I use a VPS with rackforce.com. I have about 20 domains running. It's great in theory, and you can easily migrate to real hardware if needed. It is slower than shared hosting I've found though. CPU cycles are shared, and if you've ever run 4 or 5 OSs in Virtual PC or VMWare you know it gets kinda slow. Otherwise I'd recommend it. Obviously there's tape backups, and I do rsync/scp/tar to a local machine once every couple of days. Cliff Hirsch wrote: >Interesting. I wonder how secure VPS is. Does it truly eliminate the >problems related to share hosting, like session access, etc.? And >interesting that they use RAID 1, not RAID 5. > >-----Original Message----- >If I were you, I'd start out with a virtual root system with a >hosting company that can scale you up quickly (within days), to >bigger and better hardware. I've had my eye on these guys for a >while: http://www.linode.com/ although mediatemple.net (and nearly >everyone else for that matter) is offering VPS. > >At least with this option you can get your idea up and running, even >paying for multiple vps accounts and running them as distributed >servers, or database master/slave machines, or reverse proxy servers, >etc.. and not kill yourself with financing it all. > >_______________________________________________ >New York PHP Community Talk Mailing List >Show Your Participation >http://www.nyphp.org/show_participation.php >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org > > From mitch.pirtle at gmail.com Thu Jan 19 22:14:57 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 19 Jan 2006 22:14:57 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <004a01c61d12$f466c330$0aa8a8c0@cliff> References: <004a01c61d12$f466c330$0aa8a8c0@cliff> Message-ID: <330532b60601191914q210f5512r54652201fec6c51a@mail.gmail.com> On 1/19/06, Cliff Hirsch wrote: > If I could stick this in my basement, the price wouldn't even be so bad. But > that's not realistic. With a managed service provider, the charge is > thousands per month. With co-location -- don't know. Haven't priced it and > then I need a sysadmin anyway. Co-lo isn't cheap either. Depends, you can get a 10MB burstable circuit and a 1/2 rack for around $1,000 monthly. And hardware is cheap, so you could start on one box, and when business picks up add more - as the bank account expands, so does the rack ;-) -- Mitch Pirtle Joomla! Core Developer Open Source Matters From tedd at sperling.com Fri Jan 20 00:44:14 2006 From: tedd at sperling.com (tedd) Date: Fri, 20 Jan 2006 00:44:14 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <330532b60601191914q210f5512r54652201fec6c51a@mail.gmail.com> References: <004a01c61d12$f466c330$0aa8a8c0@cliff> <330532b60601191914q210f5512r54652201fec6c51a@mail.gmail.com> Message-ID: > as the bank account expands, so does the rack ;-) > >-- >Mitch Pirtle You talking about women? :-) tedd -- -------------------------------------------------------------------------------- http://sperling.com/ From rajlist at rajshekhar.net Fri Jan 20 03:00:35 2006 From: rajlist at rajshekhar.net (Raj shekhar) Date: Fri, 20 Jan 2006 13:30:35 +0530 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <004a01c61d12$f466c330$0aa8a8c0@cliff> References: <004a01c61d12$f466c330$0aa8a8c0@cliff> Message-ID: <43D098A3.6070203@rajshekhar.net> in infinite wisdom Cliff Hirsch spoke thus on 01/19/06 21:41: > Ok, so this may be a bit off topic, but I am trying to determine a cost > effective architecture for a classic PHP/MySQL site that is fault > tolerant and can scale-out if needed. For scaling tips, check he presentations by Michael J. Radwin http://public.yahoo.com/~radwin/ Fault tolerance can be achieved using commodity hardware and free (as in speech) software. Some tips - set up replication for your mysql databases - load balance your reads between your db master and slave - store your session data in a database (so that if one machine fails, the other can take over -- see my point above about replication) - work out a failover strategy and test it rigorously. Don't depend on DNS magic for failover. -- _.-, raj shekhar .--' '-._ http://rajshekhar.net _/`- _ '. http://rajshekhar.net/blog '----'._`.----. \ ` \; WE APOLOGIZE FOR THE INCONVENIENCE ;_\ -- God's Last Message to his Creation From ajai at bitblit.net Fri Jan 20 17:43:59 2006 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 20 Jan 2006 17:43:59 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <330532b60601191914q210f5512r54652201fec6c51a@mail.gmail.com> References: <004a01c61d12$f466c330$0aa8a8c0@cliff> <330532b60601191914q210f5512r54652201fec6c51a@mail.gmail.com> Message-ID: <43D167AF.6050400@bitblit.net> Mitch Pirtle wrote: > >Depends, you can get a 10MB burstable circuit and a 1/2 rack for >around $1,000 monthly. And hardware is cheap, so you could start on >one box, and when business picks up add more - as the bank account >expands, so does the rack ;-) > You can get "third of a rack" deals too - we have a bunch of servers over at Verio for less than $1000 monthly. But to start, the best thing to do is get a dedicated box for $99 from a colo provider - you can always get a another box (or more) reasonably cheaply but after a certain point it will become cheaper to buy your own hardware and fractional rack... From cliff at pinestream.com Fri Jan 20 18:58:50 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 20 Jan 2006 18:58:50 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <43D167AF.6050400@bitblit.net> Message-ID: <001001c61e1d$75edc740$0aa8a8c0@cliff> >You can get "third of a rack" deals too - we have a bunch of servers >over at Verio for less than $1000 monthly. Any suggestions for the Boston area? >But to start, the best thing to do is get a dedicated box for $99 from a >colo provider - you can always get a another box (or more) reasonably >cheaply but after a certain point it will become cheaper to buy your own >hardware and fractional rack... That's the conclusion I'm coming too. And I have received many fine suggestions for dedicated servers in the low few hundred dollar price range. There's fault tolerant and then there's overkill. Sure, if I were the federal reserve...but I'm not. More like showstringbudget.com From lists at zaunere.com Sat Jan 21 02:58:38 2006 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 21 Jan 2006 02:58:38 -0500 Subject: [nycphp-talk] Fault tolerant server architecture In-Reply-To: <004a01c61d12$f466c330$0aa8a8c0@cliff> Message-ID: <004f01c61e60$7dba1a80$6501a8c0@MZ> Cliff Hirsch wrote on Thursday, January 19, 2006 11:11 AM: > Ok, so this may be a bit off topic, but I am trying to determine a cost > effective architecture for a classic PHP/MySQL site that is fault > tolerant and can scale-out if needed. You and the rest of the known universe :) > At one extreme I view the minimum configuration as a simple dedicated > server. A dedicated server is a single point of failure, and thus not fault tolerant. A double failure (meaning two distinct system-layers fail) is generally acceptable, even in the most restrictive circumstances. > But being a bit paranoid, at the other extreme, I have been getting > quotes for a configuration that uses a Firewall, load balancer, two web > servers, and two database servers (one master, one slave for backups). Of > course with additional backups (local & offsite), RAID, hot swap power > supplies, etc. I skipped the armed guards, tasers, and off planet > options. And so far, I am ignoring the people that are telling me that if > I want to be really serious, I should use Oracle, not MySQL. Well, that's not that far off. For real fault-tolerance, duplicity is a must. This means redundant servers, network routes, and frankly geographic locations with route awareness. Fault tolerance (or paranoia) can be quite high, and expensive. In terms of the database to use, that's an always interesting discussion. Depending on the level of fault tolerance you're trying to achieve, it comes down more to physical concerns, rather than software related, or logical, ones. That said, some software can more robustly handle failures in various layers than others. > If I could stick this in my basement, the price wouldn't even be so bad. > But that's not realistic. With a managed service provider, the charge is > thousands per month. With co-location -- don't know. Haven't priced it > and then I need a sysadmin anyway. Co-lo isn't cheap either. > > I would be funding this out of my own pocket. Am I nuts? What are other Yeah... > people doing to ensure availability at a reasonable price point? It's all about the nines, as in five-nines (99.999%). Depending on the client, you need to establish a service level agreement that dictates the availability requirements. About the nines: http://en.wikipedia.org/wiki/The_Myth_of_the_Nines I've recently completed an engagement with a US military branch, and long story short, availability is obviously a concern. At the end of the day, fault tolerance, and thus the ability to be highly available, comes down to the combination of multiple layers, ie, software, architecture, infrastructure, and physical location. That combination equates to the number of nines you're willing to commit to, and thus the cost. So what's a reasonable price point? Well, for the average eCom site, it means a backed-up dedicated server that can survive even a total hardware failure of the server itself. In the average co-lo environment, this equates to two or three nines, meaning that you can have the service restored within 24 hours, and without considerable loss of persistent data. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From chsnyder at gmail.com Sat Jan 21 11:13:17 2006 From: chsnyder at gmail.com (csnyder) Date: Sat, 21 Jan 2006 11:13:17 -0500 Subject: [nycphp-talk] An Email Architecture Puzzle In-Reply-To: <20060113192735.GZ26280@desario.homelinux.net> References: <40687.38.117.147.25.1137179887.squirrel@38.117.147.25> <20060113192735.GZ26280@desario.homelinux.net> Message-ID: On 1/13/06, Andrew Yochum wrote: > Configure your SMTP server or procmail to filter all email through a PHP > script. Parse, munge (like adding a tracking number to the subject), > store it in your DB & pass it through to the recipient. This is much > the same way many spam filters and email-based help desk apps work... > and CLEW. > > HTH, > Andrew Sorry to jump in so late on this, had my head down this week. I like this approach because it adds a header which can be used by the recipient of the email to verify that it was assigned to the proper job. You could also add a footer to "unassigned" messages, to include a link to the assignment interface. For efficiency's sake, I might opt for a different system, using an IMAP mailbox so that the messages could queue under heavy load without affecting the timely delivery of mail. Your PHP app would simply read its inbox every so often, process any new messages, and either delete them or move them to one or more folders within the mailbox based on how they are assigned (or not assigned). There is a nice tradeoff here which can help you decide: pass-through SMTP has fewer moving parts, whereas IMAP queueing has fault tolerance and a built-in message store. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Sat Jan 21 11:16:11 2006 From: chsnyder at gmail.com (csnyder) Date: Sat, 21 Jan 2006 11:16:11 -0500 Subject: [nycphp-talk] [JOB] PHP Developer In-Reply-To: <11643-42676@sneakemail.com> References: <2ca9ba910601181059p2973e37dj8fe990bc3c0ed4f7@mail.gmail.com> <11643-42676@sneakemail.com> Message-ID: On 1/18/06, inforequest <1j0lkq002 at sneakemail.com> wrote: > Jeff Knight jeff.knight-at-gmail.com |nyphp dev/internal group use| wrote: > > >It is a little unnerving having two of us here, but just keep making > >positive comments and nobody will have trouble telling us apart. > > > >On 1/18/06, Jeffrey Knight wrote: > > > > > >>Nice animation on your site http://domanistudios.com ! > >> > >> > au contrare... everytime it causes agita.... was that a real positive > comment, or was that laced with some deep cynical sarcasm that I > completely missed? Or... perhaps it was the *other* Jeff Knight. Doh! > > What ever happened to that putamare gal anyway? > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > Yeah, I vote for putamare at comprehensivity.com... talk about brand synergy! -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Sat Jan 21 12:31:02 2006 From: chsnyder at gmail.com (csnyder) Date: Sat, 21 Jan 2006 12:31:02 -0500 Subject: [nycphp-talk] MySQL 5.1 Extractvalue() and PEAR XML_Serializer Message-ID: Jon Baer wrote in a couple weeks ago with news that MySQL 5.1 will support extraction of values from XML fields using XPATH. http://dev.mysql.com/tech-resources/articles/mysql-5.1-xml.html That led me to think about ways in which this might be useful to PHP developers. Which in turn led me to XML_Serializer (and unserializer) at http://pear.php.net/package/XML_Serializer Hmmm, select and update serialized php object properties in the database... SELECT * FROM object WHERE extractvalue( object.xml, '/object/color/hue/blue' ) > 64; SELECT extractvalue( UpdateXML( object.xml, '/object/icon/href[self::text() = '/icons/xml.gif']' ,'/icons/xml.png' ),''/object/icon/href' ) FROM object; Can't wait to try it. -- Chris Snyder http://chxo.com/ From fields at hedge.net Sat Jan 21 12:43:38 2006 From: fields at hedge.net (Adam Fields) Date: Sat, 21 Jan 2006 12:43:38 -0500 Subject: [nycphp-talk] MySQL 5.1 Extractvalue() and PEAR XML_Serializer In-Reply-To: References: Message-ID: <20060121174338.GC2514@lola.aquick.org> On Sat, Jan 21, 2006 at 12:31:02PM -0500, csnyder wrote: > Jon Baer wrote in a couple weeks ago with news that MySQL 5.1 will > support extraction of values from XML fields using XPATH. > http://dev.mysql.com/tech-resources/articles/mysql-5.1-xml.html > > That led me to think about ways in which this might be useful to PHP developers. > > Which in turn led me to XML_Serializer (and unserializer) at > http://pear.php.net/package/XML_Serializer > > Hmmm, select and update serialized php object properties in the database... > > SELECT * FROM object WHERE extractvalue( object.xml, > '/object/color/hue/blue' ) > 64; > > SELECT extractvalue( UpdateXML( object.xml, > '/object/icon/href[self::text() = '/icons/xml.gif']' > ,'/icons/xml.png' ),''/object/icon/href' ) FROM object; > > Can't wait to try it. "Wait" is probably the correct word. -- - Adam ** Expert Technical Project and Business Management **** System Performance Analysis and Architecture ****** [ http://www.everylastounce.com ] [ http://www.aquick.org/blog ] ............ Blog [ http://www.adamfields.com/resume.html ].. Experience [ http://www.flickr.com/photos/fields ] ... Photos [ http://www.aquicki.com/wiki ].............Wiki [ http://del.icio.us/fields ] ............. Links From jonbaer at jonbaer.com Sat Jan 21 16:49:16 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Sat, 21 Jan 2006 16:49:16 -0500 Subject: [nycphp-talk] MySQL 5.1 Extractvalue() and PEAR XML_Serializer In-Reply-To: <20060121174338.GC2514@lola.aquick.org> References: <20060121174338.GC2514@lola.aquick.org> Message-ID: <798D4191-0805-4D07-BEDC-ECDE2A506303@jonbaer.com> Just a small quick note if you are trying it out (5.1.5 is out now) ... it seems that the only way to delete matching rows is a subselect, im not sure if this is the "official" way, does anyone know? delete from t where (select extractvalue(xml,'//foo') = 'bar'); - Jon On Jan 21, 2006, at 12:43 PM, Adam Fields wrote: > On Sat, Jan 21, 2006 at 12:31:02PM -0500, csnyder wrote: >> Jon Baer wrote in a couple weeks ago with news that MySQL 5.1 will >> support extraction of values from XML fields using XPATH. >> http://dev.mysql.com/tech-resources/articles/mysql-5.1-xml.html >> >> That led me to think about ways in which this might be useful to >> PHP developers. >> >> Which in turn led me to XML_Serializer (and unserializer) at >> http://pear.php.net/package/XML_Serializer >> >> Hmmm, select and update serialized php object properties in the >> database... >> >> SELECT * FROM object WHERE extractvalue( object.xml, >> '/object/color/hue/blue' ) > 64; >> >> SELECT extractvalue( UpdateXML( object.xml, >> '/object/icon/href[self::text() = '/icons/xml.gif']' >> ,'/icons/xml.png' ),''/object/icon/href' ) FROM object; >> >> Can't wait to try it. > > "Wait" is probably the correct word. > > -- > - Adam > > ** Expert Technical Project and Business Management > **** System Performance Analysis and Architecture > ****** [ http://www.everylastounce.com ] > > [ http://www.aquick.org/blog ] ............ Blog > [ http://www.adamfields.com/resume.html ].. Experience > [ http://www.flickr.com/photos/fields ] ... Photos > [ http://www.aquicki.com/wiki ].............Wiki > [ http://del.icio.us/fields ] ............. Links > > > > _______________________________________________ > New York PHP Community Talk Mailing List > Show Your Participation > http://www.nyphp.org/show_participation.php > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From edwardpotter at gmail.com Sun Jan 22 07:22:03 2006 From: edwardpotter at gmail.com (edward potter) Date: Sun, 22 Jan 2006 07:22:03 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! Message-ID: Based on this article, how do you write secure PHP code, the author seems to claim that there is no 100% way? A bit confusing. What can I do to totally prevent an sql hack attack? http://shiflett.org/archive/184 The addslashes() Versus mysql_real_escape_string() Debate From dcech at phpwerx.net Sun Jan 22 08:32:15 2006 From: dcech at phpwerx.net (Dan Cech) Date: Sun, 22 Jan 2006 08:32:15 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: References: Message-ID: <43D3895F.8000808@phpwerx.net> IMHO Chris wasn't as explicit as he could have been with regards to the conclusion of the article, but basically the point is something like this: When constructing SQL, any input should be properly escaped taking into account the character set of the connection. The mysql_real_escape_string() function is designed to do exactly this. If you do not take this into account you are vulnerable to hacks of the type described in the article. If you are using a database abstraction layer such as PEAR::DB or adodb you also have the option of using their variable binding in your queries, which will perform this transparently. In this case the query would look something like: $sql = 'SELECT * FROM users WHERE username = ? AND password = ?'; $args = array( $mysql['username'], $mysql['password'], ); $result = $db->query($sql,$args); This is the method I usually use as it clearly separates the data from the query and makes it almost impossible to miss quoting something, making your code simpler and more secure at the expense of a little overhead. There are quite a few other arguments against using addslashes, some of which are outlined in the phundamentals article here: http://www.nyphp.org/phundamentals/storingretrieving.php Dan edward potter wrote: > Based on this article, how do you write secure PHP code, the author > seems to claim that there is no 100% way? A bit confusing. What can I > do to totally prevent an sql hack attack? > > http://shiflett.org/archive/184 > The addslashes() Versus mysql_real_escape_string() Debate From cliff at pinestream.com Sun Jan 22 09:18:14 2006 From: cliff at pinestream.com (cliff) Date: Sun, 22 Jan 2006 09:18:14 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: <43D3895F.8000808@phpwerx.net> References: <43D3895F.8000808@phpwerx.net> Message-ID: <20060122141814.M45434@pinestream.com> Yes, the article should have ended with: NEVER USE addslashes USE mysql_real_escape_string() (or prepared statements as suggested by others) PERIOD I'd like to take this opportunity to make a commercial announcement. Yhe message you are about to hear... If you're like me, you have probably digested Chris' presentations, articles, etc. All great info and probably the single best source for PHP security. I just read two PHP books: one terrible 400+ page useless beast and Chris' concise security book, which is truly excellent. Although you can probably find most of its contents scattered throughout his various presentations, having the book as one easy to grab source is really worthwhile. My shameless plug -- hat's off Chris... On Sun, 22 Jan 2006 08:32:15 -0500, Dan Cech wrote > IMHO Chris wasn't as explicit as he could have been with regards to > the conclusion of the article, but basically the point is something > like this: From shiflett at php.net Sun Jan 22 10:23:32 2006 From: shiflett at php.net (Chris Shiflett) Date: Sun, 22 Jan 2006 10:23:32 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: References: Message-ID: <43D3A374.6090409@php.net> Edward Potter wrote: > Based on this article, how do you write secure PHP code, the author > seems to claim that there is no 100% way? My apologies. I've added the following to the end: "To avoid this type of vulnerability, use mysql_real_escape_string(), bound parameters, or any of the major database abstraction libraries." http://shiflett.org/archive/184 I only meant to highlight the distinction between addslashes() and mysql_real_escape_string(), because I see too many people claiming that there is no difference. The difference isn't likely to matter to you, but it's there. Anyway, glad to see someone read this. Thanks. :-) Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ From shiflett at php.net Sun Jan 22 11:38:29 2006 From: shiflett at php.net (Chris Shiflett) Date: Sun, 22 Jan 2006 11:38:29 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: <43D3A374.6090409@php.net> References: <43D3A374.6090409@php.net> Message-ID: <43D3B505.9030302@php.net> By the way, if you'd like to see what the resulting query looks like, it's the second code listing here: http://d.hatena.ne.jp/t_komura/20060122#1137944280 I think this is demonstrating that the same situation exists with Shift_JIS, so the crazy multi-byte character might actually be different than in GBK, but the principle is the same. Anyone read Japanese? :-) Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ From danielc at analysisandsolutions.com Sun Jan 22 12:00:25 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sun, 22 Jan 2006 12:00:25 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: <20060122141814.M45434@pinestream.com> References: <43D3895F.8000808@phpwerx.net> <20060122141814.M45434@pinestream.com> Message-ID: <20060122170025.GA1741@panix.com> On Sun, Jan 22, 2006 at 09:18:14AM -0500, cliff wrote: > > I just read two PHP books: one terrible 400+ page useless beast Which one? --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From cliff at pinestream.com Sun Jan 22 17:19:16 2006 From: cliff at pinestream.com (cliff) Date: Sun, 22 Jan 2006 17:19:16 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: <20060122170025.GA1741@panix.com> References: <43D3895F.8000808@phpwerx.net> <20060122141814.M45434@pinestream.com> <20060122170025.GA1741@panix.com> Message-ID: <20060122221916.M24038@pinestream.com> Well, of course the good one's was Chris'. I hate to be disparaging, but the bad one was PHP Hacks, also by O'Reilly -- just came out. It just doesn't work. I was hoping for a great cookbook, but this fails in most every way. For example, there's a "hack" for roles-based authentication. Yes, I know, a roles-based ACL system in 3 pages. Silly me -- I should have known better. Why even bother putting it in there? On Sun, 22 Jan 2006 12:00:25 -0500, Daniel Convissor wrote > On Sun, Jan 22, 2006 at 09:18:14AM -0500, cliff wrote: > > > > I just read two PHP books: one terrible 400+ page useless beast > > Which one? > > --Dan From cliff at pinestream.com Sun Jan 22 17:24:16 2006 From: cliff at pinestream.com (cliff) Date: Sun, 22 Jan 2006 17:24:16 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: <20060122170025.GA1741@panix.com> References: <43D3895F.8000808@phpwerx.net> <20060122141814.M45434@pinestream.com> <20060122170025.GA1741@panix.com> Message-ID: <20060122222416.M41701@pinestream.com> While we are on the subject of escaping output, here's one that has me somewhat confused. Should I be escaping output for emails? And if so, with what? On the one hand, an email msg. could end up in a browser-based client. But on the other, it should be the responsibility of the email client program to escape output, whether it's browser-based or a client-side application -- right? From andrew at plexpod.com Sun Jan 22 19:42:40 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Sun, 22 Jan 2006 19:42:40 -0500 Subject: [nycphp-talk] An Email Architecture Puzzle In-Reply-To: References: <40687.38.117.147.25.1137179887.squirrel@38.117.147.25> <20060113192735.GZ26280@desario.homelinux.net> Message-ID: <20060123004239.GJ12736@desario.homelinux.net> On Sat, Jan 21, 2006 at 11:13:17AM -0500, csnyder wrote: > On 1/13/06, Andrew Yochum wrote: > > > Configure your SMTP server or procmail to filter all email through a PHP > > script. Parse, munge (like adding a tracking number to the subject), > > store it in your DB & pass it through to the recipient. This is much > > the same way many spam filters and email-based help desk apps work... > > and CLEW. > > > > HTH, > > Andrew > > Sorry to jump in so late on this, had my head down this week. > > I like this approach because it adds a header which can be used by the > recipient of the email to verify that it was assigned to the proper > job. You could also add a footer to "unassigned" messages, to include > a link to the assignment interface. > > For efficiency's sake, I might opt for a different system, using an > IMAP mailbox so that the messages could queue under heavy load without > affecting the timely delivery of mail. Your PHP app would simply read > its inbox every so often, process any new messages, and either delete > them or move them to one or more folders within the mailbox based on > how they are assigned (or not assigned). > > There is a nice tradeoff here which can help you decide: pass-through > SMTP has fewer moving parts, whereas IMAP queueing has fault tolerance > and a built-in message store. I like the IMAP idea. However, the delayed/queuing nature of it has the downside of not allow you to drop in the connective tissue (header and/or body tags) to messages on-the-fly before they're delivered. Regular subjects and message IDs/in-reply-to headers can help thread stuff for the IMAP config, but from what I've seen it helps to build in your own for these kinds of apps. If you're dealing with high volumes, speed is a concern and the setup time of your mail filter is a hinderance... run it as a daemon. Your actual filter can be very light weight and just connect to the daemon over unix or tcp sockets. And you get a way to scale the app at the same time. Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From shiflett at php.net Sun Jan 22 21:25:01 2006 From: shiflett at php.net (Chris Shiflett) Date: Sun, 22 Jan 2006 21:25:01 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: <20060122221916.M24038@pinestream.com> References: <43D3895F.8000808@phpwerx.net> <20060122141814.M45434@pinestream.com> <20060122170025.GA1741@panix.com> <20060122221916.M24038@pinestream.com> Message-ID: <43D43E7D.1070204@php.net> Cliff wrote: > Well, of course the good one's was Chris'. Glad to hear you liked it, Cliff. :-) I'm especially glad to hear that you appreciate the small size, since that was one of my primary goals. There are some sample chapters and such available online: http://phpsecurity.org/ Regarding the original topic, Ilia has posted a follow-up: http://ilia.ws/archives/103-mysql_real_escape_string-versus-Prepared-Statements.html He explains that mysql_real_escape_string() doesn't use the correct character sets when you use a query to change it: SET CHARACTER SET 'GBK' It might be the intended behavior, or there might be a reason why it's impossible for mysql_real_escape_string() to know about the change. Anyone know? This smells like a bug to me, but I hate to cry bug without being certain. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ From chsnyder at gmail.com Sun Jan 22 21:31:43 2006 From: chsnyder at gmail.com (csnyder) Date: Sun, 22 Jan 2006 21:31:43 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: <20060122222416.M41701@pinestream.com> References: <43D3895F.8000808@phpwerx.net> <20060122141814.M45434@pinestream.com> <20060122170025.GA1741@panix.com> <20060122222416.M41701@pinestream.com> Message-ID: On 1/22/06, cliff wrote: > While we are on the subject of escaping output, here's one that has me > somewhat confused. > > Should I be escaping output for emails? And if so, with what? > > On the one hand, an email msg. could end up in a browser-based client. But > on the other, it should be the responsibility of the email client program to > escape output, whether it's browser-based or a client-side application -- > right? You should be ensuring that user-submitted newlines can't creep into your mail headers (or HTTP headers, for that matter), otherwise header injection is possible. I believe modern mail transport agents (and clients) can handle anything nasty you send in the message body, but if you feel paranoid you should make sure that email body content is ascii text with no special characters like NULL "\x00" or EOT "\x04" lurking in it. -- Chris Snyder http://chxo.com/ From tedd at sperling.com Sun Jan 22 23:37:00 2006 From: tedd at sperling.com (tedd) Date: Sun, 22 Jan 2006 23:37:00 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: <43D43E7D.1070204@php.net> References: <43D3895F.8000808@phpwerx.net> <20060122141814.M45434@pinestream.com> <20060122170025.GA1741@panix.com> <20060122221916.M24038@pinestream.com> <43D43E7D.1070204@php.net> Message-ID: >Cliff wrote: >> Well, of course the good one's was Chris'. > >Glad to hear you liked it, Cliff. :-) I'm especially glad to hear that >you appreciate the small size, since that was one of my primary goals. >There are some sample chapters and such available online: > >http://phpsecurity.org/ > >-snip- > >Chris Looks good enough for me. tedd -- -------------------------------------------------------------------------------- http://sperling.com/ From sailer at bnl.gov Mon Jan 23 09:11:15 2006 From: sailer at bnl.gov (Tim Sailer) Date: Mon, 23 Jan 2006 09:11:15 -0500 Subject: [nycphp-talk] An Email Architecture Puzzle In-Reply-To: <20060123004239.GJ12736@desario.homelinux.net> References: <40687.38.117.147.25.1137179887.squirrel@38.117.147.25> <20060113192735.GZ26280@desario.homelinux.net> <20060123004239.GJ12736@desario.homelinux.net> Message-ID: <20060123141115.GA28893@bnl.gov> On Sun, Jan 22, 2006 at 07:42:40PM -0500, Andrew Yochum wrote: > On Sat, Jan 21, 2006 at 11:13:17AM -0500, csnyder wrote: > > On 1/13/06, Andrew Yochum wrote: > > > > > Configure your SMTP server or procmail to filter all email through a PHP > > > script. Parse, munge (like adding a tracking number to the subject), > > > store it in your DB & pass it through to the recipient. This is much > > > the same way many spam filters and email-based help desk apps work... > > > and CLEW. > > > > > > HTH, > > > Andrew > > > > Sorry to jump in so late on this, had my head down this week. > > > > I like this approach because it adds a header which can be used by the > > recipient of the email to verify that it was assigned to the proper > > job. You could also add a footer to "unassigned" messages, to include > > a link to the assignment interface. > > > > For efficiency's sake, I might opt for a different system, using an > > IMAP mailbox so that the messages could queue under heavy load without > > affecting the timely delivery of mail. Your PHP app would simply read > > its inbox every so often, process any new messages, and either delete > > them or move them to one or more folders within the mailbox based on > > how they are assigned (or not assigned). > > > > There is a nice tradeoff here which can help you decide: pass-through > > SMTP has fewer moving parts, whereas IMAP queueing has fault tolerance > > and a built-in message store. > > I like the IMAP idea. However, the delayed/queuing nature of it has the > downside of not allow you to drop in the connective tissue (header > and/or body tags) to messages on-the-fly before they're delivered. > > Regular subjects and message IDs/in-reply-to headers can help > thread stuff for the IMAP config, but from what I've seen it helps to > build in your own for these kinds of apps. > > If you're dealing with high volumes, speed is a concern and the setup > time of your mail filter is a hinderance... run it as a daemon. Your > actual filter can be very light weight and just connect to the daemon > over unix or tcp sockets. And you get a way to scale the app at the > same time. Although not PHP based, OTRS is quite flexible, and does a lot of what is discussed above. I've been using it for some time for my ISP, and it works rather well. You can even set up filters to add additional headers before you pass the email on. Tim -- Tim Sailer Information and Special Technologies Program Office of Counterintelligence Brookhaven National Laboratory (631) 344-3001 From danielc at analysisandsolutions.com Mon Jan 23 10:37:28 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 23 Jan 2006 10:37:28 -0500 Subject: [nycphp-talk] PEAR DB ODBC broken after 5.0.4 -> 5.1.1 In-Reply-To: References: Message-ID: <20060123153727.GA9317@panix.com> Hey Dan: Ouch! I'm not sure what's up with that. Don't think it's a DB issue per se. Sounds like something is different between the machines. Are the php.ini's and configure lines _exactly_ the same? Are the outputs of phpinfo() the same? Can you connect to some other DBMSs and databases from the machine? --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jeffmailings99 at verizon.net Mon Jan 23 11:04:41 2006 From: jeffmailings99 at verizon.net (Jeff - Mailings) Date: Mon, 23 Jan 2006 11:04:41 -0500 Subject: [nycphp-talk] More confused now then before by PHP security! In-Reply-To: Message-ID: <0ITJ004JMZC0XFF2@vms044.mailsrvcs.net> --SNIP-- >>You should be ensuring that user-submitted newlines can't creep into >>your mail headers (or HTTP headers, for that matter), otherwise header >>injection is possible. --END SNIP-- Speaking of "header injection," see also: http://www.nyphp.org/phundamentals/email_header_injection.php Jeff From jonbaer at jonbaer.com Mon Jan 23 13:33:59 2006 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 23 Jan 2006 13:33:59 -0500 Subject: [nycphp-talk] More MySQL 5.1.x coolness (partitioning) Message-ID: Forgive me, I know this is not the list for MySQL but ive been playing around w/ partitioning the past few days and finding it pretty beneficial for "long term data thinking" before building out new apps, so I just wanted to see if anyone else has been looking at the feature as well. I currently have one site running both historical tracking stats and blog posts and had to mysqldump out the contents for backup and then discovered horizontal partitioning where you could perform PARTITION BY RANGE ( YEAR(posted_on) ) and remove/slide it off the stack easily. This particular feature is detailed here: http://dev.mysql.com/doc/ refman/5.1/en/partitioning-range.html Im sure all the other commercial dbs have this but MySQL is the only one Ive known, I just really like this feature (as well as everything else that is sure to be in 5.2), so im I excited about nothing or has this been around forever + I should be spaghetti whipped by a DBA? - Jon From abracadabra13 at gmail.com Mon Jan 23 15:37:57 2006 From: abracadabra13 at gmail.com (AbraCadab Ra) Date: Mon, 23 Jan 2006 15:37:57 -0500 Subject: [nycphp-talk] PHP Vs. Java with a flash front end. Message-ID: <316533590601231237u11986b92jf958e9c9786157da@mail.gmail.com> Guys, I know this is an age old discussion, but i need some constructive criticism and some practical advice any of you might have come across in a similar situation. There is a requirement to build a 3 tire multimedia application that will stream audio/video. The front end requirement is to be in Flash. The middle end either PHP or JAVA, and the database backend. Does anyone have a links to any good articles or personal experiences that outline the pro's and con's of using PHP Vs JAVA for the middle layer? Thanks, Yusuf -------------- next part -------------- An HTML attachment was scrubbed... URL: From woodwort at agritec.net Mon Jan 23 15:49:27 2006 From: woodwort at agritec.net (woodwort) Date: Mon, 23 Jan 2006 12:49:27 -0800 Subject: [nycphp-talk] PHP Vs. Java with a flash front end. In-Reply-To: <316533590601231237u11986b92jf958e9c9786157da@mail.gmail.com> References: <316533590601231237u11986b92jf958e9c9786157da@mail.gmail.com> Message-ID: <43D54157.9000602@agritec.net> I have been working with CakeAMFPHP. It uses CakePHP(a rails like php framework) together with AMFPHP the remoting platform for PHP. I think you will find development to be quick and painless. http://cakephp.org http://amfphp.org http://cakeforge.org/projects/cakeamfphp From lists at genoverly.net Mon Jan 23 20:57:06 2006 From: lists at genoverly.net (michael) Date: Mon, 23 Jan 2006 20:57:06 -0500 Subject: [nycphp-talk] apache basic auth Message-ID: <20060123205706.23646254@wit.genoverly.home> I've read the apache docs and googled for this but I can't seem to find a definitive answer. Can you run basic auth in nested directories? Or does it inherit auth from above? Say I have restrictions on the whole site with Tom, Dick, Harry, and Jane in the 'normal' group file. I then have a directory (called secret) in that site that I only want members of the group 'secret' to be allowed: Tom, Dick, and Harry (no Jane). ServerName subdomain.domain.com DocumentRoot /path/to/root/directory/ # restrict whole site ################################# AuthType Basic AuthName "site restricted" AuthUserFile /path/to/password/file AuthGroupFile /path/to/group/file Require group normal # restrict super secret directory ################################# Alias /secret/ "/path/to/root/directory/deep/secret/" AuthType Basic AuthName "super secret" AuthUserFile /path/to/password/file AuthGroupFile /path/to/group/file Require group secret I have something similar to this set up. When I point my browser at http://subdomain.domain.com I get prompted. I logon as Jane and can see the site. I then go into the /secret/ directory and I do NOT get prompted again! Unless I'm missing something, it looks like nested auth does not work. I've tried closing the browser and reopening the browser to clear authentication remnants. Am I doing something wrong? Is there another way to do what I'm trying to do? I am aware basic auth is not secure, but, I want to get this basic concept to work first. Then I will use encryption. -- Michael From lists at genoverly.net Tue Jan 24 09:06:17 2006 From: lists at genoverly.net (michael) Date: Tue, 24 Jan 2006 09:06:17 -0500 Subject: [nycphp-talk] apache basic auth In-Reply-To: <20060123205706.23646254@wit.genoverly.home> References: <20060123205706.23646254@wit.genoverly.home> Message-ID: <20060124090617.28bb3c00@wit.genoverly.home> On Mon, 23 Jan 2006 20:57:06 -0500 michael wrote: > I've read the apache docs and googled for this but I can't seem to > find a definitive answer. Can you run basic auth in nested > directories? Or does it inherit auth from above? > > Say I have restrictions on the whole site with Tom, Dick, Harry, and > Jane in the 'normal' group file. I then have a directory (called > secret) in that site that I only want members of the group 'secret' > to be allowed: Tom, Dick, and Harry (no Jane). > > > > ServerName subdomain.domain.com > DocumentRoot /path/to/root/directory/ > > # restrict whole site > ################################# > > AuthType Basic > AuthName "site restricted" > AuthUserFile /path/to/password/file > AuthGroupFile /path/to/group/file > Require group normal > > > # restrict super secret directory > ################################# > Alias /secret/ "/path/to/root/directory/deep/secret/" > > AuthType Basic > AuthName "super secret" > AuthUserFile /path/to/password/file > AuthGroupFile /path/to/group/file > Require group secret > > > > I have something similar to this set up. When I point my browser at > http://subdomain.domain.com I get prompted. I logon as Jane and can > see the site. I then go into the /secret/ directory and I do NOT get > prompted again! Unless I'm missing something, it looks like nested > auth does not work. > > I've tried closing the browser and reopening the browser to clear > authentication remnants. Am I doing something wrong? Is there > another way to do what I'm trying to do? > > I am aware basic auth is not secure, but, I want to get this basic > concept to work first. Then I will use encryption. Answering my own question.. File under apache/auth/proxy for the archives. 1. Apache does NOT allow nested auth. Once you auth a directory tree, everything under it is allowed. So, if separate auth is needed you have to go up the tree. Edititing the above example, If you changed the super secret directory to "/path/to/root/deep/secret" it will work because is does not fall under the original authentication umbrella. 2. If "/secret/" is a reverse proxy to another site it will NOT authenticate. You *must* create a directory below the auth directory (actually within the restricted area, thus triggering auth); Alias /virtualsecret/ "/path/to/root/deep/secret/proxy" ## send requests for /virtualsecret/ to another server ProxyRequests Off Order deny,allow Allow from all ProxyPass /virtualsecret/ http://otherdomain.com/directory/ ProxyPassReverse /virtualsecret/ http://otherdomain.com/directory/ -- Michael From mitch.pirtle at gmail.com Tue Jan 24 13:20:53 2006 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 24 Jan 2006 13:20:53 -0500 Subject: [nycphp-talk] More MySQL 5.1.x coolness (partitioning) In-Reply-To: References: Message-ID: <330532b60601241020sd43363cydcf9dfd822c82880@mail.gmail.com> On 1/23/06, Jon Baer wrote: > Im sure all the other commercial dbs have this but MySQL is the only > one Ive known, I just really like this feature (as well as everything > else that is sure to be in 5.2), so im I excited about nothing or has > this been around forever + I should be spaghetti whipped by a DBA? *spacemonkey goes to kitchen, looks for freshly cooked pasta -- Mitch Pirtle Joomla! Core Developer Open Source Matters From krook at us.ibm.com Tue Jan 24 23:23:35 2006 From: krook at us.ibm.com (Daniel Krook) Date: Tue, 24 Jan 2006 20:23:35 -0800 Subject: [nycphp-talk] PEAR DB ODBC broken after 5.0.4 -> 5.1.1 In-Reply-To: <20060123153727.GA9317@panix.com> Message-ID: > Hey Dan: > > Ouch! I'm not sure what's up with that. Don't think it's > a DB issue per > se. Sounds like something is different between the > machines. Are the > php.ini's and configure lines _exactly_ the same? Are the > outputs of > phpinfo() the same? Can you connect to some other DBMSs > and databases > from the machine? > > --Dan Dan, Yes, both php.ini values for ODBC are the same, and save for a minor Linux kernel version, both machines are SuSE Pro 9.2. The only difference in the machine that works is that I recompiled it for LDAP support later. It was able to connect before and after that though. Both are hooked to Apache 1.3.34. >From a hardware standpoint, the machine that work is P4, the one that doesn't is Xeon. Top of phpinfo: "guajillo" works: http://krook.org/etc/guajillo.gif "linsang" doesn't: http://krook.org/etc/linsang.gif Both share these ODBC settings from php.ini: http://krook.org/etc/odbc.gif MySQL is running just fine on the machine, and I can connect to the database in question from a Java application just fine: Database product name : DB2/LINUX Database product version : SQL08020 JDBC driver name : IBM DB2 JDBC Universal Driver Architecture JDBC driver version : 2.3.63 Any other thoughts? TIA, -Dan Daniel Krook, Content Tools Developer Global Production Services - Tools, ibm.com http://bluepages.redirect.webahead.ibm.com/ http://blogpages.redirect.webahead.ibm.com/ http://bookmarks.redirect.webahead.ibm.com/ From yournway at gmail.com Wed Jan 25 01:16:54 2006 From: yournway at gmail.com (Alberto dos Santos) Date: Wed, 25 Jan 2006 06:16:54 +0000 Subject: [nycphp-talk] PEAR DB ODBC broken after 5.0.4 -> 5.1.1 In-Reply-To: References: <20060123153727.GA9317@panix.com> Message-ID: I'm not sure this will help, but still... Have you checked the compilation log to see if there were no errors or something funny happened? Cheers, Al. On 25/01/06, Daniel Krook wrote: > > > Hey Dan: > > > > Ouch! I'm not sure what's up with that. Don't think it's > > a DB issue per > > se. Sounds like something is different between the > > machines. Are the > > php.ini's and configure lines _exactly_ the same? Are the > > outputs of > > phpinfo() the same? Can you connect to some other DBMSs > > and databases > > from the machine? > > > > --Dan > > Dan, > > Yes, both php.ini values for ODBC are the same, and save for a minor Linux > kernel version, both machines are SuSE Pro 9.2. The only difference in > the machine that works is that I recompiled it for LDAP support later. It > was able to connect before and after that though. Both are hooked to > Apache 1.3.34. > > >From a hardware standpoint, the machine that work is P4, the one that > doesn't is Xeon. > > Top of phpinfo: > > "guajillo" works: > http://krook.org/etc/guajillo.gif > > "linsang" doesn't: > http://krook.org/etc/linsang.gif > > Both share these ODBC settings from php.ini: > http://krook.org/etc/odbc.gif > > MySQL is running just fine on the machine, and I can connect to the > database in question from a Java application just fine: > Database product name : DB2/LINUX > Database product version : SQL08020 > JDBC driver name : IBM DB2 JDBC Universal Driver Architecture > JDBC driver version : 2.3.63 > > Any other thoughts? > > TIA, > -Dan > > > > Daniel Krook, Content Tools Developer > Global Production Services - Tools, ibm.com > > http://bluepages.redirect.webahead.ibm.com/ > http://blogpages.redirect.webahead.ibm.com/ > http://bookmarks.redirect.webahead.ibm.com/ > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott at crisscott.com Wed Jan 25 10:18:09 2006 From: scott at crisscott.com (Scott Mattocks) Date: Wed, 25 Jan 2006 10:18:09 -0500 Subject: [nycphp-talk] Determining mime type of data not a file Message-ID: <43D796B1.4040907@crisscott.com> Hello, I am looking for a way to determine the mime type of an image that is held in memory and does not come from a file. All of the functions I can find only work on files. Does anyone know of a way to get the mime type from the image data? Here is a basic idea of what is happening: function spitOutImage($imageToGet) { if (cache::isCached($imageToGet)) { $image = cache::getImage($imageToGet); } else { $image = $this->createImage($imageToGet); } header('Content-type: ???'); echo $image; } If createImage() is called, I can get the image type, but if the image is cached, I can't. The cached image just lives as data somewhere with no other information. Thanks, -- Scott Mattocks http://www.crisscott.com From chris at theyellowbox.com Wed Jan 25 10:26:52 2006 From: chris at theyellowbox.com (Chris Merlo) Date: Wed, 25 Jan 2006 10:26:52 -0500 Subject: [nycphp-talk] Determining mime type of data not a file In-Reply-To: <43D796B1.4040907@crisscott.com> References: <43D796B1.4040907@crisscott.com> Message-ID: <946586480601250726k7333826k6e760d275fcacfdc@mail.gmail.com> On 1/25/06, Scott Mattocks wrote: > I am looking for a way to determine the mime type of an image that is > held in memory and does not come from a file. [...] function spitOutImage($imageToGet) > { > if (cache::isCached($imageToGet)) { > $image = cache::getImage($imageToGet); Scott: If that cache class is something you wrote, just add a mimeType data field to it, and store the mime type when you cache the image. (If it's not, then my apologies for not being all that familiar with the PEAR repositories.) -c -- chris at theyellowbox.com http://www.theyellowbox.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott at crisscott.com Wed Jan 25 10:37:42 2006 From: scott at crisscott.com (Scott Mattocks) Date: Wed, 25 Jan 2006 10:37:42 -0500 Subject: [nycphp-talk] Determining mime type of data not a file In-Reply-To: <946586480601250726k7333826k6e760d275fcacfdc@mail.gmail.com> References: <43D796B1.4040907@crisscott.com> <946586480601250726k7333826k6e760d275fcacfdc@mail.gmail.com> Message-ID: <43D79B46.5020809@crisscott.com> Chris Merlo wrote: > On 1/25/06, Scott Mattocks wrote: > > >>I am looking for a way to determine the mime type of an image that is >>held in memory and does not come from a file. > > Scott: > If that cache class is something you wrote, just add a mimeType data field > to it, and store the mime type when you cache the image. (If it's not, then > my apologies for not being all that familiar with the PEAR repositories.) The cache class is an in house class that I can't really mess with. It holds a lot of other types of data besides images and we want it to stay as generic as possible. Unless I am confused, the mime type isn't a property of the file it is a property of the data. So I don't see why all of the mime type functions and classes that I have found only work on files. Thanks, Scott From chris at theyellowbox.com Wed Jan 25 10:46:58 2006 From: chris at theyellowbox.com (Chris Merlo) Date: Wed, 25 Jan 2006 10:46:58 -0500 Subject: [nycphp-talk] Determining mime type of data not a file In-Reply-To: <43D79B46.5020809@crisscott.com> References: <43D796B1.4040907@crisscott.com> <946586480601250726k7333826k6e760d275fcacfdc@mail.gmail.com> <43D79B46.5020809@crisscott.com> Message-ID: <946586480601250746s56d039c3p9cc84010ba3bc102@mail.gmail.com> On 1/25/06, Scott Mattocks wrote: > The cache class is an in house class that I can't really mess with. It > holds a lot of other types of data besides images and we want it to stay > as generic as possible. Make a subclass! Unless I am confused, the mime type isn't a property of the file it is a > property of the data. So I don't see why all of the mime type functions > and classes that I have found only work on files. Probably because when all our favorite languages were created, 99% of data was in files, because people had less RAM. There is a program that comes with Linux called "file" which determines the type of data in a file, regardless of file name, extension, etc. If you can dig through that source code, maybe it'll help in your quest. -c -- chris at theyellowbox.com http://www.theyellowbox.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew at plexpod.com Wed Jan 25 11:01:28 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Wed, 25 Jan 2006 11:01:28 -0500 Subject: [nycphp-talk] Determining mime type of data not a file In-Reply-To: <43D79B46.5020809@crisscott.com> References: <43D796B1.4040907@crisscott.com> <946586480601250726k7333826k6e760d275fcacfdc@mail.gmail.com> <43D79B46.5020809@crisscott.com> Message-ID: <20060125160127.GN12736@desario.homelinux.net> On Wed, Jan 25, 2006 at 10:37:42AM -0500, Scott Mattocks wrote: > Unless I am confused, the mime type isn't a property of the file it is a > property of the data. So I don't see why all of the mime type functions > and classes that I have found only work on files. Well typically the file is on disk, and you need to get its mimetype. The mimetype isn't embedded in the file at all - it needs to be guessed, which is why the extension is called "MIME Magic". Read the first bit of: http://us3.php.net/manual/en/ref.mime-magic.php That said, I believe you can make what you want happen a few ways: 1. Write the file to a temp file: $out = fopen($filename = tempnam("/tmp", 'mime'), 'w'); fwrite($out, $file_contents); fclose($out); $mimetype = mime_content_type($filename); unlink($filename); 2. Use a fifo named pipe - this avoids disk usage if thats a concern for you: posix_mkfifo($filename = tempnam("/tmp", 'mime'), 0644); $out = fopen($filename, 'w'); fwrite($out, $file_contents); fclose($out); $mimetype = mime_content_type($filename); unlink($filename); 3. Use wrappers... don't know off hand, but something tells me you could finagle getting a string to act as a php resource somehow. Anyone? HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From scott at crisscott.com Wed Jan 25 11:15:41 2006 From: scott at crisscott.com (Scott Mattocks) Date: Wed, 25 Jan 2006 11:15:41 -0500 Subject: [nycphp-talk] Determining mime type of data not a file In-Reply-To: <20060125160127.GN12736@desario.homelinux.net> References: <43D796B1.4040907@crisscott.com> <946586480601250726k7333826k6e760d275fcacfdc@mail.gmail.com> <43D79B46.5020809@crisscott.com> <20060125160127.GN12736@desario.homelinux.net> Message-ID: <43D7A42D.80204@crisscott.com> Thanks Chris and Anderw. I found the answer I was looking for in the fileinfo PECL extension (http://pecl.php.net/package/fileinfo). With this extension I can do the following: // Get the image data (see previous message for psuedo code) $fi = finfo_open(FILEINFO_MIME); $contentType = finfo_buffer($fi, $image); // Set the headers and output the message. I'll probably end up doing a check to see if the extension is loaded and if not use method 1 that you mentioned. Thanks, Scott Andrew Yochum wrote: > On Wed, Jan 25, 2006 at 10:37:42AM -0500, Scott Mattocks wrote: > > That said, I believe you can make what you want happen a few ways: > 1. Write the file to a temp file: > $out = fopen($filename = tempnam("/tmp", 'mime'), 'w'); > fwrite($out, $file_contents); > fclose($out); > $mimetype = mime_content_type($filename); > unlink($filename); From scott at crisscott.com Wed Jan 25 11:18:31 2006 From: scott at crisscott.com (Scott Mattocks) Date: Wed, 25 Jan 2006 11:18:31 -0500 Subject: [nycphp-talk] Determining mime type of data not a file In-Reply-To: <43D7A42D.80204@crisscott.com> References: <43D796B1.4040907@crisscott.com> <946586480601250726k7333826k6e760d275fcacfdc@mail.gmail.com> <43D79B46.5020809@crisscott.com> <20060125160127.GN12736@desario.homelinux.net> <43D7A42D.80204@crisscott.com> Message-ID: <43D7A4D7.8080704@crisscott.com> Scott Mattocks wrote: > Thanks Chris and Anderw. > > I found the answer I was looking for in the fileinfo PECL extension > (http://pecl.php.net/package/fileinfo). With this extension I can do the > following: > > // Get the image data (see previous message for psuedo code) > $fi = finfo_open(FILEINFO_MIME); > $contentType = finfo_buffer($fi, $image); > // Set the headers and output the message. For anyone else that is interested, you can alternatively do this: $finfo = new finfo(FILEINFO_MIME); $contentType = $finfo->buffer($image); Scott From mikko.rantalainen at peda.net Thu Jan 26 08:58:11 2006 From: mikko.rantalainen at peda.net (Mikko Rantalainen) Date: Thu, 26 Jan 2006 15:58:11 +0200 Subject: [nycphp-talk] Determining mime type of data not a file In-Reply-To: <43D79B46.5020809@crisscott.com> References: <43D796B1.4040907@crisscott.com> <946586480601250726k7333826k6e760d275fcacfdc@mail.gmail.com> <43D79B46.5020809@crisscott.com> Message-ID: <43D8D573.7020000@peda.net> Scott Mattocks wrote: > Chris Merlo wrote: >>On 1/25/06, Scott Mattocks wrote: >> >>>I am looking for a way to determine the mime type of an image that is >>>held in memory and does not come from a file. >> >>Scott: >>If that cache class is something you wrote, just add a mimeType data field >>to it, and store the mime type when you cache the image. > > The cache class is an in house class that I can't really mess with. It > holds a lot of other types of data besides images and we want it to stay > as generic as possible. > > Unless I am confused, the mime type isn't a property of the file it is a > property of the data. For such cache to be generic it should definately support storing the mime type in addition to data. For example, if data looks like "What is this thing?" how is a computer program (or even a human) going to figure out if correct mime type is a) text/plain b) application/xhtml+xml c) application/x-xml-fragment d) other, what? Notice that the above example isn't a valid HTML, XHTML or XML document. In addition, if you decide text/plain you should be somehow able to decipher the correct character set! Notice that you cannot know if the above fragment is *supposed* to be a plain text example string inside an article about XHTML (in which case it should be run through htmlentities() before inserting inside an HTML page) if it is indeed a fragment of XHTML code which should be inserted as is. Yes, in general, mime type is property of file instead of a property of data. I'd suggest implementing the mime type support for your cache and using "application/octet-stream" for already-in-use software (just default to that if nothing is provided by caller). -- Mikko From dmintz at davidmintz.org Fri Jan 27 12:41:48 2006 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 27 Jan 2006 12:41:48 -0500 (EST) Subject: [nycphp-talk] command line warning "...these options need to match" In-Reply-To: <43CEB4D4.4050307@simmons.edu> References: <43CEB4D4.4050307@simmons.edu> Message-ID: On Wed, 18 Jan 2006, Jonathan wrote: > I get these errors when I compile from C into a .so extension from > different versions of PHP. > It might not be your php script causing the error - but a shared object > you are loading (or ADODB c library for example) through a dl() function > or in the .ini. > \uffff I don't know what that is- hex for nothing? > Anyway , thats a php 5 warning message - and some extension being loaded > is from php4. > Does anybody know how you figure out which extension is offending? I have this, according to 'php -m' [PHP Modules] ctype curl date dom exif gd iconv libxml mcrypt mhash mysql mysqli openssl pcre PDO pdo_sqlite posix session SimpleXML soap SPL SQLite standard tidy tokenizer xml xsl Zend Debugger Zend Optimizer zlib [Zend Modules] Zend Debugger Zend Extension Manager Zend Optimizer I tried googling for this and at the top of the results was my own post to this list from a while ago. D'oh! The Inadvertent Autogoogle. TIA --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From hendler at simmons.edu Fri Jan 27 15:57:19 2006 From: hendler at simmons.edu (Jonathan Hendler) Date: Fri, 27 Jan 2006 15:57:19 -0500 Subject: [nycphp-talk] command line warning "...these options need to match" In-Reply-To: References: <43CEB4D4.4050307@simmons.edu> Message-ID: <43DA892F.2020303@simmons.edu> If these are extensions loaded via your php.ini then you can go through each individually and shut them on and off one at a time. And reload the extension. Otherwise won't show up in your list of "loaded" extensions because it failed to load. You can also look in your app for a ".so" or ".dll" if you are on windows. As I said, distrobutions of ADODB often include a .so. David Mintz wrote: >On Wed, 18 Jan 2006, Jonathan wrote: > > > >>I get these errors when I compile from C into a .so extension from >>different versions of PHP. >>It might not be your php script causing the error - but a shared object >>you are loading (or ADODB c library for example) through a dl() function >>or in the .ini. >>\uffff I don't know what that is- hex for nothing? >>Anyway , thats a php 5 warning message - and some extension being loaded >>is from php4. >> >> >> > >Does anybody know how you figure out which extension is offending? I have >this, according to 'php -m' > >[PHP Modules] >ctype >curl >date >dom >exif >gd >iconv >libxml >mcrypt >mhash >mysql >mysqli >openssl >pcre >PDO >pdo_sqlite >posix >session >SimpleXML >soap >SPL >SQLite >standard >tidy >tokenizer >xml >xsl >Zend Debugger >Zend Optimizer >zlib > >[Zend Modules] >Zend Debugger >Zend Extension Manager >Zend Optimizer > > >I tried googling for this and at the top of the results was my own post to >this list from a while ago. D'oh! The Inadvertent Autogoogle. > >TIA > >--- >David Mintz >http://davidmintz.org/ > >Amendment IV > >The right of the people to be secure in their >persons, houses, papers, and effects, against >unreasonable searches and seizures, shall not be >violated, and no Warrants shall issue, but upon >probable cause, supported by Oath or affirmation, >and particularly describing the place to be >searched, and the persons or things to be seized. >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk >New York PHP Conference and Expo 2006 >http://www.nyphpcon.com >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php > > From evdo.hsdpa at gmail.com Fri Jan 27 22:57:50 2006 From: evdo.hsdpa at gmail.com (Robert Kim Wireless Internet Advisor) Date: Fri, 27 Jan 2006 19:57:50 -0800 Subject: [nycphp-talk] command line warning "...these options need to match" In-Reply-To: References: <43CEB4D4.4050307@simmons.edu> Message-ID: <1ec620e90601271957q576d4fdobb5cc3f9f5bbab37@mail.gmail.com> david... try a bigger php forum... cant help ya. -- Bob Repeater Kim 2611 s Highway 101 Cardiff CA 92007 206 984 0880 http://evdo-coverage.com/cellular-repeater.html On 1/27/06, David Mintz wrote: > On Wed, 18 Jan 2006, Jonathan wrote: > > > I get these errors when I compile from C into a .so extension from > > different versions of PHP. > > It might not be your php script causing the error - but a shared object > > you are loading (or ADODB c library for example) through a dl() function > > or in the .ini. > > \uffff I don't know what that is- hex for nothing? > > Anyway , thats a php 5 warning message - and some extension being loaded > > is from php4. > > > > Does anybody know how you figure out which extension is offending? I have > this, according to 'php -m' > > [PHP Modules] > ctype > curl > date > dom > exif > gd > iconv > libxml > mcrypt > mhash > mysql > mysqli > openssl > pcre > PDO > pdo_sqlite > posix > session > SimpleXML > soap > SPL > SQLite > standard > tidy > tokenizer > xml > xsl > Zend Debugger > Zend Optimizer > zlib > > [Zend Modules] > Zend Debugger > Zend Extension Manager > Zend Optimizer > > > I tried googling for this and at the top of the results was my own post to > this list from a while ago. D'oh! The Inadvertent Autogoogle. > > TIA > > --- > David Mintz > http://davidmintz.org/ > > Amendment IV > > The right of the people to be secure in their > persons, houses, papers, and effects, against > unreasonable searches and seizures, shall not be > violated, and no Warrants shall issue, but upon > probable cause, supported by Oath or affirmation, > and particularly describing the place to be > searched, and the persons or things to be seized. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Robert Q Kim, Wireless Internet Advisor http://evdo-coverage.com/cell-repeater.html http://hsdpa-coverage.com 2611 S. Pacific Coast Highway 101 Suite 102 Cardiff by the Sea, CA 92007 206 984 0880 From shiflett at php.net Sat Jan 28 10:46:54 2006 From: shiflett at php.net (Chris Shiflett) Date: Sat, 28 Jan 2006 10:46:54 -0500 Subject: [nycphp-talk] NYPHPCon Message-ID: <43DB91EE.8090909@php.net> 14 Jun - 16 Jun 2006: http://www.nyphpcon.com/ Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ From ken at secdat.com Sat Jan 28 10:55:02 2006 From: ken at secdat.com (Kenneth Downs) Date: Sat, 28 Jan 2006 10:55:02 -0500 (EST) Subject: [nycphp-talk] NYPHPCon In-Reply-To: <43DB91EE.8090909@php.net> References: <43DB91EE.8090909@php.net> Message-ID: <38321.38.117.147.25.1138463702.squirrel@38.117.147.25> I could not find a deadline for submissions, is there one? > 14 Jun - 16 Jun 2006: > > http://www.nyphpcon.com/ > > Chris > > -- > Chris Shiflett > Brain Bulb, The PHP Consultancy > http://brainbulb.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Kenneth Downs Secure Data Software 631-379-0010 ken at secdat.com PO Box 708 East Setauket, NY 11733 From danielc at analysisandsolutions.com Sat Jan 28 13:11:12 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 28 Jan 2006 13:11:12 -0500 Subject: [nycphp-talk] PHP in SecurityFocus #330 Message-ID: <20060128181121.C420DCB3426@mailspool3.panix.com> These summaries are available online RSS: http://phpsec.org/projects/vulnerabilities/securityfocus.xml HTML: http://phpsec.org/projects/vulnerabilities/securityfocus.html Alerts from SecurityFocus Newsletter #330 APPLICATIONS USING PHP ---------------------- Round Cube Webmail Path Disclosure Weakness http://www.securityfocus.com/bid/15920 PHP Fusebox Index.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/15924 JPortal Forum Forum.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/15925 PlaySMS Index.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/15928 Box UK Amaxus CMS Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/15936 Adaptive Website Framework Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/15937 Caravel CMS Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/15939 Contenite ID Parameter Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/15942 Esselbach Storyteller CMS Search Module Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/15945 FLIP Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/15947 Libertas Enterprise CMS Index.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/15950 ContentServ Index.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/15956 Direct News Index.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/15957 ODFaq FAQ.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/15958 Marwel Index.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/15959 Miraserver Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/15960 Bitweaver Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/15962 myEZshop Shopping Cart Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/15965 Komodo CMS Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/15966 PHPGedView Multiple Remote Script Code Execution Vulnerabilities http://www.securityfocus.com/bid/15983 Enterprise Connector Main.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/15984 AbleDesign ReSearch Search Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/15988 AbleDesign D-Man Title Parameter Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/15993 Tolva Usermods.PHP Remote File Include Vulnerability http://www.securityfocus.com/bid/16000 Beehive Forum Multiple HTML Injection Vulnerabilities http://www.securityfocus.com/bid/16002 Papaya CMS Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16005 SPIP Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/16019 Papoo Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/16020 PHPSlash Article.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/16021 From danielc at analysisandsolutions.com Sat Jan 28 13:11:16 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 28 Jan 2006 13:11:16 -0500 Subject: [nycphp-talk] PHP in SecurityFocus #331 Message-ID: <20060128181125.A4C1CCB3425@mailspool3.panix.com> These summaries are available online RSS: http://phpsec.org/projects/vulnerabilities/securityfocus.xml HTML: http://phpsec.org/projects/vulnerabilities/securityfocus.html Alerts from SecurityFocus Newsletter #331 APPLICATIONS USING PHP ---------------------- SimpBook Guestbook HTML Injection Vulnerability http://www.securityfocus.com/bid/16058 Cerberus Helpdesk Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16062 Dev Web Management System Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16063 PHPSurveyor SID Parameter SQL Injection Vulnerability http://www.securityfocus.com/bid/16077 Koobi BBCode URL Tag Script Injection Vulnerability http://www.securityfocus.com/bid/16078 PHPDocumentor Remote and Local File Include Vulnerabilities http://www.securityfocus.com/bid/16080 PHPDocumentor Forum Lib Variable Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16101 MyBB Globa.PHP Cookie Data SQL Injection Vulnerability http://www.securityfocus.com/bid/16082 TinyMCE Compressor Multiple Vulnerabilities http://www.securityfocus.com/bid/16083 PHPBB Multiple Unspecified Remote Input Validation Vulnerabilities http://www.securityfocus.com/bid/16088 Ades Design AdesGuestbook Read Script Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16090 OOApp Guestbook Home Script Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16091 iPei Guestbook Index.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16092 Kayako SupportSuite Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/16094 MyBB Print Thread Script HTML Injection Vulnerability http://www.securityfocus.com/bid/16096 MyBB File Upload SQL Injection Vulnerability http://www.securityfocus.com/bid/16097 From danielc at analysisandsolutions.com Sat Jan 28 13:11:18 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 28 Jan 2006 13:11:18 -0500 Subject: [nycphp-talk] PHP in SecurityFocus #332 Message-ID: <20060128181127.A5F07CB3427@mailspool3.panix.com> These summaries are available online RSS: http://phpsec.org/projects/vulnerabilities/securityfocus.xml HTML: http://phpsec.org/projects/vulnerabilities/securityfocus.html Alerts from SecurityFocus Newsletter #332 PHP --- PHP MySQL_Connect Remote Buffer Overflow Vulnerability http://www.securityfocus.com/bid/16145 APPLICATIONS USING PHP ---------------------- MyBB Print Thread Script HTML Injection Vulnerability http://www.securityfocus.com/bid/16096 MyBB File Upload SQL Injection Vulnerability http://www.securityfocus.com/bid/16097 InTouch User Variable SQL Injection Vulnerability http://www.securityfocus.com/bid/16110 PHPJournaler Readold Variable SQL Injection Vulnerability http://www.securityfocus.com/bid/16111 Chimera Web Portal Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16113 B-Net Multiple HTML Injection Vulnerabilities http://www.securityfocus.com/bid/16114 ScozNet ScozBook AdminName Variable SQL Injection Vulnerability http://www.securityfocus.com/bid/16115 VBulletin Event Title HTML Injection Vulnerability http://www.securityfocus.com/bid/16116 Drupal URL-Encoded Input HTML Injection Vulnerability http://www.securityfocus.com/bid/16117 INCOGEN Bugport Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/16121 INCOGEN Bugport Index.PHP Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/16123 Primo Place Primo Cart Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/16125 Valdersoft Shopping Cart Remote File Include Vulnerability http://www.securityfocus.com/bid/16126 IDV Directory Viewer Index.PHP Information Disclosure Vulnerability http://www.securityfocus.com/bid/16137 raSMP User-Agent HTML Injection Vulnerability http://www.securityfocus.com/bid/16138 Lizard Cart CMS Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/16140 Foro Domus Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16154 ADN Forum Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16157 Modular Merchant Shopping Cart Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16160 TheWebForum Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16161 TinyPHPForum Multiple Directory Traversal Vulnerabilities http://www.securityfocus.com/bid/16163 Navboard Multiple BBCode Tag Script Injection Vulnerabilities http://www.securityfocus.com/bid/16165 RELATED STUFF ------------- Apache mod_auth_pgsql Multiple Format String Vulnerabilities http://www.securityfocus.com/bid/16153 From danielc at analysisandsolutions.com Sat Jan 28 13:11:21 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 28 Jan 2006 13:11:21 -0500 Subject: [nycphp-talk] PHP in SecurityFocus #334 Message-ID: <20060128181131.0F39F7E22A2@mailspool2.panix.com> These summaries are available online RSS: http://phpsec.org/projects/vulnerabilities/securityfocus.xml HTML: http://phpsec.org/projects/vulnerabilities/securityfocus.html Alerts from SecurityFocus Newsletter #334 APPLICATIONS USING PHP ---------------------- WP-Stats Author Parameter SQL Injection Vulnerability http://www.securityfocus.com/bid/16241 Benders Calendar Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/16242 Bit 5 Blog Index.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/16244 Bit 5 Blog AddComment.PHP HTML Injection Vulnerability http://www.securityfocus.com/bid/16246 White Album Pictures.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/16247 GeoBlog ViewCat.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/16249 EZDatabase Index.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16257 CubeCart Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/16259 phpXplorer Workspaces.PHP Directory Traversal Vulnerability http://www.securityfocus.com/bid/16263 phpXplorer Action.PHP Directory Traversal Vulnerability http://www.securityfocus.com/bid/16292 RedKernel Referrer Tracker Rkrt_stats.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16266 BlogPHP Index.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/16269 microBlog Index.PHP Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/16270 microBlog BBCode URL Tag Script Injection Vulnerability http://www.securityfocus.com/bid/16272 PHP Fusebox Index.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16274 WebMobo WBNews Comments.PHP HTML Injection Vulnerability http://www.securityfocus.com/bid/16277 PowerPortal Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/16279 SMBCMS Local Site Search Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16281 HTMLtoNuke HTMLtonuke.PHP Remote File Include Vulnerability http://www.securityfocus.com/bid/16282 AOblogger Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16286 Eggblog Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16305 SaralBlog Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16306 MyBB Signature HTML Injection Vulnerability http://www.securityfocus.com/bid/16308 PHlyMail Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16310 My Amazon Store Manager Search.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16312 Netrix X-Site Manager Product_Details.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16313 WebspotBlogging Login.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/16319 From danielc at analysisandsolutions.com Sat Jan 28 13:11:19 2006 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 28 Jan 2006 13:11:19 -0500 Subject: [nycphp-talk] PHP in SecurityFocus #333 Message-ID: <20060128181129.41B5B7E22A1@mailspool2.panix.com> These summaries are available online RSS: http://phpsec.org/projects/vulnerabilities/securityfocus.xml HTML: http://phpsec.org/projects/vulnerabilities/securityfocus.html Alerts from SecurityFocus Newsletter #333 PHP --- PHP MySQLI Error Logging Remote Format String Vulnerability http://www.securityfocus.com/bid/16219 Upgrade to PHP 5.1.2 PHP 5 User-Supplied Session ID Input Validation Vulnerability http://www.securityfocus.com/bid/16220 Upgrade to PHP 5.1.2 APPLICATIONS USING PHP ---------------------- Navboard Multiple BBCode Tag Script Injection Vulnerabilities http://www.securityfocus.com/bid/16165 AppServ Open Project Remote File Include Vulnerability http://www.securityfocus.com/bid/16166 427BB Showthread.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/16169 427BB Authentication Bypass Vulnerability http://www.securityfocus.com/bid/16178 Foxrum Multiple BBCode Tag Script Injection Vulnerabilities http://www.securityfocus.com/bid/16172 PHP PEAR Go-Pear.PHP Arbitrary Remote Code Execution Vulnerability http://www.securityfocus.com/bid/16174 SysCP WebFTP Module Local File Include Vulnerability http://www.securityfocus.com/bid/16175 Venom Board Post.PHP3 Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/16176 PHPChamber Search_result.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16180 Magic News Plus Administrator Password Change Vulnerability http://www.securityfocus.com/bid/16182 Andromeda Andromeda.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16183 Joomla Vcard Access Information Disclosure Vulnerability http://www.securityfocus.com/bid/16185 PHPNuke EV Search Module SQL Injection Vulnerability http://www.securityfocus.com/bid/16186 PHPNuke Multiple Modules IMG Tag HTML Injection Vulnerability http://www.securityfocus.com/bid/16192 ADOdb Server.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/16187 Xoops Pool Module IMG Tag HTML Injection Vulnerability http://www.securityfocus.com/bid/16189 Trac HTML WikiProcessor Wiki Content HTML Injection Vulnerability http://www.securityfocus.com/bid/16198 Orjinweb Index.PHP Remote File Include Vulnerability http://www.securityfocus.com/bid/16199 CaLogic Calendars Add Event Multiple HTML Injection Vulnerabilities http://www.securityfocus.com/bid/16206 MyPhPim Addresses.PHP3 Arbitrary File Upload Vulnerability http://www.securityfocus.com/bid/16208 MyPhPim Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16210 Interspire TrackPoint NX Index.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16214 PHP Toolkit for PayPal IPN_success.PHP Logfile Injection Vulnerability http://www.securityfocus.com/bid/16218 Wordcircle Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16227 TankLogger General Functions Script SQL Injection Vulnerabilities http://www.securityfocus.com/bid/16228 Light Weight Calendar Index.PHP Remote Command Execution Vulnerability http://www.securityfocus.com/bid/16229 MyBB Usercp.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/16230 DCP Portal Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/16232 AlstraSoft Template Seller Pro Fullview.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/16233 EZDatabase Remote PHP Script Code Execution Vulnerability http://www.securityfocus.com/bid/16237 From evdo.hsdpa at gmail.com Sat Jan 28 18:19:47 2006 From: evdo.hsdpa at gmail.com (Robert Kim Wireless Internet Advisor) Date: Sat, 28 Jan 2006 15:19:47 -0800 Subject: [nycphp-talk] PHP in SecurityFocus #332 In-Reply-To: <20060128181127.A5F07CB3427@mailspool3.panix.com> References: <20060128181127.A5F07CB3427@mailspool3.panix.com> Message-ID: <1ec620e90601281519n5a15e517r3de6434f7cb8a27a@mail.gmail.com> thx for the links -- Robert Q Kim, Wireless Internet Advisor http://evdo-coverage.com/cellular-repeater.html http://hsdpa-coverage.com 2611 S. Pacific Coast Highway 101 Suite 102 Cardiff by the Sea, CA 92007 206 984 0880 From lists at zaunere.com Sun Jan 29 10:58:53 2006 From: lists at zaunere.com (Hans Zaunere) Date: Sun, 29 Jan 2006 10:58:53 -0500 Subject: [nycphp-talk] NYPHPCon In-Reply-To: <38321.38.117.147.25.1138463702.squirrel@38.117.147.25> Message-ID: <012c01c624ec$e7c2e870$7001a8c0@MZ> Kenneth Downs wrote on Saturday, January 28, 2006 10:55 AM: > I could not find a deadline for submissions, is there one? > > > 14 Jun - 16 Jun 2006: > > > > http://www.nyphpcon.com/ Not yet - there will be one, but it's open for now. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From lists at zaunere.com Mon Jan 30 10:10:31 2006 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 30 Jan 2006 10:10:31 -0500 Subject: [nycphp-talk] FW: conference@nyphp: Call For Papers Open; Show Your Participation; PR Message-ID: <002901c625af$50e70620$7001a8c0@MZ> I apologize for the horrible cross-post - and I encourage others not to reply-all - but we've been receiving comments that folks haven't been hearing about announcements and events since they're not on the Announce list. Please be sure to subscribe to the moderated Announce list (http://www.nyphp.org/lists) since announcements are *not* typically cross-posted. This announcement is quite significant since it announces the call for papers is open for NYPHPCon 2006 and more details. Thanks all, --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com New York PHP wrote on Monday, January 30, 2006 8:42 AM: > News From NYPHPCon 2006 > ----------------------- > > This last week has been a great one for conference progress. Here's the > latest: > > -- Sign-Up Now To Lock in Your Early Bird Discount > http://www.nyphpcon.com/attendee_registration.php > > -- The Call For Papers is Now Open > http://www.nyphpcon.com/call_for_papers.php > > -- Show That You Are Helping the Conference > http://www.nyphpcon.com/show_participation.php > > -- Official Press Release is Available > http://www.nyphpcon.com/NYPHPCon06PR.pdf > > > We continue to bring on new sponsors and already have received a number > of great looking papers. But we can always use your help. Spread the > word to speakers and sponsors, or be one yourself. > > --- > Hans Zaunere / President / New York PHP > www.nyphp.org / www.nyphp.com From krook at us.ibm.com Mon Jan 30 12:40:23 2006 From: krook at us.ibm.com (Daniel Krook) Date: Mon, 30 Jan 2006 09:40:23 -0800 Subject: [nycphp-talk] PEAR DB ODBC broken after 5.0.4 -> 5.1.1 [update] Message-ID: I solved the issue described in my earlier post by downgrading to the latest 5.0 release, 5.0.5. Still not sure exactly where the problem was, but I think the solution for others that want to use PHP 5.1.x with DB2 is to use PDO and the new ibm_db2 driver instead of PEAR and ODBC. http://lists.nyphp.org/pipermail/talk/2006-January/017539.html Daniel Krook, Content Tools Developer Global Production Services - Tools, ibm.com http://bluepages.redirect.webahead.ibm.com/ http://blogpages.redirect.webahead.ibm.com/ http://bookmarks.redirect.webahead.ibm.com/ From dmintz at davidmintz.org Mon Jan 30 12:42:52 2006 From: dmintz at davidmintz.org (David Mintz) Date: Mon, 30 Jan 2006 12:42:52 -0500 (EST) Subject: [nycphp-talk] command line warning "...these options need to match" In-Reply-To: <1ec620e90601271957q576d4fdobb5cc3f9f5bbab37@mail.gmail.com> References: <43CEB4D4.4050307@simmons.edu> <1ec620e90601271957q576d4fdobb5cc3f9f5bbab37@mail.gmail.com> Message-ID: On Fri, 27 Jan 2006, Jonathan Hendler wrote: > If these are extensions loaded via your php.ini then you can go through > each individually and shut them on and off one at a time. And reload the > extension. > Otherwise won't show up in your list of "loaded" extensions because it > failed to load. > You can also look in your app for a ".so" or ".dll" if you are on > windows. As I said, distrobutions of ADODB often include a .so. > > I am on Fedora Core 4 and I built this Apache myself, and built PHP with './configure' '--with-gd' '--with-curl' '--with-mysql=/usr/local/mysql' '--enable-inline-optimization' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-exif' '--with-zlib-dir=/usr/local/lib' '--with-openssl' '--with-mcrypt' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-tidy' '--enable-soap' '--with-xsl' '--with-xml' '--with-mhash' '--with-jpeg-dir=/usr/lib' As best I can tell most of this stuff is not loaded via php.ini but I will look again and play around some more. Thanks. On Fri, 27 Jan 2006, Robert Kim Wireless Internet Advisor wrote: > david... try a bigger php forum... cant help ya. > OK, thanks for trying. --- David Mintz http://davidmintz.org/ Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. From scott at crisscott.com Mon Jan 30 13:24:21 2006 From: scott at crisscott.com (Scott Mattocks) Date: Mon, 30 Jan 2006 13:24:21 -0500 Subject: [nycphp-talk] command line warning "...these options need to match" In-Reply-To: References: <43CEB4D4.4050307@simmons.edu> <1ec620e90601271957q576d4fdobb5cc3f9f5bbab37@mail.gmail.com> Message-ID: <43DE59D5.1060302@crisscott.com> David Mintz wrote: > > I am on Fedora Core 4 and I built this Apache myself, and built PHP with > './configure' '--with-gd' '--with-curl' '--with-mysql=/usr/local/mysql' > '--enable-inline-optimization' '--with-apxs=/usr/local/apache/bin/apxs' > '--enable-exif' '--with-zlib-dir=/usr/local/lib' '--with-openssl' > '--with-mcrypt' '--with-mysqli=/usr/local/mysql/bin/mysql_config' > '--with-tidy' '--enable-soap' '--with-xsl' '--with-xml' '--with-mhash' > '--with-jpeg-dir=/usr/lib' As best I can tell most of this stuff is not > loaded via php.ini but I will look again and play around some more. > Thanks. Check the files in /etc/php.d/ One of those may be trying to load an extension. The files in that directory are parsed after php.ini and are just mini php.ini extracts. For example, I have a file /etc/php.d/mysqli.ini that has an extension=mysqli.so directive. -- Scott Mattocks http://www.crisscott.com From alex at pilgrimstudio.com Mon Jan 30 15:30:00 2006 From: alex at pilgrimstudio.com (Alexander) Date: Mon, 30 Jan 2006 13:30:00 -0700 Subject: [nycphp-talk] Object conversion Message-ID: <1243.216.223.218.202.1138653000.squirrel@pilgrimstudio.com> Hello, I'm kind of newbie in PHP and especially in OO PHP. I was wondering whether object conversion is possible if one is derived from another , like this: clase Base { .. } class A extends Base { .. } will that be possible to: $objBase = new Base(); $objA = new A(); $objA = $objBase; ??? From andrew at plexpod.com Mon Jan 30 21:25:02 2006 From: andrew at plexpod.com (Andrew Yochum) Date: Mon, 30 Jan 2006 21:25:02 -0500 Subject: [nycphp-talk] Object conversion In-Reply-To: <1243.216.223.218.202.1138653000.squirrel@pilgrimstudio.com> References: <1243.216.223.218.202.1138653000.squirrel@pilgrimstudio.com> Message-ID: <20060131022501.GD22027@desario.homelinux.net> On Mon, Jan 30, 2006 at 01:30:00PM -0700, Alexander wrote: > Hello, > > I'm kind of newbie in PHP and especially in OO PHP. > I was wondering whether object conversion is possible if one is derived > from another , like this: > > clase Base { .. } > > class A extends Base { .. } > > will that be possible to: > > $objBase = new Base(); > $objA = new A(); > > $objA = $objBase; What you've done above is make $objA a reference to $objBase - no "conversion". You might've meant you'd like to downcast it to a Base object. TMK, downcasting is not supported at all in PHP. It is commonly frowned upon in other languages because of problems that can arise. In fact Java 1.5 even added features 5 which resemble, or are even identical to templates in C++ (shudder ... ;-) to avoid having to do it in the common cases like collections. Anyway, I digress... If you were to do this in PHP it *might* resemble its counterparts in other languages: $objAlikeBase = (Base) $objA; But like I said, you can't in PHP. You may only cast between the primatives, not classes. If you really think you need to do this, give a better example of what your looking to do. Don't forget that an instance of class that extends another has the methods and properties of *both* classes or even interfaces. It can also be used as both when code requires it like: class shape { } interface printable{ } class circle extends shape implements printable { } function draw(shape $o) { } function myprint(printable $o) { } $dot = new circle(); draw($dot); myprint($dot); HTH, Andrew -- Andrew Yochum Plexpod andrew at plexpod.com 718-360-0879 From scott at crisscott.com Tue Jan 31 08:51:32 2006 From: scott at crisscott.com (Scott Mattocks) Date: Tue, 31 Jan 2006 08:51:32 -0500 Subject: [nycphp-talk] FW: conference@nyphp: Call For Papers Open; Show Your Participation; PR In-Reply-To: <002901c625af$50e70620$7001a8c0@MZ> References: <002901c625af$50e70620$7001a8c0@MZ> Message-ID: <43DF6B64.3020706@crisscott.com> Hi Hans, Hans Zaunere wrote: > This announcement is quite significant since it announces the call for > papers is open for NYPHPCon 2006 and more details. Just curious, but why haven't I seen this in more places? I have only seen the announcement here and on php-mag.net. Actually, only one of the sponsors even has a mention on their site (phpdeveloper.org). I was expecting to see the CfP on php.net and phparch.com at least. Is there anything us mailing list subscribers can do to help spread the word? Thanks, -- Scott Mattocks http://www.crisscott.com From alex at pilgrimstudio.com Tue Jan 31 09:19:34 2006 From: alex at pilgrimstudio.com (Alexander) Date: Tue, 31 Jan 2006 07:19:34 -0700 Subject: [nycphp-talk] Object conversion In-Reply-To: <20060131022501.GD22027@desario.homelinux.net> References: <1243.216.223.218.202.1138653000.squirrel@pilgrimstudio.com> <20060131022501.GD22027@desario.homelinux.net> Message-ID: <1305.216.223.218.202.1138717174.squirrel@pilgrimstudio.com> Thank you for detailed explanation...basically I was trying to do the following: Object of the base class($objBase) containing some data which I want to copy to object of the derived class($objA). So I was looking for different approches to this 'problem', and I was questioning myself if it is possible to do that with type-casting, which you said is not supported in PHP :) I guess it's good :) code is somewhat like that class Base { var $a; var $b; var $c; ... } class A extends Base { var $d; var $e; function SomeKindOfTransormation(Base-type parameter) { //here I was trying to copy all data from argument //as after it will be transormed and stored in the same variables } } btw, as I'm using PHP4 is there any way to define function-member of the class outside the class? > What you've done above is make $objA a reference to $objBase - no > "conversion". > > You might've meant you'd like to downcast it to a Base object. TMK, > downcasting is not supported at all in PHP. It is commonly frowned upon > in > other languages because of problems that can arise. In fact Java 1.5 even > added features 5 which resemble, or are even identical to templates in C++ > (shudder ... ;-) to avoid having to do it in the common cases like > collections. Anyway, I digress... > > If you were to do this in PHP it *might* resemble its counterparts in > other languages: > $objAlikeBase = (Base) $objA; > But like I said, you can't in PHP. You may only cast between the > primatives, not classes. > > If you really think you need to do this, give a better example of what > your looking to do. > > Don't forget that an instance of class that extends another has the > methods and properties of *both* classes or even interfaces. It can > also be used as both when code requires it like: > > class shape { } > interface printable{ } > class circle extends shape implements printable { } > > function draw(shape $o) { } > function myprint(printable $o) { } > > $dot = new circle(); > > draw($dot); > myprint($dot); From dcech at phpwerx.net Tue Jan 31 09:33:55 2006 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 31 Jan 2006 09:33:55 -0500 Subject: [nycphp-talk] Object conversion In-Reply-To: <1305.216.223.218.202.1138717174.squirrel@pilgrimstudio.com> References: <1243.216.223.218.202.1138653000.squirrel@pilgrimstudio.com> <20060131022501.GD22027@desario.homelinux.net> <1305.216.223.218.202.1138717174.squirrel@pilgrimstudio.com> Message-ID: <43DF7553.8070907@phpwerx.net> Alexander wrote: > Thank you for detailed explanation...basically I was trying to do the > following: > > Object of the base class($objBase) containing some data which I want to > copy to object of the derived class($objA). So I was looking for different > approches to this 'problem', and I was questioning myself if it is > possible to do that with type-casting, which you said is not supported in > PHP :) I guess it's good :) In PHP4 you could use a variant of the factory pattern, something like: class Base { var $a; } class A { var $a; var $b; function &frombase(&$base) { $a =& new A(); $a->a =& $base->a; return $a; } } $obj =& new Base(); $obj = a::frombase($obj); Note the use of the assign-by-reference operator, which should ensure that any internal and external references are kept intact (I think). Dan From hendler at simmons.edu Tue Jan 31 09:34:15 2006 From: hendler at simmons.edu (Jonathan Hendler) Date: Tue, 31 Jan 2006 09:34:15 -0500 Subject: [nycphp-talk] Redirect and ob_flush() In-Reply-To: <1305.216.223.218.202.1138717174.squirrel@pilgrimstudio.com> References: <1243.216.223.218.202.1138653000.squirrel@pilgrimstudio.com> <20060131022501.GD22027@desario.homelinux.net> <1305.216.223.218.202.1138717174.squirrel@pilgrimstudio.com> Message-ID: <43DF7567.2090406@simmons.edu> An HTML attachment was scrubbed... URL: From shiflett at php.net Tue Jan 31 10:16:10 2006 From: shiflett at php.net (Chris Shiflett) Date: Tue, 31 Jan 2006 10:16:10 -0500 Subject: [nycphp-talk] Redirect and ob_flush() In-Reply-To: <43DF7567.2090406@simmons.edu> References: <1243.216.223.218.202.1138653000.squirrel@pilgrimstudio.com> <20060131022501.GD22027@desario.homelinux.net> <1305.216.223.218.202.1138717174.squirrel@pilgrimstudio.com> <43DF7567.2090406@simmons.edu> Message-ID: <43DF7F3A.1030803@php.net> Jonathan Hendler wrote: > Has anyone been able to get around the issue of the HTTP header > Connection: close being ignored by server/client? Sending this header is a courtesy. It doesn't dictate whether you can close the connection - it just provides a means to notify the other party. In addition, this header is used to alter the default behavior. In HTTP/1.1, keep-alive is the default behavior. In HTTP/1.0, it's not. > You would use this if you want to execute a redirect and then > continue with a bunch of other code without the client being > delayed. Remember that you're still just sending an HTTP response. If it has a 3xx status code and a Location header, the client will request the new resource, but it can't know about it prior to receiving the original 3xx response. > If you run the code below you will observe a 30 second delay. > The desired behaviour is that after the the flush(); the client > moves on. There are a few things to consider. First, you want to be sure that the use of flush() is forcing a chunked response. Use something like LiveHTTPHeaders to verify this. (If you see a Content-Length header, that's problem number one.) If you're issuing a chunked response, you want to make sure that the client receives the response line and all of the HTTP headers before 30 seconds have passed. After all, it can't redirect before it is asked to. Lastly, you want to be sure that other systems aren't buffering this response and interfering with your plan. If you're using mod_gzip, Apache is likely buffering the response, waiting the full 30 seconds before sending it to the client (compressed). Internet Explorer buffers, so that it doesn't begin to render until it has received a significant portion of the response (making its rendering appear faster, although the overall delivery is actually slower). It's not required that a client abort a transaction as soon as it knows it must request another resource, but these are the major characteristics you want to check to make that scenario possible. Hope that helps. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ From hendler at simmons.edu Tue Jan 31 10:36:45 2006 From: hendler at simmons.edu (Jonathan Hendler) Date: Tue, 31 Jan 2006 10:36:45 -0500 Subject: [nycphp-talk] Redirect and ob_flush() In-Reply-To: <43DF7F3A.1030803@php.net> References: <1243.216.223.218.202.1138653000.squirrel@pilgrimstudio.com> <20060131022501.GD22027@desario.homelinux.net> <1305.216.223.218.202.1138717174.squirrel@pilgrimstudio.com> <43DF7567.2090406@simmons.edu> <43DF7F3A.1030803@php.net> Message-ID: <43DF840D.70004@simmons.edu> Thanks Chris - I respond inline below: Chris Shiflett wrote: >Jonathan Hendler wrote: > > >>Has anyone been able to get around the issue of the HTTP header >>Connection: close being ignored by server/client? >> >> > >Sending this header is a courtesy. It doesn't dictate whether you can >close the connection - it just provides a means to notify the other party. > > It seems to work in some cases - see below. >In addition, this header is used to alter the default behavior. In >HTTP/1.1, keep-alive is the default behavior. In HTTP/1.0, it's not. > > I though Connection: close was HTTP/1.1 only, and not HTTP/1.0 I tried adding header("Cache-Control: no-cache"); with no luck also. >>You would use this if you want to execute a redirect and then >>continue with a bunch of other code without the client being >>delayed. >> >> > >Remember that you're still just sending an HTTP response. If it has a >3xx status code and a Location header, the client will request the new >resource, but it can't know about it prior to receiving the original 3xx >response. > > If I understand you, I think that's ok. There is only one 302/Location sent. >>If you run the code below you will observe a 30 second delay. >>The desired behaviour is that after the the flush(); the client >>moves on. >> >> > >There are a few things to consider. First, you want to be sure that the >use of flush() is forcing a chunked response. Use something like >LiveHTTPHeaders to verify this. (If you see a Content-Length header, >that's problem number one.) > > It's chunked, no content-length header. >If you're issuing a chunked response, you want to make sure that the >client receives the response line and all of the HTTP headers before 30 >seconds have passed. After all, it can't redirect before it is asked to. > > I used apache ab to verify with the -v 3 option - the headers are sent when I want them to be. But I do get : "WARNING: Response code not 2xx (302)" Interestingly wget follows the redirect instantly - and the rest of the code still triggers correctly - so Connection: close isn't ignored by it. Also, I notice that although I try to force a http/1.0 in apache, if the request is 1.1 it send a 1.1 - and also adds a /Content-Type: text/html; charset=ISO-8859-1 /after the the Connect: close >Lastly, you want to be sure that other systems aren't buffering this >response and interfering with your plan. If you're using mod_gzip, >Apache is likely buffering the response, waiting the full 30 seconds >before sending it to the client (compressed). Internet Explorer buffers, >so that it doesn't begin to render until it has received a significant >portion of the response (making its rendering appear faster, although >the overall delivery is actually slower). > > > Observed in IIS, Apache, Firefox, IE etc, etc. Granted, there's still possibly a gotcha in there. >It's not required that a client abort a transaction as soon as it knows >it must request another resource, but these are the major >characteristics you want to check to make that scenario possible. > > That's the problem - it doesn't seem like there is a way to /require/ the abort. From ldhasson at us.ibm.com Tue Jan 31 15:47:34 2006 From: ldhasson at us.ibm.com (Laurent Hasson) Date: Tue, 31 Jan 2006 15:47:34 -0500 Subject: [nycphp-talk] Laurent Hasson/Hawthorne/IBM is out of the office. Message-ID: I will be out of the office starting 2006.01.31 and will not return until 2006.02.04. I will be away on personal business for teh rest of the week with limited to no access to a network. For Search related issues, please contact Aya Soffer. For JWL related issues, please contact Brendan Murray or Jim Colson. For general Porta/Workplace Content issues, please contact John Schumacher or Greg Melahn. From keith at keithjr.net Tue Jan 31 15:57:47 2006 From: keith at keithjr.net (Keith Richardson) Date: Tue, 31 Jan 2006 15:57:47 -0500 Subject: [nycphp-talk] LARGE mysql database performance Message-ID: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> So I am writing a "security camera" app at work, and using mysql/php. I have the cameras uploading snapshots via ftp to the server. Now for dealing with the images, and indexing them for easy searching, I want to throw the info into a mysql database. I wouldnt mind also sticking the image data in the table too, so that you HAD to go through the app to view the images instead of direct url linking, but was wondering, how does mysql react with a 20-30gb database? would this be very bad? I have run a forum that used vbulletin with about a 500mb database, but that did not have any issues at all.... but 20-30gb is quite the large database :p Any thoughts or experiences? -- Keith Richardson -------------- next part -------------- An HTML attachment was scrubbed... URL: From spangia at redcent.net Tue Jan 31 16:07:20 2006 From: spangia at redcent.net (Sean Pangia) Date: Tue, 31 Jan 2006 16:07:20 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> Message-ID: <43DFD188.4070208@redcent.net> is non-direct linking the only advantage to be gained? if so, why not just use PHP to do a file read from an htaccess protected directory where the actual images live? same result -- people have to go through the app. Keith Richardson wrote: > So I am writing a "security camera" app at work, and using mysql/php. I > have the cameras uploading snapshots via ftp to the server. > > Now for dealing with the images, and indexing them for easy searching, I > want to throw the info into a mysql database. I wouldnt mind also > sticking the image data in the table too, so that you HAD to go through > the app to view the images instead of direct url linking, but was > wondering, how does mysql react with a 20-30gb database? would this be > very bad? I have run a forum that used vbulletin with about a 500mb > database, but that did not have any issues at all.... but 20-30gb is > quite the large database :p > > Any thoughts or experiences? > > -- > Keith Richardson > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- _______________________________________ Sean Pangia Red Cent 54 West 21st Street, #607 NYC 10010 212.255.3800 www.redcent.net From sailer at bnl.gov Tue Jan 31 16:08:17 2006 From: sailer at bnl.gov (Tim Sailer) Date: Tue, 31 Jan 2006 16:08:17 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> Message-ID: <20060131210816.GA15636@bnl.gov> On Tue, Jan 31, 2006 at 03:57:47PM -0500, Keith Richardson wrote: > So I am writing a "security camera" app at work, and using mysql/php. I have > the cameras uploading snapshots via ftp to the server. > > Now for dealing with the images, and indexing them for easy searching, I > want to throw the info into a mysql database. I wouldnt mind also sticking > the image data in the table too, so that you HAD to go through the app to > view the images instead of direct url linking, but was wondering, how does > mysql react with a 20-30gb database? would this be very bad? I have run a > forum that used vbulletin with about a 500mb database, but that did not have > any issues at all.... but 20-30gb is quite the large database :p > > Any thoughts or experiences? I'm not sure what you consider 'large', but I work with tables that are averaging 500,000,000 records, and about 60G, with a single multi-key index. I had to switch to Innodb to actually get the inserts to work with any speed (concurrency issues), but query speed went down about 15%. Tim -- Tim Sailer Information and Special Technologies Program Northeast Regional Counterintelligence Office Brookhaven National Laboratory (631) 344-3001 From volcimaster at gmail.com Tue Jan 31 16:09:33 2006 From: volcimaster at gmail.com (Warren Myers) Date: Tue, 31 Jan 2006 16:09:33 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> Message-ID: Well, slashdot runs on MySQL, and they don't have too many problems with handling large quantities of both data and users. WMM On 1/31/06, Keith Richardson wrote: > > So I am writing a "security camera" app at work, and using mysql/php. I > have the cameras uploading snapshots via ftp to the server. > > Now for dealing with the images, and indexing them for easy searching, I > want to throw the info into a mysql database. I wouldnt mind also sticking > the image data in the table too, so that you HAD to go through the app to > view the images instead of direct url linking, but was wondering, how does > mysql react with a 20-30gb database? would this be very bad? I have run a > forum that used vbulletin with about a 500mb database, but that did not have > any issues at all.... but 20-30gb is quite the large database :p > > Any thoughts or experiences? > > -- > Keith Richardson > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > -- http://warrenmyers.com "God may not play dice with the universe, but something strange is going on with the prime numbers." --Paul Erd?s "It's not possible. We are the type of people who have everything in our favor going against us." --Ben Jarhvi, Short Circuit 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Tue Jan 31 16:20:01 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 31 Jan 2006 16:20:01 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: <20060131210816.GA15636@bnl.gov> Message-ID: <00c001c626ac$18b65230$0aa8a8c0@cliff> Can you define "any speed"? ---- I'm not sure what you consider 'large', but I work with tables that are averaging 500,000,000 records, and about 60G, with a single multi-key index. I had to switch to Innodb to actually get the inserts to work with any speed (concurrency issues), but query speed went down about 15%. From edwardpotter at gmail.com Tue Jan 31 16:30:49 2006 From: edwardpotter at gmail.com (edward potter) Date: Tue, 31 Jan 2006 16:30:49 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> Message-ID: My understanding is all the GOOG adsense, adwords delivery back-end also uses MySQL? Can't get any bigger then that! GOOG earnings at 4:30. The street awaits! :-) ed On 1/31/06, Warren Myers wrote: > Well, slashdot runs on MySQL, and they don't have too many problems with > handling large quantities of both data and users. > > WMM > > > On 1/31/06, Keith Richardson wrote: > > > > So I am writing a "security camera" app at work, and using mysql/php. I > have the cameras uploading snapshots via ftp to the server. > > > > Now for dealing with the images, and indexing them for easy searching, I > want to throw the info into a mysql database. I wouldnt mind also sticking > the image data in the table too, so that you HAD to go through the app to > view the images instead of direct url linking, but was wondering, how does > mysql react with a 20-30gb database? would this be very bad? I have run a > forum that used vbulletin with about a 500mb database, but that did not have > any issues at all.... but 20-30gb is quite the large database :p > > > > Any thoughts or experiences? > > > > -- > > Keith Richardson > > > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > New York PHP Conference and Expo 2006 > > http://www.nyphpcon.com > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > > > > > > -- > http://warrenmyers.com > "God may not play dice with the universe, but something strange is going on > with the prime numbers." --Paul Erd?s > "It's not possible. We are the type of people who have everything in our > favor going against us." --Ben Jarhvi, Short Circuit 2 > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > From hendler at simmons.edu Tue Jan 31 17:23:22 2006 From: hendler at simmons.edu (Jonathan Hendler) Date: Tue, 31 Jan 2006 17:23:22 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> Message-ID: <43DFE35A.9030209@simmons.edu> Keep the images on the filesystem - out of a BLOB record. Map the filesystem, meta data and other stuff into the database. MySQL though could handle this app. Clustering means MySQL is scalable in a way that you aren't too limited by the database performance. Keith Richardson wrote: > So I am writing a "security camera" app at work, and using mysql/php. > I have the cameras uploading snapshots via ftp to the server. > > Now for dealing with the images, and indexing them for easy searching, > I want to throw the info into a mysql database. I wouldnt mind also > sticking the image data in the table too, so that you HAD to go > through the app to view the images instead of direct url linking, but > was wondering, how does mysql react with a 20-30gb database? would > this be very bad? I have run a forum that used vbulletin with about a > 500mb database, but that did not have any issues at all.... but > 20-30gb is quite the large database :p > > Any thoughts or experiences? > > -- > Keith Richardson > >------------------------------------------------------------------------ > >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk >New York PHP Conference and Expo 2006 >http://www.nyphpcon.com >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php > > From cliff at pinestream.com Tue Jan 31 17:45:32 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 31 Jan 2006 17:45:32 -0500 Subject: [nycphp-talk] How to return a calculated result or zero Message-ID: <000001c626b8$0aeeadd0$0aa8a8c0@cliff> This has been driving me nuts: $result = ($some calculation > 0) ? $some calculation : 0; Sure it works, but ugly, ugly, ugly... I run across this situation so often that I figured there must be a built-in function. Ceiling, floor, mean, cosine. std...my grade school memory is long gone. After one last search, I came across this, which is pretty close: $result = max($some calculation, 0); Happy day... -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Tue Jan 31 17:53:19 2006 From: tedd at sperling.com (tedd) Date: Tue, 31 Jan 2006 17:53:19 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: <43DFE35A.9030209@simmons.edu> References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> <43DFE35A.9030209@simmons.edu> Message-ID: >Keep the images on the filesystem - out of a BLOB record. Why? >Map the filesystem, meta data and other stuff into the database. Isn't there a limit to the number of files that can reside in one directory? If so, then how do you handle managing what is mapped where? tedd -- -------------------------------------------------------------------------------- http://sperling.com/ From hendler at simmons.edu Tue Jan 31 17:53:42 2006 From: hendler at simmons.edu (Jonathan Hendler) Date: Tue, 31 Jan 2006 17:53:42 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> Message-ID: <43DFEA76.7090205@simmons.edu> As a follow up: If you want users not to directly access images you can handle this through mod_rewrite in apache and/or just pipe all images through a php buffer.... But that's a bit slow. Keith Richardson wrote: > So I am writing a "security camera" app at work, and using mysql/php. > I have the cameras uploading snapshots via ftp to the server. > > Now for dealing with the images, and indexing them for easy searching, > I want to throw the info into a mysql database. I wouldnt mind also > sticking the image data in the table too, so that you HAD to go > through the app to view the images instead of direct url linking, but > was wondering, how does mysql react with a 20-30gb database? would > this be very bad? I have run a forum that used vbulletin with about a > 500mb database, but that did not have any issues at all.... but > 20-30gb is quite the large database :p > > Any thoughts or experiences? > > -- > Keith Richardson > >------------------------------------------------------------------------ > >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk >New York PHP Conference and Expo 2006 >http://www.nyphpcon.com >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php > > From 1j0lkq002 at sneakemail.com Tue Jan 31 17:59:51 2006 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 31 Jan 2006 14:59:51 -0800 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> Message-ID: <3523-01490@sneakemail.com> Keith Richardson keith-at-keithjr.net |nyphp dev/internal group use| wrote: > So I am writing a "security camera" app at work, and using mysql/php. > I have the cameras uploading snapshots via ftp to the server. > > Now for dealing with the images, and indexing them for easy searching, > I want to throw the info into a mysql database. I wouldnt mind also > sticking the image data in the table too, so that you HAD to go > through the app to view the images instead of direct url linking, but > was wondering, how does mysql react with a 20-30gb database? would > this be very bad? I have run a forum that used vbulletin with about a > 500mb database, but that did not have any issues at all.... but > 20-30gb is quite the large database :p > > Any thoughts or experiences? > > -- > Keith Richardson > This may not be anything close to what you want to do, but have you seen ZoneMinder? http://www.zoneminder.com/ -=john andrews http://www.seo-fun.com From cahoyos at us.ibm.com Tue Jan 31 18:15:14 2006 From: cahoyos at us.ibm.com (Carlos A Hoyos) Date: Tue, 31 Jan 2006 18:15:14 -0500 Subject: [nycphp-talk] How to return a calculated result or zero In-Reply-To: <000001c626b8$0aeeadd0$0aa8a8c0@cliff> Message-ID: Sorry to nit-pick, but why is this one so ugly? I might come from the "c" school, but I honestly find $result = ($calculation > 0) ? $calculation : 0; easy to read (and a little sexy too). If you want a math formula, how about: $result = ($calculation + sqrt($calculation * $calculation)) / 2; now if you ask me, that one is ugly, ugly, ugly ;-) talk-bounces at lists.nyphp.org wrote on 01/31/2006 05:45:32 PM: > This has been driving me nuts: > > $result = ($some calculation > 0) > ? $some calculation > : 0; > > Sure it works, but ugly, ugly, ugly... From cliff at pinestream.com Tue Jan 31 18:19:44 2006 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 31 Jan 2006 18:19:44 -0500 Subject: [nycphp-talk] How to return a calculated result or zero In-Reply-To: Message-ID: <000d01c626bc$d1f2df60$0aa8a8c0@cliff> I know, I am making something out of nothing. The only real issue I see is that the calculation is performed twice. If we pull the calc out, it will only be performed once, but than we have an extra temp variable. -----Original Message----- From: On Behalf Of Carlos A Hoyos Sorry to nit-pick, but why is this one so ugly? I might come from the "c" school, but I honestly find $result = ($calculation > 0) ? $calculation : 0; easy to read (and a little sexy too). From shiflett at php.net Tue Jan 31 18:21:15 2006 From: shiflett at php.net (Chris Shiflett) Date: Tue, 31 Jan 2006 18:21:15 -0500 Subject: [nycphp-talk] How to return a calculated result or zero In-Reply-To: References: Message-ID: <43DFF0EB.5000107@php.net> Carlos A Hoyos wrote: > Sorry to nit-pick, but why is this one so ugly? I might come from > the "c" school, but I honestly find > > $result = ($calculation > 0) ? $calculation : 0; > > easy to read (and a little sexy too). $result = max($calculation, 0); I'm too sexy. :-) Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ From max.goldberg at gmail.com Tue Jan 31 22:52:47 2006 From: max.goldberg at gmail.com (max goldberg) Date: Tue, 31 Jan 2006 22:52:47 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> <43DFE35A.9030209@simmons.edu> Message-ID: <87e6ded30601311952l5168f7fal6307379e5f03aa4c@mail.gmail.com> Using MySQL as a file server on a large scale is just asking for problems. I've never heard of it executed well for large numbers of files and it's not really fit to handle it either. You don't need to store all the files in one directory and in reality you shouldn't. There was an informative thread on NYPHP tittled "[OT] number of files in a directory?" which describes the hurdles involved with this. Using InnoDB you should probably be fine, and you will most likely hit 10 million rows of time stamp, camera id, file name before you even see your db get to 1GB. MySQL is built well enough to handle many GB of data and hundreds of millions of rows. If you need any sort of concurrency, you are almost forced to go with InnoDB. Either way, this is all well within the capabilities of MySQL. -Cheers On 1/31/06, tedd wrote: > > >Keep the images on the filesystem - out of a BLOB record. > > Why? > > >Map the filesystem, meta data and other stuff into the database. > > Isn't there a limit to the number of files that can reside in one > directory? If so, then how do you handle managing what is mapped > where? > > tedd > > -- > > -------------------------------------------------------------------------------- > http://sperling.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > New York PHP Conference and Expo 2006 > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Tue Jan 31 23:27:39 2006 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 31 Jan 2006 23:27:39 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: Message-ID: <002101c626e7$d72f4ce0$6401a8c0@MZ> edward potter wrote on Tuesday, January 31, 2006 4:31 PM: > My understanding is all the GOOG adsense, adwords delivery back-end > also uses MySQL? Can't get any bigger then that! Well, some of that is true. :) > GOOG earnings at 4:30. The street awaits! :-) ed Uh oh... > > > So I am writing a "security camera" app at work, and using mysql/php. > > > I have the cameras uploading snapshots via ftp to the server. > > > > > > Now for dealing with the images, and indexing them for easy > > > searching, I > > want to throw the info into a mysql database. I wouldnt mind also > > sticking the image data in the table too, so that you HAD to go through > > the app to view the images instead of direct url linking, but was As mentioned already, preventing direct links to files can be easily done without storing them in a database. > > wondering, how does mysql react with a 20-30gb database? would this be > > very bad? I have run a forum that used vbulletin with about a 500mb > > database, but that did not have any issues at all.... but 20-30gb is > > quite the large database :p Just as the size of Google's ad database could be considered large, 30gb could be considered large, too. MySQL's performance can vary greatly depending on traffic patterns. For instance, read heavy applications can perform well, while read/write applications can perform poorly. But mixing storage engines can help. Putting mostly read-only information (like images, ie, a snapshot is taken and stored) in a MyISAM table (and potentially different disk), and putting read/write data in InnoDB (meta data like view counts), can maximize how MySQL can perform. And perhaps the most important factor is what constitutes "large." Are there a few very large blocks of data, or is that there are many smaller blocks of data? These types of considerations have an impact on any data storage strategy. > > > Any thoughts or experiences? I'm generally a fan of storing large static data pieces on the filesystem. Huge numbers of files can be handled, and throughput can be maximized. When storing this type of data in a relational database, bits have to be read from disk, through the database engine, and then through the network, into a language like PHP, and then again pushed out through the network via something like Apache. Compare this with Apache being able to grab a file directly from disk and pushing it onto the network. Sure, caching techiques can help with a database, but they still won't match disk caching. End of the day, large static data is suited for disk in most architectures. In extreme cases, Apache won't cut it either. All the large image caches of the Internet use the most basic HTTP servers that are optimized for data delivery, versus something like Apache/PHP that is optimized for functionality - but that's a different story. :) --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From lists at zaunere.com Tue Jan 31 23:46:39 2006 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 31 Jan 2006 23:46:39 -0500 Subject: [nycphp-talk] FW: conference@nyphp: Call For Papers Open; Show Your Participation; PR In-Reply-To: <43DF6B64.3020706@crisscott.com> Message-ID: <002201c626ea$7e9e1590$6401a8c0@MZ> Hey Scott - Scott Mattocks wrote on Tuesday, January 31, 2006 8:52 AM: > Hi Hans, > > Hans Zaunere wrote: > > > This announcement is quite significant since it announces the call for > > papers is open for NYPHPCon 2006 and more details. > > Just curious, but why haven't I seen this in more places? I have only > seen the announcement here and on php-mag.net. Actually, only one of the We're still in early phases of promotion (and frankly we're already surprised by the coverage even now) so NYPHPCon 2006 is getting out there quickly. > sponsors even has a mention on their site (phpdeveloper.org). I was > expecting to see the CfP on php.net and phparch.com at least. Is there A couple of announcements have gone out and will be going live very soon. > anything us mailing list subscribers can do to help spread the word? Absolutely. Take a look at http://www.nyphpcon.com/show_participation.php As members of New York PHP, you've all made this conference possible. Even if you live far from New York, as many on this list do, you're a vital part of NYPHP. Talk about the conference on your blogs, forums, signatures, and general web sites. The logo/link at http://www.nyphpcon.com/show_participation.php is a way to get started when mentioning the conference. The immediate recognition of NYPHPCon 2006 has already been based on the crucial role NYPHP members play - who's core is this very list. If there are any questions or special requests, please don't hesitate to contact me personally. Best regards, --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From rolan at omnistep.com Tue Jan 31 23:49:45 2006 From: rolan at omnistep.com (Rolan Yang) Date: Tue, 31 Jan 2006 23:49:45 -0500 Subject: [nycphp-talk] LARGE mysql database performance In-Reply-To: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> References: <4e1a9bc0601311257t8717772j165847c94a02a648@mail.gmail.com> Message-ID: <43E03DE9.2040305@omnistep.com> Keith Richardson wrote: > So I am writing a "security camera" app at work, and using mysql/php. > I have the cameras uploading snapshots via ftp to the server. > > Now for dealing with the images, and indexing them for easy searching, > I want to throw the info into a mysql database. I wouldnt mind also > sticking the image data in the table too, so that you HAD to go > through the app to view the images instead of direct url linking, but > was wondering, how does mysql react with a 20-30gb database? would > this be very bad? I have run a forum that used vbulletin with about a > 500mb database, but that did not have any issues at all.... but > 20-30gb is quite the large database :p > > I don't think there will be a problem with only 20-30GB, however if you want to plan for the future, saving the images as files on the filesystem is probably better approach since there is a 2 TB filesize limit under ext2/ext3. You should organize the files into some sort of nested directory tree. For ideas, examine the structure of the Postfix (mail server) queue. ~Rolan