示例#1
0
function getServiceIdDatePair($route_short_name, $service_id, $date)
{
    global $checkRouteAdd;
    // 1 - 1 mapping
    $trip_id = $route_short_name . $service_id . '1';
    global $language;
    // processor
    list($route, $stop_times, $serviceId_date_pair) = RouteFetcher::fetchRouteAndStopTimes($route_short_name, $date, $trip_id, $service_id, $language);
    if ($serviceId_date_pair == null && $route != null && $stop_times != null) {
        // Add already for performance
        // routes.txt
        if (!isset($checkRouteAdd[$route_short_name])) {
            addRoute($route);
            $checkRouteAdd[$route_short_name] = true;
        }
        // trips.txt
        $trip = generateTrip($route_short_name, $service_id, $trip_id);
        addTrip($trip);
        // stop_times.txt
        addStopTimes($stop_times);
    }
    return $serviceId_date_pair;
}
示例#2
0
    addRoute("admin", "portfolio_add_section", "admin", "admin/portfolio_add_section");
    addRoute("admin", "portfolio_edit_section", "admin", "admin/portfolio_edit_section");
    addRoute("admin", "portfolio_add_item", "admin", "admin/portfolio_add_item");
    addRoute("admin", "portfolio_edit", "admin", "admin/portfolio_edit");
    addRoute("admin", "portfolio_list", "admin", "admin/portfolio_list");
    // front-end
    addRoute("portfolio", "thumbnail", "blank", "portfolio/thumbnail");
}
if (PRODUCT_INSTALL) {
    addRoute("admin", "add_product", "admin", "admin/add_product");
    addRoute("admin", "edit_product", "admin", "admin/edit_product");
    addRoute("admin", "list_products", "admin", "admin/list_products");
    addRoute("admin", "edit_paypal", "admin", "admin/edit_paypal");
    addRoute("admin", "list_paypal", "admin", "admin/list_paypal");
    // front-end
    addRoute("images", "prodimg", "blank", "images/prodimg");
    addRoute("images", "prodimgthb", "blank", "images/prodimgthb");
}
if (RSS_INSTALL) {
    // front-end
    addRoute("rss", "index", "blank", "rss");
    addRoute(BLOG_STATIC_AREA, "rss", "blank", "rss");
    addRoute(CALENDAR_STATIC_AREA, "rss", "blank", "rss");
}
if (!defined(TESTIMONIAL_INSTALL)) {
    setConfValue('TESTIMONIAL_INSTALL', false);
}
if (TESTIMONIAL_INSTALL) {
    addRoute("admin", "edit_testimonial", "admin", "admin/edit_testimonial");
    addRoute("admin", "list_testimonials", "admin", "admin/list_testimonials");
}
示例#3
0
    if ($latency !== false) {
        $host = $item;
        break;
    }
}
$route = `route -n`;
$cekRoute = strpos($route, $host);
$pos = strpos($route, "8.8.8.8");
if ($cekRoute === false && $pos !== false) {
    delRoute();
}
$route = `route -n`;
$pos = strpos($route, "8.8.8.8");
if ($host !== false) {
    if ($pos === false) {
        addRoute($host);
        echo date("d-M-Y H:i:s") . " route added {$host}\n";
    } else {
        echo date("d-M-Y H:i:s") . " nothing to do\n";
    }
} else {
    if ($pos !== false) {
        delRoute();
        echo date("d-M-Y H:i:s") . " route deleted\n";
    } else {
        echo date("d-M-Y H:i:s") . " nothing to do\n";
    }
}
function addRoute($host)
{
    exec("route add -net 8.8.8.8 netmask 255.255.255.255 gw {$host}");
示例#4
0
                    $trunkpriority[$key + 1] = $trunkpriority[$key];
                    $trunkpriority[$key] = $temptrunk;
                }
            }
        }
    }
    unset($temptrunk);
    $trunkpriority = array_values($trunkpriority);
    // resequence our numbers
}
$routename = isset($_REQUEST["routename"]) ? $_REQUEST["routename"] : "";
$routepass = isset($_REQUEST["routepass"]) ? $_REQUEST["routepass"] : "";
//if submitting form, update database
switch ($action) {
    case "addroute":
        addRoute($routename, $dialpattern, $trunkpriority, "new", $routepass, $ctisupport, $localcid);
        exec($extenScript);
        needreload();
        $extdisplay = '';
        // resets back to main screen
        $routename = '';
        // resets back to main screen
        $routepass = '';
        // resets back to main screen
        $dialpattern = array();
        $trunkpriority = array();
        break;
    case "editroute":
        editRoute($routename, $dialpattern, $trunkpriority, $routepass, $ctisupport, $localcid);
        exec($extenScript);
        needreload();