- = t('Sorry, I didn\'t found this information in my database!') ?> + = t('Sorry, I didn\'t find this information in my database!') ?>
diff --git a/.gitignore b/.gitignore
index 2d1c0ad4f..557137aa4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,4 +54,5 @@ Thumbs.db
################
config.php
data/files
+data/cache
vendor
\ No newline at end of file
diff --git a/app/Controller/Base.php b/app/Controller/Base.php
index cd807d565..4719ebe4b 100644
--- a/app/Controller/Base.php
+++ b/app/Controller/Base.php
@@ -101,9 +101,13 @@ abstract class Base
public function __destruct()
{
if (DEBUG) {
+
foreach ($this->container['db']->getLogMessages() as $message) {
- $this->container['logger']->addDebug($message);
+ $this->container['logger']->debug($message);
}
+
+ $this->container['logger']->debug('SQL_QUERIES={nb}', array('nb' => $this->container['db']->nb_queries));
+ $this->container['logger']->debug('RENDERING={time}', array('time' => microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']));
}
}
diff --git a/app/Core/Cache.php b/app/Core/Cache.php
new file mode 100644
index 000000000..670a76e0c
--- /dev/null
+++ b/app/Core/Cache.php
@@ -0,0 +1,58 @@
+container = $container;
+ $this->init();
+ }
+
+ /**
+ * Proxy cache
+ *
+ * Note: Arguments must be scalar types
+ *
+ * @access public
+ * @param string $container Container name
+ * @param string $method Container method
+ * @return mixed
+ */
+ public function proxy($container, $method)
+ {
+ $args = func_get_args();
+ $key = 'proxy_'.implode('_', $args);
+ $result = $this->get($key);
+
+ if ($result === null) {
+ $result = call_user_func_array(array($this->container[$container], $method), array_splice($args, 2));
+ $this->set($key, $result);
+ }
+
+ return $result;
+ }
+}
diff --git a/app/Core/FileCache.php b/app/Core/FileCache.php
new file mode 100644
index 000000000..2037f2717
--- /dev/null
+++ b/app/Core/FileCache.php
@@ -0,0 +1,41 @@
+container[$name];
}
+ /**
+ * Proxy cache helper for acl::isManagerActionAllowed()
+ *
+ * @access public
+ * @param integer $project_id
+ * @return boolean
+ */
+ public function isManager($project_id)
+ {
+ if ($this->userSession->isAdmin()) {
+ return true;
+ }
+
+ return $this->container['memoryCache']->proxy('acl', 'isManagerActionAllowed', $project_id);
+ }
+
/**
* Return the user full name
*
diff --git a/app/Core/MemoryCache.php b/app/Core/MemoryCache.php
new file mode 100644
index 000000000..f80a66efe
--- /dev/null
+++ b/app/Core/MemoryCache.php
@@ -0,0 +1,32 @@
+storage[$key] = $value;
+ }
+
+ public function get($key)
+ {
+ return isset($this->storage[$key]) ? $this->storage[$key] : null;
+ }
+
+ public function flush()
+ {
+ $this->storage = array();
+ }
+
+ public function remove($key)
+ {
+ unset($this->storage[$key]);
+ }
+}
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php
index 9a10ba74e..c16e3d92b 100644
--- a/app/Locale/da_DK/translations.php
+++ b/app/Locale/da_DK/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Ændre ansvarlig',
'Change assignee for the task "%s"' => 'Ændre ansvarlig for opgaven: "%s"',
'Timezone' => 'Tidszone',
- 'Sorry, I didn\'t found this information in my database!' => 'Denne information kunne ikke findes i databasen!',
+ 'Sorry, I didn\'t find this information in my database!' => 'Denne information kunne ikke findes i databasen!',
'Page not found' => 'Siden er ikke fundet',
'Complexity' => 'Kompleksitet',
'limit' => 'Begrænsning',
diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php
index c75b64952..d0f9ee40f 100644
--- a/app/Locale/de_DE/translations.php
+++ b/app/Locale/de_DE/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Zuständigkeit ändern',
'Change assignee for the task "%s"' => 'Zuständigkeit für diese Aufgabe ändern: "%s"',
'Timezone' => 'Zeitzone',
- 'Sorry, I didn\'t found this information in my database!' => 'Diese Information wurde in der Datenbank nicht gefunden!',
+ 'Sorry, I didn\'t find this information in my database!' => 'Diese Information wurde in der Datenbank nicht gefunden!',
'Page not found' => 'Seite nicht gefunden',
'Complexity' => 'Komplexität',
'limit' => 'Limit',
diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php
index b94b4537f..1dcb07680 100644
--- a/app/Locale/es_ES/translations.php
+++ b/app/Locale/es_ES/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Cambiar la persona asignada',
'Change assignee for the task "%s"' => 'Cambiar la persona asignada por la tarea « %s »',
'Timezone' => 'Zona horaria',
- 'Sorry, I didn\'t found this information in my database!' => 'Lo siento no he encontrado información en la base de datos!',
+ 'Sorry, I didn\'t find this information in my database!' => 'Lo siento no he encontrado información en la base de datos!',
'Page not found' => 'Página no encontrada',
'Complexity' => 'Complejidad',
'limit' => 'límite',
diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php
index 53404026b..ff5a365d9 100644
--- a/app/Locale/fi_FI/translations.php
+++ b/app/Locale/fi_FI/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Vaihda suorittajaa',
'Change assignee for the task "%s"' => 'Vaihda suorittajaa tehtävälle %s',
'Timezone' => 'Aikavyöhyke',
- 'Sorry, I didn\'t found this information in my database!' => 'Anteeksi, en löytänyt tätä tietoa tietokannastani',
+ 'Sorry, I didn\'t find this information in my database!' => 'Anteeksi, en löytänyt tätä tietoa tietokannastani',
'Page not found' => 'Sivua ei löydy',
'Complexity' => 'Monimutkaisuus',
'limit' => 'raja',
diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php
index 2b8c034fc..b830a4356 100644
--- a/app/Locale/fr_FR/translations.php
+++ b/app/Locale/fr_FR/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Changer la personne assignée',
'Change assignee for the task "%s"' => 'Changer la personne assignée pour la tâche « %s »',
'Timezone' => 'Fuseau horaire',
- 'Sorry, I didn\'t found this information in my database!' => 'Désolé, je n\'ai pas trouvé cette information dans ma base de données !',
+ 'Sorry, I didn\'t find this information in my database!' => 'Désolé, je n\'ai pas trouvé cette information dans ma base de données !',
'Page not found' => 'Page introuvable',
'Complexity' => 'Complexité',
'limit' => 'limite',
diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php
index 242e74ce2..b7e5ae252 100644
--- a/app/Locale/hu_HU/translations.php
+++ b/app/Locale/hu_HU/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Felelős módosítása',
'Change assignee for the task "%s"' => 'Feladat felelősének módosítása: "%s"',
'Timezone' => 'Időzóna',
- 'Sorry, I didn\'t found this information in my database!' => 'Ez az információ nem található az adatbázisban!',
+ 'Sorry, I didn\'t find this information in my database!' => 'Ez az információ nem található az adatbázisban!',
'Page not found' => 'Az oldal nem található',
'Complexity' => 'Bonyolultság',
'limit' => 'határ',
diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php
index 0b0473869..828c72a75 100644
--- a/app/Locale/it_IT/translations.php
+++ b/app/Locale/it_IT/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Cambiare la persona assegnata',
'Change assignee for the task "%s"' => 'Cambiare la persona assegnata per il compito « %s »',
'Timezone' => 'Fuso orario',
- 'Sorry, I didn\'t found this information in my database!' => 'Mi dispiace, non ho trovato questa informazione sulla base dati!',
+ 'Sorry, I didn\'t find this information in my database!' => 'Mi dispiace, non ho trovato questa informazione sulla base dati!',
'Page not found' => 'Pagina non trovata',
// 'Complexity' => '',
'limit' => 'limite',
diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php
index 16f9928b9..e424a1518 100644
--- a/app/Locale/ja_JP/translations.php
+++ b/app/Locale/ja_JP/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => '担当を変更する',
'Change assignee for the task "%s"' => 'タスク「%s」の担当を変更する',
'Timezone' => 'タイムゾーン',
- 'Sorry, I didn\'t found this information in my database!' => 'データベース上で情報が見つかりませんでした!',
+ 'Sorry, I didn\'t find this information in my database!' => 'データベース上で情報が見つかりませんでした!',
'Page not found' => 'ページが見つかりません',
'Complexity' => '複雑さ',
'limit' => '制限',
diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php
index f385d47c5..aa4e74284 100644
--- a/app/Locale/pl_PL/translations.php
+++ b/app/Locale/pl_PL/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Zmień odpowiedzialną osobę',
'Change assignee for the task "%s"' => 'Zmień odpowiedzialną osobę dla zadania "%s"',
'Timezone' => 'Strefa czasowa',
- 'Sorry, I didn\'t found this information in my database!' => 'Niestety nie znaleziono tej informacji w bazie danych',
+ 'Sorry, I didn\'t find this information in my database!' => 'Niestety nie znaleziono tej informacji w bazie danych',
'Page not found' => 'Strona nie istnieje',
'Complexity' => 'Poziom trudności',
'limit' => 'limit',
diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php
index e5a2c8807..cb873cd26 100644
--- a/app/Locale/pt_BR/translations.php
+++ b/app/Locale/pt_BR/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Mudar a designação',
'Change assignee for the task "%s"' => 'Modificar designação para a tarefa "%s"',
'Timezone' => 'Fuso horário',
- 'Sorry, I didn\'t found this information in my database!' => 'Desculpe, não encontrei esta informação no meu banco de dados!',
+ 'Sorry, I didn\'t find this information in my database!' => 'Desculpe, não encontrei esta informação no meu banco de dados!',
'Page not found' => 'Página não encontrada',
'Complexity' => 'Complexidade',
'limit' => 'limite',
diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php
index 445bb2c40..e3ad20df3 100644
--- a/app/Locale/ru_RU/translations.php
+++ b/app/Locale/ru_RU/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Сменить назначенного',
'Change assignee for the task "%s"' => 'Сменить назначенного для задачи « %s »',
'Timezone' => 'Часовой пояс',
- 'Sorry, I didn\'t found this information in my database!' => 'К сожалению, информация в базе данных не найдена !',
+ 'Sorry, I didn\'t find this information in my database!' => 'К сожалению, информация в базе данных не найдена !',
'Page not found' => 'Страница не найдена',
'Complexity' => 'Сложность',
'limit' => 'лимит',
diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php
index 5a19e6219..779cce068 100644
--- a/app/Locale/sv_SE/translations.php
+++ b/app/Locale/sv_SE/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'Ändra uppdragsinnehavare',
'Change assignee for the task "%s"' => 'Ändra uppdragsinnehavare för uppgiften "%s"',
'Timezone' => 'Tidszon',
- 'Sorry, I didn\'t found this information in my database!' => 'Informationen kunde inte hittas i databasen.',
+ 'Sorry, I didn\'t find this information in my database!' => 'Informationen kunde inte hittas i databasen.',
'Page not found' => 'Sidan hittas inte',
'Complexity' => 'Ungefärligt antal timmar',
'limit' => 'max',
diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php
index 60e68711f..c0cd52920 100644
--- a/app/Locale/th_TH/translations.php
+++ b/app/Locale/th_TH/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => 'เปลี่ยนการกำหนด',
'Change assignee for the task "%s"' => 'เปลี่ยนการกำหนดสำหรับงาน « %s »',
'Timezone' => 'เขตเวลา',
- 'Sorry, I didn\'t found this information in my database!' => 'เสียใจด้วย ไม่สามารถหาข้อมูลในฐานข้อมูลได้',
+ 'Sorry, I didn\'t find this information in my database!' => 'เสียใจด้วย ไม่สามารถหาข้อมูลในฐานข้อมูลได้',
'Page not found' => 'ไม่พบหน้า',
'Complexity' => 'ความซับซ้อน',
'limit' => 'จำกัด',
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index 6b793bf6d..a78109894 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -182,7 +182,7 @@ return array(
'Change assignee' => '变更负责人',
'Change assignee for the task "%s"' => '更改任务"%s"的负责人',
'Timezone' => '时区',
- 'Sorry, I didn\'t found this information in my database!' => '抱歉,无法在数据库中找到该信息!',
+ 'Sorry, I didn\'t find this information in my database!' => '抱歉,无法在数据库中找到该信息!',
'Page not found' => '页面未找到',
'Complexity' => '复杂度',
'limit' => '限制',
diff --git a/app/Model/Acl.php b/app/Model/Acl.php
index 0d26edc4c..d717e12f0 100644
--- a/app/Model/Acl.php
+++ b/app/Model/Acl.php
@@ -189,10 +189,6 @@ class Acl extends Base
public function isManagerActionAllowed($project_id)
{
- if ($this->userSession->isAdmin()) {
- return true;
- }
-
return $project_id > 0 && $this->projectPermission->isManager($project_id, $this->userSession->getId());
}
diff --git a/app/Model/Action.php b/app/Model/Action.php
index 95e22d277..2204ad37d 100644
--- a/app/Model/Action.php
+++ b/app/Model/Action.php
@@ -199,6 +199,7 @@ class Action extends Base
*/
public function remove($action_id)
{
+ // $this->container['fileCache']->remove('proxy_action_getAll');
return $this->db->table(self::TABLE)->eq('id', $action_id)->remove();
}
@@ -242,6 +243,8 @@ class Action extends Base
$this->db->closeTransaction();
+ // $this->container['fileCache']->remove('proxy_action_getAll');
+
return true;
}
@@ -252,7 +255,10 @@ class Action extends Base
*/
public function attachEvents()
{
- foreach ($this->getAll() as $action) {
+ //$actions = $this->container['fileCache']->proxy('action', 'getAll');
+ $actions = $this->getAll();
+
+ foreach ($actions as $action) {
$listener = $this->load($action['action_name'], $action['project_id'], $action['event_name']);
@@ -315,6 +321,8 @@ class Action extends Base
}
}
+ // $this->container['fileCache']->remove('proxy_action_getAll');
+
return true;
}
diff --git a/app/Model/Board.php b/app/Model/Board.php
index 5ebec2799..550009fa2 100644
--- a/app/Model/Board.php
+++ b/app/Model/Board.php
@@ -253,6 +253,23 @@ class Board extends Base
return $swimlanes;
}
+ /**
+ * Get the total of tasks per column
+ *
+ * @access public
+ * @param integer $project_id
+ * @return array
+ */
+ public function getColumnStats($project_id)
+ {
+ return $this->db
+ ->table(Task::TABLE)
+ ->eq('project_id', $project_id)
+ ->eq('is_active', 1)
+ ->groupBy('column_id')
+ ->listing('column_id', 'COUNT(*) AS total');
+ }
+
/**
* Get the first column id for a given project
*
diff --git a/app/Model/Notification.php b/app/Model/Notification.php
index 8c13aadad..95306e864 100644
--- a/app/Model/Notification.php
+++ b/app/Model/Notification.php
@@ -114,7 +114,7 @@ class Notification extends Base
}
}
catch (Swift_TransportException $e) {
- $this->container['logger']->addError($e->getMessage());
+ $this->container['logger']->error($e->getMessage());
}
}
diff --git a/app/Model/Project.php b/app/Model/Project.php
index de9408ecb..6d8885b15 100644
--- a/app/Model/Project.php
+++ b/app/Model/Project.php
@@ -191,11 +191,12 @@ class Project extends Base
public function getStats($project_id)
{
$stats = array();
- $columns = $this->board->getColumns($project_id);
$stats['nb_active_tasks'] = 0;
+ $columns = $this->board->getColumns($project_id);
+ $column_stats = $this->board->getColumnStats($project_id);
foreach ($columns as &$column) {
- $column['nb_active_tasks'] = $this->taskFinder->countByColumnId($project_id, $column['id']);
+ $column['nb_active_tasks'] = isset($column_stats[$column['id']]) ? $column_stats[$column['id']] : 0;
$stats['nb_active_tasks'] += $column['nb_active_tasks'];
}
diff --git a/app/Model/ProjectPaginator.php b/app/Model/ProjectPaginator.php
index 9f1c39f0d..68b216b13 100644
--- a/app/Model/ProjectPaginator.php
+++ b/app/Model/ProjectPaginator.php
@@ -38,9 +38,10 @@ class ProjectPaginator extends Base
foreach ($projects as &$project) {
$project['columns'] = $this->board->getColumns($project['id']);
+ $stats = $this->board->getColumnStats($project['id']);
foreach ($project['columns'] as &$column) {
- $column['nb_tasks'] = $this->taskFinder->countByColumnId($project['id'], $column['id']);
+ $column['nb_tasks'] = isset($stats[$column['id']]) ? $stats[$column['id']] : 0;
}
}
diff --git a/app/Model/ProjectPermission.php b/app/Model/ProjectPermission.php
index a53f9195b..fc7ab0d54 100644
--- a/app/Model/ProjectPermission.php
+++ b/app/Model/ProjectPermission.php
@@ -298,7 +298,11 @@ class ProjectPermission extends Base
*/
public function getAllowedProjects($user_id)
{
- return $this->filterProjects($this->project->getListByStatus(Project::ACTIVE), $user_id, 'isUserAllowed');
+ if ($this->user->isAdmin($user_id)) {
+ return $this->project->getListByStatus(Project::ACTIVE);
+ }
+
+ return $this->getMemberProjects($user_id);
}
/**
@@ -310,7 +314,11 @@ class ProjectPermission extends Base
*/
public function getMemberProjects($user_id)
{
- return $this->filterProjects($this->project->getListByStatus(Project::ACTIVE), $user_id, 'isMember');
+ return $this->db
+ ->table(Project::TABLE)
+ ->eq('user_id', $user_id)
+ ->join(self::TABLE, 'project_id', 'id')
+ ->listing('projects.id', 'name');
}
/**
diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php
index 7f66fa4d1..eb86fe3e1 100644
--- a/app/Model/TaskFinder.php
+++ b/app/Model/TaskFinder.php
@@ -216,16 +216,15 @@ class TaskFinder extends Base
* @access public
* @param integer $project_id Project id
* @param integer $column_id Column id
- * @param array $status List of status id
* @return integer
*/
- public function countByColumnId($project_id, $column_id, array $status = array(Task::STATUS_OPEN))
+ public function countByColumnId($project_id, $column_id)
{
return $this->db
->table(Task::TABLE)
->eq('project_id', $project_id)
->eq('column_id', $column_id)
- ->in('is_active', $status)
+ ->in('is_active', 1)
->count();
}
diff --git a/app/Model/User.php b/app/Model/User.php
index 78d44b47a..29def6d47 100644
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -48,7 +48,8 @@ class User extends Base
*/
public function isAdmin($user_id)
{
- return $this->db
+ return $this->userSession->isAdmin() || // Avoid SQL query if connected
+ $this->db
->table(User::TABLE)
->eq('id', $user_id)
->eq('is_admin', 1)
diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php
index 39a32cf66..f8d202622 100644
--- a/app/ServiceProvider/ClassProvider.php
+++ b/app/ServiceProvider/ClassProvider.php
@@ -52,6 +52,8 @@ class ClassProvider implements ServiceProviderInterface
'Core' => array(
'Template',
'Session',
+ 'MemoryCache',
+ 'FileCache',
),
'Integration' => array(
'GitlabWebhook',
diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php
index 632b02389..4218f5ff4 100644
--- a/app/ServiceProvider/DatabaseProvider.php
+++ b/app/ServiceProvider/DatabaseProvider.php
@@ -12,6 +12,7 @@ class DatabaseProvider implements ServiceProviderInterface
{
$container['db'] = $this->getInstance();
$container['db']->stopwatch = DEBUG;
+ $container['db']->log_queries = DEBUG;
}
/**
diff --git a/app/ServiceProvider/LoggingProvider.php b/app/ServiceProvider/LoggingProvider.php
index f5e70381f..5b2cf5659 100644
--- a/app/ServiceProvider/LoggingProvider.php
+++ b/app/ServiceProvider/LoggingProvider.php
@@ -4,19 +4,19 @@ namespace ServiceProvider;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
-use Monolog\Logger;
-use Monolog\Handler\StreamHandler;
-use Monolog\Handler\SyslogHandler;
+use SimpleLogger\Logger;
+use SimpleLogger\Syslog;
+use SimpleLogger\File;
class LoggingProvider implements ServiceProviderInterface
{
public function register(Container $container)
{
- $logger = new Logger('app');
- $logger->pushHandler(new SyslogHandler('kanboard', LOG_USER, Logger::INFO));
+ $logger = new Logger;
+ $logger->setLogger(new Syslog('kanboard'));
if (DEBUG) {
- $logger->pushHandler(new StreamHandler(__DIR__.'/../../data/debug.log', Logger::DEBUG));
+ $logger->setLogger(new File(__DIR__.'/../../data/debug.log'));
}
$container['logger'] = $logger;
diff --git a/app/ServiceProvider/MailerProvider.php b/app/ServiceProvider/MailerProvider.php
index f6b713635..6469a7371 100644
--- a/app/ServiceProvider/MailerProvider.php
+++ b/app/ServiceProvider/MailerProvider.php
@@ -12,25 +12,22 @@ class MailerProvider implements ServiceProviderInterface
{
public function register(Container $container)
{
- $container['mailer'] = $this->getInstance();
- }
+ $container['mailer'] = function () {
+ switch (MAIL_TRANSPORT) {
+ case 'smtp':
+ $transport = Swift_SmtpTransport::newInstance(MAIL_SMTP_HOSTNAME, MAIL_SMTP_PORT);
+ $transport->setUsername(MAIL_SMTP_USERNAME);
+ $transport->setPassword(MAIL_SMTP_PASSWORD);
+ $transport->setEncryption(MAIL_SMTP_ENCRYPTION);
+ break;
+ case 'sendmail':
+ $transport = Swift_SendmailTransport::newInstance(MAIL_SENDMAIL_COMMAND);
+ break;
+ default:
+ $transport = Swift_MailTransport::newInstance();
+ }
- public function getInstance()
- {
- switch (MAIL_TRANSPORT) {
- case 'smtp':
- $transport = Swift_SmtpTransport::newInstance(MAIL_SMTP_HOSTNAME, MAIL_SMTP_PORT);
- $transport->setUsername(MAIL_SMTP_USERNAME);
- $transport->setPassword(MAIL_SMTP_PASSWORD);
- $transport->setEncryption(MAIL_SMTP_ENCRYPTION);
- break;
- case 'sendmail':
- $transport = Swift_SendmailTransport::newInstance(MAIL_SENDMAIL_COMMAND);
- break;
- default:
- $transport = Swift_MailTransport::newInstance();
- }
-
- return $transport;
+ return $transport;
+ };
}
}
diff --git a/app/Template/app/notfound.php b/app/Template/app/notfound.php
index 686f1fa08..0419902cf 100644
--- a/app/Template/app/notfound.php
+++ b/app/Template/app/notfound.php
@@ -1,5 +1,5 @@
- = t('Sorry, I didn\'t found this information in my database!') ?>
+ = t('Sorry, I didn\'t find this information in my database!') ?>