mirror of
https://github.com/codeforspain/ds-organizacion-administrativa.git
synced 2024-06-16 10:54:06 +02:00
Add STI csv
This commit is contained in:
parent
7d9c165dcd
commit
fe773fe167
|
@ -46,8 +46,7 @@ Si se invoca sin subcomandos o argumentos, executa:
|
||||||
all Procesa todas las fuentes (por defecto).
|
all Procesa todas las fuentes (por defecto).
|
||||||
|
|
||||||
|
|
||||||
convert-to-json Convierte todo los archivos .csv en /data a .json.
|
convert-to-json Convierte todos los archivos .csv almacenados en /data a .json.
|
||||||
|
|
||||||
|
|
||||||
update Actualiza el archivo datapackage.json
|
update Actualiza el archivo datapackage.json
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ class UpdateCommand extends ConsoleKit\Command
|
||||||
/**
|
/**
|
||||||
* Actualiza datapackage.json
|
* Actualiza datapackage.json
|
||||||
*
|
*
|
||||||
|
* @opt nojson no incluye los recursos .json
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function execute(array $args, array $options = array())
|
public function execute(array $args, array $options = array())
|
||||||
{
|
{
|
||||||
|
@ -21,6 +23,7 @@ class UpdateCommand extends ConsoleKit\Command
|
||||||
|
|
||||||
$datapackageNew['last_updated']=date('Y-m-d ');
|
$datapackageNew['last_updated']=date('Y-m-d ');
|
||||||
|
|
||||||
|
// Comprobobamos si hay que omitir JSON
|
||||||
if (!isset($options['nojson']) && !isset($options['n'])){
|
if (!isset($options['nojson']) && !isset($options['n'])){
|
||||||
foreach ( Config::$datapackage['resources'] as $resource){
|
foreach ( Config::$datapackage['resources'] as $resource){
|
||||||
$resource['format'] = 'json';
|
$resource['format'] = 'json';
|
||||||
|
@ -30,7 +33,7 @@ class UpdateCommand extends ConsoleKit\Command
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Nueva version
|
// Actualizamos versión
|
||||||
if (file_exists(BASE_PATH . DS . "datapackage.json")) {
|
if (file_exists(BASE_PATH . DS . "datapackage.json")) {
|
||||||
$datapackageOld = json_decode(file_get_contents(BASE_PATH . DS . "datapackage.json"));
|
$datapackageOld = json_decode(file_get_contents(BASE_PATH . DS . "datapackage.json"));
|
||||||
if (!empty($datapackageOld->version)) {
|
if (!empty($datapackageOld->version)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user