update api documentation
This commit is contained in:
@@ -22,12 +22,8 @@
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Command;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Symfony\Component\Console\Application;
|
||||
|
||||
|
||||
abstract class BaseModuleGenerate extends ContainerAwareCommand {
|
||||
|
||||
abstract class BaseModuleGenerate extends ContainerAwareCommand
|
||||
{
|
||||
protected $module;
|
||||
protected $moduleDirectory;
|
||||
|
||||
@@ -53,6 +49,8 @@ abstract class BaseModuleGenerate extends ContainerAwareCommand {
|
||||
if (in_array(strtolower($name), $this->reservedKeyWords)) {
|
||||
throw new \RuntimeException(sprintf("%s module name is a reserved keyword", $name));
|
||||
}
|
||||
|
||||
return ucfirst($name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,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;
|
||||
@@ -56,9 +55,10 @@ class CacheClear extends ContainerAwareCommand
|
||||
$fs->remove($cacheDir);
|
||||
|
||||
$output->writeln("<info>cache cleared successfully</info>");
|
||||
} catch(IOException $e) {
|
||||
} catch (IOException $e) {
|
||||
$output->writeln(sprintf("error during clearing cache : %s", $e->getMessage()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class ContainerAwareCommand extends Command implements ContainerAwareInterface {
|
||||
class ContainerAwareCommand extends Command implements ContainerAwareInterface
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
@@ -58,3 +59,4 @@ class ContainerAwareCommand extends Command implements ContainerAwareInterface {
|
||||
$this->container = $container;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Thelia\Command\ContainerAwareCommand;
|
||||
|
||||
|
||||
class Install extends ContainerAwareCommand
|
||||
{
|
||||
/**
|
||||
@@ -80,7 +79,6 @@ class Install extends ContainerAwareCommand
|
||||
|
||||
$this->checkPermission($output);
|
||||
|
||||
|
||||
$connectionInfo = array(
|
||||
"host" => $input->getOption("db_host"),
|
||||
"dbName" => $input->getOption("db_name"),
|
||||
@@ -88,9 +86,7 @@ class Install extends ContainerAwareCommand
|
||||
"password" => $input->getOption("db_password")
|
||||
);
|
||||
|
||||
|
||||
|
||||
while(false === $connection = $this->tryConnection($connectionInfo, $output)) {
|
||||
while (false === $connection = $this->tryConnection($connectionInfo, $output)) {
|
||||
$connectionInfo = $this->getConnectionInfo($input, $output);
|
||||
}
|
||||
|
||||
@@ -164,8 +160,6 @@ class Install extends ContainerAwareCommand
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,7 +174,6 @@ class Install extends ContainerAwareCommand
|
||||
$sampleConfigFile = THELIA_ROOT . "/local/config/database.yml.sample";
|
||||
$configFile = THELIA_ROOT . "/local/config/database.yml";
|
||||
|
||||
|
||||
$fs->copy($sampleConfigFile, $configFile, true);
|
||||
|
||||
$configContent = file_get_contents($configFile);
|
||||
@@ -200,7 +193,6 @@ class Install extends ContainerAwareCommand
|
||||
|
||||
$fs->remove($this->getContainer()->getParameter("kernel.cache_dir"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,7 +229,7 @@ class Install extends ContainerAwareCommand
|
||||
|
||||
$tab = explode(";", $sql);
|
||||
|
||||
for($i=0; $i<count($tab); $i++){
|
||||
for ($i=0; $i<count($tab); $i++) {
|
||||
$queryTemp = str_replace("-CODE-", ";',", $tab[$i]);
|
||||
$queryTemp = str_replace("|", ";", $queryTemp);
|
||||
$query[] = $queryTemp;
|
||||
@@ -266,7 +258,7 @@ class Install extends ContainerAwareCommand
|
||||
* test database access
|
||||
*
|
||||
* @param $connectionInfo
|
||||
* @param OutputInterface $output
|
||||
* @param OutputInterface $output
|
||||
* @return bool|\PDO
|
||||
*/
|
||||
protected function tryConnection($connectionInfo, OutputInterface $output)
|
||||
@@ -288,19 +280,18 @@ class Install extends ContainerAwareCommand
|
||||
$output->writeln(array(
|
||||
"<error>Wrong connection information</error>"
|
||||
));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask to user all needed information
|
||||
*
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
* @return array
|
||||
*/
|
||||
protected function getConnectionInfo(InputInterface $input, OutputInterface $output)
|
||||
@@ -364,3 +355,4 @@ class Install extends ContainerAwareCommand
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -22,16 +22,13 @@
|
||||
/*************************************************************************************/
|
||||
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;
|
||||
|
||||
class ModuleGenerateCommand extends BaseModuleGenerate {
|
||||
|
||||
|
||||
|
||||
class ModuleGenerateCommand extends BaseModuleGenerate
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
@@ -53,7 +50,7 @@ class ModuleGenerateCommand extends BaseModuleGenerate {
|
||||
|
||||
$this->createDirectories();
|
||||
$this->createFiles();
|
||||
if(method_exists($this, "renderBlock")) {
|
||||
if (method_exists($this, "renderBlock")) {
|
||||
//impossible to change output class in CommandTester...
|
||||
$output->renderBlock(array(
|
||||
'',
|
||||
@@ -99,6 +96,5 @@ class ModuleGenerateCommand extends BaseModuleGenerate {
|
||||
file_put_contents($this->moduleDirectory . DIRECTORY_SEPARATOR . "Config". DIRECTORY_SEPARATOR . "schema.xml", $schemaContent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,18 +23,16 @@
|
||||
|
||||
namespace Thelia\Command;
|
||||
|
||||
|
||||
use Propel\Generator\Command\ModelBuildCommand;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Output\StreamOutput;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
class ModuleGenerateModelCommand extends BaseModuleGenerate {
|
||||
|
||||
class ModuleGenerateModelCommand extends BaseModuleGenerate
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
@@ -124,7 +122,7 @@ class ModuleGenerateModelCommand extends BaseModuleGenerate {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,17 +23,15 @@
|
||||
|
||||
namespace Thelia\Command;
|
||||
|
||||
|
||||
use Propel\Generator\Command\SqlBuildCommand;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Output\StreamOutput;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
class ModuleGenerateSqlCommand extends BaseModuleGenerate {
|
||||
|
||||
class ModuleGenerateSqlCommand extends BaseModuleGenerate
|
||||
{
|
||||
public function configure()
|
||||
{
|
||||
$this
|
||||
@@ -83,3 +81,4 @@ class ModuleGenerateSqlCommand extends BaseModuleGenerate {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,10 @@
|
||||
|
||||
namespace Thelia\Command\Output;
|
||||
|
||||
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
|
||||
class TheliaConsoleOutput extends ConsoleOutput{
|
||||
|
||||
class TheliaConsoleOutput extends ConsoleOutput
|
||||
{
|
||||
public function renderBlock(array $messages, $style = "info")
|
||||
{
|
||||
$strlen = function ($string) {
|
||||
@@ -54,3 +53,4 @@ class TheliaConsoleOutput extends ConsoleOutput{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,11 @@
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
|
||||
namespace %%NAMESPACE%%;
|
||||
|
||||
use Thelia\Module\BaseModule;
|
||||
|
||||
class %%CLASSNAME%% extends BaseModule
|
||||
class Class extends BaseModule
|
||||
{
|
||||
/**
|
||||
* YOU HAVE TO IMPLEMENT HERE ABSTRACT METHODD FROM BaseModule Class
|
||||
|
||||
Reference in New Issue
Block a user