示例#1
0
<?php

require_once 'Jm/Autoloader.php';
Jm_Autoloader::singleton()->prependPath('lib/php');
$console = Jm_Console::singleton();
$console->write('hello', 'black,bg:yellow');
$console->write(' ');
$console->writeln('world', 'black,bg:red');
示例#2
0
 /**
  * Use it to get a reference of the singleton object. Usually the 
  * singleton object will be created the first time the autoloader is 
  * triggered by Zend. When you call this method before that the singleton
  * object will be created.
  *
  * @return Jm_Autoloader
  */
 public static function singleton()
 {
     if (!self::$instance) {
         self::$instance = new Jm_Autoloader();
     }
     return self::$instance;
 }