pakeApp::get_instance PHP Method

get_instance() public static method

public static get_instance ( ) : pakeApp
return pakeApp
    public static function get_instance()
    {
        if (!self::$instance) {
            self::$instance = new pakeApp();
        }
        return self::$instance;
    }

Usage Example

 public static function package_pear_package($package_xml_path, $target_dir)
 {
     if (!file_exists($package_xml_path)) {
         throw new pakeException('"' . $package_xml_path . '" file does not exist');
     }
     pake_mkdirs($target_dir);
     $current = getcwd();
     chdir($target_dir);
     if (!class_exists('PEAR_Packager')) {
         @(include 'PEAR/Packager.php');
         if (!class_exists('PEAR_Packager')) {
             // falling back to cli-call
             $results = pake_sh(escapeshellarg(pake_which('pear')) . ' package ' . escapeshellarg($package_xml_path));
             if (pakeApp::get_instance()->get_verbose()) {
                 echo $results;
             }
             chdir($current);
             return;
         }
     }
     $packager = new PEAR_Packager();
     $packager->debug = 0;
     // silence output
     $archive = $packager->package($package_xml_path, true);
     pake_echo_action('file+', $target_dir . '/' . $archive);
     chdir($current);
 }
All Usage Examples Of pakeApp::get_instance