Merge branch 'master' of https://github.com/thelia/thelia into yochima-branch

This commit is contained in:
Guillaume Barral
2014-06-19 13:59:16 +02:00
391 changed files with 8886 additions and 2126 deletions

View File

@@ -21,30 +21,28 @@ namespace Thelia\Core;
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
use Propel\Runtime\Connection\ConnectionManagerSingle;
use Propel\Runtime\Connection\ConnectionWrapper;
use Propel\Runtime\Propel;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Config\DatabaseConfiguration;
use Thelia\Config\DefinePropel;
use Thelia\Core\DependencyInjection\Loader\XmlFileLoader;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Template\ParserInterface;
use Thelia\Core\Template\TemplateDefinition;
use Thelia\Core\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\Config\FileLocator;
use Propel\Runtime\Propel;
use Propel\Runtime\Connection\ConnectionManagerSingle;
use Thelia\Core\Template\TemplateHelper;
use Thelia\Log\Tlog;
use Thelia\Model\Module;
use Thelia\Model\ModuleQuery;
class Thelia extends Kernel
{
@@ -143,7 +141,7 @@ class Thelia extends Kernel
}
}
} catch (\UnexpectedValueException $ex) {
// The directory does not exists, ignore it.
// The directory does not exists, ignore it.
}
}
@@ -162,12 +160,13 @@ class Thelia extends Kernel
->depth(0)
->in(THELIA_ROOT . "/core/lib/Thelia/Config/Resources");
/** @var \SplFileInfo $file */
foreach ($finder as $file) {
$loader->load($file->getBaseName());
}
if (defined("THELIA_INSTALL_MODE") === false) {
$modules = \Thelia\Model\ModuleQuery::getActivated();
$modules = ModuleQuery::getActivated();
$translationDirs = array();
@@ -233,12 +232,16 @@ class Thelia extends Kernel
$translationDirs[$module->getFrontOfficeTemplateTranslationDomain($template->getName())] =
$module->getAbsoluteFrontOfficeI18nTemplatePath($template->getName());
}
$this->addStandardModuleTemplatesToParserEnvironment($parser, $module);
} catch (\InvalidArgumentException $e) {
Tlog::getInstance()->addError(
sprintf("Failed to load module %s: %s", $module->getCode(), $e->getMessage()), $e
);
throw $e;
}
}

View File

@@ -73,6 +73,11 @@ class ConfigQuery extends BaseConfigQuery
return true;
}
public static function getConfiguredShopUrl()
{
return ConfigQuery::read("url_site", '');
}
public static function getDefaultLangWhenNoTranslationAvailable()
{
return ConfigQuery::read("default_lang_without_translation", 1);

View File

@@ -787,7 +787,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->getMock();
$stubUploadedFile = $this->getMockBuilder('\Symfony\Component\HttpFoundation\File\UploadedFile')
->disableOriginalConstructor()
->setConstructorArgs([__DIR__ . '/fixtures/test.xml', 'test.xml'])
->getMock();
$stubUploadedFile->expects($this->any())
->method('getClientOriginalExtension')
@@ -814,8 +814,9 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->getMock();
$stubUploadedFile = $this->getMockBuilder('\Symfony\Component\HttpFoundation\File\UploadedFile')
->disableOriginalConstructor()
->setConstructorArgs([__DIR__ . '/fixtures/test.xml', 'test.xml'])
->getMock();
$stubUploadedFile->expects($this->any())
->method('getClientOriginalExtension')
->will($this->returnValue(''));