Getting Started
With default values
The easiest way is simply:
Classical installation
// Require the library
require_once('bootils/Bootils.php');
// Initialize it
$bootils = new \Bootils\Core();
Installation using Composer (the php package manager)
"require": {
...
"oriolfg/bootils": "dev-stable"
}
// Require the library
require_once('vendor/autoload.php');
// Initialize it
$bootils = new \Bootils\Core();
Optional bootils values
You can configure bootils after started, in the sample (In the examples we set the defaults already have, if not configured)
// Debug options
$bootils->setDebug(false);
// Regional configuration
$bootils->setLocales('en_GB.utf8');
$bootils->setComaSeparator('.');
$bootils->setThousendSeparator(',');
$bootils->setDateFormat("%A %d %B %Y");
// Error values
$bootils->display_errors = true;
$bootils->error_reporting = true;
$bootils->e_error = true;
$bootils->e_recoverable_error = true;
$bootils->e_warning = true;
$bootils->e_parse = true;
$bootils->e_strict = true;
$bootils->e_notice = true;
$bootils->e_deprecated = true;
$bootils->e_user_deprecated = true;
$bootils->phpErrors();
// Mail general values
$bootils->setMailCharset = 'UTF-8';
$bootils->setMailCharset_plain = 'UTF-8';
$bootils->setMailCharset_html = 'UTF-8';
$bootils->setMailSender_mail = 'bootils@sample.org';
$bootils->setMailSender_name = false;
$bootils->setMailReply_to_mail = 'bootils@sample.org';
$bootils->setMailReply_to_name = false;
// Mail SMTP values
$bootils->setSmtpHost = "localhost"; // only need configure if works with Swiftmailer or PHPMailer
$bootils->setSmtpProtocol = "tls"; // only need configure if works with PHPMailer
$bootils->setSmptUser = false; // only need configure if works with Swiftmailer or PHPMailer
$bootils->setSmtpPassword = false; // only need configure if works with Swiftmailer or PHPMailer
$bootils->setSmtpPort = 25; // only need configure if works with Swiftmailer or PHPMailer
// Mail Antiflood values
$bootils->setSmtpAntiflood = true; // For massive sending - only need configure if works with Swiftmailer
$bootils->setSmtpAntiflood_mails = 100; // number of emails between breaks - only need configure if works with Swiftmailer
$bootils->setSmtpAntiflood_pause = 30; // Seconds-long break before continuing - only need configure if works with Swiftmailer