You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
<?php
|
|
declare(strict_types=1);
|
|
/*
|
|
* This file is Auto-Generated, Do NOT Modify!!! Please Delete this file to update configuration!
|
|
*/
|
|
|
|
/* Contents of : on_html_filter.php */
|
|
|
|
|
|
\tts\registry::get('di')->register('html_filter', function() {
|
|
return new \tts\html_filter();
|
|
});
|
|
/* Contents of : on_log.php */
|
|
|
|
|
|
\tts\registry::get('di')->register('log', function(array $arg) {
|
|
$file_name = null;
|
|
if (isset($arg[0]) && is_string($arg[0])) {
|
|
$file_name = $arg[0]; // filename
|
|
}
|
|
|
|
if (isset($arg[1]) && is_int($arg[1])) {
|
|
$count = $arg[1]; // max count
|
|
return new \tts\log($file_name, $count);
|
|
}
|
|
|
|
if (! empty($file_name)) {
|
|
return new \tts\log($file_name);
|
|
}
|
|
|
|
return new \tts\log();
|
|
});
|
|
/* Contents of : on_templates.php */
|
|
|
|
|
|
\tts\registry::get('di')->register('templates', function(array $arg) {
|
|
$file_type = '.tpl';
|
|
if (isset($arg[0]) && is_string($arg[0])) {
|
|
$file_type = $arg[0];
|
|
}
|
|
return new \tts\liquid_templates($file_type);
|
|
});
|
|
/* Contents of : on_test_db.php */
|
|
|
|
|
|
\tts\registry::get('di')->register('db_mocker', function($args) {
|
|
try {
|
|
$conn = new \PDO('sqlite::memory:');
|
|
// set the PDO error mode to exception
|
|
$conn->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
|
|
return $conn;
|
|
} catch (\PDOException $e) {
|
|
echo $e->getMessage();
|
|
} catch (\Exception $e) {
|
|
echo $e->getMessage();
|
|
}
|
|
}); |