This commit is contained in:
Romain Neutron
2013-12-03 21:01:43 +01:00
parent b024492c07
commit 7904a33e07
21 changed files with 11 additions and 51 deletions

View File

@@ -11,9 +11,6 @@
namespace Alchemy\Phrasea\Core\Event; namespace Alchemy\Phrasea\Core\Event;
use Alchemy\Phrasea\Authentication\Context;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\EventDispatcher\Event as SfEvent; use Symfony\Component\EventDispatcher\Event as SfEvent;
class CollectionCreateEvent extends SfEvent class CollectionCreateEvent extends SfEvent

View File

@@ -15,7 +15,6 @@ use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Event\CollectionCreateEvent; use Alchemy\Phrasea\Core\Event\CollectionCreateEvent;
use Alchemy\Phrasea\Core\Event\PostAuthenticate; use Alchemy\Phrasea\Core\Event\PostAuthenticate;
use Alchemy\Phrasea\Core\PhraseaEvents; use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class PhraseaEngineSubscriber implements EventSubscriberInterface class PhraseaEngineSubscriber implements EventSubscriberInterface

View File

@@ -11,8 +11,6 @@
namespace Entities; namespace Entities;
use Doctrine\ORM\Mapping as ORM;
/** /**
* AuthFailure * AuthFailure
*/ */

View File

@@ -11,8 +11,6 @@
namespace Entities; namespace Entities;
use Alchemy\Phrasea\Application;
/** /**
* LazaretAttribute * LazaretAttribute
*/ */

View File

@@ -11,8 +11,6 @@
namespace Entities; namespace Entities;
use Alchemy\Phrasea\Application;
/** /**
* LazaretCheck * LazaretCheck
*/ */

View File

@@ -11,8 +11,6 @@
namespace Entities; namespace Entities;
use Alchemy\Phrasea\Application;
/** /**
* SessionModule * SessionModule
*/ */

View File

