RU beehive logo ITEC dept promo banner
ITEC 325
2015spring
ibarland

homelectshws
D2Lbreeze (snow day)

running-php-on-rucs
including files
running on rucs: file-protections

splitting into multiple files

We can take blend.php (src), and separate the code from the test-cases: utils.php (src), and separately utils-test.php (src). The directive require-once is a run-time instruction which just goes to the require'd file and (effectively) splices it into the current file, and continues evaluating line-by-line. (So it's reminiscent of java's import, but require-once significantly more simple-minded. Beware trampling on identifiers, and it's poor practice to have any dangling tags / code in the require'd file.)

This also lets us separate a program that uses blend from the test cases: some-web-page.php (src), and some-web-page.php (output). (Can you figure how to fix the errant “\n” on that page?)


Linux Review

You'll want to be familiar with the main options for the following:

Accessing rucs

Before we even revisit the code, let's talk about rucs (“radford university computer science”; it's a machine managed by the ITEC department, not the campus IT division):


Running a php file via the web

Recall that when a web-server gets a request, it decides how to respond. For php.radford.edu, some of the configuration rules:

Let's put our php program on the web!

homelectshws
D2Lbreeze (snow day)


©2014, Ian Barland, Radford University
Last modified 2015.Jan.30 (Fri)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.