Switch PHPMailer, MoovRelocator, Zend Gdata, TCPDF, Oauth2, PhlickR, PHPShortener from git submodules to Composer

This commit is contained in:
Romain Neutron
2012-03-30 20:12:14 +02:00
parent f835ea84e8
commit 9e640c27cf
27 changed files with 63 additions and 102 deletions

View File

@@ -29,8 +29,47 @@
"symfony/serializer": "2.1.*",
"symfony/validator": "2.1.*",
"symfony/yaml": "2.1.*",
"silex/silex": "1.0.*"
"phpexiftool/phpexiftool": "dev-master",
"mediavorus/mediavorus": "dev-master",
"silex/silex": "1.0.*",
"alchemy/oauth2php": "master",
"alchemy/tcpdf": "master",
"alchemy/phlickr": "master",
"alchemy/phpshortener": "master",
"alchemy/phpmailer": "master",
"alchemy/moovrelocator": "master",
"alchemy/gdata": "master"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/alchemy-fr/tcpdf"
},
{
"type": "vcs",
"url": "https://github.com/alchemy-fr/oauth2-php"
},
{
"type": "vcs",
"url": "https://github.com/alchemy-fr/Phlickr"
},
{
"type": "vcs",
"url": "https://github.com/alchemy-fr/PHPShortener"
},
{
"type": "vcs",
"url": "https://github.com/alchemy-fr/PHPMailer_v5.1"
},
{
"type": "vcs",
"url": "https://github.com/alchemy-fr/MoovRelocator"
},
{
"type": "vcs",
"url": "https://github.com/alchemy-fr/gdata"
}
],
"autoload": {
"psr-0": {
"Alchemy": "lib"

View File

@@ -11,11 +11,8 @@
namespace Alchemy\Phrasea\Application;
require_once __DIR__ . "/../../../../lib/classes/API/OAuth2/Autoloader.class.php";
require_once __DIR__ . "/../../../../lib/bootstrap.php";
\API_OAuth2_Autoloader::register();
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception;

View File

@@ -12,9 +12,6 @@
namespace Alchemy\Phrasea\Application;
require_once __DIR__ . "/../../../../lib/bootstrap.php";
require_once __DIR__ . "/../../../../lib/classes/API/OAuth2/Autoloader.class.php";
\API_OAuth2_Autoloader::register();
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;

View File

@@ -428,13 +428,11 @@ class Core extends \Pimple
$loader = new Loader\Autoloader();
}
$getComposerNamespaces = function()
{
return require realpath(__DIR__ . '/../../../vendor/.composer/autoload_namespaces.php');
};
foreach ($getComposerNamespaces() as $prefix => $path)
{
if (substr($prefix, -1) === '_')

View File

@@ -23,11 +23,13 @@ use Symfony\Component\ClassLoader\UniversalClassLoader;
*/
class Autoloader extends UniversalClassLoader
{
/**
* An array of path to check
* @var type
*/
private $paths = array();
private $classmap = array();
/**
* Construct a new phrasea Autoloader
@@ -40,6 +42,13 @@ class Autoloader extends UniversalClassLoader
{
$this->paths['config'] = __DIR__ . '/../../../../config/classes/';
$this->paths['library'] = __DIR__ . '/../../../classes/';
$getComposerClassMap = function()
{
return require realpath(__DIR__ . '/../../../../vendor/.composer/autoload_classmap.php');
};
$this->classmap = $getComposerClassMap();
}
/**
@@ -71,11 +80,18 @@ class Autoloader extends UniversalClassLoader
* @param string $class
* @return mixed string|null
*/
private function checkFile($class)
private function checkFile($classname)
{
if (isset($this->classmap[$classname]))
{
return $this->classmap[$classname];
}
$normalized_classname = str_replace('_', '/', $classname);
foreach ($this->paths as $path)
{
$file = $path. str_replace('_', '/', $class) . '.class.php';
$file = $path . $normalized_classname . '.class.php';
if (file_exists($file))
{
@@ -92,4 +108,5 @@ class Autoloader extends UniversalClassLoader
{
return $this->paths;
}
}

View File

@@ -13,8 +13,6 @@ namespace Alchemy\Phrasea\Out\Module;
use \Alchemy\Phrasea\Out\Tool\PhraseaPDF;
require_once __DIR__ . '/../../../../vendor/tcpdf/tcpdf.php';
/**
* Creates a PDF
*

View File

@@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
require_once __DIR__ . '/../../../vendor/oauth2/lib/OAuth2.inc';
/**
*
*

View File

@@ -1,6 +1,5 @@
<?php
require_once __DIR__ . "/../../../../lib/vendor/oauth2/lib/OAuth2.inc";
/*
* This file is part of Phraseanet
*

View File

@@ -9,13 +9,6 @@
* file that was distributed with this source code.
*/
$include_path = realpath(__DIR__ . '/../../../../vendor/');
if(strpos(get_include_path(), $include_path) === false)
{
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
set_include_path($new_include_path);
}
/**
*
* @package Bridge

View File

@@ -9,19 +9,8 @@
* file that was distributed with this source code.
*/
$include_path = realpath(__DIR__ . '/../../../vendor');
if (strpos(get_include_path(), $include_path . ':') === false)
{
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
set_include_path($new_include_path);
}
use \Symfony\Component\HttpFoundation\Request;
require_once __DIR__ . "/../../../vendor/Phlickr/Api.php";
require_once __DIR__ . "/../../../vendor/Phlickr/Uploader.php";
/**
*
* @package Bridge

View File

@@ -9,19 +9,6 @@
* file that was distributed with this source code.
*/
$include_path = realpath(__DIR__ . '/../../../vendor/gdata/');
if(strpos(get_include_path(), $include_path) === false)
{
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
set_include_path($new_include_path);
}
require_once('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_HttpClient');
Zend_Loader::loadClass('Zend_Gdata_Query');
Zend_Loader::loadClass('Zend_Gdata_App_MediaFileSource');
use \Symfony\Component\HttpFoundation\Request;
/**

View File

@@ -1,5 +1,5 @@
<?php
require_once __DIR__ . '/../../../../vendor/moov/relocator.class.php';
/*
* This file is part of Phraseanet
*

View File

@@ -188,9 +188,6 @@ class mail
public static function validateEmail($email)
{
$registry = registry::get_instance();
require_once($registry->get('GV_RootPath') . 'lib/vendor/PHPMailer_v5.1/class.phpmailer.php');
return PHPMailer::ValidateAddress($email);
}
@@ -198,7 +195,6 @@ class mail
{
$registry = registry::get_instance();
require_once($registry->get('GV_RootPath') . 'lib/vendor/PHPMailer_v5.1/class.phpmailer.php');
if (!isset($to['email']) || !PHPMailer::ValidateAddress($to['email']))

View File

@@ -4,8 +4,6 @@ require_once __DIR__ . '/../../../PhraseanetWebTestCaseAbstract.class.inc';
require_once __DIR__ . '/../../../../Alchemy/Phrasea/Application/Api.php';
API_OAuth2_Autoloader::register();
use Silex\WebTestCase;
use Symfony\Component\HttpFoundation\Response;

View File

@@ -4,8 +4,6 @@ require_once __DIR__ . '/../../../PhraseanetWebTestCaseAbstract.class.inc';
require_once __DIR__ . '/../../../../Alchemy/Phrasea/Application/Api.php';
API_OAuth2_Autoloader::register();
use Silex\WebTestCase;
use Symfony\Component\HttpFoundation\Response;

View File

@@ -4,8 +4,6 @@ require_once __DIR__ . '/../../../PhraseanetWebTestCaseAuthenticatedAbstract.cla
require_once __DIR__ . '/../../../../Alchemy/Phrasea/Application/OAuth2.php';
API_OAuth2_Autoloader::register();
use Symfony\Component\HttpFoundation\Response;
use Silex\WebTestCase;

View File

@@ -3,25 +3,6 @@
require_once __DIR__ . '/../../../PhraseanetPHPUnitAuthenticatedAbstract.class.inc';
require_once __DIR__ . '/../../Bridge_datas.inc';
$include_path = realpath(__DIR__ . '/../../../../vendor/gdata/');
if(strpos(get_include_path(), $include_path) === false)
{
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
set_include_path($new_include_path);
}
require_once('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_YouTube_VideoEntry');
Zend_Loader::loadClass('Zend_Gdata_YouTube_Extension_MediaGroup');
Zend_Loader::loadClass('Zend_Gdata_YouTube_Extension_Statistics');
Zend_Loader::loadClass('Zend_Gdata_Media_Extension_MediaPlayer');
Zend_Loader::loadClass('Zend_Gdata_YouTube_Extension_Duration');
Zend_Loader::loadClass('Zend_Gdata_Extension_Rating');
Zend_Loader::loadClass('Zend_Gdata_App_Extension_Published');
Zend_Loader::loadClass('Zend_Gdata_App_Extension_Updated');
Zend_Loader::loadClass('Zend_Gdata_App_Extension_Id');
/**
* Test class for Bridge_Api_Youtube_Element.
* Generated by PHPUnit on 2011-10-12 at 18:35:49.

View File

@@ -1,15 +1,5 @@
<?php
$include_path = realpath(__DIR__ . '/../../vendor/');
if(strpos(get_include_path(), $include_path) === false)
{
$new_include_path = $include_path . PATH_SEPARATOR . get_include_path();
set_include_path($new_include_path);
}
require_once __DIR__ . "/../../vendor/Phlickr/Api.php";
/*
* This file is part of Phraseanet
*

View File

@@ -1,6 +1,5 @@
<?php
require_once __DIR__ . "/../../../../lib/vendor/oauth2/lib/OAuth2.inc";
require_once __DIR__ . '/../../PhraseanetPHPUnitAuthenticatedAbstract.class.inc';
use Symfony\Component\HttpFoundation\Request;

View File

@@ -193,7 +193,6 @@ if (!is_null($templates) || !is_null($parm['deny']) || !is_null($parm['accept'])
if ($row)
{
require_once(__DIR__ . '/../../lib/vendor/PHPMailer_v5.1/class.phpmailer.php');
if (PHPMailer::ValidateAddress($row['usr_mail']))
{
foreach ($bases as $bas => $isok)

View File

@@ -17,10 +17,6 @@
/* @var $Core \Alchemy\Phrasea\Core */
$Core = require_once __DIR__ . "/../../lib/bootstrap.php";
require_once __DIR__ . "/../../lib/classes/API/OAuth2/Autoloader.class.php";
API_OAuth2_Autoloader::register();
$appbox = appbox::get_instance($Core);
require_once($appbox->get_registry()->get('GV_RootPath') . 'lib/classes/deprecated/inscript.api.php');

View File

@@ -29,7 +29,6 @@ $needed = array();
if (isset($parm["mail"]) && trim($parm["mail"]) != "")
{
require_once(__DIR__ . '/../../lib/vendor/PHPMailer_v5.1/class.phpmailer.php');
if (!PHPMailer::ValidateAddress($parm['mail']))
{
return phrasea::redirect('/login/forgotpwd.php?error=noaccount');

View File

@@ -43,7 +43,6 @@ if (!$user->get_mail_locked())
$user->set_mail_locked(false);
random::removeToken($parm['code']);
require_once(dirname(__FILE__) . '/../../lib/vendor/PHPMailer_v5.1/class.phpmailer.php');
if (PHPMailer::ValidateAddress($user->get_email()))
{
if (count($user->ACL()->get_granted_base()) > 0)
@@ -53,7 +52,6 @@ if (PHPMailer::ValidateAddress($user->get_email()))
$user->set_mail_locked(false);
random::removeToken($parm['code']);
require_once(__DIR__ . '/../../lib/vendor/PHPMailer_v5.1/class.phpmailer.php');
if (PHPMailer::ValidateAddress($user->get_email()))
{
$appbox_register = new appbox_register($appbox);

View File

@@ -101,7 +101,6 @@ if ($request->has_post_datas())
$needed['form_password'] = _('forms::la valeur donnee contient des caracteres invalides');
//2 - on verifie que lemail a lair correcte si elle est requise
require_once(__DIR__ . '/../../lib/vendor/PHPMailer_v5.1/class.phpmailer.php');
if (trim($parm['form_email']) != '' && !PHPMailer::ValidateAddress($parm['form_email']))
$needed['form_email'] = _('forms::l\'email semble invalide');

View File

@@ -135,7 +135,6 @@ if (isset($parm['form_password']) && isset($parm['form_email']) && isset($parm['
if (str_replace(array("\r\n", "\r", "\n", "\t"), '_', trim($parm['form_email'])) == $parm['form_email_confirm'])
{
require_once(__DIR__ . '/../../lib/vendor/PHPMailer_v5.1/class.phpmailer.php');
if (PHPMailer::ValidateAddress($parm['form_email']))
{
if (mail::reset_email($parm['form_email'], $session->get_usr_id()) === true)

View File

@@ -20,7 +20,6 @@ $Core = require_once __DIR__ . "/../../lib/bootstrap.php";
phrasea::headers();
$appbox = appbox::get_instance($Core);
$registry = $appbox->get_registry();
require($registry->get('GV_RootPath') . "lib/vendor/PHPShortener/phpshortener.class.php");
$session = Session_Handler::getInstance($appbox);
$request = http_request::getInstance();