[PHP] Re: MySQL and SVN
Emil Edeholt schrieb: Hi all! Maybe slightly off topic, but I would like to know how you guys handle mysql structures between different computers (and for that matter from the developer desktop to the stable server). I work on my home and my office computer with the same php projects. I keep all my php files on svn, so I just update and commit the first and last thing I do when I switch computer. The problem is when I've made a change in the structure of my mysql tables. I usually try to save a dump and ssh it to my server and download and import it on the other computer. But that feels clumsy, and if I've made changes on both computers I have no simple way to merge the structures like I can in svn. How do you handle this in your projects? Best Regards Emil Edeholt Hi Emil, I use pear MDB2_Schema package to handle and manage my database structures. Another option would be http://dbdeploy.com/. There is also a pear proposal: http://pear.php.net/pepr/pepr-proposal-show.php?id=507. Both, very interesting components in the area of database deployment. Cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SMTP
Diana schrieb: I dont know what I did but now I get this message Failed to connect to mailserver at localhost port 25, verify your SMTP Do you have a smtp server running on localhost? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php-tidy
OOzy Pal schrieb: I have php4 running on Ubuntu Feisty. I can see php5-tidy in the Synaptic (Package Manager) but can not see php4-tidy or php-tidy. How can I install php4-tidy for php4? On linux: - download the source - untar and go to directory - /path/to/phpize - ./configure ( maybe --help ) - make - make install - enable the new extension in the php.ini - done hth Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Frameworks - Opinion
Matt Todd wrote: In my experience with the other frameworks (primarily Wasp, CakePHP, Symfony, eZ Components, and Zend Framework), I've found that I was not satisfied with the quantity of low-quality code they advocate. I have a high standard for code quality, readability, maintainability, and (more generally) semantics. Because of this, I determined to build my own framework. This was a few months ago, and Canvas[1] was the result of my labor. I produced this framework while working on numerous projects at the university I work at. This allowed me to build an application concurrently with the framework and give it a good benchmark for usability, feature, performance, etc. Some of the features include pretty URLs and a fairly capable router, a simplistic implementation of the ActiveRecord pattern (with a very easy way to make adapters for your favorite flavor of RDBMS), incorporation of Smarty for its templating, and usage of the MVC pattern. (Of course, this list is hardly sorted by priority.) A quick sample of using the ActiveRecord implementation: class shoe extends Model {} $shoe = new shoe(); $shoe-find_by_color('green')-delete(); $shoe-find_by_id(12); $shoe-color = 'red'; $shoe-save(); $shoe-find_or_create_by_color('tangerine'); $shoe-find(array(where=array('color like :color or size :size, color=pink, size=11)))-all(); Do check it out. M.T. 1. http://c.anvas.es/ Please do not recommend stuff like this. It is a funky framework! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Templates, PHP Frameworks, and DB Abstraction?
Jay Paulson wrote: I'd like to get some feedback on what the list thinks is a good template engine other than smarty. I like ezTemplate. (E_STRICT) I'd also like to do some quick prototyping using a PHP framework does anyone have any recommendations for one that is easy to pick up and run with? Seems to be a really difficult question imho :) Finally, does anyone have any suggestions for a good PHP database abstraction library? Depends on your environment, MDB2 is fine if you have to run php4, otherwise, I like Zend_Db (http://framework.zend.com/manual/en/zend.db.html) and also ezDatabase (http://ez.no/doc/components/view/latest/(file)/classtrees_Database.html) is worth a look. just my 0,2 €cents -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Templates, PHP Frameworks, and DB Abstraction?
Robert Cummings wrote: On Mon, 2006-07-03 at 08:37, Jens Kleikamp wrote: Jay Paulson wrote: I'd like to get some feedback on what the list thinks is a good template engine other than smarty. I like ezTemplate. (E_STRICT) YOU DO?? I hope it's changed then from the one used on a site I'm now maintaining. I find it to be a nightmare. You can't just move around blocks of content because the template's block structure requires you maintain the nesting association... thus you need to go back to the code every time you move a block of content to synch up the block declarations. Cheers, Rob. Hi Rob, Sorry, typo, I meant ezcTemplate. Maybe ezTemplate is a package within ezPublish 3.x cms, which I don´t know. ( not 100% sure ) The lately released ezcTemplate does the job very well, I didn´t experienced the issue you described. Cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Forms Validation library
Murtaza Chang wrote: Hi I just wanted to know if there's a generalised library available for Forms validation in php? -- Murtaza Chang http://pear.php.net/package/HTML_QuickForm http://ez.no/doc/components/view/latest/(file)/introduction_UserInput.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SVN PHP
Jon Morgan wrote: Hi. I'm trying to access SVN from PHP and as there seems to be no direct binding for it yet i've had a look at WebSVN source to try and list directories in a repository with the following code but it just doesn't return anything. It doesn't return anything whether re-directing or not (i..e. using 21). If I use the same method to call svnlook author, etc. it work fine, the only problem is when using the svn command line program. $output = array (); $err = false; $cmd = svn info http://172.16.0.32/svn/java/trunk 21; if ($handle = popen($cmd, r)) { $firstline = true; while(!feof($handle)) { $line = fgets($handle); if($firstline $line == ) { $err = true; } $firstline = false; $output[] = rtrim($line); } pclose($handle); if(!$err) print $output; } Any help would be appreciated. Cheers, J. Maybe the svn pecl extension can help, http://pecl.php.net/package/svn cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Coding Practice: Use global $var or pass in by refernce
Mark Steudel wrote: I was wondering what the general rule on using the global driective versus passing in a variable by reference, why you should or shouldn't, etc. e.g. function () { global $db; $res = $db-query( SQL); } or function ( $db ) { $res = $db-query( SQL); } or function foo () { $db = $GLOBALS['database']; $res = $db-query(); } or function foo () { $res = $GLOBALS['database']-query(); } Just some more possibilities... cheers Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: APC and PHP 5.1.2
steve wrote: Thanks for that! It meant that I should look in other directions which helped me figure out the problem. Can you try again with: apc.optimization=1 Your script also seems to work on my sytem with optimization=1. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: APC and PHP 5.1.2
steve wrote: Really? Now I am confused on why I'd be having a problem and you aren't. I even deleted the php.ini file and made a new one that only contained this: extension=apc.so apc.optimization=1 and it still failed. At least I have it working without the second line. My phpinfo() has this as the configure line (why the quotes?): './configure' '--with-mysqli' '--with-pdo' '--with-cli' '--with-gd' '--with-dom' '--with-zlib' '--with-xml' '--with-openssl' '--enable-mbstring=all' '--enable-inline-optimization' '--enable-memory-limit' '--enable-exif' '--enable-fastcgi' '--enable-force-cgi-redirect' '--without-pear' Can you check yours? Maybe there is a conflict with the modules compiled in and APC's optimizer (though that sounds really strange). Maybe I'll try removing all of them and recompile and see what happens... ./configure \ --prefix=/usr/local/php5-fcgi \ --with-config-file-path=/etc/php5-fcgi \ --with-mysql=/usr \ --with-zlib \ --enable-fastcgi \ --enable-memory-limit \ --enable-force-cgi-redirect \ --enable-track-vars \ --without-pear \ --with-imap \ --with-imap-ssl \ --with-gd \ --enable-gd-native-ttf \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-freetype-dir=/usr \ --enable-pdo \ --enable-pdo_mysql \ --with-pdo_mysql \ --with-gettext \ --with-iconv \ --enable-mbstring=all \ --enable-mbregex \ --with-mime-magic=/usr/share/misc/file/magic.mime \ --with-dom \ --with-mcrypt hth, Jens -steve- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: APC and PHP 5.1.2
steve wrote: You know not what you ask!! I'm going to have to wait a bit before I do that. Currently using Apache 2, and the config files would need to be different, etc., so I'll have to choose a webserver I can take down for a longer time. :( What I did try was different versions of PHP (All using FastCGI APC-dev) (if this even helps): 5.1.2 -- Failed 5.1.1 -- Failed 5.0.5 -- Success -steve-- On 3/2/06, Rasmus Lerdorf [EMAIL PROTECTED] wrote: It probably does. I have never tried it against the Fastcgi sapi. Try it with the Apache module version to rule this out. -Rasmus Your script works fine for me on linux, php 5.1.2 FastCGI + apc-dev. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Linux distributions and tools for Linux/Apache/PHP/MySQL dev
Chris Lott wrote: I'm making the switch from Windows to Linux for mydesktop and development environment and would greatly appreciate suggestions for development tools on this platform. Ubuntu seems to be getting all the press, but suggestions about Linux distributions are welcome as well! c Just for editing php files under linux I found the eclipse plugin http://www.phpeclipse.de. Very nice screenshot: http://www.flickr.com/photo_zoom.gne?id=101196627size=o Also it seems that there will be a more powerfull php environment for eclipse in the future by Zend and IBM. http://www.eclipse.org/proposals/php-ide/ - promising! :) Best Regards, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: auto download
Benjamin Adams wrote: I have three links. The code already auto selects one. I'm trying to take that one link and automaticly start the download. I tryed with header('location:$link'); but it tells me Warning: Cannot modify header information what would I use to start downloading? one of the link is another page so I need it to pop up in a new window. Thanks for any help Moin, You can´t start the browsers download dialog if you already sent any data. No header(), echo(), print() etc. Have a look at http://pear.php.net/package/HTTP_Download. cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Working with a config file
Benjamin Adams wrote: I'm trying to parse a config file, example of the config is: [fred] id=8782 section=s1 years=4 download1=mirror1 [frank] id=8372 section=s3 years=4 download1=mirror12 download2=mirror2 . . . I want to parse this so I can only call frank or freds data and move id, section, years, etc to varaibles. Can someone give me some help Thanks Ben --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you´ve a php 5 environment I would recommend the Configuration Package of the newly releases ezComponents. Components overview: http://ez.no/doc/components/overview Fast, feature-rich and easy to use, hava a look at the tutorial: http://ez.no/doc/components/view/(file)/1.0/introduction_Configuration.html -Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to build custom/private pear packages
Jochem Maas wrote: hi people, I have been thinking about how I rollout some of my code (stuff that gets reused alot) and I thought it would be nice if I could have basic functionality available for my projects via a custom pear package server (referred to as a 'pear channel'??) - so what I would like to figure out is how to set up a 'package server' and how to roll my own packages. I have been searching but I've drawn a bit of a blank - anyone know some good reading material that could get me started? rgds, Jochem Hoi, http://www.schlitt.info/applications/blog/index.php?/archives/308-Set-up-your-own-PEAR-channel.html http://greg.chiaraquartet.net/archives/19-Its-official-pear.chiaraquartet.net-is-live.html These guides helped quite a lot. Cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stopping users to see uploaded files
verffentlicht per Mail versendet symbulos wrote: Dear friends, we are using php for developing a small tool for uploading files for download (publications). Using the usual move_uploaded_file, the publications are loaded into a directory where the webserver can write / read. Unfortunately, that means every person who connects to the directory can see the files. If some of the files are for sale, how do you stop the user from seeing them / downloading them without permission? Is there any other way to upload files using php? Thanks in advance! Probably you want to upload the files in a directory outsite the document root, but read permission by the webserver user. Then you can you use e.g. PEAR::HTTP_Download for sending the files to the client. Hope this helps, and sorry for my bad english. :) cheers Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Fastest templating mechanism
Evert | Rooftop Solutions wrote: Hi all, I'm working on a template system which works a bit like a text translation block. The data looks for example like: beginblock div class=block endblock /div beginauthor span class=author endauthor /div The list is going to be very large, it will have several overlays and not all pages need all items in the list. (usually just a fraction) What will be the smartest way to implement this? I need a low-memory cost and fast solution I can do it with a php script, like: $list = array( 'beginblock' = 'div class=block', etc. ); but this will use up too much memory. I could additionally do it with a textfile, but if I need to loop through it at every lookup it will be slow.. What are your suggestions? regards, Evert Have also a look at www.phpsavant.com. Different from smarty, its a lightweight object-oriented template engine. One neat feature is that you could add optionally your own custom markup compilers. Regards, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php