@@ -91,7 +91,7 @@ |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - $recursive = function ($config, $space = ' ') use (&$recursive, $output) { |
|
94 | + $recursive = function($config, $space = ' ') use (&$recursive, $output) { |
|
95 | 95 | foreach ($config as $key => $item) { |
96 | 96 | if (is_array($item)) { |
97 | 97 | $space = ' '; |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | if ($code) { |
138 | 138 | $pluginDir = $service->calcPluginDir($code); |
139 | 139 | $service->checkPluginArchiveContent($pluginDir); |
140 | - $config = $service->readYml($pluginDir . '/config.yml'); |
|
141 | - $event = $service->readYml($pluginDir . '/event.yml'); |
|
140 | + $config = $service->readYml($pluginDir.'/config.yml'); |
|
141 | + $event = $service->readYml($pluginDir.'/event.yml'); |
|
142 | 142 | $service->checkSamePlugin($config['code']); |
143 | 143 | $service->registerPlugin($config, $event); |
144 | 144 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | // ディレクトリは残し, プラグインを削除. |
189 | 189 | $pluginDir = $service->calcPluginDir($code); |
190 | - $config = $service->readYml($pluginDir . '/config.yml'); |
|
190 | + $config = $service->readYml($pluginDir.'/config.yml'); |
|
191 | 191 | $service->callPluginManagerMethod($config, 'disable'); |
192 | 192 | $service->callPluginManagerMethod($config, 'uninstall'); |
193 | 193 | $service->unregisterPlugin($plugin); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $app->match('/plugin/[lower_code]/hello', 'Plugin\[code]\Controller\[code]Controller::index')->bind('plugin_[code]_hello'); |
34 | 34 | |
35 | 35 | // Form |
36 | - $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) { |
|
36 | + $app['form.types'] = $app->share($app->extend('form.types', function($types) use ($app) { |
|
37 | 37 | $types[] = new [code]ConfigType(); |
38 | 38 | |
39 | 39 | return $types; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // } |
58 | 58 | |
59 | 59 | // ログファイル設定 |
60 | - $app['monolog.logger.[lower_code]'] = $app->share(function ($app) { |
|
60 | + $app['monolog.logger.[lower_code]'] = $app->share(function($app) { |
|
61 | 61 | |
62 | 62 | $logger = new $app['monolog.logger.class']('[lower_code]'); |
63 | 63 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $this->output->writeln('------------------------------------------------------'); |
48 | 48 | $this->output->writeln('---Plugin Generator for Entity'); |
49 | 49 | $this->output->writeln('---[*] You need to create yaml file first.'); |
50 | - $this->output->writeln('---[*]You can exit from Console Application, by typing ' . self::STOP_PROCESS . ' instead of typing another word.'); |
|
50 | + $this->output->writeln('---[*]You can exit from Console Application, by typing '.self::STOP_PROCESS.' instead of typing another word.'); |
|
51 | 51 | $this->output->writeln('------------------------------------------------------'); |
52 | 52 | $this->output->writeln(''); |
53 | 53 | } |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | $pluginCode = $this->paramList['pluginCode']['value']; |
63 | 63 | $yamlList = $this->paramList['entityList']['value']; |
64 | 64 | |
65 | - $codePath = $this->app['config']['root_dir'] . '/app/Plugin/' . $pluginCode; |
|
65 | + $codePath = $this->app['config']['root_dir'].'/app/Plugin/'.$pluginCode; |
|
66 | 66 | |
67 | 67 | $dirList = array('Entity', 'Repository', '/Resource/doctrine/migration'); |
68 | 68 | foreach ($dirList as $dirName) { |
69 | - $dirPath = $codePath . '/' . $dirName; |
|
69 | + $dirPath = $codePath.'/'.$dirName; |
|
70 | 70 | if (!is_dir($dirPath)) { |
71 | 71 | mkdir($dirPath); |
72 | 72 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $metadetas = array(); |
80 | 80 | |
81 | 81 | |
82 | - $YamlDriver = new YamlDriver(array($codePath . '/Resource/doctrine')); |
|
82 | + $YamlDriver = new YamlDriver(array($codePath.'/Resource/doctrine')); |
|
83 | 83 | foreach ($yamlList as $pathYaml => $fullClassName) { |
84 | 84 | |
85 | 85 | $MetadataInfo = new ClassMetadataInfo($fullClassName); |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | $EntityGenerator->setGenerateStubMethods(true); |
96 | 96 | $EntityGenerator->setUpdateEntityIfExists(false); |
97 | 97 | |
98 | - $pathClass = $this->app['config']['root_dir'] . '/app/'; |
|
98 | + $pathClass = $this->app['config']['root_dir'].'/app/'; |
|
99 | 99 | $EntityGenerator->generate(array($MetadataInfo), $pathClass); |
100 | - $pathClass .= str_replace('\\', DIRECTORY_SEPARATOR, $MetadataInfo->name) . '.php'; |
|
100 | + $pathClass .= str_replace('\\', DIRECTORY_SEPARATOR, $MetadataInfo->name).'.php'; |
|
101 | 101 | if (is_file($pathClass)) { |
102 | 102 | $fsList['file'][$pathClass] = true; |
103 | 103 | } else { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $migrationContent = $this->makeMigration($pluginCode, $metadetas); |
119 | 119 | $timeSt = date('YmdHis'); |
120 | 120 | $migrationContent = str_replace('[datetime]', $timeSt, $migrationContent); |
121 | - $migPath = $codePath . '/Resource/doctrine/migration/Version' . $timeSt . '.php'; |
|
121 | + $migPath = $codePath.'/Resource/doctrine/migration/Version'.$timeSt.'.php'; |
|
122 | 122 | |
123 | 123 | file_put_contents($migPath, $migrationContent); |
124 | 124 | if (is_file($migPath)) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $this->output->writeln(''); |
151 | 151 | $this->output->writeln(' this files and folders were created.'); |
152 | 152 | foreach ($dirFileOk as $path) { |
153 | - $this->output->writeln('<info> - ' . $path . '</info>'); |
|
153 | + $this->output->writeln('<info> - '.$path.'</info>'); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | |
202 | 202 | if ($this->entityList === null) { |
203 | 203 | $this->entityList = array(); |
204 | - $directory = $this->app['config']['root_dir'] . '/app/Plugin/' . $this->paramList['pluginCode']['value'] . '/Resource/doctrine/'; |
|
204 | + $directory = $this->app['config']['root_dir'].'/app/Plugin/'.$this->paramList['pluginCode']['value'].'/Resource/doctrine/'; |
|
205 | 205 | if (!is_dir($directory)) { |
206 | 206 | return $this->entityList; |
207 | 207 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | private function getPluginList() |
223 | 223 | { |
224 | 224 | $ret = array(); |
225 | - $pluginDir = $this->app['config']['root_dir'] . '/app/Plugin'; |
|
225 | + $pluginDir = $this->app['config']['root_dir'].'/app/Plugin'; |
|
226 | 226 | $iterator = new \DirectoryIterator($pluginDir); |
227 | 227 | foreach ($iterator as $fileInfo) { |
228 | 228 | if ($fileInfo->isDot()) { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | private function toCamelCase($name) |
239 | 239 | { |
240 | - return lcfirst(implode('', array_map(function ($name) { |
|
240 | + return lcfirst(implode('', array_map(function($name) { |
|
241 | 241 | return ucfirst($name); |
242 | 242 | }, explode('_', $name)))); |
243 | 243 | } |
@@ -249,31 +249,31 @@ discard block |
||
249 | 249 | $line = array(); |
250 | 250 | $line[] = '<?php'; |
251 | 251 | $line[] = '/*'; |
252 | - $line[] = ' * This file is part of ' . $pluginCode; |
|
252 | + $line[] = ' * This file is part of '.$pluginCode; |
|
253 | 253 | $line[] = ' *'; |
254 | 254 | $line[] = ' *'; |
255 | 255 | $line[] = ' * For the full copyright and license information, please view the LICENSE'; |
256 | 256 | $line[] = ' * file that was distributed with this source code.'; |
257 | 257 | $line[] = ' */'; |
258 | 258 | $line[] = ''; |
259 | - $line[] = 'namespace Plugin\\' . $pluginCode . '\Repository;'; |
|
259 | + $line[] = 'namespace Plugin\\'.$pluginCode.'\Repository;'; |
|
260 | 260 | $line[] = ''; |
261 | 261 | $line[] = 'use Doctrine\ORM\EntityRepository;'; |
262 | 262 | $line[] = ''; |
263 | 263 | $line[] = '/**'; |
264 | - $line[] = ' * ' . $nameFormated; |
|
264 | + $line[] = ' * '.$nameFormated; |
|
265 | 265 | $line[] = ' *'; |
266 | 266 | $line[] = ' * This class was generated by the Doctrine ORM. Add your own custom'; |
267 | 267 | $line[] = ' * repository methods below.'; |
268 | 268 | $line[] = ' */'; |
269 | - $line[] = 'class ' . $nameFormated . 'Repository extends EntityRepository'; |
|
269 | + $line[] = 'class '.$nameFormated.'Repository extends EntityRepository'; |
|
270 | 270 | $line[] = '{'; |
271 | 271 | $line[] = ''; |
272 | 272 | $line[] = '}'; |
273 | 273 | $line[] = ''; |
274 | 274 | |
275 | 275 | $cont = join(PHP_EOL, $line); |
276 | - $filename = $this->app['config']['root_dir'] . '/app/Plugin/' . $pluginCode . '/Repository/' . $nameFormated . 'Repository.php'; |
|
276 | + $filename = $this->app['config']['root_dir'].'/app/Plugin/'.$pluginCode.'/Repository/'.$nameFormated.'Repository.php'; |
|
277 | 277 | file_put_contents($filename, $cont); |
278 | 278 | return $filename; |
279 | 279 | } |
@@ -281,20 +281,20 @@ discard block |
||
281 | 281 | private function makeMigration($pluginCode, $metadetas) |
282 | 282 | { |
283 | 283 | if ($this->paramList['supportFlag']['value']) { |
284 | - $migrationFileCont = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/MigrationVersionSupport.php'); |
|
284 | + $migrationFileCont = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/MigrationVersionSupport.php'); |
|
285 | 285 | } else { |
286 | - $migrationFileCont = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/MigrationVersion.php'); |
|
286 | + $migrationFileCont = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/MigrationVersion.php'); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | $entityList = $this->createEntityList($pluginCode, $metadetas); |
290 | 290 | |
291 | - $entityListStr = join(',' . PHP_EOL, $entityList); |
|
291 | + $entityListStr = join(','.PHP_EOL, $entityList); |
|
292 | 292 | $migrationFileCont = str_replace('[entityList]', $entityListStr, $migrationFileCont); |
293 | 293 | if ($this->paramList['supportFlag']['value']) { |
294 | 294 | $createParts = $this->makeCreateParts($metadetas); |
295 | 295 | $tableNameArr = array(); |
296 | 296 | foreach ($createParts as $tableName => $tableArr) { |
297 | - $tableNameArr[] = ' $this->createTable' . $tableName . '($schema);'; |
|
297 | + $tableNameArr[] = ' $this->createTable'.$tableName.'($schema);'; |
|
298 | 298 | } |
299 | 299 | $tableNameStr = join(PHP_EOL, $tableNameArr); |
300 | 300 | $migrationFileCont = str_replace('[createTable]', $tableNameStr, $migrationFileCont); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | { |
318 | 318 | $ret = array(); |
319 | 319 | foreach ($migrations as $metadata) { |
320 | - $ret[] = " '" . 'Plugin\\' . $pluginCode . '\Entity\\' . ucfirst($this->getShortClassName($metadata->table['name'])) . "'"; |
|
320 | + $ret[] = " '".'Plugin\\'.$pluginCode.'\Entity\\'.ucfirst($this->getShortClassName($metadata->table['name']))."'"; |
|
321 | 321 | } |
322 | 322 | return $ret; |
323 | 323 | } |
@@ -335,14 +335,14 @@ discard block |
||
335 | 335 | $nameFormated = $this->getShortClassName($metadata->table['name']); |
336 | 336 | $tmp = array(); |
337 | 337 | $tmp[] = ''; |
338 | - $tmp[] = ' public function createTable' . ucfirst($nameFormated) . '(Schema $schema)'; |
|
338 | + $tmp[] = ' public function createTable'.ucfirst($nameFormated).'(Schema $schema)'; |
|
339 | 339 | $tmp[] = ' {'; |
340 | - $tmp[] = ' $table = $schema->createTable(\'' . $metadata->table['name'] . '\');'; |
|
340 | + $tmp[] = ' $table = $schema->createTable(\''.$metadata->table['name'].'\');'; |
|
341 | 341 | $columns = $metadata->fieldMappings; |
342 | 342 | foreach ($columns as $column) { |
343 | 343 | |
344 | 344 | $typeName = $column['type']; |
345 | - $tmp[] = ' $table->addColumn(\'' . $column['columnName'] . '\', \'' . $typeName . '\', array('; |
|
345 | + $tmp[] = ' $table->addColumn(\''.$column['columnName'].'\', \''.$typeName.'\', array('; |
|
346 | 346 | $param = array(); |
347 | 347 | if (isset($column['nullable']) && $column['nullable']) { |
348 | 348 | $param['notnull'] = 'true'; |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | } |
352 | 352 | |
353 | 353 | foreach ($param as $parKey => $parVal) { |
354 | - $tmp[] = ' \'' . $parKey . '\' => ' . $parVal . ','; |
|
354 | + $tmp[] = ' \''.$parKey.'\' => '.$parVal.','; |
|
355 | 355 | } |
356 | 356 | $tmp[] = ' ));'; |
357 | 357 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | { |
370 | 370 | $ret = array(); |
371 | 371 | foreach ($metadetas as $metadata) { |
372 | - $ret[] = ' $schema->dropTable(\'' . $metadata->table['name'] . '\');'; |
|
372 | + $ret[] = ' $schema->dropTable(\''.$metadata->table['name'].'\');'; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | return $ret; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $this->output->writeln('------------------------------------------------------'); |
44 | 44 | $this->output->writeln('---Plugin Generator for Entity'); |
45 | 45 | $this->output->writeln('---[*] You need to create table schema first.'); |
46 | - $this->output->writeln('---[*]You can exit from Console Application, by typing ' . self::STOP_PROCESS . ' instead of typing another word.'); |
|
46 | + $this->output->writeln('---[*]You can exit from Console Application, by typing '.self::STOP_PROCESS.' instead of typing another word.'); |
|
47 | 47 | $this->output->writeln('------------------------------------------------------'); |
48 | 48 | $this->output->writeln(''); |
49 | 49 | } |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | |
58 | 58 | $pluginCode = $this->paramList['pluginCode']['value']; |
59 | 59 | $tableList = $this->paramList['tableList']['value']; |
60 | - $codePath = $this->app['config']['root_dir'] . '/app/Plugin/' . $pluginCode; |
|
60 | + $codePath = $this->app['config']['root_dir'].'/app/Plugin/'.$pluginCode; |
|
61 | 61 | |
62 | 62 | $dirList = array('Entity', 'Repository', 'Resource', 'Resource/doctrine', '/Resource/doctrine/migration'); |
63 | 63 | foreach ($dirList as $dirName) { |
64 | - $dirPath = $codePath . '/' . $dirName; |
|
64 | + $dirPath = $codePath.'/'.$dirName; |
|
65 | 65 | if (!is_dir($dirPath)) { |
66 | 66 | mkdir($dirPath); |
67 | 67 | } |
@@ -86,13 +86,13 @@ discard block |
||
86 | 86 | $migrationContent = $this->makeMigration($pluginCode, $migration); |
87 | 87 | $timeSt = date('YmdHis'); |
88 | 88 | $migrationContent = str_replace('[datetime]', $timeSt, $migrationContent); |
89 | - $path = '/Resource/doctrine/migration/Version' . $timeSt . '.php'; |
|
89 | + $path = '/Resource/doctrine/migration/Version'.$timeSt.'.php'; |
|
90 | 90 | $entityInfoList[] = array($path => $migrationContent); |
91 | 91 | } |
92 | 92 | |
93 | 93 | foreach ($entityInfoList as $entityInfo) { |
94 | 94 | foreach ($entityInfo as $path => $body) { |
95 | - $fullPath = $this->app['config']['root_dir'] . '/app/Plugin/' . $pluginCode . $path; |
|
95 | + $fullPath = $this->app['config']['root_dir'].'/app/Plugin/'.$pluginCode.$path; |
|
96 | 96 | file_put_contents($fullPath, $body); |
97 | 97 | if (is_file($fullPath)) { |
98 | 98 | $fsList['file'][$fullPath] = true; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $this->output->writeln(''); |
124 | 124 | $this->output->writeln(' this files and folders were created.'); |
125 | 125 | foreach ($dirFileOk as $path) { |
126 | - $this->output->writeln('<info> - ' . $path . '</info>'); |
|
126 | + $this->output->writeln('<info> - '.$path.'</info>'); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | } |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | $nameFormated = ucfirst($this->toCamelCase($tableName)); |
135 | 135 | |
136 | 136 | $ret = array(); |
137 | - $ret['/Entity/' . $nameFormated . '.php'] = $this->getSrc($pluginCode, $TableInfo); |
|
137 | + $ret['/Entity/'.$nameFormated.'.php'] = $this->getSrc($pluginCode, $TableInfo); |
|
138 | 138 | |
139 | - $ret['/Resource/doctrine/Plugin.' . $pluginCode . '.Entity.' . $nameFormated . '.dcm.yml'] = $this->getConfig($pluginCode, $TableInfo); |
|
139 | + $ret['/Resource/doctrine/Plugin.'.$pluginCode.'.Entity.'.$nameFormated.'.dcm.yml'] = $this->getConfig($pluginCode, $TableInfo); |
|
140 | 140 | |
141 | - $ret['/Repository/' . $nameFormated . 'Repository.php'] = $this->getRepo($pluginCode, $TableInfo); |
|
141 | + $ret['/Repository/'.$nameFormated.'Repository.php'] = $this->getRepo($pluginCode, $TableInfo); |
|
142 | 142 | |
143 | 143 | return $ret; |
144 | 144 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | private function getPluginList() |
202 | 202 | { |
203 | 203 | $ret = array(); |
204 | - $pluginDir = $this->app['config']['root_dir'] . '/app/Plugin'; |
|
204 | + $pluginDir = $this->app['config']['root_dir'].'/app/Plugin'; |
|
205 | 205 | $iterator = new \DirectoryIterator($pluginDir); |
206 | 206 | foreach ($iterator as $fileInfo) { |
207 | 207 | if ($fileInfo->isDot()) { |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | private function toCamelCase($name) |
218 | 218 | { |
219 | - return lcfirst(implode('', array_map(function ($name) { |
|
219 | + return lcfirst(implode('', array_map(function($name) { |
|
220 | 220 | return ucfirst($name); |
221 | 221 | }, explode('_', $name)))); |
222 | 222 | } |
@@ -259,43 +259,43 @@ discard block |
||
259 | 259 | $varName = 'string'; |
260 | 260 | } |
261 | 261 | |
262 | - $tmpProp = '' . PHP_EOL; |
|
263 | - $tmpProp .= ' /**' . PHP_EOL; |
|
264 | - $tmpProp .= ' * @var ' . $varName . PHP_EOL; |
|
265 | - $tmpProp .= ' */' . PHP_EOL; |
|
266 | - $tmpProp .= ' private $' . $columnName . ';' . PHP_EOL; |
|
262 | + $tmpProp = ''.PHP_EOL; |
|
263 | + $tmpProp .= ' /**'.PHP_EOL; |
|
264 | + $tmpProp .= ' * @var '.$varName.PHP_EOL; |
|
265 | + $tmpProp .= ' */'.PHP_EOL; |
|
266 | + $tmpProp .= ' private $'.$columnName.';'.PHP_EOL; |
|
267 | 267 | |
268 | 268 | $prop[] = $tmpProp; |
269 | 269 | |
270 | - $tmpGetMethName = $this->toCamelCase('get_' . $columnName); |
|
270 | + $tmpGetMethName = $this->toCamelCase('get_'.$columnName); |
|
271 | 271 | |
272 | - $tmpGet = '' . PHP_EOL; |
|
273 | - $tmpGet .= ' /**' . PHP_EOL; |
|
274 | - $tmpGet .= ' * Get ' . $columnName . PHP_EOL; |
|
275 | - $tmpGet .= ' *' . PHP_EOL; |
|
276 | - $tmpGet .= ' * @return ' . $varName . PHP_EOL; |
|
277 | - $tmpGet .= ' */' . PHP_EOL; |
|
278 | - $tmpGet .= ' public function ' . $tmpGetMethName . '()' . PHP_EOL; |
|
279 | - $tmpGet .= ' {' . PHP_EOL; |
|
280 | - $tmpGet .= ' return $this->' . $columnName . ';' . PHP_EOL; |
|
281 | - $tmpGet .= ' }' . PHP_EOL; |
|
272 | + $tmpGet = ''.PHP_EOL; |
|
273 | + $tmpGet .= ' /**'.PHP_EOL; |
|
274 | + $tmpGet .= ' * Get '.$columnName.PHP_EOL; |
|
275 | + $tmpGet .= ' *'.PHP_EOL; |
|
276 | + $tmpGet .= ' * @return '.$varName.PHP_EOL; |
|
277 | + $tmpGet .= ' */'.PHP_EOL; |
|
278 | + $tmpGet .= ' public function '.$tmpGetMethName.'()'.PHP_EOL; |
|
279 | + $tmpGet .= ' {'.PHP_EOL; |
|
280 | + $tmpGet .= ' return $this->'.$columnName.';'.PHP_EOL; |
|
281 | + $tmpGet .= ' }'.PHP_EOL; |
|
282 | 282 | |
283 | 283 | $getMethods[] = $tmpGet; |
284 | 284 | |
285 | - $tmpSetMethName = $this->toCamelCase('set_' . $columnName); |
|
286 | - |
|
287 | - $tmpSet = '' . PHP_EOL; |
|
288 | - $tmpSet .= ' /**' . PHP_EOL; |
|
289 | - $tmpSet .= ' * Set ' . $columnName . PHP_EOL; |
|
290 | - $tmpSet .= ' *' . PHP_EOL; |
|
291 | - $tmpSet .= ' * @param ' . $varName . ' $' . $columnName . PHP_EOL; |
|
292 | - $tmpSet .= ' * @return ' . $nameFormated . PHP_EOL; |
|
293 | - $tmpSet .= ' */' . PHP_EOL; |
|
294 | - $tmpSet .= ' public function ' . $tmpSetMethName . '( $' . $columnName . ')' . PHP_EOL; |
|
295 | - $tmpSet .= ' {' . PHP_EOL; |
|
296 | - $tmpSet .= ' $this->' . $columnName . ' = $' . $columnName . ';' . PHP_EOL; |
|
297 | - $tmpSet .= ' return $this;' . PHP_EOL; |
|
298 | - $tmpSet .= ' }' . PHP_EOL; |
|
285 | + $tmpSetMethName = $this->toCamelCase('set_'.$columnName); |
|
286 | + |
|
287 | + $tmpSet = ''.PHP_EOL; |
|
288 | + $tmpSet .= ' /**'.PHP_EOL; |
|
289 | + $tmpSet .= ' * Set '.$columnName.PHP_EOL; |
|
290 | + $tmpSet .= ' *'.PHP_EOL; |
|
291 | + $tmpSet .= ' * @param '.$varName.' $'.$columnName.PHP_EOL; |
|
292 | + $tmpSet .= ' * @return '.$nameFormated.PHP_EOL; |
|
293 | + $tmpSet .= ' */'.PHP_EOL; |
|
294 | + $tmpSet .= ' public function '.$tmpSetMethName.'( $'.$columnName.')'.PHP_EOL; |
|
295 | + $tmpSet .= ' {'.PHP_EOL; |
|
296 | + $tmpSet .= ' $this->'.$columnName.' = $'.$columnName.';'.PHP_EOL; |
|
297 | + $tmpSet .= ' return $this;'.PHP_EOL; |
|
298 | + $tmpSet .= ' }'.PHP_EOL; |
|
299 | 299 | $setMethods[] = $tmpSet; |
300 | 300 | } |
301 | 301 | $ret .= PHP_EOL; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $ret .= PHP_EOL; |
306 | 306 | $ret .= join(PHP_EOL, $setMethods); |
307 | 307 | $ret .= PHP_EOL; |
308 | - $ret .= '}' . PHP_EOL; |
|
308 | + $ret .= '}'.PHP_EOL; |
|
309 | 309 | |
310 | 310 | |
311 | 311 | return $ret; |
@@ -316,16 +316,16 @@ discard block |
||
316 | 316 | $line = array(); |
317 | 317 | $line[] = '<?php'; |
318 | 318 | $line[] = '/*'; |
319 | - $line[] = ' * This file is part of ' . $pluginCode; |
|
319 | + $line[] = ' * This file is part of '.$pluginCode; |
|
320 | 320 | $line[] = ' *'; |
321 | 321 | $line[] = ' *'; |
322 | 322 | $line[] = ' * For the full copyright and license information, please view the LICENSE'; |
323 | 323 | $line[] = ' * file that was distributed with this source code.'; |
324 | 324 | $line[] = ' */'; |
325 | 325 | $line[] = ''; |
326 | - $line[] = 'namespace Plugin\\' . $pluginCode . '\Entity;'; |
|
326 | + $line[] = 'namespace Plugin\\'.$pluginCode.'\Entity;'; |
|
327 | 327 | $line[] = ''; |
328 | - $line[] = 'class ' . ucfirst($nameFormated) . ' extends \Eccube\Entity\AbstractEntity'; |
|
328 | + $line[] = 'class '.ucfirst($nameFormated).' extends \Eccube\Entity\AbstractEntity'; |
|
329 | 329 | $line[] = '{'; |
330 | 330 | $line[] = ' /**'; |
331 | 331 | $line[] = ' * @return string'; |
@@ -409,10 +409,10 @@ discard block |
||
409 | 409 | } |
410 | 410 | |
411 | 411 | $yml = array( |
412 | - 'Plugin\\' . $pluginCode . '\Entity\\' . ucfirst($nameFormated) => array( |
|
412 | + 'Plugin\\'.$pluginCode.'\Entity\\'.ucfirst($nameFormated) => array( |
|
413 | 413 | 'type' => 'entity', |
414 | 414 | 'table' => $TableInfo->getName(), |
415 | - 'repositoryClass' => 'Plugin\\' . $pluginCode . '\Repository\\' . ucfirst($nameFormated) . 'Repository', |
|
415 | + 'repositoryClass' => 'Plugin\\'.$pluginCode.'\Repository\\'.ucfirst($nameFormated).'Repository', |
|
416 | 416 | 'id' => array( |
417 | 417 | 'id' => $id |
418 | 418 | ), |
@@ -430,24 +430,24 @@ discard block |
||
430 | 430 | $line = array(); |
431 | 431 | $line[] = '<?php'; |
432 | 432 | $line[] = '/*'; |
433 | - $line[] = ' * This file is part of ' . $pluginCode; |
|
433 | + $line[] = ' * This file is part of '.$pluginCode; |
|
434 | 434 | $line[] = ' *'; |
435 | 435 | $line[] = ' *'; |
436 | 436 | $line[] = ' * For the full copyright and license information, please view the LICENSE'; |
437 | 437 | $line[] = ' * file that was distributed with this source code.'; |
438 | 438 | $line[] = ' */'; |
439 | 439 | $line[] = ''; |
440 | - $line[] = 'namespace Plugin\\' . $pluginCode . '\Repository;'; |
|
440 | + $line[] = 'namespace Plugin\\'.$pluginCode.'\Repository;'; |
|
441 | 441 | $line[] = ''; |
442 | 442 | $line[] = 'use Doctrine\ORM\EntityRepository;'; |
443 | 443 | $line[] = ''; |
444 | 444 | $line[] = '/**'; |
445 | - $line[] = ' * ' . ucfirst($nameFormated); |
|
445 | + $line[] = ' * '.ucfirst($nameFormated); |
|
446 | 446 | $line[] = ' *'; |
447 | 447 | $line[] = ' * This class was generated by the Doctrine ORM. Add your own custom'; |
448 | 448 | $line[] = ' * repository methods below.'; |
449 | 449 | $line[] = ' */'; |
450 | - $line[] = 'class ' . ucfirst($nameFormated) . 'Repository extends EntityRepository'; |
|
450 | + $line[] = 'class '.ucfirst($nameFormated).'Repository extends EntityRepository'; |
|
451 | 451 | $line[] = '{'; |
452 | 452 | $line[] = ''; |
453 | 453 | $line[] = '}'; |
@@ -458,21 +458,21 @@ discard block |
||
458 | 458 | private function makeMigration($pluginCode, $migration) |
459 | 459 | { |
460 | 460 | if ($this->paramList['supportFlag']['value']) { |
461 | - $migrationFileCont = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/MigrationVersionSupport.php'); |
|
461 | + $migrationFileCont = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/MigrationVersionSupport.php'); |
|
462 | 462 | } else { |
463 | - $migrationFileCont = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/MigrationVersion.php'); |
|
463 | + $migrationFileCont = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/MigrationVersion.php'); |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | $entityList = $this->createEntityList($pluginCode, $migration); |
467 | 467 | |
468 | - $entityListStr = join(',' . PHP_EOL, $entityList); |
|
468 | + $entityListStr = join(','.PHP_EOL, $entityList); |
|
469 | 469 | $migrationFileCont = str_replace('[entityList]', $entityListStr, $migrationFileCont); |
470 | 470 | |
471 | 471 | if ($this->paramList['supportFlag']['value']) { |
472 | 472 | $createParts = $this->makeCreateParts($migration); |
473 | 473 | $tableNameArr = array(); |
474 | 474 | foreach ($createParts as $tableName => $tableArr) { |
475 | - $tableNameArr[] = ' $this->createTable' . $tableName . '($schema);'; |
|
475 | + $tableNameArr[] = ' $this->createTable'.$tableName.'($schema);'; |
|
476 | 476 | } |
477 | 477 | $tableNameStr = join(PHP_EOL, $tableNameArr); |
478 | 478 | $migrationFileCont = str_replace('[createTable]', $tableNameStr, $migrationFileCont); |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | { |
496 | 496 | $ret = array(); |
497 | 497 | foreach ($migration as $TableInfo) { |
498 | - $ret[] = " '" . 'Plugin\\' . $pluginCode . '\Entity\\' . ucfirst($this->getShortClassName($TableInfo->getName())) . "'"; |
|
498 | + $ret[] = " '".'Plugin\\'.$pluginCode.'\Entity\\'.ucfirst($this->getShortClassName($TableInfo->getName()))."'"; |
|
499 | 499 | } |
500 | 500 | return $ret; |
501 | 501 | } |
@@ -512,14 +512,14 @@ discard block |
||
512 | 512 | $nameFormated = $this->getShortClassName($TableInfo->getName()); |
513 | 513 | $tmp = array(); |
514 | 514 | $tmp[] = PHP_EOL; |
515 | - $tmp[] = ' public function createTable' . ucfirst($nameFormated) . '(Schema $schema)'; |
|
515 | + $tmp[] = ' public function createTable'.ucfirst($nameFormated).'(Schema $schema)'; |
|
516 | 516 | $tmp[] = ' {'; |
517 | - $tmp[] = ' $table = $schema->createTable(\'' . $TableInfo->getName() . '\');'; |
|
517 | + $tmp[] = ' $table = $schema->createTable(\''.$TableInfo->getName().'\');'; |
|
518 | 518 | $columns = $TableInfo->getColumns(); |
519 | 519 | foreach ($columns as $column) { |
520 | 520 | |
521 | 521 | $typeName = $column->getType()->getName(); |
522 | - $tmp[] = ' $table->addColumn(\'' . $column->getName() . '\', \'' . $typeName . '\', array('; |
|
522 | + $tmp[] = ' $table->addColumn(\''.$column->getName().'\', \''.$typeName.'\', array('; |
|
523 | 523 | $param = array(); |
524 | 524 | if ($column->getNotNull()) { |
525 | 525 | $param['notnull'] = 'true'; |
@@ -530,16 +530,16 @@ discard block |
||
530 | 530 | $param['unsigned'] = 'true'; |
531 | 531 | } |
532 | 532 | if ($column->getDefault()) { |
533 | - $param['default'] = '\'' . $column->getDefault() . '\''; |
|
533 | + $param['default'] = '\''.$column->getDefault().'\''; |
|
534 | 534 | } |
535 | 535 | if ($column->getAutoincrement()) { |
536 | 536 | $param['autoincrement'] = 'true'; |
537 | 537 | } |
538 | 538 | if ($column->getComment()) { |
539 | - $param['comment'] = '\'' . str_replace('\'', '\\\'', $column->getComment()) . '\''; |
|
539 | + $param['comment'] = '\''.str_replace('\'', '\\\'', $column->getComment()).'\''; |
|
540 | 540 | } |
541 | 541 | if ($column->getLength()) { |
542 | - $param['length'] = '\'' . $column->getLength() . '\''; |
|
542 | + $param['length'] = '\''.$column->getLength().'\''; |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | if ($typeName == 'decimal') { |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $param['scale'] = $column->getScale(); |
548 | 548 | } |
549 | 549 | foreach ($param as $parKey => $parVal) { |
550 | - $tmp[] = ' \'' . $parKey . '\' => ' . $parVal . ','; |
|
550 | + $tmp[] = ' \''.$parKey.'\' => '.$parVal.','; |
|
551 | 551 | } |
552 | 552 | $tmp[] = ' ));'; |
553 | 553 | } |
@@ -557,20 +557,20 @@ discard block |
||
557 | 557 | if ($index->isPrimary()) { |
558 | 558 | $tmpCol = $index->getColumns(); |
559 | 559 | foreach ($tmpCol as $colName) { |
560 | - $tmp[] = ' $table->setPrimaryKey(array(\'' . $colName . '\'));'; |
|
560 | + $tmp[] = ' $table->setPrimaryKey(array(\''.$colName.'\'));'; |
|
561 | 561 | break; |
562 | 562 | } |
563 | 563 | } else { |
564 | 564 | $tmp[] = ' $columnNames = array();'; |
565 | 565 | foreach ($index->getColumns() as $IdentName) { |
566 | - $tmp[] = ' $columnNames[] = \'' . $IdentName . '\';'; |
|
566 | + $tmp[] = ' $columnNames[] = \''.$IdentName.'\';'; |
|
567 | 567 | } |
568 | - $tmp[] = ' $indexName = \'' . $index->getName() . '\';'; |
|
569 | - $tmp[] = ' $options = ' . var_export($index->getOptions(), true) . ';'; |
|
568 | + $tmp[] = ' $indexName = \''.$index->getName().'\';'; |
|
569 | + $tmp[] = ' $options = '.var_export($index->getOptions(), true).';'; |
|
570 | 570 | if ($index->isUnique()) { |
571 | 571 | $tmp[] = ' $table->addUniqueIndex($columnNames, $indexName, $options);'; |
572 | 572 | } else { |
573 | - $tmp[] = ' $flags = ' . var_export($index->getFlags(), true) . ';'; |
|
573 | + $tmp[] = ' $flags = '.var_export($index->getFlags(), true).';'; |
|
574 | 574 | $tmp[] = ' $table->addIndex($columnNames, $indexName,$flags, $options);'; |
575 | 575 | } |
576 | 576 | } |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | { |
588 | 588 | $ret = array(); |
589 | 589 | foreach ($migration as $TableInfo) { |
590 | - $ret[] = ' $schema->dropTable(\'' . $TableInfo->getName() . '\');'; |
|
590 | + $ret[] = ' $schema->dropTable(\''.$TableInfo->getName().'\');'; |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | return $ret; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $this->output->writeln('------------------------------------------------------'); |
52 | 52 | $this->output->writeln('---Plugin Generator'); |
53 | - $this->output->writeln('---[*]You can exit from Console Application, by typing ' . self::STOP_PROCESS . ' instead of typing another word.'); |
|
53 | + $this->output->writeln('---[*]You can exit from Console Application, by typing '.self::STOP_PROCESS.' instead of typing another word.'); |
|
54 | 54 | $this->output->writeln('------------------------------------------------------'); |
55 | 55 | $this->output->writeln(''); |
56 | 56 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | 'label' => '[+]Old version support: ', |
102 | 102 | 'value' => null, |
103 | 103 | 'name' => '[+]Do you want to support old versions too? [y/n]', |
104 | - 'show' => array(1 => 'Yes' ,0 => 'No'), |
|
104 | + 'show' => array(1 => 'Yes', 0 => 'No'), |
|
105 | 105 | 'validation' => array( |
106 | 106 | 'isRequired' => true, |
107 | 107 | 'choice' => array('y' => 1, 'n' => 0) |
@@ -148,13 +148,13 @@ discard block |
||
148 | 148 | $this->events = array(); |
149 | 149 | $routeEvents = array(); |
150 | 150 | if ($this->paramList['supportFlag']['value']) { |
151 | - $this->events = include $this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/eventsList.php'; |
|
151 | + $this->events = include $this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/eventsList.php'; |
|
152 | 152 | $routeEvents['eccube.event.controller.__route__.before'] = 'Controller__route__Before'; |
153 | 153 | $routeEvents['eccube.event.controller.__route__.after'] = 'Controller__route__After'; |
154 | 154 | $routeEvents['eccube.event.controller.__route__.finish'] = 'Controller__route__Finish'; |
155 | 155 | $routeEvents['eccube.event.render.__route__.before'] = 'Render__route__Before'; |
156 | 156 | } |
157 | - $this->events += include $this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/eventsListNew.php'; |
|
157 | + $this->events += include $this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/eventsListNew.php'; |
|
158 | 158 | |
159 | 159 | $routeEvents['eccube.event.route.__route__.request'] = 'Route__route__Request'; |
160 | 160 | $routeEvents['eccube.event.route.__route__.controller'] = 'Route__route__Controller'; |
@@ -214,11 +214,11 @@ discard block |
||
214 | 214 | $config['code'] = $code; |
215 | 215 | $config['version'] = $paramList['version']['value']; |
216 | 216 | if (!empty($paramList['hookPoints']['value'])) { |
217 | - $config['event'] = $code . 'Event'; |
|
217 | + $config['event'] = $code.'Event'; |
|
218 | 218 | } |
219 | - $config['service'] = array($code . 'ServiceProvider'); |
|
219 | + $config['service'] = array($code.'ServiceProvider'); |
|
220 | 220 | |
221 | - $codePath = $this->app['config']['root_dir'] . '/app/Plugin/' . $code; |
|
221 | + $codePath = $this->app['config']['root_dir'].'/app/Plugin/'.$code; |
|
222 | 222 | |
223 | 223 | $file = new Filesystem(); |
224 | 224 | $file->mkdir($codePath); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $fsList['dir'][$codePath] = false; |
229 | 229 | } |
230 | 230 | |
231 | - $srcPath = $codePath . '/config.yml'; |
|
231 | + $srcPath = $codePath.'/config.yml'; |
|
232 | 232 | file_put_contents($srcPath, Yaml::dump($config)); |
233 | 233 | if (is_file($srcPath)) { |
234 | 234 | $fsList['file'][$srcPath] = true; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $year = date('Y'); |
241 | 241 | |
242 | 242 | // PluginManager |
243 | - $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/PluginManager.php'); |
|
243 | + $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/PluginManager.php'); |
|
244 | 244 | $from = '/\[code\]/'; |
245 | 245 | $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore); |
246 | 246 | $from = '/\[author\]/'; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $from = '/\[year\]/'; |
249 | 249 | $pluginFileAfter = preg_replace($from, $year, $pluginFileAfter); |
250 | 250 | |
251 | - $srcPath = $codePath . '/PluginManager.php'; |
|
251 | + $srcPath = $codePath.'/PluginManager.php'; |
|
252 | 252 | file_put_contents($srcPath, $pluginFileAfter); |
253 | 253 | if (is_file($srcPath)) { |
254 | 254 | $fsList['file'][$srcPath] = true; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | // ServiceProvider |
260 | - $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/ServiceProvider.php'); |
|
260 | + $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/ServiceProvider.php'); |
|
261 | 261 | $from = '/\[code\]/'; |
262 | 262 | $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore); |
263 | 263 | $from = '/\[author\]/'; |
@@ -265,14 +265,14 @@ discard block |
||
265 | 265 | $from = '/\[year\]/'; |
266 | 266 | $pluginFileAfter = preg_replace($from, $year, $pluginFileAfter); |
267 | 267 | |
268 | - $file->mkdir($codePath . '/ServiceProvider'); |
|
269 | - if (is_dir($codePath . '/ServiceProvider')) { |
|
270 | - $fsList['dir'][$codePath . '/ServiceProvider'] = true; |
|
268 | + $file->mkdir($codePath.'/ServiceProvider'); |
|
269 | + if (is_dir($codePath.'/ServiceProvider')) { |
|
270 | + $fsList['dir'][$codePath.'/ServiceProvider'] = true; |
|
271 | 271 | } else { |
272 | - $fsList['dir'][$codePath . '/ServiceProvider'] = false; |
|
272 | + $fsList['dir'][$codePath.'/ServiceProvider'] = false; |
|
273 | 273 | } |
274 | 274 | |
275 | - $srcPath = $codePath . '/ServiceProvider/' . $code . 'ServiceProvider.php'; |
|
275 | + $srcPath = $codePath.'/ServiceProvider/'.$code.'ServiceProvider.php'; |
|
276 | 276 | file_put_contents($srcPath, $pluginFileAfter); |
277 | 277 | if (is_file($srcPath)) { |
278 | 278 | $fsList['file'][$srcPath] = true; |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | // ConfigController |
284 | - $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/ConfigController.php'); |
|
284 | + $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/ConfigController.php'); |
|
285 | 285 | $from = '/\[code\]/'; |
286 | 286 | $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore); |
287 | 287 | $from = '/\[author\]/'; |
@@ -291,14 +291,14 @@ discard block |
||
291 | 291 | $from = '/\[code_name\]/'; |
292 | 292 | $pluginFileAfter = preg_replace($from, mb_strtolower($code), $pluginFileAfter); |
293 | 293 | |
294 | - $file->mkdir($codePath . '/Controller'); |
|
295 | - if (is_dir($codePath . '/Controller')) { |
|
296 | - $fsList['dir'][$codePath . '/Controller'] = true; |
|
294 | + $file->mkdir($codePath.'/Controller'); |
|
295 | + if (is_dir($codePath.'/Controller')) { |
|
296 | + $fsList['dir'][$codePath.'/Controller'] = true; |
|
297 | 297 | } else { |
298 | - $fsList['dir'][$codePath . '/Controller'] = false; |
|
298 | + $fsList['dir'][$codePath.'/Controller'] = false; |
|
299 | 299 | } |
300 | 300 | |
301 | - $srcPath = $codePath . '/Controller/ConfigController.php'; |
|
301 | + $srcPath = $codePath.'/Controller/ConfigController.php'; |
|
302 | 302 | file_put_contents($srcPath, $pluginFileAfter); |
303 | 303 | if (is_file($srcPath)) { |
304 | 304 | $fsList['file'][$srcPath] = true; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | // Controller |
310 | - $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/Controller.php'); |
|
310 | + $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/Controller.php'); |
|
311 | 311 | $from = '/\[code\]/'; |
312 | 312 | $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore); |
313 | 313 | $from = '/\[author\]/'; |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $from = '/\[code_name\]/'; |
318 | 318 | $pluginFileAfter = preg_replace($from, mb_strtolower($code), $pluginFileAfter); |
319 | 319 | |
320 | - $srcPath = $codePath . '/Controller/' . $code . 'Controller.php'; |
|
320 | + $srcPath = $codePath.'/Controller/'.$code.'Controller.php'; |
|
321 | 321 | file_put_contents($srcPath, $pluginFileAfter); |
322 | 322 | if (is_file($srcPath)) { |
323 | 323 | $fsList['file'][$srcPath] = true; |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | } |
327 | 327 | |
328 | 328 | // Form |
329 | - $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/ConfigType.php'); |
|
329 | + $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/ConfigType.php'); |
|
330 | 330 | $from = '/\[code\]/'; |
331 | 331 | $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore); |
332 | 332 | $from = '/\[author\]/'; |
@@ -336,15 +336,15 @@ discard block |
||
336 | 336 | $from = '/\[code_name\]/'; |
337 | 337 | $pluginFileAfter = preg_replace($from, mb_strtolower($code), $pluginFileAfter); |
338 | 338 | |
339 | - $file->mkdir($codePath . '/Form/Type'); |
|
340 | - if (is_dir($codePath . '/Form/Type')) { |
|
341 | - $fsList['dir'][$codePath . '/Form/Type'] = true; |
|
339 | + $file->mkdir($codePath.'/Form/Type'); |
|
340 | + if (is_dir($codePath.'/Form/Type')) { |
|
341 | + $fsList['dir'][$codePath.'/Form/Type'] = true; |
|
342 | 342 | } else { |
343 | - $fsList['dir'][$codePath . '/Form/Type'] = false; |
|
343 | + $fsList['dir'][$codePath.'/Form/Type'] = false; |
|
344 | 344 | } |
345 | 345 | |
346 | - $srcPath = $codePath . '/Form/Type/' . $code . 'ConfigType.php'; |
|
347 | - file_put_contents($codePath . '/Form/Type/' . $code . 'ConfigType.php', $pluginFileAfter); |
|
346 | + $srcPath = $codePath.'/Form/Type/'.$code.'ConfigType.php'; |
|
347 | + file_put_contents($codePath.'/Form/Type/'.$code.'ConfigType.php', $pluginFileAfter); |
|
348 | 348 | if (is_file($srcPath)) { |
349 | 349 | $fsList['file'][$srcPath] = true; |
350 | 350 | } else { |
@@ -352,18 +352,18 @@ discard block |
||
352 | 352 | } |
353 | 353 | |
354 | 354 | // Twig |
355 | - $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/config.twig'); |
|
355 | + $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/config.twig'); |
|
356 | 356 | $from = '/\[code\]/'; |
357 | 357 | $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore); |
358 | 358 | |
359 | - $file->mkdir($codePath . '/Resource/template/admin'); |
|
360 | - if (is_dir($codePath . '/Resource/template/admin')) { |
|
361 | - $fsList['dir'][$codePath . '/Resource/template/admin'] = true; |
|
359 | + $file->mkdir($codePath.'/Resource/template/admin'); |
|
360 | + if (is_dir($codePath.'/Resource/template/admin')) { |
|
361 | + $fsList['dir'][$codePath.'/Resource/template/admin'] = true; |
|
362 | 362 | } else { |
363 | - $fsList['dir'][$codePath . '/Resource/template/admin'] = false; |
|
363 | + $fsList['dir'][$codePath.'/Resource/template/admin'] = false; |
|
364 | 364 | } |
365 | 365 | |
366 | - $srcPath = $codePath . '/Resource/template/admin/config.twig'; |
|
366 | + $srcPath = $codePath.'/Resource/template/admin/config.twig'; |
|
367 | 367 | file_put_contents($srcPath, $pluginFileAfter); |
368 | 368 | if (is_file($srcPath)) { |
369 | 369 | $fsList['file'][$srcPath] = true; |
@@ -372,18 +372,18 @@ discard block |
||
372 | 372 | } |
373 | 373 | |
374 | 374 | // index.twig |
375 | - $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/index.twig'); |
|
375 | + $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/index.twig'); |
|
376 | 376 | $from = '/\[code\]/'; |
377 | 377 | $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore); |
378 | 378 | |
379 | - $file->mkdir($codePath . '/Resource/template/admin'); |
|
380 | - if (is_dir($codePath . '/Resource/template/admin')) { |
|
381 | - $fsList['dir'][$codePath . '/Resource/template/admin'] = true; |
|
379 | + $file->mkdir($codePath.'/Resource/template/admin'); |
|
380 | + if (is_dir($codePath.'/Resource/template/admin')) { |
|
381 | + $fsList['dir'][$codePath.'/Resource/template/admin'] = true; |
|
382 | 382 | } else { |
383 | - $fsList['dir'][$codePath . '/Resource/template/admin'] = false; |
|
383 | + $fsList['dir'][$codePath.'/Resource/template/admin'] = false; |
|
384 | 384 | } |
385 | 385 | |
386 | - $srcPath = $codePath . '/Resource/template/index.twig'; |
|
386 | + $srcPath = $codePath.'/Resource/template/index.twig'; |
|
387 | 387 | file_put_contents($srcPath, $pluginFileAfter); |
388 | 388 | if (is_file($srcPath)) { |
389 | 389 | $fsList['file'][$srcPath] = true; |
@@ -398,8 +398,8 @@ discard block |
||
398 | 398 | $events = $paramList['events']['value']; |
399 | 399 | if (count($events) > 0) { |
400 | 400 | foreach ($events as $eventKey => $eventConst) { |
401 | - $onEvents[$eventKey] = array(array('on' . $eventConst . ', NORMAL')); |
|
402 | - $onFunctions[] = 'on' . $eventConst; |
|
401 | + $onEvents[$eventKey] = array(array('on'.$eventConst.', NORMAL')); |
|
402 | + $onFunctions[] = 'on'.$eventConst; |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
@@ -407,14 +407,14 @@ discard block |
||
407 | 407 | $hookPoints = $paramList['hookPoints']['value']; |
408 | 408 | if (count($hookPoints)) { |
409 | 409 | foreach ($hookPoints as $hookKey => $hookConst) { |
410 | - $onName = 'on' . join(array_map('ucfirst', explode('_', strtolower($hookConst)))); |
|
411 | - $onEvents[$hookKey] = array(array($onName . ', NORMAL')); |
|
410 | + $onName = 'on'.join(array_map('ucfirst', explode('_', strtolower($hookConst)))); |
|
411 | + $onEvents[$hookKey] = array(array($onName.', NORMAL')); |
|
412 | 412 | $onFunctions[] = $onName; |
413 | 413 | } |
414 | 414 | } |
415 | 415 | |
416 | 416 | if (count($onEvents)) { |
417 | - $srcPath = $codePath . '/event.yml'; |
|
417 | + $srcPath = $codePath.'/event.yml'; |
|
418 | 418 | file_put_contents($srcPath, str_replace('\'', '', Yaml::dump($onEvents))); |
419 | 419 | if (is_file($srcPath)) { |
420 | 420 | $fsList['file'][$srcPath] = true; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $fsList['file'][$srcPath] = false; |
423 | 423 | } |
424 | 424 | |
425 | - $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/EventHookpoint2.php'); |
|
425 | + $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/EventHookpoint2.php'); |
|
426 | 426 | |
427 | 427 | // Event |
428 | 428 | $from = '/\[code\]/'; |
@@ -434,11 +434,11 @@ discard block |
||
434 | 434 | |
435 | 435 | $functions = ''; |
436 | 436 | foreach ($onFunctions as $functionName) { |
437 | - $functions .= " public function " . $functionName . "(EventArgs \$event)\n {\n }\n\n"; |
|
437 | + $functions .= " public function ".$functionName."(EventArgs \$event)\n {\n }\n\n"; |
|
438 | 438 | } |
439 | 439 | $from = '/\[hookpoint_function\]/'; |
440 | 440 | $pluginFileAfter = preg_replace($from, $functions, $pluginFileAfter); |
441 | - $srcPath = $codePath . '/' . $code . 'Event.php'; |
|
441 | + $srcPath = $codePath.'/'.$code.'Event.php'; |
|
442 | 442 | file_put_contents($srcPath, $pluginFileAfter); |
443 | 443 | if (is_file($srcPath)) { |
444 | 444 | $fsList['file'][$srcPath] = true; |
@@ -452,9 +452,9 @@ discard block |
||
452 | 452 | $config['name'] = $paramList['pluginName']['value']; |
453 | 453 | $config['code'] = $code; |
454 | 454 | $config['version'] = $paramList['version']['value']; |
455 | - $config['event'] = $code . 'Event'; |
|
456 | - $config['service'] = array($code . 'ServiceProvider'); |
|
457 | - $srcPath = $codePath . '/config.yml'; |
|
455 | + $config['event'] = $code.'Event'; |
|
456 | + $config['service'] = array($code.'ServiceProvider'); |
|
457 | + $srcPath = $codePath.'/config.yml'; |
|
458 | 458 | file_put_contents($srcPath, Yaml::dump($config)); |
459 | 459 | if (is_file($srcPath)) { |
460 | 460 | $fsList['file'][$srcPath] = true; |
@@ -463,8 +463,8 @@ discard block |
||
463 | 463 | } |
464 | 464 | |
465 | 465 | // LICENSE |
466 | - $srcPath = $codePath . '/LICENSE'; |
|
467 | - $file->copy($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/LICENSE', $srcPath); |
|
466 | + $srcPath = $codePath.'/LICENSE'; |
|
467 | + $file->copy($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/LICENSE', $srcPath); |
|
468 | 468 | if (is_file($srcPath)) { |
469 | 469 | $fsList['file'][$srcPath] = true; |
470 | 470 | } else { |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | $this->output->writeln(''); |
494 | 494 | $this->output->writeln(' this files and folders were created.'); |
495 | 495 | foreach ($dirFileOk as $path) { |
496 | - $this->output->writeln('<info> - ' . $path . '</info>'); |
|
496 | + $this->output->writeln('<info> - '.$path.'</info>'); |
|
497 | 497 | } |
498 | 498 | } |
499 | 499 | |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | $this->output->writeln(''); |
502 | 502 | $this->output->writeln(' this files and folders was not created.'); |
503 | 503 | foreach ($dirFileOk as $path) { |
504 | - $this->output->writeln('<error> - ' . $path . '</error>'); |
|
504 | + $this->output->writeln('<error> - '.$path.'</error>'); |
|
505 | 505 | } |
506 | 506 | } |
507 | 507 | } |
@@ -524,9 +524,9 @@ discard block |
||
524 | 524 | $this->output->writeln(''); |
525 | 525 | $this->output->writeln('[+]Database'); |
526 | 526 | if ($Plugin->getId()) { |
527 | - $this->output->writeln('<info> Plugin information was added to table [DB.Plugin] (id=' . $Plugin->getId() . ')</info>'); |
|
527 | + $this->output->writeln('<info> Plugin information was added to table [DB.Plugin] (id='.$Plugin->getId().')</info>'); |
|
528 | 528 | } else { |
529 | - $this->output->writeln('<error> there was a problem inserting plugin information to table [DB.Plugin] (id=' . $Plugin->getId() . ')</error>'); |
|
529 | + $this->output->writeln('<error> there was a problem inserting plugin information to table [DB.Plugin] (id='.$Plugin->getId().')</error>'); |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | $hookPoints = $paramList['hookPoints']['value']; |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | $eventCount = 0; |
538 | 538 | foreach ($hookPoints as $hookKey => $hookConst) { |
539 | 539 | $PluginEventHandler = new PluginEventHandler(); |
540 | - $functionName = 'on' . join(array_map('ucfirst', explode('_', strtolower($hookConst)))); |
|
540 | + $functionName = 'on'.join(array_map('ucfirst', explode('_', strtolower($hookConst)))); |
|
541 | 541 | $PluginEventHandler->setPlugin($Plugin) |
542 | 542 | ->setEvent($hookKey) |
543 | 543 | ->setPriority($this->app['eccube.repository.plugin_event_handler']->calcNewPriority($hookKey, $functionName)) |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | $this->app['orm.em']->flush(); |
551 | 551 | if ($eventCount) { |
552 | 552 | $this->output->writeln(''); |
553 | - $this->output->writeln('<info> Plugin information was added to table [DB.PluginEventHandler] (inserts number=' . $eventCount . ') </info>'); |
|
553 | + $this->output->writeln('<info> Plugin information was added to table [DB.PluginEventHandler] (inserts number='.$eventCount.') </info>'); |
|
554 | 554 | } |
555 | 555 | } |
556 | 556 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | if (is_array($params['value'])) { |
128 | 128 | $this->output->writeln($params['label']); |
129 | 129 | foreach ($params['value'] as $keys => $val) { |
130 | - $this->output->writeln('<info> ' . $keys . '</info>'); |
|
130 | + $this->output->writeln('<info> '.$keys.'</info>'); |
|
131 | 131 | } |
132 | 132 | } else { |
133 | 133 | if (isset($params['show'])) { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } else { |
136 | 136 | $disp = $params['value']; |
137 | 137 | } |
138 | - $this->output->writeln($params['label'] . ' <info>' . $disp . '</info>'); |
|
138 | + $this->output->writeln($params['label'].' <info>'.$disp.'</info>'); |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 | $this->output->writeln(''); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $this->nestingLevel--; |
166 | 166 | |
167 | 167 | $this->output->writeln($params['name']); |
168 | - $Question = new Question('<comment>Input' . self::INPUT_OPEN . $params['no'] . self::INPUT_CLOSE . ' : </comment>', ''); |
|
168 | + $Question = new Question('<comment>Input'.self::INPUT_OPEN.$params['no'].self::INPUT_CLOSE.' : </comment>', ''); |
|
169 | 169 | $value = $this->dialog->ask($this->input, $this->output, $Question); |
170 | 170 | $value = trim($value); |
171 | 171 | if ($value === self::STOP_PROCESS) { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $params['value'][$value] = $row[$value]; |
199 | 199 | $this->output->writeln('<info>--- your entry list</info>'); |
200 | 200 | foreach ($params['value'] as $subKey => $node) { |
201 | - $this->output->writeln('<info> - ' . $subKey . '</info>'); |
|
201 | + $this->output->writeln('<info> - '.$subKey.'</info>'); |
|
202 | 202 | } |
203 | 203 | $this->output->writeln(''); |
204 | 204 | $this->output->writeln('--- Press Enter to move to the next step ---'); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | foreach ($row as $eventKey => $eventConst) { |
211 | 211 | if (strpos($eventKey, $value) !== false || strpos($eventConst, $value) !== false) { |
212 | 212 | if (count($searchList) >= $max) { |
213 | - $searchList['-- there are more then ' . $max . ''] = ''; |
|
213 | + $searchList['-- there are more then '.$max.''] = ''; |
|
214 | 214 | break; |
215 | 215 | } |
216 | 216 | $searchList[$eventKey] = $eventConst; |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $this->output->writeln('--- there are more then one search result'); |
222 | 222 | } |
223 | 223 | foreach ($searchList as $subKey => $node) { |
224 | - $this->output->writeln(' - ' . $subKey); |
|
224 | + $this->output->writeln(' - '.$subKey); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | if (!empty($searchList)) { |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | |
57 | 57 | public function __construct() |
58 | 58 | { |
59 | - $this->config_path = __DIR__ . '/../../../../app/config/eccube'; |
|
60 | - $this->dist_path = __DIR__ . '/../../Resource/config'; |
|
61 | - $this->cache_path = __DIR__ . '/../../../../app/cache'; |
|
59 | + $this->config_path = __DIR__.'/../../../../app/config/eccube'; |
|
60 | + $this->dist_path = __DIR__.'/../../Resource/config'; |
|
61 | + $this->cache_path = __DIR__.'/../../../../app/cache'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | private function isValid(Request $request, Form $form) |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | return $app['twig']->render('step1.twig', array( |
110 | 110 | 'form' => $form->createView(), |
111 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
111 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
112 | 112 | )); |
113 | 113 | } |
114 | 114 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | return $app['twig']->render('step2.twig', array( |
133 | 133 | 'protectedDirs' => $protectedDirs, |
134 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
134 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
135 | 135 | )); |
136 | 136 | } |
137 | 137 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | if (empty($sessionData['shop_name'])) { |
147 | 147 | |
148 | - $config_file = $this->config_path . '/config.yml'; |
|
148 | + $config_file = $this->config_path.'/config.yml'; |
|
149 | 149 | $fs = new Filesystem(); |
150 | 150 | |
151 | 151 | if ($fs->exists($config_file)) { |
@@ -159,11 +159,11 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | // セキュリティの設定 |
162 | - $config_file = $this->config_path . '/path.yml'; |
|
162 | + $config_file = $this->config_path.'/path.yml'; |
|
163 | 163 | $config = Yaml::parse(file_get_contents($config_file)); |
164 | 164 | $sessionData['admin_dir'] = $config['admin_route']; |
165 | 165 | |
166 | - $config_file = $this->config_path . '/config.yml'; |
|
166 | + $config_file = $this->config_path.'/config.yml'; |
|
167 | 167 | $config = Yaml::parse(file_get_contents($config_file)); |
168 | 168 | |
169 | 169 | $allowHost = $config['admin_allow_host']; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $sessionData['admin_force_ssl'] = (bool) $config['force_ssl']; |
174 | 174 | |
175 | 175 | // メール設定 |
176 | - $config_file = $this->config_path . '/mail.yml'; |
|
176 | + $config_file = $this->config_path.'/mail.yml'; |
|
177 | 177 | $config = Yaml::parse(file_get_contents($config_file)); |
178 | 178 | $mail = $config['mail']; |
179 | 179 | $sessionData['mail_backend'] = $mail['transport']; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | return $app['twig']->render('step3.twig', array( |
198 | 198 | 'form' => $form->createView(), |
199 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
199 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
200 | 200 | )); |
201 | 201 | } |
202 | 202 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | |
212 | 212 | if (empty($sessionData['database'])) { |
213 | 213 | |
214 | - $config_file = $this->config_path . '/database.yml'; |
|
214 | + $config_file = $this->config_path.'/database.yml'; |
|
215 | 215 | $fs = new Filesystem(); |
216 | 216 | |
217 | 217 | if ($fs->exists($config_file)) { |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | |
240 | 240 | return $app['twig']->render('step4.twig', array( |
241 | 241 | 'form' => $form->createView(), |
242 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
242 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
243 | 243 | )); |
244 | 244 | } |
245 | 245 | |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $host = $request->getSchemeAndHttpHost(); |
286 | 286 | $basePath = $request->getBasePath(); |
287 | 287 | $params = array( |
288 | - 'http_url' => $host . $basePath, |
|
288 | + 'http_url' => $host.$basePath, |
|
289 | 289 | 'shop_name' => $sessionData['shop_name'], |
290 | 290 | ); |
291 | 291 | |
@@ -300,24 +300,24 @@ discard block |
||
300 | 300 | |
301 | 301 | return $app['twig']->render('step5.twig', array( |
302 | 302 | 'form' => $form->createView(), |
303 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
303 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
304 | 304 | )); |
305 | 305 | } |
306 | 306 | |
307 | 307 | // インストール完了 |
308 | 308 | public function complete(InstallApplication $app, Request $request) |
309 | 309 | { |
310 | - $config_file = $this->config_path . '/path.yml'; |
|
310 | + $config_file = $this->config_path.'/path.yml'; |
|
311 | 311 | $config = Yaml::parse(file_get_contents($config_file)); |
312 | 312 | |
313 | 313 | $host = $request->getSchemeAndHttpHost(); |
314 | 314 | $basePath = $request->getBasePath(); |
315 | 315 | |
316 | - $adminUrl = $host . $basePath . '/' . $config['admin_dir']; |
|
316 | + $adminUrl = $host.$basePath.'/'.$config['admin_dir']; |
|
317 | 317 | |
318 | 318 | return $app['twig']->render('complete.twig', array( |
319 | 319 | 'admin_url' => $adminUrl, |
320 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
320 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
321 | 321 | )); |
322 | 322 | } |
323 | 323 | |
@@ -333,12 +333,12 @@ discard block |
||
333 | 333 | { |
334 | 334 | foreach ($this->required_modules as $module) { |
335 | 335 | if (!extension_loaded($module)) { |
336 | - $app->addDanger('[必須] ' . $module . ' 拡張モジュールが有効になっていません。', 'install'); |
|
336 | + $app->addDanger('[必須] '.$module.' 拡張モジュールが有効になっていません。', 'install'); |
|
337 | 337 | } |
338 | 338 | } |
339 | 339 | |
340 | 340 | if (!extension_loaded('pdo_mysql') && !extension_loaded('pdo_pgsql')) { |
341 | - $app->addDanger('[必須] ' . 'pdo_pgsql又はpdo_mysql 拡張モジュールを有効にしてください。', 'install'); |
|
341 | + $app->addDanger('[必須] '.'pdo_pgsql又はpdo_mysql 拡張モジュールを有効にしてください。', 'install'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | foreach ($this->recommended_module as $module) { |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | //http://php.net/manual/en/migration71.deprecated.php |
349 | 349 | continue; |
350 | 350 | } |
351 | - $app->addWarning('[推奨] ' . $module . ' 拡張モジュールが有効になっていません。', 'install'); |
|
351 | + $app->addWarning('[推奨] '.$module.' 拡張モジュールが有効になっていません。', 'install'); |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | if (!function_exists('apache_get_modules')) { |
367 | 367 | $app->addWarning('mod_rewrite が有効になっているか不明です。', 'install'); |
368 | 368 | } elseif (!in_array('mod_rewrite', apache_get_modules())) { |
369 | - $app->addDanger('[必須] ' . 'mod_rewriteを有効にしてください。', 'install'); |
|
369 | + $app->addDanger('[必須] '.'mod_rewriteを有効にしてください。', 'install'); |
|
370 | 370 | } |
371 | 371 | } elseif (isset($_SERVER['SERVER_SOFTWARE']) && strpos('Microsoft-IIS', $_SERVER['SERVER_SOFTWARE']) !== false) { |
372 | 372 | // iis |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | |
378 | 378 | private function setPDO() |
379 | 379 | { |
380 | - $config_file = $this->config_path . '/database.yml'; |
|
380 | + $config_file = $this->config_path.'/database.yml'; |
|
381 | 381 | $config = Yaml::parse(file_get_contents($config_file)); |
382 | 382 | |
383 | 383 | try { |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | */ |
412 | 412 | private function getEntityManager() |
413 | 413 | { |
414 | - $config_file = $this->config_path . '/database.yml'; |
|
414 | + $config_file = $this->config_path.'/database.yml'; |
|
415 | 415 | $database = Yaml::parse(file_get_contents($config_file)); |
416 | 416 | |
417 | 417 | $this->app->register(new \Silex\Provider\DoctrineServiceProvider(), array( |
@@ -419,15 +419,15 @@ discard block |
||
419 | 419 | )); |
420 | 420 | |
421 | 421 | $this->app->register(new \Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider(), array( |
422 | - 'orm.proxies_dir' => __DIR__ . '/../../app/cache/doctrine', |
|
422 | + 'orm.proxies_dir' => __DIR__.'/../../app/cache/doctrine', |
|
423 | 423 | 'orm.em.options' => array( |
424 | 424 | 'mappings' => array( |
425 | 425 | array( |
426 | 426 | 'type' => 'yml', |
427 | 427 | 'namespace' => 'Eccube\Entity', |
428 | 428 | 'path' => array( |
429 | - __DIR__ . '/../../Resource/doctrine', |
|
430 | - __DIR__ . '/../../Resource/doctrine/master', |
|
429 | + __DIR__.'/../../Resource/doctrine', |
|
430 | + __DIR__.'/../../Resource/doctrine/master', |
|
431 | 431 | ), |
432 | 432 | ), |
433 | 433 | ), |
@@ -454,11 +454,11 @@ discard block |
||
454 | 454 | { |
455 | 455 | $this->resetNatTimer(); |
456 | 456 | |
457 | - $config_file = $this->config_path . '/database.yml'; |
|
457 | + $config_file = $this->config_path.'/database.yml'; |
|
458 | 458 | $database = Yaml::parse(file_get_contents($config_file)); |
459 | 459 | $config['database'] = $database['database']; |
460 | 460 | |
461 | - $config_file = $this->config_path . '/config.yml'; |
|
461 | + $config_file = $this->config_path.'/config.yml'; |
|
462 | 462 | $baseConfig = Yaml::parse(file_get_contents($config_file)); |
463 | 463 | $config['config'] = $baseConfig; |
464 | 464 | |
@@ -514,11 +514,11 @@ discard block |
||
514 | 514 | { |
515 | 515 | $this->resetNatTimer(); |
516 | 516 | |
517 | - $config_file = $this->config_path . '/database.yml'; |
|
517 | + $config_file = $this->config_path.'/database.yml'; |
|
518 | 518 | $database = Yaml::parse(file_get_contents($config_file)); |
519 | 519 | $config['database'] = $database['database']; |
520 | 520 | |
521 | - $config_file = $this->config_path . '/config.yml'; |
|
521 | + $config_file = $this->config_path.'/config.yml'; |
|
522 | 522 | $baseConfig = Yaml::parse(file_get_contents($config_file)); |
523 | 523 | $config['config'] = $baseConfig; |
524 | 524 | |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | $config = new Configuration($app['db']); |
582 | 582 | $config->setMigrationsNamespace('DoctrineMigrations'); |
583 | 583 | |
584 | - $migrationDir = __DIR__ . '/../../Resource/doctrine/migration'; |
|
584 | + $migrationDir = __DIR__.'/../../Resource/doctrine/migration'; |
|
585 | 585 | $config->setMigrationsDirectory($migrationDir); |
586 | 586 | $config->registerMigrationsFromDirectory($migrationDir); |
587 | 587 | |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | private function getProtectedDirs() |
614 | 614 | { |
615 | 615 | $protectedDirs = array(); |
616 | - $base = __DIR__ . '/../../../..'; |
|
616 | + $base = __DIR__.'/../../../..'; |
|
617 | 617 | $dirs = array( |
618 | 618 | '/html', |
619 | 619 | '/app', |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | ); |
627 | 627 | |
628 | 628 | foreach ($dirs as $dir) { |
629 | - if (!is_writable($base . $dir)) { |
|
629 | + if (!is_writable($base.$dir)) { |
|
630 | 630 | $protectedDirs[] = $dir; |
631 | 631 | } |
632 | 632 | } |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | private function createConfigYamlFile($data, $auth = true) |
638 | 638 | { |
639 | 639 | $fs = new Filesystem(); |
640 | - $config_file = $this->config_path . '/config.yml'; |
|
640 | + $config_file = $this->config_path.'/config.yml'; |
|
641 | 641 | |
642 | 642 | if ($fs->exists($config_file)) { |
643 | 643 | $config = Yaml::parse(file_get_contents($config_file)); |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | |
667 | 667 | $fs = new Filesystem(); |
668 | 668 | $content = str_replace( |
669 | - $target, $replace, file_get_contents($this->dist_path . '/config.yml.dist') |
|
669 | + $target, $replace, file_get_contents($this->dist_path.'/config.yml.dist') |
|
670 | 670 | ); |
671 | 671 | $fs->dumpFile($config_file, $content); |
672 | 672 | |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | |
681 | 681 | private function addInstallStatus() |
682 | 682 | { |
683 | - $config_file = $this->config_path . '/config.yml'; |
|
683 | + $config_file = $this->config_path.'/config.yml'; |
|
684 | 684 | $config = Yaml::parse(file_get_contents($config_file)); |
685 | 685 | $config['eccube_install'] = 1; |
686 | 686 | $yml = Yaml::dump($config); |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | private function createDatabaseYamlFile($data) |
693 | 693 | { |
694 | 694 | $fs = new Filesystem(); |
695 | - $config_file = $this->config_path . '/database.yml'; |
|
695 | + $config_file = $this->config_path.'/database.yml'; |
|
696 | 696 | if ($fs->exists($config_file)) { |
697 | 697 | $fs->remove($config_file); |
698 | 698 | } |
@@ -725,14 +725,14 @@ discard block |
||
725 | 725 | |
726 | 726 | $fs = new Filesystem(); |
727 | 727 | $content = str_replace( |
728 | - $target, $replace, file_get_contents($this->dist_path . '/database.yml.dist') |
|
728 | + $target, $replace, file_get_contents($this->dist_path.'/database.yml.dist') |
|
729 | 729 | ); |
730 | 730 | } else { |
731 | 731 | $content = Yaml::dump( |
732 | 732 | array( |
733 | 733 | 'database' => array( |
734 | 734 | 'driver' => 'pdo_sqlite', |
735 | - 'path' => realpath($this->config_path . '/eccube.db') |
|
735 | + 'path' => realpath($this->config_path.'/eccube.db') |
|
736 | 736 | ) |
737 | 737 | ) |
738 | 738 | ); |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | private function createMailYamlFile($data) |
746 | 746 | { |
747 | 747 | $fs = new Filesystem(); |
748 | - $config_file = $this->config_path . '/mail.yml'; |
|
748 | + $config_file = $this->config_path.'/mail.yml'; |
|
749 | 749 | if ($fs->exists($config_file)) { |
750 | 750 | $fs->remove($config_file); |
751 | 751 | } |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | |
761 | 761 | $fs = new Filesystem(); |
762 | 762 | $content = str_replace( |
763 | - $target, $replace, file_get_contents($this->dist_path . '/mail.yml.dist') |
|
763 | + $target, $replace, file_get_contents($this->dist_path.'/mail.yml.dist') |
|
764 | 764 | ); |
765 | 765 | $fs->dumpFile($config_file, $content); |
766 | 766 | |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | private function createPathYamlFile($data, Request $request) |
771 | 771 | { |
772 | 772 | $fs = new Filesystem(); |
773 | - $config_file = $this->config_path . '/path.yml'; |
|
773 | + $config_file = $this->config_path.'/path.yml'; |
|
774 | 774 | if ($fs->exists($config_file)) { |
775 | 775 | $fs->remove($config_file); |
776 | 776 | } |
@@ -778,16 +778,16 @@ discard block |
||
778 | 778 | $ADMIN_ROUTE = $data['admin_dir']; |
779 | 779 | $TEMPLATE_CODE = 'default'; |
780 | 780 | $USER_DATA_ROUTE = 'user_data'; |
781 | - $ROOT_DIR = realpath(__DIR__ . '/../../../../'); |
|
781 | + $ROOT_DIR = realpath(__DIR__.'/../../../../'); |
|
782 | 782 | $ROOT_URLPATH = $request->getBasePath(); |
783 | - $ROOT_PUBLIC_URLPATH = $ROOT_URLPATH . RELATIVE_PUBLIC_DIR_PATH; |
|
783 | + $ROOT_PUBLIC_URLPATH = $ROOT_URLPATH.RELATIVE_PUBLIC_DIR_PATH; |
|
784 | 784 | |
785 | 785 | $target = array('${ADMIN_ROUTE}', '${TEMPLATE_CODE}', '${USER_DATA_ROUTE}', '${ROOT_DIR}', '${ROOT_URLPATH}', '${ROOT_PUBLIC_URLPATH}'); |
786 | 786 | $replace = array($ADMIN_ROUTE, $TEMPLATE_CODE, $USER_DATA_ROUTE, $ROOT_DIR, $ROOT_URLPATH, $ROOT_PUBLIC_URLPATH); |
787 | 787 | |
788 | 788 | $fs = new Filesystem(); |
789 | 789 | $content = str_replace( |
790 | - $target, $replace, file_get_contents($this->dist_path . '/path.yml.dist') |
|
790 | + $target, $replace, file_get_contents($this->dist_path.'/path.yml.dist') |
|
791 | 791 | ); |
792 | 792 | $fs->dumpFile($config_file, $content); |
793 | 793 | |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | |
797 | 797 | private function sendAppData($params) |
798 | 798 | { |
799 | - $config_file = $this->config_path . '/database.yml'; |
|
799 | + $config_file = $this->config_path.'/database.yml'; |
|
800 | 800 | $db_config = Yaml::parse(file_get_contents($config_file)); |
801 | 801 | |
802 | 802 | $this->setPDO(); |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | } |
809 | 809 | |
810 | 810 | if ($db_config['database']['driver'] === 'pdo_mysql') { |
811 | - $db_ver = 'MySQL:' . $version; |
|
811 | + $db_ver = 'MySQL:'.$version; |
|
812 | 812 | } else { |
813 | 813 | $db_ver = $version; |
814 | 814 | } |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | |
827 | 827 | $header = array( |
828 | 828 | 'Content-Type: application/x-www-form-urlencoded', |
829 | - 'Content-Length: ' . strlen($data), |
|
829 | + 'Content-Length: '.strlen($data), |
|
830 | 830 | ); |
831 | 831 | $context = stream_context_create( |
832 | 832 | array( |
@@ -853,7 +853,7 @@ discard block |
||
853 | 853 | public function migration(InstallApplication $app, Request $request) |
854 | 854 | { |
855 | 855 | return $app['twig']->render('migration.twig', array( |
856 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
856 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
857 | 857 | )); |
858 | 858 | } |
859 | 859 | |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | return $app['twig']->render('migration_plugin.twig', array( |
883 | 883 | 'Plugins' => $Plugins, |
884 | 884 | 'version' => Constant::VERSION, |
885 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
885 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
886 | 886 | )); |
887 | 887 | } |
888 | 888 | } |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | \Eccube\Util\Cache::clear($config_app, true); |
906 | 906 | |
907 | 907 | return $app['twig']->render('migration_end.twig', array( |
908 | - 'publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/', |
|
908 | + 'publicPath' => '..'.RELATIVE_PUBLIC_DIR_PATH.'/', |
|
909 | 909 | )); |
910 | 910 | } |
911 | 911 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | $extension = $image->getClientOriginalExtension(); |
205 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
205 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
206 | 206 | $image->move($app['config']['image_temp_realdir'], $filename); |
207 | 207 | $files[] = $filename; |
208 | 208 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $form = $builder->getForm(); |
279 | 279 | |
280 | 280 | if (!$has_class) { |
281 | - $ProductClass->setStockUnlimited((boolean)$ProductClass->getStockUnlimited()); |
|
281 | + $ProductClass->setStockUnlimited((boolean) $ProductClass->getStockUnlimited()); |
|
282 | 282 | $form['class']->setData($ProductClass); |
283 | 283 | } |
284 | 284 | |
@@ -364,8 +364,8 @@ discard block |
||
364 | 364 | $Categories = $form->get('Category')->getData(); |
365 | 365 | $categoriesIdList = array(); |
366 | 366 | foreach ($Categories as $Category) { |
367 | - foreach($Category->getPath() as $ParentCategory){ |
|
368 | - if (!isset($categoriesIdList[$ParentCategory->getId()])){ |
|
367 | + foreach ($Category->getPath() as $ParentCategory) { |
|
368 | + if (!isset($categoriesIdList[$ParentCategory->getId()])) { |
|
369 | 369 | $ProductCategory = $this->createProductCategory($Product, $ParentCategory, $count); |
370 | 370 | $app['orm.em']->persist($ProductCategory); |
371 | 371 | $count++; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $categoriesIdList[$ParentCategory->getId()] = true; |
375 | 375 | } |
376 | 376 | } |
377 | - if (!isset($categoriesIdList[$Category->getId()])){ |
|
377 | + if (!isset($categoriesIdList[$Category->getId()])) { |
|
378 | 378 | $ProductCategory = $this->createProductCategory($Product, $Category, $count); |
379 | 379 | $app['orm.em']->persist($ProductCategory); |
380 | 380 | $count++; |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $app['orm.em']->persist($ProductImage); |
397 | 397 | |
398 | 398 | // 移動 |
399 | - $file = new File($app['config']['image_temp_realdir'] . '/' . $add_image); |
|
399 | + $file = new File($app['config']['image_temp_realdir'].'/'.$add_image); |
|
400 | 400 | $file->move($app['config']['image_save_realdir']); |
401 | 401 | } |
402 | 402 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | // 削除 |
418 | 418 | $fs = new Filesystem(); |
419 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $delete_image); |
|
419 | + $fs->remove($app['config']['image_save_realdir'].'/'.$delete_image); |
|
420 | 420 | } |
421 | 421 | $app['orm.em']->persist($Product); |
422 | 422 | $app['orm.em']->flush(); |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | foreach ($deleteImages as $deleteImage) { |
575 | 575 | try { |
576 | 576 | $fs = new Filesystem(); |
577 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $deleteImage); |
|
577 | + $fs->remove($app['config']['image_save_realdir'].'/'.$deleteImage); |
|
578 | 578 | } catch (\Exception $e) { |
579 | 579 | // エラーが発生しても無視する |
580 | 580 | } |
@@ -644,10 +644,10 @@ discard block |
||
644 | 644 | |
645 | 645 | // 画像ファイルを新規作成 |
646 | 646 | $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION); |
647 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
647 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
648 | 648 | try { |
649 | 649 | $fs = new Filesystem(); |
650 | - $fs->copy($app['config']['image_save_realdir'] . '/' . $Image->getFileName(), $app['config']['image_save_realdir'] . '/' . $filename); |
|
650 | + $fs->copy($app['config']['image_save_realdir'].'/'.$Image->getFileName(), $app['config']['image_save_realdir'].'/'.$filename); |
|
651 | 651 | } catch (\Exception $e) { |
652 | 652 | // エラーが発生しても無視する |
653 | 653 | } |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | $em->getConfiguration()->setSQLLogger(null); |
723 | 723 | |
724 | 724 | $response = new StreamedResponse(); |
725 | - $response->setCallback(function () use ($app, $request) { |
|
725 | + $response->setCallback(function() use ($app, $request) { |
|
726 | 726 | |
727 | 727 | // CSV種別を元に初期化. |
728 | 728 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_PRODUCT); |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | |
747 | 747 | // データ行の出力. |
748 | 748 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
749 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) { |
|
749 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) { |
|
750 | 750 | |
751 | 751 | $Csvs = $csvService->getCsvs(); |
752 | 752 | |
@@ -778,9 +778,9 @@ discard block |
||
778 | 778 | }); |
779 | 779 | |
780 | 780 | $now = new \DateTime(); |
781 | - $filename = 'product_' . $now->format('YmdHis') . '.csv'; |
|
781 | + $filename = 'product_'.$now->format('YmdHis').'.csv'; |
|
782 | 782 | $response->headers->set('Content-Type', 'application/octet-stream'); |
783 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
783 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
784 | 784 | $response->send(); |
785 | 785 | |
786 | 786 | log_info('商品CSV出力ファイル名', array($filename)); |