-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #482 from GOCDB/481-code-style-issues-in-sample-da…
…ta-deploy-scripts Fix code style issues in sample data deploy scripts
- Loading branch information
Showing
20 changed files
with
660 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
<?php | ||
|
||
require_once __DIR__."/../bootstrap.php"; | ||
require_once __DIR__."/AddUtils.php"; | ||
/* AddNGIs.php: Loads a list of cert statuses from an XML file and inserts them into | ||
* the doctrine prototype. | ||
* XML format is the xml input format of the cert status seed data | ||
require_once __DIR__ . "/../bootstrap.php"; | ||
require_once __DIR__ . "/AddUtils.php"; | ||
/* AddCertificationStatuses.php: Loads a list of cert statuses from | ||
* an XML file and inserts them into the doctrine prototype. | ||
* XML format is the xml input format of the cert status seed data. | ||
*/ | ||
$certStatsFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . "/CertificationStatuses.xml"; | ||
$certStatsFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . | ||
"/CertificationStatuses.xml"; | ||
$certStats = simplexml_load_file($certStatsFileName); | ||
|
||
foreach($certStats as $certStat) { | ||
foreach ($certStats as $certStat) { | ||
$doctrineCertStat = new CertificationStatus(); | ||
$name = ""; | ||
foreach($certStat as $key => $value) { | ||
if($key == "name") { | ||
foreach ($certStat as $key => $value) { | ||
if ($key == "name") { | ||
$name = (string) $value; | ||
} | ||
} | ||
|
||
$doctrineCertStat->setName($name); | ||
$entityManager->persist($doctrineCertStat); | ||
} | ||
|
||
$entityManager->flush(); | ||
$entityManager->flush(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
<?php | ||
|
||
require_once __DIR__."/../bootstrap.php"; | ||
require_once __DIR__."/AddUtils.php"; | ||
require_once __DIR__ . "/../bootstrap.php"; | ||
require_once __DIR__ . "/AddUtils.php"; | ||
|
||
/* AddCountries.php: Loads a list of countries from an XML file and inserts them into | ||
* the doctrine prototype. | ||
/* AddCountries.php: Loads a list of countries from an XML file and | ||
* inserts them into the doctrine prototype. | ||
*/ | ||
|
||
$countriesFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . "/Countries.xml"; | ||
$countriesFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . | ||
"/Countries.xml"; | ||
$countries = simplexml_load_file($countriesFileName); | ||
|
||
foreach($countries as $country) { | ||
foreach ($countries as $country) { | ||
$doctrineCountry = new Country(); | ||
$code = ""; | ||
$name = ""; | ||
foreach($country as $key => $value) { | ||
if($key == "name") { | ||
foreach ($country as $key => $value) { | ||
if ($key == "name") { | ||
$code = (string) $value; | ||
} | ||
if($key == "description") { | ||
|
||
if ($key == "description") { | ||
$name = (string) $value; | ||
} | ||
} | ||
|
||
$doctrineCountry->setName($name); | ||
$doctrineCountry->setCode($code); | ||
$entityManager->persist($doctrineCountry); | ||
} | ||
|
||
$entityManager->flush(); | ||
$entityManager->flush(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
<?php | ||
|
||
require_once __DIR__."/../bootstrap.php"; | ||
require_once __DIR__."/AddUtils.php"; | ||
require_once __DIR__ . "/../bootstrap.php"; | ||
require_once __DIR__ . "/AddUtils.php"; | ||
|
||
/* AddNGIs.php: Loads a list of infrastructures from an XML file and inserts them into | ||
* the doctrine prototype. | ||
/* AddInfrastructures.php: Loads a list of infrastructures from an XML file and | ||
* inserts them into the doctrine prototype. | ||
* XML format is the xml input production status format. | ||
*/ | ||
$infrastructureFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . "/Infrastructures.xml"; | ||
$infrastructureFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . | ||
"/Infrastructures.xml"; | ||
$infs = simplexml_load_file($infrastructureFileName); | ||
|
||
foreach($infs as $xmlInf) { | ||
foreach ($infs as $xmlInf) { | ||
$doctrineInf = new Infrastructure(); | ||
$name = ""; | ||
foreach($xmlInf as $key => $value) { | ||
if($key == "name") { | ||
foreach ($xmlInf as $key => $value) { | ||
if ($key == "name") { | ||
$name = (string) $value; | ||
} | ||
} | ||
|
||
$doctrineInf->setName($name); | ||
$entityManager->persist($doctrineInf); | ||
} | ||
|
||
$entityManager->flush(); | ||
$entityManager->flush(); |
Oops, something went wrong.