migrating.html 6.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {
  2. title: 'Migrating to GoAhead 3',
  3. crumbs: [
  4. { "Developer's Guide": '../developers/' },
  5. ],
  6. }
  7. <h1>Migrating to GoAhead 3</h1>
  8. <p>GoAhead 3 is a major upgrade from GoAhead 2. It incorporates new features and upgrades
  9. to existing capabilities. It also changes many APIs and interfaces.</p>
  10. <a id="compatibility"></a>
  11. <h2 >Compatibility with GoAhead 3</h2>
  12. <p>We make every effort to preserve compatibility, but with GoAhead 3, we needed to make some important
  13. improvements that necessitated breaking compatibility with GoAhead 2. Rather than make several ongoing
  14. compatibility breaks we decided to make all the changes in one release. In this way we can ensure
  15. that GoAhead 3 quickly becomes a stable platform going forward. Please see our <a href=
  16. "../ref/compatibility.html">Compatibility Policy</a>.</p>
  17. <a name="legacy"></a>
  18. <h3>Legacy Support</h3>
  19. <p>To aid migrating existing GoAhead 2.X applications, GoAhead 3.X can be built to support the old
  20. GoAhead 2.X APIs. This is called legacy mode. In this mode, the old APIs are mapped to new APIs via
  21. compiler defines and shim APIs. For full details of the API mappings, see the ME_GOAHEAD_LEGACY
  22. section in src/goahead.h.</p>
  23. <p>GoAhead 3.X is built by default without legacy mode. You can enable legacy mode by configuring via:
  24. <pre class="ui code segment">configure --set goahead.legacy=true</pre>
  25. or if building via make:
  26. <pre class="ui code segment">make ME_GOAHEAD_LEGACY=1</pre>
  27. <p>This will enable the legacy APIs and type names. However, You are <span class="warn">strongly
  28. encouraged to fully migrate your application to the GoAhead 3.X APIs</span>
  29. and to transition off the old GoAhead 2.X APIs. Note: GoAhead 2 is now officially "end-of-life".</p>
  30. <a id="changes"></a>
  31. <h2 >Changes in GoAhead 3</h2>
  32. <p>GoAhead 3 provides equivalent or greater functionality to that in GoAhead 2.
  33. While GoAhead 3 may have a different interface or API, the capabilities of GoAhead 2 have been continued
  34. in GoAhead 3, and in many cases, the features have been enhanced.</p>
  35. <h3>New Capabilities</h3>
  36. <p>The following new capabilities have been added to GoAhead 3 for which there is no equivalent in GoAhead 2.
  37. These additions should not require adjustment for applications developed under GoAhead 2.</p>
  38. <ul>
  39. <li>HTTP 1.1 chunking</li>
  40. <li>IPv6</li>
  41. <li>PUT, DELETE, OPTIONS and TRACE HTTP methods</li>
  42. <li>Request routing</li>
  43. <li>New web form-based authentication</li>
  44. <li>Session state storage</li>
  45. <li>New User/Role/Ability authorization framework</li>
  46. <li>Extended security sandbox limits</li>
  47. <li>Flexible request tracing and logging</li>
  48. </ul>
  49. <h3>Changed Capabilities</h3>
  50. <p>The following capabilities have been changed and may impact your GoAhead 3 applications.</p>
  51. <ul>
  52. <li>The GoAhead 2.X User Management authentication has been upgrade to the User/Role/Ability framework</li>
  53. <li>The EMF database has been removed. The new authentication framework does not utilize it.</li>
  54. <li>The GoForm facility has been upgrade to the GoAction handler. The calling sequence for GoForms has
  55. been modified and simplified.</li>
  56. <li>POST request form data is only stored in the query field of the Webs structure if
  57. <a href="#legacy">Legacy</a> mode is enabled. Without legacy mode, query data and
  58. form body data are stored separately. Form data is stored in the 'input' field of the Webs structure.
  59. Code that accesses wp-&gt;query for GoForms will need to be modified.
  60. In legacy mode, the input is also copied to the wp-&gt;query field.
  61. </li>
  62. <li>Request parameter variables are only created for POST requests if the request Content-Type is set to
  63. application/x-www-form-urlencoded.</li>
  64. <li>The build system is upgraded and simplified. It now uses the MakeMe build system.
  65. New configure options and cross compiling capabilities have been added.</li>
  66. <li>In GoAhead 2, the websHeader routine was used to write a fixes set of HTTP response headers. This was
  67. inflexible and did not permit easy custom modification of headers. GoAhead 3 supports user-definable
  68. response headers via the new API
  69. <a href="../ref/api/goahead.html#group___webs_1ga506c041a3eb2dfeaab1e9d1f322eea0b">websWriteHeader</a>. Consequently,
  70. the websHeader and websFooter APIs are removed.</li>
  71. </ul>
  72. <h3>Changed APIs</h3>
  73. <p>The internal APIs in GoAhead 3 have been upgraded. Some have been renamed and others modified.
  74. GoAhead 3 APIs have been renamed/converted on a function by function
  75. basis to equivalent APIs in GoAhead 2. Often, the APIs have very similar names to the previous counterpart.</p>
  76. <p>Here is a partial list of changed APIs in GoAhead 3.X:
  77. <ul>
  78. <li>balloc memory allocation routines renamed to walloc</li>
  79. <li>g*() string routines mapped back to standard C library and Posix routines</li>
  80. <li>hAlloc*() handle allocation routines mapped to wallocHandle</li>
  81. <li>ASP renamed to JSP and websAsp* renamed to websJst*</li>
  82. <li>GoForms renamed to Actions, /goforms renamed to /action</li>
  83. <li>ringq*() renamed to buf*</li>
  84. <li>sym*() renamed to hash*</li>
  85. </ul>
  86. <p>For a complete list, see the ME_GOAHEAD_LEGACY section at the end of goahead.h for a list of all the API name
  87. mappings. It is strongly recommended that you refactor your application to use the new API naming.</p>
  88. <h3>Routes</h3>
  89. <p>GoAhead 3 uses a flexible URI routing mechanism to direct client requests to the appropriate handler.
  90. In GoAhead 2, this was done by hard-coded handlers. The routing framework is controlled by the route.txt
  91. configuration file.
  92. The routing framework has more flexibility and allows URI parsing and routing.
  93. <p>See <a href="../users/routing.html">Request Routing</a> for more details.</p>