Search found 82 matches

by Bruno De Barros
Thu Aug 05, 2010 4:55 am
Forum: PHP - Code
Topic: setting semi-permanent variables?
Replies: 6
Views: 1898

Re: setting semi-permanent variables?

Session data is kept on the server, the only thing the user keeps is the session in ID, usually in a cookie. It will expire, but you can set the lifetime to something like a a year or more, then the data will stay there for that period of time. I don't see why you want to avoid databases that much, ...
by Bruno De Barros
Wed Aug 04, 2010 2:41 pm
Forum: PHP - Code
Topic: setting semi-permanent variables?
Replies: 6
Views: 1898

Re: setting semi-permanent variables?

Use sessions if you want the stuff to stay there until the browser is closed. If you want it to stay longer, change the session lifetime. More on this here: http://php.net/manual/en/ref.session.php With sessions, just run session_start() at the beginning of your script, and when a user submits somet...
by Bruno De Barros
Fri Jul 23, 2010 8:45 am
Forum: PHP - Code
Topic: Combinatratics
Replies: 15
Views: 691

Re: Combinatratics

The code looks all messed up, is there any chance you can fix it?
by Bruno De Barros
Thu Jul 22, 2010 5:22 pm
Forum: Testing
Topic: Viewing php files as html files
Replies: 2
Views: 5596

Re: Viewing php files as html files

PHP has to be processed by a PHP server. Yes, you could run a PHP script using the command line and see the resulting HTML, but that's pretty much useless if your script depends on browser data (sessions, cookies, even a simple URL). If you can't access websites made with PHP on a browser, you've go...
by Bruno De Barros
Mon Jul 12, 2010 4:01 pm
Forum: Testing
Topic: Testing the output
Replies: 30
Views: 28967

Re: Testing the output

Tests can't automate everything, obviously, but I find it that if I have a load of pages to manually test, and a load of behaviors to test... Well, I'm bound to forget some of them, especially if I'm trying to finish up a project and the deadline's getting closer. I mean, I've been manually testing ...
by Bruno De Barros
Sun Jul 11, 2010 5:12 pm
Forum: Testing
Topic: TDD Kata
Replies: 3
Views: 7024

Re: TDD Kata

I had heard of this before, I think it's a brilliant way to really get into the TDD way.
by Bruno De Barros
Sun Jul 11, 2010 11:02 am
Forum: Testing
Topic: Testing the output
Replies: 30
Views: 28967

Re: Testing the output

God damn, you guys have gotten way too carried away. :P In my opinion manual testing is always necessary. The less manual testing you have to do the better, of course, since, as McGruff pointed, manual testing can be error-prone. But if I have a template for a form, and I expect it to be filled with...
by Bruno De Barros
Sat Jul 03, 2010 5:27 pm
Forum: Testing
Topic: Testing the output
Replies: 30
Views: 28967

Re: Testing the output

That looks really good, thanks! I'll try it out.
by Bruno De Barros
Fri Jul 02, 2010 5:43 pm
Forum: Testing
Topic: Testing the output
Replies: 30
Views: 28967

Re: Testing the output

Selenium acts human, as far as I've seen. Besides, when testing hundreds of times a day, you can't go check all the pages to make sure they work manually. Sure, you can do it manually now and then, but I like to make sure that if I change a piece of code, it doesn't break anything at all. Not the co...
by Bruno De Barros
Fri Jul 02, 2010 2:09 pm
Forum: Testing
Topic: Testing the output
Replies: 30
Views: 28967

Re: Testing the output

The problem with that would be me having to do it manually. I've been searching a bit, and I might use Selenium, to test that the HTML functionality works as required. Thanks :)
by Bruno De Barros
Fri Jul 02, 2010 9:48 am
Forum: Testing
Topic: Testing the output
Replies: 30
Views: 28967

Re: Testing the output

Thanks Jade :) It's much easier to do that when you have a class and its methods, and you can just call them a bunch of times with a variety of different arguments to try and break them, but when it comes to testing an HTML page it gets harder :P
by Bruno De Barros
Thu Jul 01, 2010 8:48 am
Forum: Testing
Topic: Testing the output
Replies: 30
Views: 28967

Testing the output

I'm currently writing a class to generate a set of management pages (for adding/editing/deleting/managing records of a table), and I was wondering what is the best way to test it. I've got template html files, my class picks them up, fills them up with the necessary data, and outputs them. I want to...
by Bruno De Barros
Mon May 24, 2010 4:58 pm
Forum: PHP - Theory and Design
Topic: Library directory structure
Replies: 9
Views: 3188

Re: Library directory structure

@allspiritsteve, why would you need tests and docs when you're trying to use the code in your application? And especially when you're deploying it, there's no need for them.
I like Zyxist's approach, it's simple and keeps the right things appropriately separated.
by Bruno De Barros
Mon May 24, 2010 4:26 pm
Forum: PHP - Theory and Design
Topic: include() or exec()
Replies: 2
Views: 1097

Re: include() or exec()

The code that outputs the graphic, is it PHP? Because if it is, then I don't see why you'd have to use exec(), as exec() is for executing external programs.
by Bruno De Barros
Tue Apr 13, 2010 6:09 pm
Forum: PHP - Theory and Design
Topic: Update system for PHP script.
Replies: 7
Views: 2372

Re: Update system for PHP script.

If you have root access, sure. Otherwise, use FTP. By the way, don't forget about database updates (if you need to do any). Lately, I've been through this problem with some of the scripts I've deployed for a few clients, and I think I'm just going to develop something to help remotely deploy scripts...