mirror of
https://github.com/FriendsOfSymfony/FOSAdvancedEncoderBundle.git
synced 2026-03-24 08:42:13 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc9d59affb | ||
|
|
e3ef1f1317 | ||
|
|
2726627405 | ||
|
|
9c69e092db | ||
|
|
f30fc908ac | ||
|
|
531cf302bc | ||
|
|
c75786a658 | ||
|
|
0ffd8b1ce9 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
phpunit.xml
|
||||
Tests/autoload.php
|
||||
|
||||
vendor/symfony
|
||||
vendor/
|
||||
composer.lock
|
||||
composer.phar
|
||||
|
||||
17
.travis.yml
17
.travis.yml
@@ -1,16 +1,13 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.3
|
||||
- 5.4
|
||||
|
||||
env:
|
||||
- SYMFONY_VERSION=v2.0.12
|
||||
- SYMFONY_VERSION=origin/2.0
|
||||
- SYMFONY_VERSION=origin/master
|
||||
|
||||
before_script: php vendor/vendors.php
|
||||
before_script:
|
||||
- curl -s http://getcomposer.org/installer | php
|
||||
- php composer.phar install --dev
|
||||
|
||||
notifications:
|
||||
email:
|
||||
- friendsofsymfony-dev@googlegroups.com
|
||||
email:
|
||||
- friendsofsymfony-dev@googlegroups.com
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
</service>
|
||||
</services>
|
||||
|
||||
</container>
|
||||
</container>
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
|
||||
namespace FOS\AdvancedEncoderBundle\Security\Encoder;
|
||||
|
||||
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
|
||||
|
||||
/**
|
||||
* @author Christophe Coevoet <stof@notk.org>
|
||||
*/
|
||||
@@ -26,5 +24,5 @@ interface EncoderAwareInterface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getEncoderName();
|
||||
public function getEncoderName();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace FOS\AdvancedEncoderBundle\Security\Encoder;
|
||||
|
||||
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
|
||||
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
/**
|
||||
* @author Christophe Coevoet <stof@notk.org>
|
||||
@@ -26,8 +25,8 @@ class EncoderFactory implements EncoderFactoryInterface
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface $genericFactory
|
||||
* @param array $encoders
|
||||
* @param EncoderFactoryInterface $genericFactory
|
||||
* @param array $encoders
|
||||
*/
|
||||
public function __construct(EncoderFactoryInterface $genericFactory, array $encoders)
|
||||
{
|
||||
@@ -35,7 +34,7 @@ class EncoderFactory implements EncoderFactoryInterface
|
||||
$this->encoders = $encoders;
|
||||
}
|
||||
|
||||
public function getEncoder(UserInterface $user)
|
||||
public function getEncoder($user)
|
||||
{
|
||||
if (!$user instanceof EncoderAwareInterface) {
|
||||
return $this->genericFactory->getEncoder($user);
|
||||
@@ -61,8 +60,8 @@ class EncoderFactory implements EncoderFactoryInterface
|
||||
/**
|
||||
* Creates an encoder for the given algorithm.
|
||||
*
|
||||
* @param array $config
|
||||
* @return \Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface
|
||||
* @param array $config
|
||||
* @return PasswordEncoderInterface
|
||||
*/
|
||||
protected function createEncoder(array $config)
|
||||
{
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the FOSAdvancedEncoderBundle package.
|
||||
*
|
||||
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
$vendorDir = __DIR__.'/../vendor';
|
||||
require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
|
||||
|
||||
use Symfony\Component\ClassLoader\UniversalClassLoader;
|
||||
|
||||
$loader = new UniversalClassLoader();
|
||||
$loader->registerNamespaces(array(
|
||||
'Symfony' => $vendorDir.'/symfony/src',
|
||||
));
|
||||
$loader->register();
|
||||
|
||||
spl_autoload_register(function($class) {
|
||||
if (0 === strpos($class, 'FOS\\AdvancedEncoderBundle\\')) {
|
||||
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
|
||||
if (!stream_resolve_include_path($path)) {
|
||||
return false;
|
||||
}
|
||||
require_once $path;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the FOSAdvancedEncoderBundle package.
|
||||
*
|
||||
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (file_exists($file = __DIR__.'/autoload.php')) {
|
||||
require_once $file;
|
||||
} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
|
||||
require_once $file;
|
||||
}
|
||||
@@ -13,8 +13,8 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.2",
|
||||
"symfony/framework-bundle": ">=2.0,<2.2",
|
||||
"symfony/security-bundle": ">=2.0,<2.2"
|
||||
"symfony/framework-bundle": "~2.1",
|
||||
"symfony/security-bundle": "~2.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "FOS\\AdvancedEncoderBundle": "" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
|
||||
<phpunit bootstrap="vendor/autoload.php" colors="true">
|
||||
<testsuites>
|
||||
<testsuite name="FOSAdvancedEncoderBundle">
|
||||
<directory suffix="Test.php">./Tests</directory>
|
||||
|
||||
35
vendor/vendors.php
vendored
35
vendor/vendors.php
vendored
@@ -1,35 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the FOSAdvancedEncoderBundle package.
|
||||
*
|
||||
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
if (isset($argv[1])) {
|
||||
$_SERVER['SYMFONY_VERSION'] = $argv[1];
|
||||
}
|
||||
|
||||
$vendorDir = __DIR__;
|
||||
$deps = array(
|
||||
array('symfony', 'http://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
|
||||
);
|
||||
|
||||
foreach ($deps as $dep) {
|
||||
list($name, $url, $rev) = $dep;
|
||||
|
||||
echo "> Installing/Updating $name\n";
|
||||
|
||||
$installDir = $vendorDir.'/'.$name;
|
||||
if (!is_dir($installDir)) {
|
||||
system(sprintf('git clone -q %s %s', escapeshellarg($url), escapeshellarg($installDir)));
|
||||
}
|
||||
|
||||
system(sprintf('cd %s && git fetch -q origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
|
||||
}
|
||||
Reference in New Issue
Block a user