public function __construct($input) { if (filter_var($input, FILTER_VALIDATE_URL) || is_file($input)) { $this->data = file_get_contents($input); $this->source["source"] = $input; $this->source["info"] = pathinfo($input); $this->source["info"]["size"] = strlen($this->data); $this->mode = $this->data != "false" ? "read" : "write"; if (MODE === "dev") { Reporting::notify($input . "|" . strlen($this->data), "info"); Reporting::dump($this->data, "info"); } } }
public function send($message) { $this->message = '<html><body>'; $this->message .= '<div>' . $message . '</div>'; $this->message .= "</body></html>"; if (!empty($this->message) && $this->status == 1) { mail($this->to, $this->subject, $this->message, $this->headers); if (MODE === "dev") { Reporting::notify("Mail sent to {$this->to}!", "success"); } } else { if (MODE === "dev") { Reporting::notify("Please add an message!", "error"); } } }
/* ============================ CONSTANTS ============================== */ define("ROOT", getcwd() . "/"); define("CFG", ROOT . "config/"); define("MODE", "dev"); // dev | prod /* ============================ LOCALE SETTINGS ============================== */ date_default_timezone_set('Europe/Brussels'); setlocale(LC_ALL, 'nl_NL'); /* ============================ PHP SETTINGS ============================== */ set_time_limit(0); error_reporting(E_ALL); ini_set("display_errors", true); /* ============================ INCLUDES ============================== */ include 'includes/Strings.php'; include 'includes/Reporting.php'; include 'includes/data/database.php'; include 'includes/data/base.php'; include 'includes/data/json.php'; include 'includes/Mail.php'; include 'music/bootstrap.php'; Reporting::notify("Init succesful", "success");
<?php /* ============================ CONSTANTS ============================== */ /* ============================ INCLUDES ============================== */ include 'notes.php'; include 'chord.php'; include 'scale.php'; include 'harmony.php'; Reporting::notify("Music package init succesful", "success");
<?php include "bootstrap.php"; $harmony = new Harmony("C", "minor"); foreach ($harmony->chords as $chord) { Reporting::notify($chord->name); Reporting::dump($chord->notes); }