Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

PHP date question

Name: NWS 2007-06-18 2:40 ID:PlS1wRw+

Ok I can echo "Hello World!" but the problem is that after 30 minutes it should only echo "Hello you loser!"
How do I do this?

Name: Anonymous 2007-06-19 16:13 ID:/TFcm5h9

>>6
THAT'S NOT ENTERPRISE ENOUGH.

An EXPERT ENTERPRISE PROGRAMMER should be always ready to implement scalable dynamic solutions for mission-critical business applications.

<?php

  class Message {
    private $message;
    public function __construct($msg = '') {
      $this->message = $msg;
    }
    public function display() {
      echo $this->message;
    }
  }

  class MessageFatal extends Message {
    public function display() {
      parent::display();
      die;
    }
  }

  class MessageFactory {
    static public function produce($msg, $fatal = false) {
      return $fatal ? new MessageFatal($msg)
                    : new Message($msg);
    }
  }

  interface IGenericConfigurationProvider {
    public function getValue($name);
  }

  class XMLConfig implements IGenericConfigurationProvider {
    private $data;
    public function __construct($filename = 'config.xml') {
      $this->data = simplexml_load_file("config.xml");
    }
    public function getValue($name) {
      return $this->data[$name];
    }
  }

  $config = new XMLConfig(); // Todo: OracleDBConfig, of course.
  $messages = array (
    'fine' => MessageFactory::produce($config->getValue('string1'), false),
    'error' => MessageFactory::produce($config->getValue('string2'), true),
  );

  $what = 'fine';
  $messages = array (
    'fine' => MessageFactory::produce($config->getValue('string1'), false),
    'error' => MessageFactory::produce($config->getValue('string2'), true),
  );

  $what = 'fine'; // TODO: use constants.
  if (isset($_COOKIE['time'])) {
    if (time() < ($_COOKIE['time'] + $config->getValue('secondsInMinute') *
                                     $config->getValue('minutesUntilChange'))) {
      $what = 'error';
    }
  } else {
    setcookie('time', time());
  }
  $messages[$what]->display();

?>


But, of course, this should be rewritten in Java.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List