@@ -238,7 +238,7 @@ class UsrList
public function has(\User_Adapter $user, Application $app) public function has(\User_Adapter $user, Application $app)
{ {
return $this->entries->exists( return $this->entries->exists(
function($key, $entry) use ($user, $app) { function ($key, $entry) use ($user, $app) {
return $entry->getUser($app)->get_id() === $user->get_id(); return $entry->getUser($app)->get_id() === $user->get_id();
} }
); );

View File

@@ -11,8 +11,6 @@
namespace Entities; namespace Entities;
use Alchemy\Phrasea\Application;
/** /**
* ValidationData * ValidationData
*/ */

View File

@@ -124,8 +124,8 @@ class BasketRepository extends EntityRepository
* *
* @throws NotFoundHttpException * @throws NotFoundHttpException
* @throws AccessDeniedHttpException * @throws AccessDeniedHttpException
* @param type $basket_id * @param type $basket_id
* @param \User_Adapter $user * @param \User_Adapter $user
* @return \Entities\Basket * @return \Entities\Basket
*/ */
public function findUserBasket(Application $app, $basket_id, \User_Adapter $user, $requireOwner) public function findUserBasket(Application $app, $basket_id, \User_Adapter $user, $requireOwner)

View File

@@ -15,7 +15,7 @@ class LazaretFileRepository extends EntityRepository
public function findPerPage(array $base_ids, $offset = 0, $perPage = 10) public function findPerPage(array $base_ids, $offset = 0, $perPage = 10)
{ {
$base_ids = implode(', ', array_map(function($int) { $base_ids = implode(', ', array_map(function ($int) {
return (int) $int; return (int) $int;
}, $base_ids)); }, $base_ids));

View File

@@ -46,7 +46,7 @@ class StoryWZRepository extends EntityRepository
$sortedStories[] = $story->getRecord($app)->get_title(); $sortedStories[] = $story->getRecord($app)->get_title();
} }
uasort($sortedStories, function($a, $b) { uasort($sortedStories, function ($a, $b) {
if ($a == $b) { if ($a == $b) {
return 0; return 0;
} }

View File

@@ -202,11 +202,9 @@ class module_console_checkExtension extends Command
return 1; return 1;
} }
// test disconnected mode if available // test disconnected mode if available
// prepare the test before closing session // prepare the test before closing session
if(function_exists("phrasea_public_query")) if (function_exists("phrasea_public_query")) {
{
// fill an array for each sbas to query // fill an array for each sbas to query
$tbases = array(); $tbases = array();
foreach ($phSession["bases"] as $phbase) { foreach ($phSession["bases"] as $phbase) {
@@ -231,7 +229,6 @@ class module_console_checkExtension extends Command
} }
} }
$output->writeln("\n-- phrasea_close_session --"); $output->writeln("\n-- phrasea_close_session --");
$rs = phrasea_close_session($sessid); $rs = phrasea_close_session($sessid);
@@ -244,11 +241,8 @@ class module_console_checkExtension extends Command
return 1; return 1;
} }
// session is closed, test disconnected mode if available // session is closed, test disconnected mode if available
if(function_exists("phrasea_public_query")) if (function_exists("phrasea_public_query")) {
{
$output->writeln("\n-- phrasea_public_query(...0, 5,...) --"); $output->writeln("\n-- phrasea_public_query(...0, 5,...) --");
$ret = phrasea_public_query( $ret = phrasea_public_query(
@@ -262,7 +256,7 @@ class module_console_checkExtension extends Command
, true // verbose output (chrono, sql...) , true // verbose output (chrono, sql...)
); );
if(is_array($ret) && array_key_exists("results", $ret) && is_array($ret["results"])) { if (is_array($ret) && array_key_exists("results", $ret) && is_array($ret["results"])) {
$output->writeln( sprintf("<info>Succes ! </info> returned %d answers", count($ret["results"])) ); $output->writeln( sprintf("<info>Succes ! </info> returned %d answers", count($ret["results"])) );
} else { } else {
$output->writeln("<error>Failed ! </error>"); $output->writeln("<error>Failed ! </error>");
@@ -270,9 +264,7 @@ class module_console_checkExtension extends Command
return 1; return 1;
} }
foreach ($ret['results'] as $result) {
foreach($ret['results'] as $result)
{
$sbid = $result["sbid"]; $sbid = $result["sbid"];
$rid = $result["rid"]; $rid = $result["rid"];
$q = $tbases["S".$sbid]["arrayq"]; // query tree $q = $tbases["S".$sbid]["arrayq"]; // query tree

View File

@@ -63,4 +63,4 @@ Entities\Session:
mappedBy: session mappedBy: session
cascade: ["ALL"] cascade: ["ALL"]
orderBy: orderBy:
module_id: ASC module_id: ASC

View File

@@ -22,8 +22,3 @@ Entities\StoryWZ:
gedmo: gedmo:
timestampable: timestampable:
on: create on: create

View File

@@ -29,5 +29,3 @@ Entities\UsrList:
targetEntity: UsrListEntry targetEntity: UsrListEntry
mappedBy: list mappedBy: list
cascade: ["ALL"] cascade: ["ALL"]

View File

@@ -31,5 +31,3 @@ Entities\UsrListEntry:
name: list_id name: list_id
referencedColumnName: id referencedColumnName: id
cascade: ["persist"] cascade: ["persist"]

View File

@@ -33,6 +33,3 @@ Entities\UsrListOwner:
name: list_id name: list_id
referencedColumnName: id referencedColumnName: id
cascade: ["persist"] cascade: ["persist"]

View File

@@ -35,7 +35,3 @@ Entities\ValidationSession:
targetEntity: ValidationParticipant targetEntity: ValidationParticipant
mappedBy: session mappedBy: session
cascade: ["ALL"] cascade: ["ALL"]

View File

@@ -29,7 +29,7 @@ class LoadFiveBaskets extends \PhraseaFixture\AbstractWZ implements FixtureInter
public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
for ($i = 0; $i < 5; $i ++ ) { for ($i = 0; $i < 5; $i ++) {
$basket = new \Entities\Basket(); $basket = new \Entities\Basket();
$basket->setName('test ' . $i); $basket->setName('test ' . $i);

View File

@@ -6,6 +6,5 @@
use Alchemy\Phrasea\CLI; use Alchemy\Phrasea\CLI;
return call_user_func(function (CLI $cli) { return call_user_func(function (CLI $cli) {
return $cli; return $cli;
}, $cli); }, $cli);

View File

@@ -6,6 +6,5 @@
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
return call_user_func(function (Application $app) { return call_user_func(function (Application $app) {
return $app; return $app;
}, $app); }, $app);