Merge branch 'master' into tax

Conflicts:
	core/lib/Thelia/Config/Resources/action.xml
	core/lib/Thelia/Controller/Admin/AddressController.php
	core/lib/Thelia/Controller/Admin/CustomerController.php
	core/lib/Thelia/Controller/Admin/ModuleController.php
This commit is contained in:
Etienne Roudeix
2013-10-21 17:48:13 +02:00
100 changed files with 1333 additions and 491 deletions

View File

@@ -30,6 +30,8 @@ use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
use Thelia\Command\ContainerAwareCommand;
use Thelia\Core\Event\Cache\CacheEvent;
use Thelia\Core\Event\TheliaEvents;
/**
* clear the cache
@@ -72,7 +74,11 @@ class CacheClear extends ContainerAwareCommand
$output->writeln(sprintf("Clearing cache in <info>%s</info> directory", $dir));
try {
$directoryBrowser = new \DirectoryIterator($dir);
$cacheEvent = new CacheEvent($dir);
$this->
getContainer()
->get('event_dispatcher')
->dispatch(TheliaEvents::CACHE_CLEAR, $cacheEvent);
} catch (\UnexpectedValueException $e) {
// throws same exception code for does not exist and permission denied ...
if (!file_exists($dir)) {
@@ -82,15 +88,11 @@ class CacheClear extends ContainerAwareCommand
}
throw $e;
}
$fs = new Filesystem();
try {
$fs->remove($dir);
$output->writeln(sprintf("<info>%s cache dir cleared successfully</info>", $dir));
} catch (IOException $e) {
$output->writeln(sprintf("Error during clearing cache : %s", $e->getMessage()));
}
$output->writeln(sprintf("<info>%s cache dir cleared successfully</info>", $dir));
}
}

View File

@@ -143,8 +143,8 @@ class Install extends ContainerAwareCommand
$permissions = new CheckPermission(false, $this->getContainer()->get('thelia.translator'));
$isValid = $permissions->exec();
foreach($permissions->getValidationMessages() as $item => $data) {
if($data['status']) {
foreach ($permissions->getValidationMessages() as $item => $data) {
if ($data['status']) {
$output->writeln(array(
sprintf("<info>%s ...</info> %s",
$data['text'],
@@ -162,7 +162,7 @@ class Install extends ContainerAwareCommand
}
if(false === $isValid) {
if (false === $isValid) {
$output->writeln(array(
"",
"<error>Please put correct permissions and reload install process</error>"

View File

@@ -26,7 +26,6 @@ namespace Thelia\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
use Thelia\Model\ModuleQuery;

View File

@@ -62,7 +62,7 @@ class ModuleGenerateCommand extends BaseModuleGenerate
$output->renderBlock(array(
'',
sprintf("module %s create with success", $this->module),
"You can now configure your module and complete plugin.xml file",
"You can now configure your module and complete module.xml file",
''
), "bg=green;fg=black");
}
@@ -86,7 +86,7 @@ class ModuleGenerateCommand extends BaseModuleGenerate
$fs = new Filesystem();
$skeletonDir = str_replace("/", DIRECTORY_SEPARATOR, THELIA_ROOT . "/core/lib/Thelia/Command/Skeleton/Module/");
$fs->copy($skeletonDir . "config.xml", $this->moduleDirectory . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "config.xml");
$fs->copy($skeletonDir . "plugin.xml", $this->moduleDirectory . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "plugin.xml");
$fs->copy($skeletonDir . "module.xml", $this->moduleDirectory . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "module.xml");
$classContent = file_get_contents($skeletonDir . "Class.php");

View File

@@ -25,7 +25,7 @@ namespace %%NAMESPACE%%;
use Thelia\Module\BaseModule;
class %%CLASSNAME%% extends BaseModule
class Class extends BaseModule
{
/**
* YOU HAVE TO IMPLEMENT HERE ABSTRACT METHODD FROM BaseModule Class

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module>
<fullnamespace></fullnamespace>
<descriptive locale="en_US">
<title></title>
</descriptive>
<descriptive locale="fr_FR">
<title></title>
</descriptive>
<version></version>
<author>
<name></name>
<email></email>
</author>
<type></type>
<thelia></thelia>
<stability></stability>
</module>