Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 328 lines (272 sloc) 11.031 kB
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
1 <?php
2
87ad04f @willdurand Fixed LICENSE
willdurand authored
3 /**
4 * This file is part of the PropelBundle package.
5 * For the full copyright and license information, please view the LICENSE
6 * file that was distributed with this source code.
7 *
8 * @license MIT License
9 */
10
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
11 namespace Propel\PropelBundle\Command;
12
13 use Symfony\Component\Console\Input\InputOption;
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
14 use Symfony\Component\Console\Input\InputArgument;
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
15 use Symfony\Component\Console\Input\InputInterface;
16 use Symfony\Component\Console\Output\OutputInterface;
d12c092 @willdurand Use the new Filesystem component
willdurand authored
17 use Symfony\Component\Filesystem\Filesystem;
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
18 use Symfony\Component\Finder\Finder;
0f78f2b Avoid duplicating fixtures path
Romain Pouclet authored
19 use Symfony\Component\HttpKernel\Bundle\BundleInterface;
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
20
29ca595 @willdurand Removed 'Propel' class prefixes
willdurand authored
21 use Propel\PropelBundle\Command\AbstractCommand;
48f1baa @willdurand [DataFixtures] Moved loader part to its own place
willdurand authored
22 use Propel\PropelBundle\DataFixtures\Loader\YamlDataLoader;
23 use Propel\PropelBundle\DataFixtures\Loader\XmlDataLoader;
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
24
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
25 /**
6f4a7e7 @willdurand [Command] Changed fixture commands names
willdurand authored
26 * FixturesLoadCommand
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
27 *
28 * @author William DURAND <william.durand1@gmail.com>
29 */
29ca595 @willdurand Removed 'Propel' class prefixes
willdurand authored
30 class FixturesLoadCommand extends AbstractCommand
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
31 {
32 /**
33 * Default fixtures directory.
0394594 @willdurand [command] Fixed information for load-fixtures command
willdurand authored
34 * @var string
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
35 */
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
36 private $defaultFixturesDir = 'app/propel/fixtures';
0b85aba @willdurand [Command] Added a new command named: propel:form:generate
willdurand authored
37
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
38 /**
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
39 * Absolute path for fixtures directory
0394594 @willdurand [command] Fixed information for load-fixtures command
willdurand authored
40 * @var string
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
41 */
42 private $absoluteFixturesPath = '';
0b85aba @willdurand [Command] Added a new command named: propel:form:generate
willdurand authored
43
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
44 /**
45 * Filesystem for manipulating files
d12c092 @willdurand Use the new Filesystem component
willdurand authored
46 * @var \Symfony\Component\Filesystem\Filesystem
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
47 */
48 private $filesystem = null;
0b85aba @willdurand [Command] Added a new command named: propel:form:generate
willdurand authored
49
994f599 Use FileLocator
Romain Pouclet authored
50 /**
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
51 * @see Command
52 */
53 protected function configure()
54 {
55 $this
0394594 @willdurand [command] Fixed information for load-fixtures command
willdurand authored
56 ->setDescription('Load XML, SQL and/or YAML fixtures')
b28c863 Add a way to load fixtures from a specific bundle
Romain Pouclet authored
57 ->addArgument('bundle', InputArgument::OPTIONAL, 'The bundle to load fixtures from')
0394594 @willdurand [command] Fixed information for load-fixtures command
willdurand authored
58 ->addOption(
59 'dir', 'd', InputOption::VALUE_OPTIONAL,
60 'The directory where XML, SQL and/or YAML fixtures files are located',
61 $this->defaultFixturesDir
62 )
102e688 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
63 ->addOption('xml', '', InputOption::VALUE_NONE, 'Load XML fixtures')
64 ->addOption('sql', '', InputOption::VALUE_NONE, 'Load SQL fixtures')
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
65 ->addOption('yml', '', InputOption::VALUE_NONE, 'Load YAML fixtures')
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
66 ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'Set this parameter to define a connection to use')
67 ->setHelp(<<<EOT
6f4a7e7 @willdurand [Command] Changed fixture commands names
willdurand authored
68 The <info>propel:fixtures:load</info> loads <info>XML</info>, <info>SQL</info> and/or <info>YAML</info> fixtures.
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
69
6f4a7e7 @willdurand [Command] Changed fixture commands names
willdurand authored
70 <info>php app/console propel:fixtures:load</info>
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
71
72 The <info>--connection</info> parameter allows you to change the connection to use.
73 The default connection is the active connection (propel.dbal.default_connection).
74
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
75 The <info>--dir</info> parameter allows you to change the directory that contains <info>XML</info> or/and <info>SQL</info> fixtures files <comment>(default: app/propel/fixtures)</comment>.
76
77 The <info>--xml</info> parameter allows you to load only <info>XML</info> fixtures.
78 The <info>--sql</info> parameter allows you to load only <info>SQL</info> fixtures.
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
79 The <info>--yml</info> parameter allows you to load only <info>YAML</info> fixtures.
4459a9e @willdurand Fixed typo
willdurand authored
80
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
81 You can mix <info>--xml</info>, <info>--sql</info> and <info>--yml</info> parameters to load XML, YAML and SQL fixtures at the same time.
82 If none of this parameter is set, all XML, YAML and SQL files in the directory will be load.
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
83
84 XML fixtures files are the same XML files you can get with the command <info>propel:data-dump</info>:
85 <comment>
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
86 <Fixtures>
87 <Object Namespace="Awesome">
88 <o1 Title="My title" MyFoo="bar" />
89 </Object>
90 <Related Namespace="Awesome">
91 <r1 ObjectId="o1" Description="Hello world !" />
92 </Related>
93 </Fixtures>
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
94 </comment>
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
95
96 YAML fixtures are:
97 <comment>
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
98 \Awesome\Object:
99 o1:
100 Title: My title
101 MyFoo: bar
102
103 \Awesome\Related:
104 r1:
105 ObjectId: o1
106 Description: Hello world !
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
107 </comment>
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
108 EOT
0b85aba @willdurand [Command] Added a new command named: propel:form:generate
willdurand authored
109 )
6f4a7e7 @willdurand [Command] Changed fixture commands names
willdurand authored
110 ->setName('propel:fixtures:load')
0b85aba @willdurand [Command] Added a new command named: propel:form:generate
willdurand authored
111 ;
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
112 }
113
114 /**
115 * @see Command
116 *
117 * @throws \InvalidArgumentException When the target directory does not exist
118 */
119 protected function execute(InputInterface $input, OutputInterface $output)
120 {
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
121 $this->filesystem = new Filesystem();
0b85aba @willdurand [Command] Added a new command named: propel:form:generate
willdurand authored
122
a30747e @willdurand Added a better way to use a bundle argument in commands
willdurand authored
123 if (null !== $this->bundle) {
0f78f2b Avoid duplicating fixtures path
Romain Pouclet authored
124 $this->absoluteFixturesPath = $this->getFixturesPath($this->bundle);
b28c863 Add a way to load fixtures from a specific bundle
Romain Pouclet authored
125 } else {
126 $this->absoluteFixturesPath = realpath($this->getApplication()->getKernel()->getRootDir() . '/../' . $input->getOption('dir'));
127 }
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
128
cd6ae1a @willdurand [command] Added --verbose option to the load-fixtures command
willdurand authored
129 if ($input->getOption('verbose')) {
0b85aba @willdurand [Command] Added a new command named: propel:form:generate
willdurand authored
130 $this->additionalPhingArgs[] = 'verbose';
cd6ae1a @willdurand [command] Added --verbose option to the load-fixtures command
willdurand authored
131 }
132
445e3cc @willdurand [command] Fixed output in load-fixtures command
willdurand authored
133 if (!$this->absoluteFixturesPath && !file_exists($this->absoluteFixturesPath)) {
d1c64b2 @willdurand [Command] Fixed error output in fixtures:load command
willdurand authored
134 return $this->writeSection($output, array(
a6bb5d2 @maxailloud Escaping table name in the table:drop command and improve error messa…
maxailloud authored
135 'The fixtures directory "' . $this->absoluteFixturesPath . '" does not exist.'
d1c64b2 @willdurand [Command] Fixed error output in fixtures:load command
willdurand authored
136 ), 'fg=white;bg=red');
445e3cc @willdurand [command] Fixed output in load-fixtures command
willdurand authored
137 }
138
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
139 $noOptions = (!$input->getOption('xml') && !$input->getOption('sql') && !$input->getOption('yml'));
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
140
35a56e8 @willdurand Improved commands
willdurand authored
141 if ($input->getOption('sql') || $noOptions) {
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
142 if (-1 === $this->loadSqlFixtures($input, $output)) {
590787d @willdurand Removed command headers, fixed naming
willdurand authored
143 $output->writeln('No <info>SQL</info> fixtures found.');
9302735 @willdurand Fixed load fixtures with custom datasources
willdurand authored
144 }
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
145 }
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
146
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
147 if ($input->getOption('xml') || $noOptions) {
148 if (-1 === $this->loadFixtures($input, $output, 'xml')) {
590787d @willdurand Removed command headers, fixed naming
willdurand authored
149 $output->writeln('No <info>XML</info> fixtures found.');
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
150 }
151 }
152
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
153 if ($input->getOption('yml') || $noOptions) {
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
154 if (-1 === $this->loadFixtures($input, $output, 'yml')) {
590787d @willdurand Removed command headers, fixed naming
willdurand authored
155 $output->writeln('No <info>YML</info> fixtures found.');
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
156 }
157 }
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
158 }
159
160 /**
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
161 * Load fixtures
4459a9e @willdurand Fixed typo
willdurand authored
162 *
4219e70 @Adel-E RUN PHP-CS PSR-2
Adel-E authored
163 * @param \Symfony\Component\Console\Input\InputInterface $input
164 * @param \Symfony\Component\Console\Output\OutputInterface $output
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
165 * @return void
166 */
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
167 protected function loadFixtures(InputInterface $input, OutputInterface $output, $type = null)
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
168 {
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
169 if (null === $type) {
170 return;
171 }
172
db8ed4d @K-Phoen Fix: fixtures ordering was not handled by the FixturesLoad command
K-Phoen authored
173 $datas = $this->getFixtureFiles($type);
e463a8b @willdurand Fixed CS
willdurand authored
174
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
175 if (count(iterator_to_array($datas)) === 0) {
9302735 @willdurand Fixed load fixtures with custom datasources
willdurand authored
176 return -1;
177 }
178
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
179 list($name, $defaultConfig) = $this->getConnection($input, $output);
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
180
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
181 if ('yml' === $type) {
ca45e9c @willdurand Added faker support
willdurand authored
182 $loader = new YamlDataLoader($this->getApplication()->getKernel()->getRootDir(), $this->getContainer());
7f3c171 @willdurand [command] Added a new XML loader
willdurand authored
183 } elseif ('xml' === $type) {
184 $loader = new XmlDataLoader($this->getApplication()->getKernel()->getRootDir());
185 } else {
186 return;
187 }
d7c5c51 @willdurand [command] Added better error messages
willdurand authored
188
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
189 try {
98e0433 @willdurand Added feedback to know which has been loaded
willdurand authored
190 $nb = $loader->load($datas, $name);
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
191 } catch (\Exception $e) {
192 $this->writeSection($output, array(
193 '[Propel] Exception',
194 '',
195 $e->getMessage()), 'fg=white;bg=red');
ab50b5e @willdurand Fixed CS
willdurand authored
196
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
197 return false;
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
198 }
9302735 @willdurand Fixed load fixtures with custom datasources
willdurand authored
199
554132c @willdurand Fixed command output, fixes #161
willdurand authored
200 $output->writeln(sprintf('<comment>%s</comment> %s fixtures file%s loaded.', $nb, strtoupper($type), $nb > 1 ? 's' : ''));
98e0433 @willdurand Added feedback to know which has been loaded
willdurand authored
201
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
202 return true;
203 }
204
205 /**
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
206 * Load SQL fixtures
207 *
4219e70 @Adel-E RUN PHP-CS PSR-2
Adel-E authored
208 * @param \Symfony\Component\Console\Input\InputInterface $input
209 * @param \Symfony\Component\Console\Output\OutputInterface $output
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
210 * @return void
211 */
212 protected function loadSqlFixtures(InputInterface $input, OutputInterface $output)
213 {
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
214 $tmpdir = $this->getApplication()->getKernel()->getRootDir() . '/cache/propel';
db8ed4d @K-Phoen Fix: fixtures ordering was not handled by the FixturesLoad command
K-Phoen authored
215 $datas = $this->getFixtureFiles('sql');
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
216
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
217 $this->prepareCache($tmpdir);
218
5143a5f @willdurand Fixed previous commit (again)
willdurand authored
219 list($name, $defaultConfig) = $this->getConnection($input, $output);
220
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
221 // Create a "sqldb.map" file
222 $sqldbContent = '';
6970913 @willdurand Fixed CS
willdurand authored
223 foreach ($datas as $data) {
4dcdc0f @willdurand [command] Naming + minor fixes on commands
willdurand authored
224 $output->writeln(sprintf('<info>Loading SQL fixtures from</info> <comment>%s</comment>.', $data));
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
225
deae657 @willdurand Fixed previous commit
willdurand authored
226 $sqldbContent .= $data->getFilename() . '=' . $name . PHP_EOL;
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
227 $this->filesystem->copy($data, $tmpdir . '/fixtures/' . $data->getFilename(), true);
deae657 @willdurand Fixed previous commit
willdurand authored
228 }
9302735 @willdurand Fixed load fixtures with custom datasources
willdurand authored
229
deae657 @willdurand Fixed previous commit
willdurand authored
230 if ('' === $sqldbContent) {
9302735 @willdurand Fixed load fixtures with custom datasources
willdurand authored
231 return -1;
232 }
233
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
234 $sqldbFile = $tmpdir . '/fixtures/sqldb.map';
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
235 file_put_contents($sqldbFile, $sqldbContent);
236
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
237 if (!$this->insertSql($defaultConfig, $tmpdir . '/fixtures', $tmpdir, $output)) {
238 return -1;
239 }
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
240
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
241 $this->filesystem->remove($tmpdir);
9302735 @willdurand Fixed load fixtures with custom datasources
willdurand authored
242
243 return 0;
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
244 }
245
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
246 /**
247 * Prepare the cache directory
248 *
6970913 @willdurand Fixed CS
willdurand authored
249 * @param string $tmpdir The temporary directory path.
b51550e @willdurand [command] Changed the load-fixtures command to handle the new logic
willdurand authored
250 */
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
251 protected function prepareCache($tmpdir)
252 {
253 // Recreate a propel directory in cache
254 $this->filesystem->remove($tmpdir);
255 $this->filesystem->mkdir($tmpdir);
256
257 $fixturesdir = $tmpdir . '/fixtures/';
258 $this->filesystem->remove($fixturesdir);
259 $this->filesystem->mkdir($fixturesdir);
260 }
261
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
262 /**
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
263 * Insert SQL
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
264 */
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
265 protected function insertSql($config, $sqlDir, $schemaDir, $output)
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
266 {
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
267 // Insert SQL
268 $ret = $this->callPhing('insert-sql', array(
269 'propel.database.url' => $config['connection']['dsn'],
270 'propel.database.database' => $config['adapter'],
271 'propel.database.user' => $config['connection']['user'],
272 'propel.database.password' => $config['connection']['password'],
273 'propel.schema.dir' => $schemaDir,
274 'propel.sql.dir' => $sqlDir,
275 ));
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
276
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
277 if (true === $ret) {
554132c @willdurand Fixed command output, fixes #161
willdurand authored
278 $output->writeln('All SQL statements have been inserted.');
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
279 } else {
f18df26 @willdurand [command] Fixed output (for real)
willdurand authored
280 $this->writeTaskError($output, 'insert-sql', false);
ab50b5e @willdurand Fixed CS
willdurand authored
281
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
282 return false;
35af040 @maxailloud Add the ability to the LoadFixturesCommand to load SQL files
maxailloud authored
283 }
ab50b5e @willdurand Fixed CS
willdurand authored
284
9a2c464 @willdurand Refactored 'load-fixtures' command
willdurand authored
285 return true;
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
286 }
db8ed4d @K-Phoen Fix: fixtures ordering was not handled by the FixturesLoad command
K-Phoen authored
287
288 /**
289 * Returns the fixtures files to load.
290 *
6970913 @willdurand Fixed CS
willdurand authored
291 * @param string $type The extension of the files.
292 * @param string $in The directory in which we search the files. If null,
db8ed4d @K-Phoen Fix: fixtures ordering was not handled by the FixturesLoad command
K-Phoen authored
293 * we'll use the absoluteFixturesPath property.
294 *
295 * @return \Iterator An iterator through the files.
296 */
297 protected function getFixtureFiles($type = 'sql', $in = null)
298 {
299 $finder = new Finder();
300 $finder->sortByName()->name('*.' . $type);
301
994f599 Use FileLocator
Romain Pouclet authored
302 $files = $finder->in(null !== $in ? $in : $this->absoluteFixturesPath);
303
304 if (null === $this->bundle) {
305 return $files;
306 }
0b85aba @willdurand [Command] Added a new command named: propel:form:generate
willdurand authored
307
994f599 Use FileLocator
Romain Pouclet authored
308 $finalFixtureFiles = array();
309 foreach ($files as $file) {
0f78f2b Avoid duplicating fixtures path
Romain Pouclet authored
310 $fixtureFilePath = str_replace($this->getFixturesPath($this->bundle) . DIRECTORY_SEPARATOR, '', $file->getRealPath());
994f599 Use FileLocator
Romain Pouclet authored
311 $logicalName = sprintf('@%s/Resources/fixtures/%s', $this->bundle->getName(), $fixtureFilePath);
312 $finalFixtureFiles[] = new \SplFileInfo($this->getFileLocator()->locate($logicalName));
313 }
314
315 return new \ArrayIterator($finalFixtureFiles);
db8ed4d @K-Phoen Fix: fixtures ordering was not handled by the FixturesLoad command
K-Phoen authored
316 }
0f78f2b Avoid duplicating fixtures path
Romain Pouclet authored
317
318 /**
319 * Returns the path the command will look into to find fixture files
320 *
321 * @return String
322 */
323 protected function getFixturesPath(BundleInterface $bundle)
324 {
a30747e @willdurand Added a better way to use a bundle argument in commands
willdurand authored
325 return $bundle->getPath() . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'fixtures';
0b85aba @willdurand [Command] Added a new command named: propel:form:generate
willdurand authored
326 }
9aca0bf @willdurand Added new command: load-fixtures
willdurand authored
327 }
Something went wrong with that request. Please try again.