[PHP] self:: vs this
Hy people, I have an existential doubt regarding php classes. I have been a php programmer for quite a long time, but never could figure out the clear difference between using this- or self:: when calling member functions, wether they are private or public. I used them indistinctly and seemed to sort the same effects, although, when working with statics classes, self:: was the only way to access members. Well, that's all, any can put me some light on the matter? Thanks, -- Mariano Guadagnini UVCMS S.R.L www.uvcms.com
Re: [PHP] strip urls
You may try using regular expressions for that. Something like preg_replace(http:\/\/.*\s,,$your_var). That's a simple example, but you can change to suit your needs, check the online help for more info about. HTH, Mariano. Merlin wrote: Hi there, I am trying to strip URL's out of a text. There is a function for this in php, but I can't find it anywhere. Can sombody help? Regards, Merlin -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/443 - Release Date: 11/09/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php and Cygwin SVN
Hello list, I'm developing an application that fetches some files from a local svn repository, and shows them on request (using svn cat, svn list and such). Originally, it was deployed in Linux (Apache, PHP5.0) and worked perfectly well. I tried to port it to Windows (specifically, WinXP Pro SP2, PHP5, IIS5), and because it depends on many command line utilities, i decided to install cygwin. After struggling a bit, i got it working. The thing is that, when executing any cygwin svn command (via shell_exec), many command windows pops up appears on the windows desktop, making the sistem quite slow during the process. I realized that, this happens because of shell_exec opening a new shell on every command call, i tried the other exec functions, but the same happened. I wonder if it is posible to launch those commands in a silent manner. Thanks, Mariano.- -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.7/434 - Release Date: 30/08/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Php and Cygwin SVN
Thanks for your reply. I checked those ports and seem nice. Actually, i use cygwin mainly because it was already installed on the Windows server. But the same problem arises with any command I execute trough shell_exec, no matter if it's a cygwin executable or a windows native app, the command shell pop ups always. There should be some way to execute something without the cmd windows opening again and again, i guess. Any ideas? Adam Zey wrote: Mariano Guadagnini wrote: Hello list, I'm developing an application that fetches some files from a local svn repository, and shows them on request (using svn cat, svn list and such). Originally, it was deployed in Linux (Apache, PHP5.0) and worked perfectly well. I tried to port it to Windows (specifically, WinXP Pro SP2, PHP5, IIS5), and because it depends on many command line utilities, i decided to install cygwin. After struggling a bit, i got it working. The thing is that, when executing any cygwin svn command (via shell_exec), many command windows pops up appears on the windows desktop, making the sistem quite slow during the process. I realized that, this happens because of shell_exec opening a new shell on every command call, i tried the other exec functions, but the same happened. I wonder if it is posible to launch those commands in a silent manner. Thanks, Mariano.- There is a windows port of Subversion, and the GNU utilities you're referring to have mostly been ported to Windows without the use of cygwin (see gnuwin32). Do you really need to rely on cygwin? Regards, Adam Zey. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.7/434 - Release Date: 30/08/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php/ajax..
bruce wrote: hi.. will php allow a user to enter field on a form, and compute aresult based on the field, without having to reload the entire form, or will i need ajax... any good examples on how to accomplish this.. thanks PHP is executed on the server, so you cannot campute something without sending it back, reprocessing the form and put the result on the client browser's. Some basic tasks can be done in the client with javascript, but you have no much choices to accomplish what you want: 1)Ajax (change or reload a section or node of your document based on an action) 2)Frames and Javascript (reload only a frame with javascript, for example) There are many good examples out there of either ways. Regards, Mariano. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.10.7/410 - Release Date: 05/08/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Step by step code running
Personally, i think the best one is Zend debugger. It's integrated on the Zend IDE, and let you debug remotely, from a server. The problem aside, is that is paid and closed source, neverthless is the best IMHO. You may give it a try: www.zend.com/products/zend_studio HTH, Mariano. weetat wrote: Hi Ryan, I use Log4jPhp to log any debug value. I think it is better than using echo or print method. Thanks - weetat Ryan A wrote: Hi, I need to explain a script to a pal of mine but either i cant explain it properly or he just cant get the concept being new to php's slightly advanced stuff (OO and classes, mind you...i ain't no expert myself in this, more like Jochem's(from this list) field of expertise) I remember in my old C++ days we used to use something that basically showed how the code executed, line by line, running in the loops etc anything like that for PHP? Personally I use EditPlus and a lot of echo/print statements when I debug, I try to keep things simple. Thanks! -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.4/396 - Release Date: 24/07/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Drag 'n Drop - File Upload
I've seen some places using a java applet for this. A good example is the course uploading interface of Blackboard LMS. Martin Staiger wrote: Dear group, we would like to have the possibility to upload files not via HTML-form but via Drag 'n Drop of files. WebDav seem to offer potentials ... but HOW? Are there any examples existing? Are there alternatives existing? Thanks, Marc -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.8/380 - Release Date: 30/06/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] xmldoc
Brad Bonkoski wrote: weetat wrote: Hi all, I have simple code below : It run ok in one of my test server (Red Hat Enterprise) , PHP 4.3.2. However in the one of production server which have same OS and PHP version , the code did not display done parsing xml in log file. It just display starting parsing xml only. I have check all setting in php.ini , however cannot found any different between 2 server. Anybody have any ideas what happening here ? Thanks ?php $xmlfile = '/test/test.xml'; $_logger-logdebug(starting parsing xml); $doc = xmldoc($xmlfile); $_logger-logdebug(done parsing xml); ? What does xmldoc() do? Perhaps it reaches some critical error within that segment and causes the script to never complete? Maybe when parsing the xml, the function throws an exception. That happened to me with PHP 5 xml builtin support, which uses libxml to process xml's, it can be that your document is malformed, you could try with a php debugger (like zend debugger). -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.2/373 - Release Date: 22/06/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serving a graphic downloads it instead of displaying it
Brian Dunning wrote: I'm trying to serve up a jpeg like this: header(Content-type: image/jpg); readfile('images/banner-ad.jpg'); It works on other browsers, but on Safari it downloads the graphic like a file, rather than displaying it. What's up with that --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.0/367 - Release Date: 16/06/2006 Maybe you can try to embed the image in a blank html, inside img tag for example, to show only the image you want. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.0/367 - Release Date: 16/06/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] declaring a class as stdClass?
Hi list, I hace an existencial doubt: i've seem many scripts declaring classes as stdClass. In the documentation (for PHP5 and also for 4), it says that this class is internal of php, and should't be used. By the manner I saw it's being used, i guess that it can be handy to create a 'generic' or so class, and append members when needed on the fly, without the need for a formal class declaration, but i could't find any good source explaining that. Has somebody some info about? Thanks in advance. Mariano Guadagnini.- -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 13/06/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] arrays
Jess Alain Rodrguez Santos wrote: if I have two arrays, example: $a = array ("one", "two", "three", "four", "two"); $b = array ("seven", "one", "three", "six", "five"); How can I get in another variable a new array with the same elements into $a and $b. $new_array = array_merge( $a, $b); regards, Mariano Guadagnini. No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.8.3/359 - Release Date: 08/06/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cgi.fix_pathinfo and iis 5
Hi people, I have the following issue: I´m using PHP 5 on IIS 5 and Windows XP Pro, and when trying to pass values through the path to my scripts, iis rejects them. After some googling, I found an advice to set AllowPathInfoForScriptMappings variable in iis, but it didn't work either. Finally, I ended up with a solution i found somewhere else, enabling cgi.fix_pathinfo in php.ini . The thing is, that when i restart the server, it seems that php doesn't recognize such variable, as it doesn't apper on phpinfo or ini_get() neither. That looks weird, because in documentation is clearly stated that this variable is available since PHP 4.3.0 . What can I do to have that setting enabled? Thanks in advance, Mariano Guadagnini. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.5.1/326 - Release Date: 27/04/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cgi.fix_pathinfo and iis 5
Mariano Guadagnini wrote: Hi people, I have the following issue: I´m using PHP 5 on IIS 5 and Windows XP Pro, and when trying to pass values through the path to my scripts, iis rejects them. After some googling, I found an advice to set AllowPathInfoForScriptMappings variable in iis, but it didn't work either. Finally, I ended up with a solution i found somewhere else, enabling cgi.fix_pathinfo in php.ini . The thing is, that when i restart the server, it seems that php doesn't recognize such variable, as it doesn't apper on phpinfo or ini_get() neither. That looks weird, because in documentation is clearly stated that this variable is available since PHP 4.3.0 . What can I do to have that setting enabled? Thanks in advance, Mariano Guadagnini. Any ideas? -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.5.1/326 - Release Date: 27/04/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parsing malformed xml documents
Hei guys, I´m parsing some xml's and fetching nodes using xpath, and the PHP 5.0 DOM. Unfortunately, some documents have white spaces in the beginning or some missing tags. In some situations, the script just skips that xml, or even crashes without notice. I tried loading them as html, and disabling validation, but that didn´t do the trick, as they have invalid html tags. I wonder if there is some way (maybe an external class, or something) to accomplish this. I know that theorically, it would be better to have well formed xml (I also think so), but I need to handle them at any rate, and they´re created by an external source away from my control. Thanks in advance, Mariano Guadagnini -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.5/300 - Release Date: 03/04/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5 XML Dom, set doctype and system
Hello, I need to set the doctype and the system dtd of a document created directly with the xml DOM. I couldn´t find any function or property to set this, i saw some examples that directly wrote onto the file manually, but i´m pretty sure thare must be a way to do this with the dom (i remembered that libxml c api has such capability, so, if php dom is based on such, then it would be able to). Any ideas? Thanks in advance, cheers. Mariano. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.13.12/193 - Release Date: 06/12/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Manage directory security on iis
Hi guys, I wonder if it would be able to manage access to some directories using php, on a website using iis 6.0. To be more clear, the application i'm working on has a database with users, accounts and an administrator. So, i need to grant access to specific directories in the site to the users that the admin allow. The thing is that the accounts created are not present on the system (in this case, windows 2003 web edition), but only on the site database, i wouldn't like to create a system account per user so as to apply windows directories polycies. Is there a way to achieve this inside php? i know that with apache htaccess, this can be done, but i am not able to change the web server right now. Any ideas? Thanks! Mariano G. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.10/189 - Release Date: 30/11/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Manage directory security on iis
Well, the htaccess on iis seems to be the best solution for us, thanks people! Cheers, Mariano -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.10/189 - Release Date: 30/11/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Server Client Architecture, best parctice
Reading this, a question arose me: is it possible to read a shared memory area with php, supposing than both programs are in the same machine? does php support ipc? that would be greatly useful. Mariano. James Benson wrote: Each has its own benefits, if on a shared server then a database would be the most secure I think, if its a dedicated server then tmpfs or just plain old files will probably be the best, it also depends on various other factors like, server hardware and bandwith, only you can select the best option for your particular setup. James Yaswanth Narvaneni wrote: Hi! I would like to know what does the community think of the best architecture for server client communication and why? That is, if there is a server in C++ (say a game server) and the PHP has to 'read' data 'from' the server then what is the best form of communication? a) Shared Memory : Server opens the shared memory in write and the PHP scripts open it in read and gets the data b) TMPFS (just like shared memory): Server opens a file in tmpfs in write and PHP in read c) Databases: Server Updates a table in the DB and client reads from the table d) Files: Same as TMPFS Regards, Yaswanth -- In theory there is no difference between theory and practice. In practice there is. -- Fortune Cookie -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.3/173 - Release Date: 16/11/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Catch warnings
Curt Zirzow wrote: On Tue, Nov 15, 2005 at 04:39:05PM -0300, Mariano Guadagnini wrote: Hi, i�m writting a php program that parses and saves some xml files on a server. The problem is that i want to catch warnings so as to be able to store them in a variable, but not to be put directly on client�s browser. I got the following code, but i cannot get it working: // $old_track = ini_set('track_errors', '1'); if ([EMAIL PROTECTED]()) { echo $php_errormsg, \n; } ini_set('track_errors', $old_track); // When i execute the cgi, the $php_errormsg variable is always empty, even when there are errors. Any ideas? I'd probably scratch that approach and use set_error_handler() instead. You could even get fancy and create a class that uses it so your code could be something like: ?php phpErrorHandler::start(); // some code that causes errors... phpErrorHander::stop(); ? Although i see this more as a developement tool than production solution. Curt Thanks for the reply Curt. You are right that this is not a production solution, but in fact i need to store the warnings somewhere because the server I have access to has warnings disable, and i need to track the messages to find which xml documents are malformed and failed to parse. I´ll try this. Mariano. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.1/169 - Release Date: 15/11/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Catch warnings
Hi, i´m writting a php program that parses and saves some xml files on a server. The problem is that i want to catch warnings so as to be able to store them in a variable, but not to be put directly on client´s browser. I got the following code, but i cannot get it working: // $old_track = ini_set('track_errors', '1'); if ([EMAIL PROTECTED]()) { echo $php_errormsg, \n; } ini_set('track_errors', $old_track); // When i execute the cgi, the $php_errormsg variable is always empty, even when there are errors. Any ideas? Thanks in advance, Mariano Guadagnini -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.1/169 - Release Date: 15/11/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php