Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG-1.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ CHANGELOG - ZIKULA 1.4.x
- Added Twig filters profileLinkByUserName and profileLinkByUserId (#3079).
- Added LocaleApi for access to locale definitions.
- Added Asset merger feature for twig themes (#2912, #3138).
- Added validation of extension composer files (#2669, #3151)

- Vendor updates:
- doctrine dbal updated from 2.5.4 to 2.5.5
- doctrine orm updated from 2.5.4 to 2.5.5
- gedmo/doctrine-extensions updates from 2.4.22 to 2.4.24
- jquery ui updates from 1.12.0.1 to 1.12.1
- psr log updated from 1.0.0 to 1.0.2
- sensio distribution bundle updated from 5.0.8 to 5.0.13
- sensio distribution bundle updated from 5.0.8 to 5.0.14
- sensio generator bundle updated from 3.0.7 to 3.0.11
- sensiolabs security checker updated from 3.0.2 to 4.0.0
- symfony updated from 2.8.9 to 2.8.13
Expand All @@ -48,6 +49,8 @@ CHANGELOG - ZIKULA 1.4.x
- knp-menu-bundle installed at version 2.1.3
- liip/imagine-bundle installed at 1.6.0
- font-awesome updated from 4.6.3 to 4.7.0
- added justinrainbow/json-schema 4.0.1
- jstree updated from 3.3.2 to 3.3.3

* 1.4.3 (2016-09-02)

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"afarkas/html5shiv": "3.7.*",


"justinrainbow/json-schema": "4.*",
"ramsey/array_column": "1.1.*",
"beberlei/DoctrineExtensions": "v0.3",
"drak/doctrine1": "dev-master",
Expand Down
116 changes: 91 additions & 25 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 41 additions & 3 deletions src/lib/Zikula/Bundle/CoreBundle/Bundle/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,36 @@
namespace Zikula\Bundle\CoreBundle\Bundle;

use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Zikula\ExtensionsModule\Helper\ComposerValidationHelper;

class Scanner
{
private $jsons = [];

/**
* @var ComposerValidationHelper
*/
private $composerValidationHelper;

/**
* @var SessionInterface
*/
protected $session;

/**
* Scanner constructor.
*
* @param ComposerValidationHelper $composerValidationHelper Composer validation helper (optional)
* @param SessionInterface $session
*/
public function __construct(ComposerValidationHelper $composerValidationHelper = null, SessionInterface $session = null)
{
$this->composerValidationHelper = $composerValidationHelper;
$this->session = $session;
}

/**
* Scans and loads composer.json files.
*
Expand All @@ -38,9 +63,18 @@ public function scan(array $paths, $depth = 3, Finder $finder = null)
->depth('<' . $depth)
->name('composer.json');

/** @var $f \SplFileInfo */
foreach ($finder as $f) {
$json = $this->decode($f->getRealPath());
/** @var $file SplFileInfo */
foreach ($finder as $file) {
if (null !== $this->composerValidationHelper) {
$this->composerValidationHelper->check($file);
if (!$this->composerValidationHelper->isValid()) {
foreach ($this->composerValidationHelper->getErrors() as $errorMessage) {
$this->session->getFlashBag()->add('error', $errorMessage);
}
}
}

$json = $this->decode($file->getRealPath());
if (false !== $json) {
$this->jsons[$json['name']] = $json;
}
Expand Down Expand Up @@ -106,11 +140,13 @@ public function getThemesMetaData($indexByShortName = false)
return $this->getMetaData('zikula-theme', $indexByShortName);
}

// @todo remove for 2.0
public function getPluginsMetaData($indexByShortName = false)
{
return $this->getMetaData('zikula-plugin', $indexByShortName);
}

// @todo this can probably be removed in favour of ComposerValidationHelper
private function validateBasic($json)
{
if (!isset($json['type'])) {
Expand All @@ -120,12 +156,14 @@ private function validateBasic($json)
switch ($json['type']) {
case 'zikula-module':
case 'zikula-theme':
// @todo remove for 2.0
case 'zikula-plugin':
break;
default:
return false;
}

// @todo remove psr-0 for 2.0
if (!isset($json['autoload']['psr-0']) && !isset($json['autoload']['psr-4'])) {
return false;
}
Expand Down
5 changes: 3 additions & 2 deletions src/system/ExtensionsModule/Controller/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public function viewModuleListAction(Request $request, $pos = 1)
$this->get('event_dispatcher')->dispatch(ExtensionEvents::REGENERATE_VETO, $vetoEvent);
if (!$vetoEvent->isPropagationStopped() && $pos == 1) {
// regenerate the extension list only when viewing the first page
$extensionsInFileSystem = $this->get('zikula_extensions_module.bundle_sync_helper')->scanForBundles();
$upgradedExtensions = $this->get('zikula_extensions_module.bundle_sync_helper')->syncExtensions($extensionsInFileSystem);
$bundleSyncHelper = $this->get('zikula_extensions_module.bundle_sync_helper');
$extensionsInFileSystem = $bundleSyncHelper->scanForBundles();
$upgradedExtensions = $bundleSyncHelper->syncExtensions($extensionsInFileSystem);
}

$pagedResult = $this->getDoctrine()->getManager()
Expand Down
Loading