[ Team LiB ] Previous Section Next Section

Workshop

Quiz

1:

From the Unix command line, how would you install an imaginary PEAR package called MyPack?

2:

Which method of the Auth class would you use to commence authentication?

3:

What is the name of the PEAR object that some methods we have encountered return to indicate a problem with execution?

4:

Which tag would you use in a PhpDocumentor comment to describe an argument to a method?

5:

Which flag would you pass to the phpdoc command-line script to ensure that private methods and properties are documented?

6:

A tree of configuration objects in the Config packages will all be of the same type. What is the name of the class from which they will all be instantiated?

7:

The PEAR style guide recommends that you should drop parentheses from control structures where it is legal to do so. True or false?


Answers

A1:

To install a package called MyPack using the command line, you would use pear install as follows:

pear install MyPack

A2:

The Auth::start() method is used to commence authentication with the Auth package.

A3:

The PEAR_Error object is often returned by a PEAR method when an error occurs.

A4:

The @param tag is used to document method arguments.

A5:

You would pass the flag -pp to phpdoc to ensure that private elements are documented, like so:

phpdoc -s from -pp on -t target

A6:

The Config package builds trees of Config_Container objects.

A7:

The PEAR style guide recommends that you include parentheses in control structures, even when you don't strictly have to.


    [ Team LiB ] Previous Section Next Section