-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathnamespaces.html
42 lines (38 loc) · 2.04 KB
/
namespaces.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
layout: default
navPage: docs
heading: Namespaces
breadcrumbs:
- API,/api/
- API v1.x,/api/v1
- Namespaces
prev: API Error Codes,/api/error_codes/
next: API Sessions,/api/sessions/
versions: FT2
categories: api
tags: developer
---
{% include open_section.html nav='nav_api_v1.html' selected='namespaces' nav_width=5 %}
<p>
Form Tools conscientiously namespaces all data to reduce the likelihood of conflict with
other scripts that are running. Namespacing is done on every level of the script:
database tables, main script sessions, API script sessions, API script function names, main script
function names (JS and PHP), special form fields. Truth is, I've been burned so many times by <b>other</b>
scripts not namespacing themselves properly, I got pretty sick of it!
</p>
<ul>
<li>All API functions begin with the <b>ft_api_</b> prefix.</li>
<li>For the form processing / management functions, the API stores all sessions in the
<b>$_SESSION["form_tools_form"]</b> key, but this can be changed if you're concerned about a conflict.
Just see the <a href="{{site.baseurl}}/api/ft_api_init_form_page/">ft_api_init_form_page</a> function for
information on how to set the session namespace. If you change it there, it will be reflected in all
subsequent API functions (i.e. you'll need to pass your custom namespace to those as well)</li>
<li>Form fields that have special meaning to Form Tools all have a <b>form_tools_</b> prefix, e.g.
form_tools_initialize_form, form_tools_redirect_url, form_tools_form_id, form_tools_ignore_submission</li>
<li>All main script functions have a <b>ft_</b> prefix.</li>
<li>The main script javascript files each have a namespace particular to the file. e.g. manage_submissions.js
stores all the functions wrapped in an ms_ns object, with the functions defined as object attributes.</li>
<li>The database tables all have a namespace specified by the user during the installation script. This is
defined in <b>$g_table_prefix</b> in your config.php file.</li>
</ul>
{% include close_section.html %}