Package org.eclipse.php.internal.server.core.tunneling

Examples of org.eclipse.php.internal.server.core.tunneling.SSHTunnel


    // then create the start and stop debug URLs
    String[] startStopURLs;
    String baseURL = new String(configuration.getAttribute(Server.BASE_URL,
        "").getBytes()); //$NON-NLS-1$
    IDBGpDebugTarget target = null;
    SSHTunnel tunnel = null;

    if (mode.equals(ILaunchManager.DEBUG_MODE)) {
      String sessionId = DBGpSessionHandler.getInstance()
          .generateSessionId();
      String ideKey = null;
      if (DBGpProxyHandler.instance.useProxy()) {
        ideKey = DBGpProxyHandler.instance.getCurrentIdeKey();
        if (DBGpProxyHandler.instance.registerWithProxy() == false) {
          displayErrorMessage(PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_2
              + DBGpProxyHandler.instance.getErrorMsg());
          DebugPlugin.getDefault().getLaunchManager()
              .removeLaunch(launch);
          return;
        }
      } else {
        ideKey = DBGpSessionHandler.getInstance().getIDEKey();
      }
      startStopURLs = generateStartStopDebugURLs(baseURL, sessionId,
          ideKey);
      String launchScript = configuration.getAttribute(Server.FILE_NAME,
          (String) null);

      // Check if a tunneled connection is needed and create request for a
      // tunnel if needed.
      tunnel = PHPLaunchUtilities.getSSHTunnel(configuration);

      // determine if we should use the multisession manager or the single
      // session manager
      if (XDebugPreferenceMgr.useMultiSession() == true) {
        target = new DBGpMultiSessionTarget(launch, launchScript,
            startStopURLs[1], ideKey, stopAtFirstLine, browser[0]);
        target.setPathMapper(PathMapperRegistry.getByServer(server));
        launch.addDebugTarget(target); // has to be added now, not
                        // later.
      } else {
        target = new DBGpTarget(launch, launchScript, startStopURLs[1],
            ideKey, stopAtFirstLine, browser[0]);
        target.setPathMapper(PathMapperRegistry.getByServer(server));
      }
      DBGpSessionHandler.getInstance().addSessionListener(
          (IDBGpSessionListener) target);
    } else {
      startStopURLs = new String[] { baseURL, null };
    }
    final String startURL = startStopURLs[0];
    final SSHTunnel sshTunnel = tunnel;

    // load the URL into the appropriate web browser
    IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 30);
    subMonitor.beginTask(
        PHPDebugCoreMessages.XDebug_WebLaunchConfigurationDelegate_3,
        10);

    Display.getDefault().syncExec(new Runnable() {
      public void run() {
        try {
          // establish a secured tunnel connection in case it's
          // defined in the configuration dialog
          if (sshTunnel != null) {
            sshTunnel.connect();
          }
          if (openExternal) {
            browser[0].openURL(new URL(startURL));
          } else {
            DBGpUtils.openInternalBrowserView(startURL);
View Full Code Here


   */
  protected void initiateDebug(ILaunch launch) {
    try {
      // Initiate a debug tunnel in case needed.
      if (!ILaunchManager.RUN_MODE.equals(launch.getLaunchMode())) {
        SSHTunnel tunnel = PHPLaunchUtilities.getSSHTunnel(launch
            .getLaunchConfiguration());
        if (tunnel != null) {
          tunnel.connect();
        }
      }
      debuggerInitializer.debug(launch);
    } catch (DebugException e) {
      IStatus status = e.getStatus();
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.server.core.tunneling.SSHTunnel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.