Class that may be used to compose and send e-mail messages.
It features:
- User definable headers and body parts.
- MIME encoding of text and HTML body parts with user defined character encoding using quoted-printable.
- Addition of file parts (attachments) with automatic content type detection.
- Forwarding of messages received from somebody else as intact attachments
- Support for multipart/related messages (eg. HTML messages with embedded images, stylesheets, frames, etc..)
- Support for multipart/alternative messages (eg. text and HTML versions in the same message).
- Encoding of message headers with user defined character encoding using q-encoding.
- Definition of the error delivery address setting the Return-Path header calling sendmail program directly.
- Several sub-classes for sending messages by different methods: PHP mail() function, sendmail, qmail, SMTP (with support for authentication and direct delivery mode), maildrop in Microsoft IIS or Exchange Pickup folder.
- Wrappers that emulate the mail() function using the SMTP, sendmail and qmail delivery sub-classes.
- Support for sending personalized bulk mail by replacing the contents of the message parts that differ for each recipient.
- HTML and plain text message parts can be composed using template engines. An example that works with Smarty template engine is provided.
- Retrieving the composed message data or size without sending the message
This class can be used to query arrays,html,xml or json file with a SQL-like syntax using LINQ.
It takes an array as parameter and can perform several types of queries using an SQL-like syntax as if the array was a relational database.
Currently it supports performing SELECT , DELETE, INSERT and UPDATE queries.
Example SELECT Queries:
========================
- SELECT *FROM myArray ORDER BY key DESC,value ASC,
- SELECT key,value FROM myArray WHERE value='100',
- SELECT * FROM json_file(my_json_file.txt),
- SELECT * FROM xml_file(http://tufyta.com/feed/).channel.item WHERE title LIKE '%linq%'
- SELECT *FROM html_file(http://tufyta.com).div WHERE class='post_title'
- SELECT *FROM text_file(data.txt) WHERE in_array('.line.',array(1,2,3,4,5,6,))
-SELECT * FROM dir_files(doc).files WHERE name LIKE '%D3Linq%'
- SELECT *FROM myArray.subitems WHERE name='Tufan'
- SELECT DISTINCT surname FROM personnels ORDER BY surname DESC
Example INSERT Queries:
========================
- INSERT INTO myArray (name,surname) VALUES ('Tufan','YILDIRIM')
- INSERT INTO myArray.subitems ('known_langs') VALUES ('PHP,C#,C++')
Example UPDATE Queries:
========================
- UPDATE myArray SET name='TUFAN' WHERE surname='YILDIRIM',
- UPDATE myarray.subitems SET known_lags='PHP,C#'
Example DELETE Queries:
========================
- DELETE FROM myArray WHERE name='Tufan'
- DELETE FROM myArray.subistems WHERE known_language LIKE '%PHP%'
Protect Flash files from hotlinking by other sites
The Apache mod_rewrite is often used to protect images and other types of media files from hotlinking from other sites, that make them appear in their pages although they are served from the original sites.
However, mod_rewrite can be used to protect the service of Flash files against hotlinking because these are embedded in pages using the <object> tag and in this case the browsers do not send a referer when requesting the Flash file from the origin server.
This class provides an alternative solution that works by generating a access key that is used to compose the URL used in the object tag but it is only valid only during a limited period of time.
The class takes as options the location of server directory where is the file to be protected, a password and the limit of time during which the access key is valid.
When the class validates the access key, it serves the real Flash file if the key is valid, or serves an error Flash file otherwise.
This class can validate XHTML documents. It may also validate other types of XML documents.
It can validate a XHTML document first determining whether it is well-formed and then verifying whether it uses only valid tags and attributes. The list of tags and attributes accepted as valid is configurable.
If there is an error, it can provide detailed information about what ist wrong.
It uses PHP 5 syntax and exceptions for handling errors.
This package can be used to handle application errors by sending notification e-mail messages.
The package is based on code originally written for MySQL Eventum project.
It composes and sends a message to a given recipient with information about an error that occurred.
The message includes details about the error such as the script name, the error line number, the current request script, the user IP address, the request referrer, the user browser, and a backtrace of the stack of functions that triggered the error.