* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
interface OutputStreamer extends Streamable {
- /**
- * Assigns a variable for output
- *
- * @param $var The variable we shall assign
- * @param $value The value to store in the variable
- * @return void
- */
- function assignVariable ($var, $value);
-
/**
* Output the code
*
printf("%s\n", $output);
}
- /**
- * Assigns a variable for output
- *
- * @param $var The variable we shall assign
- * @param $value The value to store in the variable
- * @return void
- */
- public final function assignVariable ($var, $value) {
- // Empty stub!
- trigger_error(__METHOD__.": Stub!");
- }
-
/**
* Output the code
*
}
}
- /**
- * Assigns a variable for output
- *
- * @param $var The variable we shall assign
- * @param $value The value to store in the variable
- * @return void
- */
- public final function assignVariable ($var, $value) {
- // Empty stub!
- trigger_error(__METHOD__.": Stub!");
- }
-
/**
* Output the code
*
print(stripslashes($output)."<br />\n");
}
- /**
- * Assigns a variable for output
- *
- * @param $var The variable we shall assign
- * @param $value The value to store in the variable
- * @return void
- */
- public final function assignVariable ($var, $value) {
- // Empty stub!
- trigger_error(__METHOD__.": Stub!");
- }
-
/**
* Output the code
*
*/
private static $consoleInstance = null;
- /**
- * Assigned variables
- */
- private $vars = array();
-
/**
* Protected constructor
*
* @return void
*/
public final function output ($outStream = false) {
- if ($outStream === false) {
- // Output something here...
- foreach ($this->vars as $var => $value) {
- $this->output("var=".$var.", value=".$value.'');
- }
- } else {
- // Output it to the console
- printf("%s\n", trim(html_entity_decode(strip_tags(stripslashes($outStream)))));
- }
- }
-
- /**
- * Assigns a variable for output
- *
- * @param $var The variable we shall assign
- * @param $value The value to store in the variable
- * @return void
- */
- public function assignVariable ($var, $value) {
- $this->vars[$var] = $value;
+ print trim($outStream) . "\n";
}
}