Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ptsavdar committed Mar 2, 2016
2 parents e489c7e + 921312d commit 45f469f
Show file tree
Hide file tree
Showing 210 changed files with 4,487 additions and 5,656 deletions.
3 changes: 2 additions & 1 deletion Command/CreateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$roleName = PlatformRoles::USER;
}

$this->getContainer()->get('claroline.manager.user_manager')
->createUserWithRole($user, $roleName, false);
->createUser($user, false, array($roleName));
}
}
7 changes: 2 additions & 5 deletions Command/Dev/InitTestSchemaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand;
use Claroline\InstallationBundle\Bundle\InstallableBundle;;

class InitTestSchemaCommand extends ContainerAwareCommand
{
Expand Down Expand Up @@ -78,10 +77,8 @@ private function createSchema(OutputInterface $output)
$migrator->setLogger($consoleLogger);

foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
if ($bundle instanceof InstallableBundle && $bundle->hasMigrations()) {
if (count($migrator->getBundleStatus($bundle)[Migrator::STATUS_AVAILABLE]) > 1) {
$migrator->upgradeBundle($bundle, Migrator::VERSION_FARTHEST);
}
if (count($migrator->getBundleStatus($bundle)[Migrator::STATUS_AVAILABLE]) > 1) {
$migrator->upgradeBundle($bundle, Migrator::VERSION_FARTHEST);
}
}
}
Expand Down
51 changes: 0 additions & 51 deletions Command/DumpIniFileCommand.php

This file was deleted.

19 changes: 13 additions & 6 deletions Command/PlatformUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
namespace Claroline\CoreBundle\Command;

use Claroline\CoreBundle\Library\Maintenance\MaintenanceHandler;
use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand;
use Psr\Log\LogLevel;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Logger\ConsoleLogger;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -23,9 +25,10 @@
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Updates, installs or uninstalls the core and plugin bundles, following
* the operation order logged in *app/config/operations.xml* during
* composer execution.
* Updates, installs or uninstalls core and plugin bundles, based
* on the comparison of packages previously and currently installed
* by composer (vendor/composer/installed.json and
* app/config/previous-installed.json).
*
* @Service("claroline.command.update_command")
*/
Expand All @@ -36,14 +39,18 @@ protected function configure()
parent::configure();
$this->setName('claroline:update')
->setDescription(
'Updates, installs or uninstalls the platform packages '
. 'brought by composer (requires an operation file).'
'Updates, installs or uninstalls the platform packages brought by composer.'
);
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln(sprintf('<comment>%s - Updating the platform...</comment>', date('H:i:s')));

$databaseCreator = new CreateDatabaseDoctrineCommand();
$databaseCreator->setContainer($this->getContainer());
$databaseCreator->run(new ArrayInput(array()), $output);

$verbosityLevelMap = array(
LogLevel::NOTICE => OutputInterface::VERBOSITY_NORMAL,
LogLevel::INFO => OutputInterface::VERBOSITY_NORMAL,
Expand All @@ -55,7 +62,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$installer = $this->getContainer()->get('claroline.installation.platform_installer');
$installer->setOutput($output);
$installer->setLogger($consoleLogger);
$installer->installFromOperationFile();
$installer->updateFromComposerInfo();

/** @var \Claroline\CoreBundle\Library\Installation\Refresher $refresher */
$refresher = $this->getContainer()->get('claroline.installation.refresher');
Expand Down
97 changes: 0 additions & 97 deletions Controller/API/Admin/PackageController.php

This file was deleted.

21 changes: 13 additions & 8 deletions Controller/API/Organization/LocationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
use FOS\RestBundle\Controller\Annotations\NamePrefix;
use Sensio\Bundle\FrameworkExtraBundle\Configuration as EXT;
use Claroline\CoreBundle\Form\Organization\LocationType;
use JMS\SecurityExtraBundle\Annotation as SEC;

/**
* @NamePrefix("api_")
* @DI\Tag("security.secure_service")
* @SEC\PreAuthorize("canOpenAdminTool('user_management')")
*/
class LocationController extends FOSRestController
{
Expand Down Expand Up @@ -56,7 +59,7 @@ public function __construct(


/**
* @View(serializerGroups={"api"})
* @View(serializerGroups={"api_location"})
* @ApiDoc(
* description="Returns the location list",
* views = {"location"}
Expand All @@ -68,7 +71,7 @@ public function getLocationsAction()
}

/**
* @View(serializerGroups={"api"})
* @View(serializerGroups={"api_location"})
* @ApiDoc(
* description="Returns the location creation form",
* views = {"location"}
Expand All @@ -85,7 +88,7 @@ public function getCreateLocationFormAction()


/**
* @View(serializerGroups={"api"})
* @View(serializerGroups={"api_location"})
* @ApiDoc(
* description="Returns the location edition form",
* views = {"location"}
Expand All @@ -101,7 +104,7 @@ public function getEditLocationFormAction(Location $location)
}

/**
* @View(serializerGroups={"api"})
* @View(serializerGroups={"api_location"})
* @ApiDoc(
* description="Creates a location",
* views = {"location"},
Expand All @@ -125,14 +128,15 @@ public function postLocationAction()

$options = array(
'http_code' => $httpCode,
'extra_parameters' => $location
'extra_parameters' => $location,
'serializer_group' => 'api_location'
);

return $this->apiManager->handleFormView('ClarolineCoreBundle:API:Organization\createLocationForm.html.twig', $form, $options);
}

/**
* @View(serializerGroups={"api"})
* @View(serializerGroups={"api_location"})
* @ApiDoc(
* description="Update a location",
* views = {"location"},
Expand All @@ -155,7 +159,8 @@ public function putLocationAction(Location $location)

$options = array(
'http_code' => $httpCode,
'extra_parameters' => $location
'extra_parameters' => $location,
'serializer_group' => 'api_location'
);

return $this->apiManager->handleFormView('ClarolineCoreBundle:API:Organization\editLocationForm.html.twig', $form, $options);
Expand All @@ -166,7 +171,7 @@ public function putLocationAction(Location $location)
* @ApiDoc(
* description="Removes a location",
* section="location",
* views = {"api"}
* views = {"api_location"}
* )
* @EXT\ParamConverter("location", class="ClarolineCoreBundle:Organization\Location",)
*/
Expand Down
Loading

0 comments on commit 45f469f

Please sign in to comment.