reference/mysqlnd/plugin.xml
2e8ef0a1bd98243cb2c6c5c627a195bb53a7a440
...
...
@@ -251,7 +251,7 @@
251
251
</para>
252
252
<para>
253
253
<literal>Mysqlnd</literal> plugins work on top of the C API, which
254
-
mirrors the <literal>libmysqlclient</literal> client and Connector/C APIs.
254
+
mirrors the <literal>libmysqlclient</literal> client.
255
255
This C API is basically a wrapper around the MySQL Client Server
256
256
protocol, or wire protocol, as it is sometimes called. You can
257
257
intercept all C API calls. PHP makes use of the C API, therefore you
...
...
@@ -282,43 +282,6 @@
282
282
source snapshot downloads.
283
283
</para>
284
284
<para>
285
-
The following table shows PHP versions and the corresponding
286
-
<literal>mysqlnd</literal> version contained within.
287
-
</para>
288
-
<table>
289
-
<title>The bundled mysqlnd version per PHP release</title>
290
-
<tgroup cols="2">
291
-
<thead>
292
-
<row>
293
-
<entry>PHP Version</entry>
294
-
<entry>MySQL Native Driver version</entry>
295
-
</row>
296
-
</thead>
297
-
<tbody>
298
-
<row>
299
-
<entry>5.3.0</entry>
300
-
<entry>5.0.5</entry>
301
-
</row>
302
-
<row>
303
-
<entry>5.3.1</entry>
304
-
<entry>5.0.5</entry>
305
-
</row>
306
-
<row>
307
-
<entry>5.3.2</entry>
308
-
<entry>5.0.7</entry>
309
-
</row>
310
-
<row>
311
-
<entry>5.3.3</entry>
312
-
<entry>5.0.7</entry>
313
-
</row>
314
-
<row>
315
-
<entry>5.3.4</entry>
316
-
<entry>5.0.7</entry>
317
-
</row>
318
-
</tbody>
319
-
</tgroup>
320
-
</table>
321
-
<para>
322
285
Plugin developers can determine the <literal>mysqlnd</literal>
323
286
version through accessing <literal>MYSQLND_VERSION</literal>, which
324
287
is a string of the format <quote>mysqlnd 5.0.7-dev - 091210 -
...
...
@@ -326,7 +289,7 @@
326
289
<literal>MYSQLND_VERSION_ID</literal>, which is an integer such as
327
290
50007. Developers can calculate the version number as follows:
328
291
</para>
329
-
<table>
292
+
<table xml:id="mysqlnd.plugin.version-id">
330
293
<title>MYSQLND_VERSION_ID calculation table</title>
331
294
<tgroup cols="2">
332
295
<thead>
...
...
@@ -377,14 +340,16 @@
377
340
know a little of how <literal>mysqlnd</literal> itself is organized.
378
341
<literal>Mysqlnd</literal> consists of the following modules:
379
342
</para>
380
-
<table>
343
+
<table xml:id="mysqlnd.plugin.orgchart">
381
344
<title>The mysqlnd organization chart, per module</title>
382
345
<tgroup cols="2">
383
-
<tbody>
346
+
<thead>
384
347
<row>
385
348
<entry>Modules Statistics</entry>
386
349
<entry>mysqlnd_statistics.c</entry>
387
350
</row>
351
+
</thead>
352
+
<tbody>
388
353
<row>
389
354
<entry>Connection</entry>
390
355
<entry>mysqlnd.c</entry>
...
...
@@ -413,7 +378,7 @@
413
378
</tgroup>
414
379
</table>
415
380
<para>
416
-
<emphasis role="bold">C Object Oriented Paradigm</emphasis>
381
+
<emphasis role="bold">C Object-Oriented Paradigm</emphasis>
417
382
</para>
418
383
<para>
419
384
At the code level, <literal>mysqlnd</literal> uses a C pattern for
...
...
@@ -426,7 +391,7 @@
426
391
</para>
427
392
<para>
428
393
Unlike with other languages such as C++ or Java, there are no fixed
429
-
rules on inheritance in the C object oriented paradigm. However,
394
+
rules on inheritance in the C object-oriented paradigm. However,
430
395
there are some conventions that need to be followed that will be
431
396
discussed later.
432
397
</para>
...
...
@@ -564,14 +529,16 @@ MYSQLND_METHOD(my_conn_class, query)(MYSQLND *conn,
564
529
The following table shows how to calculate the position of the
565
530
pointer for a specific plugin:
566
531
</para>
567
-
<table>
532
+
<table xml:id="mysqlnd.plugin.pointercalc">
568
533
<title>Pointer calculations for mysqlnd</title>
569
534
<tgroup cols="2">
570
-
<tbody>
535
+
<thead>
571
536
<row>
572
537
<entry>Memory address</entry>
573
538
<entry>Contents</entry>
574
539
</row>
540
+
</thead>
541
+
<tbody>
575
542
<row>
576
543
<entry>0</entry>
577
544
<entry>Beginning of the mysqlnd object C struct</entry>
...
...
@@ -633,16 +600,18 @@ static MY_CONN_PROPERTIES** get_conn_properties(const MYSQLND *conn TSRMLS_DC) {
633
600
allocator has some useful features, such as the ability to use a
634
601
debug allocator in a non-debug build.
635
602
</para>
636
-
<table>
603
+
<table xml:id="mysqlnd.plugin.subclass">
637
604
<title>When and how to subclass</title>
638
605
<tgroup cols="4">
639
-
<tbody>
606
+
<thead>
640
607
<row>
641
608
<entry></entry>
642
609
<entry>When to subclass?</entry>
643
610
<entry>Each instance has its own private function table?</entry>
644
611
<entry>How to subclass?</entry>
645
612
</row>
613
+
</thead>
614
+
<tbody>
646
615
<row>
647
616
<entry>Connection (MYSQLND)</entry>
648
617
<entry>MINIT</entry>
...
...
@@ -706,16 +675,18 @@ static MY_CONN_PROPERTIES** get_conn_properties(const MYSQLND *conn TSRMLS_DC) {
706
675
The advantage of the shared function table approach is performance.
707
676
There is no need to copy a function table for each and every object.
708
677
</para>
709
-
<table>
678
+
<table xml:id="mysqlnd.plugin.constatus">
710
679
<title>Constructor status</title>
711
680
<tgroup cols="4">
712
-
<tbody>
681
+
<thead>
713
682
<row>
714
-
<entry></entry>
683
+
<entry>Type</entry>
715
684
<entry>Allocation, construction, reset</entry>
716
685
<entry>Can be modified?</entry>
717
686
<entry>Caller</entry>
718
687
</row>
688
+
</thead>
689
+
<tbody>
719
690
<row>
720
691
<entry>Connection (MYSQLND)</entry>
721
692
<entry>mysqlnd_init()</entry>
...
...
@@ -815,15 +786,17 @@ static MY_CONN_PROPERTIES** get_conn_properties(const MYSQLND *conn TSRMLS_DC) {
815
786
function tables of objects with non-shared object tables, such as
816
787
Resultset, Network, Wire Protocol.
817
788
</para>
818
-
<table>
789
+
<table xml:id="mysqlnd.plugin.deststatus">
819
790
<title>Destruction status</title>
820
791
<tgroup cols="3">
821
-
<tbody>
792
+
<thead>
822
793
<row>
823
-
<entry></entry>
794
+
<entry>Type</entry>
824
795
<entry>Derived method must call parent?</entry>
825
796
<entry>Destructor</entry>
826
797
</row>
798
+
</thead>
799
+
<tbody>
827
800
<row>
828
801
<entry>Connection</entry>
829
802
<entry>yes, after method execution</entry>
...
...
@@ -876,16 +849,6 @@ static MY_CONN_PROPERTIES** get_conn_properties(const MYSQLND *conn TSRMLS_DC) {
876
849
free your memory and call the parent implementation immediately
877
850
following this.
878
851
</para>
879
-
<caution>
880
-
<para>
881
-
Due to a bug in PHP versions 5.3.0 to 5.3.3, plugins do not
882
-
associate plugin data with a persistent connection. This is because
883
-
<literal>ext/mysql</literal> and <literal>ext/mysqli</literal> do
884
-
not trigger all the necessary <literal>mysqlnd</literal>
885
-
<literal>end_psession()</literal> method calls and the plugin may
886
-
therefore leak memory. This has been fixed in PHP 5.3.4.
887
-
</para>
888
-
</caution>
889
852
</section>
890
853
<section xml:id="mysqlnd.plugin.api">
891
854
<title>The mysqlnd plugin API</title>
...
...
@@ -1014,15 +977,17 @@ static MY_CONN_PROPERTIES** get_conn_properties(const MYSQLND *conn TSRMLS_DC) {
1014
977
always call the parent method. The plugins should always cooperate
1015
978
with <literal>mysqlnd</literal> itself.
1016
979
</para>
1017
-
<table>
980
+
<table xml:id="mysqlnd.plugin.chaining">
1018
981
<title>Issues: an example of chaining and cooperation</title>
1019
982
<tgroup cols="3">
1020
-
<tbody>
983
+
<thead>
1021
984
<row>
1022
985
<entry>Extension</entry>
1023
986
<entry>mysqlnd.query() pointer</entry>
1024
987
<entry>call stack if calling parent</entry>
1025
988
</row>
989
+
</thead>
990
+
<tbody>
1026
991
<row>
1027
992
<entry>ext/mysqlnd</entry>
1028
993
<entry>mysqlnd.query()</entry>
1029
994