Foo - How to take the rust of your PHP programming skills?

Bikeforums.net is a forum about nothing but bikes. Our community can help you find information about hard-to-find and localized information like bicycle tours, specialties like where in your area to have your recumbent bike serviced, or what are the best bicycle tires and seats for the activities you use your bike for.
I'll be working on a PHP gig in a couple of weeks and I want to start practicing now as my PHP-fu is very rusty. Last time I had a test server with Linux/Apache/MySql... but now I'm stuck with just a Win7 box.
How can I convert this Win7 box into a PHP Testing Facility?
StupidlyBrave
06-17-12, 09:33 PM
Dual boot centos
Artkansas
06-17-12, 09:33 PM
I'll be working on a PHP gig in a couple of weeks and I want to start practicing now as my PHP-fu is very rusty. Last time I had a test server with Linux/Apache/MySql... but now I'm stuck with just a Win7 box.
How can I convert this Win7 box into a PHP Testing Facility?
Why not just get a cheap website with php capability.
wphamilton
06-17-12, 09:46 PM
wamp is a LAMP stack for windows including apache and mysql.
wamp is a LAMP stack for windows including apache and mysql.
Yes Yes!
*imagine Rube like the pantene commercial*
This is it! I got the wamp package for win7 that comes with:
- WAMPServer 64 bits
- PHP 5.3.13
- Apache 2.2.22
- MySQL 5.5.24
- XDebug 2.1.2
- XDC 1.5
- PhpMyadmin 3.4.10.1
- SQLBuddy 1.3.3
- webGrid 1.0
It installed all the stuff in one click without having to read all the darn HowTOs of every single component. SWEET!
And to add some more happiness, I also installed Notepad++ and set it to open all the ".php" files. I'm back in business!
PS: Now if I could just get curl to work on this thing... :\
Koobazaur
06-17-12, 11:59 PM
Yep, there's windows versions of apache, php and mysql, I turned my laptop into a web server so I could test code locally.
Well.. it was fun for a while there, trying to figure out why the curl library was not working. Turns out that the 64 version of wamp has the curl broken. Uninstalled 64, installed 32 and is now working.
now I'm writing an xml parser to properly display my data. :D
Artkansas
06-18-12, 12:38 PM
now I'm writing an xml parser to properly display my data. :D
Watch out, around here you could get in trouble for improper display of data. ;)
http://por-img.cimcontent.net/api/assets/bin-201205/ff93a22d4379ccb9802ffce6cd0c9886.jpg
bigbenaugust
06-18-12, 12:42 PM
centos in a virtual machine of our choice.
Or use a wire wheel on your Dremel tool... that'll derustify anything.
wphamilton
06-18-12, 01:02 PM
now I'm writing an xml parser to properly display my data. :D
Not really fun imho, but may I suggest "cheating" with xsl transform (enable extension=php_xsl.dll in php.ini)
Not really fun imho, but may I suggest "cheating" with xsl transform (enable extension=php_xsl.dll in php.ini)
So that's where they hide the xml parser now? Sneaky smarty pants! They couldn't call it php_xml.dll oh no. Too bad I read this after the 25th nested if statement (very complicated/obfuscated xml data here)... but the way it's looking, it could get to the 400th nested if's... I guess I owe Mr Hamilton a beer. :thumb:
wphamilton
06-18-12, 01:49 PM
Well, I think it's extension=php_xmlrpc.dll to enable the xml, and the other is for the transform which is an alternative to parsing the dom object. http://w3schools.com/xsl/xsl_transformation.asp
You might wait on the beer, considering how much of a headache this can be.
Well, I think it's extension=php_xmlrpc.dll to enable the xml, and the other is for the transform which is an alternative to parsing the dom object. http://w3schools.com/xsl/xsl_transformation.asp
You might wait on the beer, considering how much of a headache this can be.
Nah... the beer goes... it's not gonna be easy but still beats debugging a missing coma in 400 nested if's statements. ATM I'm reading a huge lists of "orders" of a remote server. The XML I get looks kinda like this:
------------example-------------------
<?xml version='1.0' encoding='UTF-8'?>
<blah blah version x>
<currentTime>2012-06-18 19:57:08</currentTime>
<result>
<rowset name="orders" key="orderID" columns="orderID,clientID,locationID,volEntered,volRemaining,minVolume,orderState,typeID,accountID">
<row orderID="1234" clientID="111" locationID="222" volEntered="10000" volRemaining="10000" minVolume="1" orderState="0" typeID="333" accountID="555" />
...
-repeat a gazilion time-
...
</rowset>
</result>
------------end example------------------
I was in the middle of splitting each column item on it's "=" character when I decided to take your suggestion and cheat (libraries are there for a reason).
But this is just the start. There's gonna be another XML from which I'm gonna get the client's actual address using the clientID. Then yet another XML to get the warehouse addr from the locationID... Then I need to use another site to get estimated travel times between all the addresses... then do some research as per what algorithm could give me an optimized route (TSP, Floyd-Warshall, Breadth-First, Branch, Bound, tinfoil?)...
I'm starting to understand why the logistics guy at the office was the only guy authorized to have his own coffee machine right there in his cubicle (not to mention the 6 figures salary).
Good thing this wamp package had mysql too... I'm gonna need it.
wphamilton
06-18-12, 02:43 PM
... Then I need to use another site to get estimated travel times between all the addresses... then do some research as per what algorithm could give me an optimized route (TSP, Floyd-Warshall, Breadth-First, Branch, Bound, tinfoil?)...
Dijkstra's algorithm. Processing is linear with respect to number of nodes.
Take care not to accidentally degrade it to the simple "greedy" path algorithm, which is unfortunately cited (incorrectly) in many textbooks.
Dijkstra's algorithm. Processing is linear with respect to number of nodes.
Take care not to accidentally degrade it to the simple "greedy" path algorithm, which is unfortunately cited (incorrectly) in many textbooks.
Make that 2 beers. And if I succeed on this project, please write my name down in case you ever need an assistant padawan... :D
UmneyDurak
06-18-12, 09:50 PM
I would just use parser and lexer generators hack some grammar together, and call it good. Up front it's a bit more work, but more maintainable that bunch of nested if statements.
- Lost a whole day troubleshooting mysql... turns out the wamp-included version of mysql doesn't like running off a raid array...
- Lost quite a few hours troubleshooting phpmyadmin... aparently it sucks for importing *BIG* data dumps... lucky for me, I found some old notes about the "source" command...
- I had a beer (well, more than one) trying to understand why the dev b4 me put warehouse names on one table, warehouse size on another table, warehouse street number on yet another table, street name on yet another....
- Had another beer while looking at the output flowing, converting mindless id numbers into meaningful human-readable data..."Orlando Warehouse, 4 million sqr ft, 123 main st, orange county, 6 employees, 7am-5pm, mon-fri"...oh the beauty!
My PHP pages are getting quite messy... time to start doing some objectification/librarization over here...and I have the right t-shirt for the job:
http://www.ministryu.org/wp-content/uploads/eschew_obfuscation_tshirt.jpg
:D Coding makes me happy (when it works)
ahsposo
06-19-12, 06:41 AM
Are you running the Hotmail servers this morning by chance?
They're all messed up.
Are you running the Hotmail servers this morning by chance?
They're all messed up.
I have nothing to do with neither micro$oft or the omnigoogle. HTFU, read the 5k pages long sendmail conf manual and set up ur own.
^ This RubenProject TM will leave the kitchen table much cleaner.
^ This RubenProject TM will leave the kitchen table much cleaner.
...Fathers of the code, forgive them, for they do not know what they are saying...
*Rube looks around*
- Pizza paraphernalia, check
- Red Bull cans, check
- Soda cans, check
- Lots of post it notes, check
- Multiple books opened, check
- Several scrap pads with more handwritten notes, check
- A collection of writing instruments (pens, sharpies, colored sharpies, pencils), check
jfmckenna
06-19-12, 02:50 PM
I wouldn't run Apache/mySQL/PHP on Windows. You can just as easily build a Linux OS in a VM.
Powered by vBulletin® Version 4.1.12 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.