protected static function getInstance() { if (self::$_instance === null) { self::$_instance = new Eco_Autoload(); } return self::$_instance; }
<?php if (isset($_POST['flavors']) || isset($_GET['payment'])) { error_reporting(E_ALL, E_STRICT); ini_set("display_errors", 1); $path = get_include_path(); define('ECO', getcwd()); define('DS', DIRECTORY_SEPARATOR); $paths = array(); $paths[] = ECO . DS . 'config'; $paths[] = ECO . DS . 'lib'; set_include_path(implode(PATH_SEPARATOR, $paths) . PATH_SEPARATOR . $path); date_default_timezone_set('America/Los_Angeles'); include_once 'Eco/Autoload.php'; Eco_Autoload::register(); if (isset($_POST['flavors'])) { $searchFlavors = $_POST['flavors']; $obj = new Icecream(); echo json_encode($obj->addScoop($searchFlavors)); } else { if (isset($_GET['payment'])) { $payment = $_GET['payment']; $name = $_GET['name']; $number = $_GET['number']; $obj = new Order(); echo json_encode($obj->checkPayment($payment, $name, $number)); } } }