diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-11-04 21:33:05 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-11-04 21:33:05 -0500 |
commit | 135b921db75da5995eab7e36393ecd4d2b0bc66f (patch) | |
tree | 46efc60fcf1f9d5c57ab1fb9418c2acfbda0698a /app | |
parent | 850645dd6b22f5b495d1680e0b49540e0ebf9bd3 (diff) |
Switch to composer
Diffstat (limited to 'app')
-rw-r--r-- | app/Auth/GitHub.php | 2 | ||||
-rw-r--r-- | app/Auth/Google.php | 2 | ||||
-rw-r--r-- | app/Core/Loader.php | 62 | ||||
-rw-r--r-- | app/common.php | 19 | ||||
-rw-r--r-- | app/functions.php | 2 |
5 files changed, 2 insertions, 85 deletions
diff --git a/app/Auth/GitHub.php b/app/Auth/GitHub.php index 096d4101..034f9260 100644 --- a/app/Auth/GitHub.php +++ b/app/Auth/GitHub.php @@ -2,8 +2,6 @@ namespace Auth; -require __DIR__.'/../../vendor/OAuth/bootstrap.php'; - use Core\Request; use OAuth\Common\Storage\Session; use OAuth\Common\Consumer\Credentials; diff --git a/app/Auth/Google.php b/app/Auth/Google.php index 2bed5b09..587ecde1 100644 --- a/app/Auth/Google.php +++ b/app/Auth/Google.php @@ -2,8 +2,6 @@ namespace Auth; -require __DIR__.'/../../vendor/OAuth/bootstrap.php'; - use Core\Request; use OAuth\Common\Storage\Session; use OAuth\Common\Consumer\Credentials; diff --git a/app/Core/Loader.php b/app/Core/Loader.php deleted file mode 100644 index 151081c1..00000000 --- a/app/Core/Loader.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -namespace Core; - -/** - * Loader class - * - * @package core - * @author Frederic Guillot - */ -class Loader -{ - /** - * List of paths - * - * @access private - * @var array - */ - private $paths = array(); - - /** - * Load the missing class - * - * @access public - * @param string $class Class name with namespace - */ - public function load($class) - { - foreach ($this->paths as $path) { - - $filename = $path.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php'; - - if (file_exists($filename)) { - require $filename; - break; - } - } - } - - /** - * Register the autoloader - * - * @access public - */ - public function execute() - { - spl_autoload_register(array($this, 'load')); - } - - /** - * Register a new path - * - * @access public - * @param string $path Path - * @return Core\Loader - */ - public function setPath($path) - { - $this->paths[] = $path; - return $this; - } -} diff --git a/app/common.php b/app/common.php index 1ace3d81..613d4501 100644 --- a/app/common.php +++ b/app/common.php @@ -2,17 +2,7 @@ // Common file between cli and web interface -require __DIR__.'/Core/Loader.php'; -require __DIR__.'/helpers.php'; -require __DIR__.'/functions.php'; - -use Core\Loader; -use Core\Registry; - -// Include password_compat for PHP < 5.5 -if (version_compare(PHP_VERSION, '5.5.0', '<')) { - require __DIR__.'/../vendor/password.php'; -} +require 'vendor/autoload.php'; // Include custom config file if (file_exists('config.php')) { @@ -21,12 +11,7 @@ if (file_exists('config.php')) { require __DIR__.'/constants.php'; -$loader = new Loader; -$loader->setPath('app'); -$loader->setPath('vendor'); -$loader->execute(); - -$registry = new Registry; +$registry = new Core\Registry; $registry->db = setup_db(); $registry->event = setup_events(); $registry->mailer = function() { return setup_mailer(); }; diff --git a/app/functions.php b/app/functions.php index c39eaf98..5fe218ce 100644 --- a/app/functions.php +++ b/app/functions.php @@ -35,8 +35,6 @@ function setup_events() */ function setup_mailer() { - require_once __DIR__.'/../vendor/swiftmailer/swift_required.php'; - switch (MAIL_TRANSPORT) { case 'smtp': $transport = Swift_SmtpTransport::newInstance(MAIL_SMTP_HOSTNAME, MAIL_SMTP_PORT); |