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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
+
|
KD2FW (KD2 Framework) is a collection of tools and libraries developed for the KD2.org projects over the years.
KD2FW (KD2 is not FrameWork) is a collection of tools and libraries developed for the KD2.org projects over the years.
<h2>Features:</h2>
## Features:
* Lightweight
* Small
* Fast
* Code is simple and straightforward to read
* Simple API
* Easy to extend and adapt to own needs
* No extra dependency, you don't have to install any other library to use it
* Each component can be used outside the framework, there is no internal dependency
* PHP 5.4+ object code
* PHP 5.6+ object
* Components comes with full documentation, examples and tests
This framework is used for a couple of websites serving millions of web pages each day.
This framework is used for some websites serving millions of web pages each day.
WARNING: there is currently no release cycle of kd2fw, all components are considered stable, and no backward-incompatible changes should be made.
See the [Roadmap] for planned features.
<h2>PHP Components (version 1.0)</h2>
## PHP Components (legacy 5.6 branch)
* [BubbleBabble]: encodes and decodes using the [http://bohwaz.net/archives/web/Bubble_Babble.html|Bubble Babble] binary data encoding. Much like base64 but makes actually pronounceable pseudo-words.
* [CacheCookie]: stores session data in a cookie (using MsgPack if available or JSON as a fallback), without using session files. For MsgPack you can use [https://github.com/onlinecity/msgpack-php|this pure PHP implementation] but the PECL module "msgpack" is much faster.
* [DB]: abstraction layer to PDO with useful helper methods
* [DB_SQLite3]: abstraction layer to SQLite3, same API as [DB]
* [Delta]: to compute and apply deltas between two revisions of the same file (PHP port of Fossil delta algorithm). Allows to store only differences between two edits of a text, may be useful for example in CVS or a Wiki.
* [ErrorManager]: error and exception handler with dev/prod mode, email reporting and more, like a lightweight version of [https://github.com/nette/tracy|Nette Tracy]
* [FeedParser]: parses RSS and ATOM feeds, any version, even if they are invalid XML
* [Form]: to validate and filter form fields, including CSRF protection
* [HTMLDocument]: DOMDocument/DOMNode wrapper that adds support for querySelector/querySelectorAll methods (easy to use CSS selectors, internally transformed to XPath queries, so it is quite fast)
* [Image]: a simple and fast image library providing resize, image informations and image thumbnail through EPEG (JPEG only), ExactImage, GD, ImageMagick or ImLib (will use the fastest available option).
* [Image_Blob]: to get image size (supports PNG, JPEG and GIF) and EXIF orientation from image blobs, doesn't require any library
* [Image_EXIF]: deals with EXIF data from JPEG files
* [Karto]: mapping/GPS tools
* [Mail_Message]: parser/writer of email MIME messages (with support for MIME encoded messages and attachments)
* [MemCache]: memory cache wrapper (APCu, XCache, Opcache, etc.)
* [BubbleBabble](wiki:BubbleBabble): encodes and decodes using the [http://bohwaz.net/archives/web/Bubble_Babble.html|Bubble Babble] binary data encoding. Much like base64 but makes actually pronounceable pseudo-words.
* CacheCookie: stores session data in a cookie (using MsgPack if available or JSON as a fallback), without using session files. For MsgPack you can use [https://github.com/onlinecity/msgpack-php|this pure PHP implementation] but the PECL module "msgpack" is much faster.
* DB: abstraction layer to PDO with useful helper methods
* DB_SQLite3: abstraction layer to SQLite3, same API as [DB]
* Delta: to compute and apply deltas between two revisions of the same file (PHP port of Fossil delta algorithm). Allows to store only differences between two edits of a text, may be useful for example in CVS or a Wiki.
* ErrorManager: error and exception handler with dev/prod mode, email reporting and more, like a lightweight version of [https://github.com/nette/tracy|Nette Tracy]
* FeedParser: parses RSS and ATOM feeds, any version, even if they are invalid XML
* [Form](wiki:Form): to validate and filter form fields, including CSRF protection
* HTMLDocument: DOMDocument/DOMNode wrapper that adds support for querySelector/querySelectorAll methods (easy to use CSS selectors, internally transformed to XPath queries, so it is quite fast)
* Image: a simple and fast image library providing resize, image informations and image thumbnail through EPEG (JPEG only), ExactImage, GD, ImageMagick or ImLib (will use the fastest available option).
* Image_Blob: to get image size (supports PNG, JPEG and GIF) and EXIF orientation from image blobs, doesn't require any library
* Image_EXIF: deals with EXIF data from JPEG files
* Karto: mapping/GPS tools
* Mail_Message: parser/writer of email MIME messages (with support for MIME encoded messages and attachments)
* MemCache: memory cache wrapper (APCu, XCache, Opcache, etc.)
* MikroMarkupBBCode: fast and lightweight BBcode parser/renderer for HTML
* [MiniSkel]: template-based programming language compatible with the SPIP CMS
* [Mustachier]: lightweight template engine based on Mustache
* [QRCode]: generates QR codes
* [Security]: common security functions, including anti CSRF tokens
* [Security_OTP]: secure one time password generator/verifier, compatible with TOTP/HOTP and Google Authenticator
* MiniSkel: template-based programming language compatible with the SPIP CMS
* [Mustachier](wiki:Mustachier): lightweight template engine based on Mustache
* [QRCode](wiki:QRCode): generates QR codes
* Security: common security functions, including anti CSRF tokens
* [Security_OTP](wiki:Security_OTP): secure one time password generator/verifier, compatible with TOTP/HOTP and Google Authenticator
* Session: a basic PHP session manager that can be set to be non-blocking.
* SimpleDiff: to compute a text diff between two versions of a string (+patch utility)
* Singleton: used to make singleton classes.
* [SkrivLite]: implementation of the Skriv Markup Language (inspired by Creole and Markdown).
* [Smartyer]: fast and lightweight template engine, mostly compatible with Smarty / Template_Lite.
* [SMTP]: send emails using SMTP (supports SMTH AUTH and TLS).
* [SkrivLite](wiki:SkrivLite): implementation of the Skriv Markup Language (inspired by Creole and Markdown).
* [Smartyer](wiki:Smartyer): fast and lightweight template engine, mostly compatible with Smarty / Template_Lite.
* SMTP: send emails using SMTP (supports SMTH AUTH and TLS).
* SVGPie: renders a pie chart in SVG
* SVGPlot: renders a plot chart in SVG
* [Test]: unit testing library
* [Translate]: platform independent gettext replacement, parses Gettext MO and PO files, optional memory cache
* [Test](wiki:Test): unit testing library
* [Translate](wiki:Translate with Smartyer): platform independent gettext replacement, parses Gettext MO and PO files, optional memory cache
* XML_RPC_Server: a XML/RPC server using PHP XML/RPC extension
<h2>Javascript components</h2>
## Javascript components
* Text editor: extends textareas with tools to select, insert or replace content, with support for keyboard shortcuts.
* Code editor: built on Text editor, it provides an easy to use browser code editor including: common keyboard shortcuts, search, search and replace, go to line, fullscreen editing, indentation, brackets/parenthesis matching, line counter, and more.
* Karto (alpha): Mapping/GPS tools (Mercator projection)
* XHR.js: micro XmlHttpRequest library (less than 500 bytes minified)
|