PageRenderTime 53ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/src/org/numiton/nwp/wp_includes/Wp_dbPage.java

https://github.com/rohans/tradeinbooks
Java | 109 lines | 46 code | 21 blank | 42 comment | 2 complexity | 7bd53da27baa26f187882d3fa8696119 MD5 | raw file
  1. /**********************************************************************************
  2. * nWordPress is an automated migration of WordPress 2.5.1 performed by Numiton.
  3. *
  4. * copyright : (C) 2008 Numiton - www.numiton.com
  5. * email : numiton@users.sourceforge.net
  6. *
  7. * $Id: Wp_dbPage.java,v 1.3 2008/10/14 13:15:49 numiton Exp $
  8. *
  9. **********************************************************************************/
  10. /**********************************************************************************
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 2 of the License, or
  15. * (at your option) any later version.
  16. *
  17. **********************************************************************************/
  18. /***************************************************************************
  19. *
  20. * This program is free software; you can redistribute it and/or modify
  21. * it under the terms of the GNU General Public License as published by
  22. * the Free Software Foundation; either version 2 of the License, or
  23. * (at your option) any later version.
  24. *
  25. ***************************************************************************/
  26. package org.numiton.nwp.wp_includes;
  27. import static com.numiton.VarHandling.isset;
  28. import static com.numiton.generic.PhpWeb.DEFAULT_VAL;
  29. import java.io.IOException;
  30. import javax.servlet.ServletException;
  31. import javax.servlet.http.HttpServletRequest;
  32. import javax.servlet.http.HttpServletResponse;
  33. import org.apache.log4j.Logger;
  34. import org.numiton.nwp.NumitonController;
  35. import org.springframework.context.annotation.Scope;
  36. import org.springframework.stereotype.Controller;
  37. import org.springframework.web.bind.annotation.RequestMapping;
  38. import org.springframework.web.servlet.ModelAndView;
  39. import com.numiton.generic.PhpWebEnvironment;
  40. @Controller
  41. @Scope("request")
  42. public class Wp_dbPage extends NumitonController {
  43. protected static final Logger LOG = Logger.getLogger(Wp_dbPage.class.getName());
  44. @Override
  45. @RequestMapping("/wp-includes/wp-db.php")
  46. public ModelAndView execute(HttpServletRequest javaRequest, HttpServletResponse javaResponse)
  47. throws IOException {
  48. return super.execute(javaRequest, javaResponse);
  49. }
  50. @Override
  51. public String getViewName() {
  52. return "wp_includes/wp_db";
  53. }
  54. public Object generateContent(PhpWebEnvironment webEnv)
  55. throws IOException, ServletException {
  56. /* Start of block */
  57. super.startBlock("__wp_includes_wp_db_block1");
  58. gVars.webEnv = webEnv;
  59. // WordPress DB Class
  60. // ORIGINAL CODE FROM:
  61. // Justin Vincent (justin@visunet.ie)
  62. // http://php.justinvincent.com
  63. gConsts.setEZSQL_VERSION("WP1.25");
  64. /*
  65. * Case insensitive constants are not supported, ignoring flag: 503430
  66. */
  67. gConsts.setOBJECT("OBJECT");
  68. /*
  69. * Case insensitive constants are not supported, ignoring flag: 503440
  70. */
  71. gConsts.setOBJECT_K("OBJECT_K");
  72. /*
  73. * Case insensitive constants are not supported, ignoring flag: 503450
  74. */
  75. gConsts.setARRAY_A("ARRAY_A");
  76. /*
  77. * Case insensitive constants are not supported, ignoring flag: 503460
  78. */
  79. gConsts.setARRAY_N("ARRAY_N");
  80. if (!gConsts.isSAVEQUERIESDefined()) {
  81. gConsts.setSAVEQUERIES(false);
  82. }
  83. if (!isset(gVars.wpdb)) {
  84. gVars.wpdb = new wpdb(gVars, gConsts, gConsts.getDB_USER(), gConsts.getDB_PASSWORD(), gConsts.getDB_NAME(), gConsts.getDB_HOST());
  85. }
  86. return DEFAULT_VAL;
  87. }
  88. }