From 7d934c0bc84710f1c310010b9d9c7b9d5cebbdc6 Mon Sep 17 00:00:00 2001 From: Felipe Nascimento de Moura Date: Tue, 15 Mar 2011 12:36:46 -0300 Subject: [PATCH] added the cache control for analyzed projects --- .gitignore | 2 + Tests/bundle.list | 0 Tests/config.php | 0 .../API/cortex/analyst/AnalystTest.php | 0 .../API/cortex/syntaxer/SyntaxerTest.php | 0 .../API/cortex/tokenizer/TokenizerTest.php | 0 .../API/languages/en/IgnoreFormsTest.php | 0 .../mind3rd/API/languages/en/InflectTest.php | 0 .../API/languages/en/VerbalizerTest.php | 0 Tests/mind3rd/API/languages/en/ignore.list | 0 Tests/mind3rd/API/languages/en/sintatics.list | 0 Tests/mind3rd/API/languages/en/verbs.list | 0 .../API/languages/pt/IgnoreFormsTest.php | 0 .../mind3rd/API/languages/pt/InflectTest.php | 0 .../API/languages/pt/VerbalizerTest.php | 0 Tests/mind3rd/API/languages/pt/ignore.list | 0 Tests/mind3rd/API/languages/pt/sintatics.list | 0 Tests/mind3rd/API/languages/pt/verbs.list | 0 docs/Diagrams/Classes/Mind-Classes.png | Bin docs/Diagrams/Deploiment/BasicDeploiment.png | Bin docs/Diagrams/Deploiment/Layers.png | Bin docs/Diagrams/MindMap/MindMap-Mind-1.png | Bin docs/Diagrams/MindMap/MindMap-Mind-2.png | Bin docs/Diagrams/Sequence/Cortex.png | Bin docs/Diagrams/UseCase-Activity/Interface.png | Bin docs/Diagrams/UseCase-Activity/MainAPI.png | Bin docs/Diagrams/tests/testPasses-lexer.png | Bin docs/drafts/1-1 possibilities.txt | 0 docs/drafts/workflow.txt | 0 docs/en/example-1.mnd | 0 docs/help/main.php | 0 docs/ide/README | 0 docs/pt/Relatorio parcial - TCC-I-5.odt | Bin docs/pt/exemplo-1.mnd | 0 docs/pt/mind3rd-tcc1-odp.odp | Bin mind3rd/API/L10N/en.php | 3 + mind3rd/API/L10N/pt.php | 3 + mind3rd/API/classes/MindDir.php | 0 mind3rd/API/classes/MindEntity.php | 0 mind3rd/API/classes/MindProject.php | 26 +++- mind3rd/API/classes/MindProperty.php | 0 mind3rd/API/classes/MindRelation.php | 0 mind3rd/API/classes/MindSpeaker.php | 0 mind3rd/API/classes/MindTimer.php | 0 mind3rd/API/classes/VersionManager.php | 36 ++++++ mind3rd/API/cortex/Darwin/Darwin.php | 0 mind3rd/API/cortex/analyst/Analysis.php | 0 mind3rd/API/cortex/analyst/Analyst.php | 117 ++++++++++-------- mind3rd/API/cortex/analyst/Normal.php | 0 mind3rd/API/cortex/analyst/Normalizer.php | 0 mind3rd/API/cortex/syntaxer/Syntaxer.php | 0 mind3rd/API/cortex/tokenizer/Token.php | 0 mind3rd/API/cortex/tokenizer/Tokenizer.php | 0 mind3rd/API/languages/en/IgnoreForms.php | 0 mind3rd/API/languages/en/Verbalizer.php | 0 mind3rd/API/languages/en/datatypes.xml | 0 mind3rd/API/languages/en/ignore.list | 0 mind3rd/API/languages/en/lexics.xml | 0 mind3rd/API/languages/en/qualifiers.xml | 0 mind3rd/API/languages/en/quantifiers.xml | 0 mind3rd/API/languages/en/sintatics.list | 0 mind3rd/API/languages/en/verbs.list | 0 mind3rd/API/languages/pt/datatypes.xml | 0 mind3rd/API/languages/pt/qualifiers.xml | 0 mind3rd/API/languages/pt/sintatics.list | 0 mind3rd/API/plugins/PluginTwo/PluginTwo.php | 0 mind3rd/API/programs/Analyze.php | 1 + mind3rd/API/programs/Create.php | 1 + mind3rd/API/programs/Show.php | 24 ++++ mind3rd/API/utils/command.php | 0 mind3rd/API/utils/constants.php | 0 mind3rd/API/utils/header.php | 0 mind3rd/env/setup/Setup.php | 0 mind3rd/env/setup/UnixSetup.php | 0 mind3rd/env/setup/WinSetup.php | 0 mind3rd/env/setup/wizard/installation-1.php | 0 mind3rd/env/setup/wizard/installation-2.php | 0 77 files changed, 161 insertions(+), 52 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 Tests/bundle.list mode change 100644 => 100755 Tests/config.php mode change 100644 => 100755 Tests/mind3rd/API/cortex/analyst/AnalystTest.php mode change 100644 => 100755 Tests/mind3rd/API/cortex/syntaxer/SyntaxerTest.php mode change 100644 => 100755 Tests/mind3rd/API/cortex/tokenizer/TokenizerTest.php mode change 100644 => 100755 Tests/mind3rd/API/languages/en/IgnoreFormsTest.php mode change 100644 => 100755 Tests/mind3rd/API/languages/en/InflectTest.php mode change 100644 => 100755 Tests/mind3rd/API/languages/en/VerbalizerTest.php mode change 100644 => 100755 Tests/mind3rd/API/languages/en/ignore.list mode change 100644 => 100755 Tests/mind3rd/API/languages/en/sintatics.list mode change 100644 => 100755 Tests/mind3rd/API/languages/en/verbs.list mode change 100644 => 100755 Tests/mind3rd/API/languages/pt/IgnoreFormsTest.php mode change 100644 => 100755 Tests/mind3rd/API/languages/pt/InflectTest.php mode change 100644 => 100755 Tests/mind3rd/API/languages/pt/VerbalizerTest.php mode change 100644 => 100755 Tests/mind3rd/API/languages/pt/ignore.list mode change 100644 => 100755 Tests/mind3rd/API/languages/pt/sintatics.list mode change 100644 => 100755 Tests/mind3rd/API/languages/pt/verbs.list mode change 100644 => 100755 docs/Diagrams/Classes/Mind-Classes.png mode change 100644 => 100755 docs/Diagrams/Deploiment/BasicDeploiment.png mode change 100644 => 100755 docs/Diagrams/Deploiment/Layers.png mode change 100644 => 100755 docs/Diagrams/MindMap/MindMap-Mind-1.png mode change 100644 => 100755 docs/Diagrams/MindMap/MindMap-Mind-2.png mode change 100644 => 100755 docs/Diagrams/Sequence/Cortex.png mode change 100644 => 100755 docs/Diagrams/UseCase-Activity/Interface.png mode change 100644 => 100755 docs/Diagrams/UseCase-Activity/MainAPI.png mode change 100644 => 100755 docs/Diagrams/tests/testPasses-lexer.png mode change 100644 => 100755 docs/drafts/1-1 possibilities.txt create mode 100755 docs/drafts/workflow.txt mode change 100644 => 100755 docs/en/example-1.mnd mode change 100644 => 100755 docs/help/main.php mode change 100644 => 100755 docs/ide/README mode change 100644 => 100755 docs/pt/Relatorio parcial - TCC-I-5.odt mode change 100644 => 100755 docs/pt/exemplo-1.mnd mode change 100644 => 100755 docs/pt/mind3rd-tcc1-odp.odp mode change 100644 => 100755 mind3rd/API/classes/MindDir.php mode change 100644 => 100755 mind3rd/API/classes/MindEntity.php mode change 100644 => 100755 mind3rd/API/classes/MindProperty.php mode change 100644 => 100755 mind3rd/API/classes/MindRelation.php mode change 100644 => 100755 mind3rd/API/classes/MindSpeaker.php mode change 100644 => 100755 mind3rd/API/classes/MindTimer.php mode change 100644 => 100755 mind3rd/API/classes/VersionManager.php mode change 100644 => 100755 mind3rd/API/cortex/Darwin/Darwin.php mode change 100644 => 100755 mind3rd/API/cortex/analyst/Analysis.php mode change 100644 => 100755 mind3rd/API/cortex/analyst/Analyst.php mode change 100644 => 100755 mind3rd/API/cortex/analyst/Normal.php mode change 100644 => 100755 mind3rd/API/cortex/analyst/Normalizer.php mode change 100644 => 100755 mind3rd/API/cortex/syntaxer/Syntaxer.php mode change 100644 => 100755 mind3rd/API/cortex/tokenizer/Token.php mode change 100644 => 100755 mind3rd/API/cortex/tokenizer/Tokenizer.php mode change 100644 => 100755 mind3rd/API/languages/en/IgnoreForms.php mode change 100644 => 100755 mind3rd/API/languages/en/Verbalizer.php mode change 100644 => 100755 mind3rd/API/languages/en/datatypes.xml mode change 100644 => 100755 mind3rd/API/languages/en/ignore.list mode change 100644 => 100755 mind3rd/API/languages/en/lexics.xml mode change 100644 => 100755 mind3rd/API/languages/en/qualifiers.xml mode change 100644 => 100755 mind3rd/API/languages/en/quantifiers.xml mode change 100644 => 100755 mind3rd/API/languages/en/sintatics.list mode change 100644 => 100755 mind3rd/API/languages/en/verbs.list mode change 100644 => 100755 mind3rd/API/languages/pt/datatypes.xml mode change 100644 => 100755 mind3rd/API/languages/pt/qualifiers.xml mode change 100644 => 100755 mind3rd/API/languages/pt/sintatics.list mode change 100644 => 100755 mind3rd/API/plugins/PluginTwo/PluginTwo.php mode change 100644 => 100755 mind3rd/API/utils/command.php mode change 100644 => 100755 mind3rd/API/utils/constants.php mode change 100644 => 100755 mind3rd/API/utils/header.php mode change 100644 => 100755 mind3rd/env/setup/Setup.php mode change 100644 => 100755 mind3rd/env/setup/UnixSetup.php mode change 100644 => 100755 mind3rd/env/setup/WinSetup.php mode change 100644 => 100755 mind3rd/env/setup/wizard/installation-1.php mode change 100644 => 100755 mind3rd/env/setup/wizard/installation-2.php diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 4a844dd..640c028 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,6 @@ mind3rd/API/temp/* *.*~ .project .DS_Store +./nbproject nbproject +nbproject/* diff --git a/Tests/bundle.list b/Tests/bundle.list old mode 100644 new mode 100755 diff --git a/Tests/config.php b/Tests/config.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/cortex/analyst/AnalystTest.php b/Tests/mind3rd/API/cortex/analyst/AnalystTest.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/cortex/syntaxer/SyntaxerTest.php b/Tests/mind3rd/API/cortex/syntaxer/SyntaxerTest.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/cortex/tokenizer/TokenizerTest.php b/Tests/mind3rd/API/cortex/tokenizer/TokenizerTest.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/en/IgnoreFormsTest.php b/Tests/mind3rd/API/languages/en/IgnoreFormsTest.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/en/InflectTest.php b/Tests/mind3rd/API/languages/en/InflectTest.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/en/VerbalizerTest.php b/Tests/mind3rd/API/languages/en/VerbalizerTest.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/en/ignore.list b/Tests/mind3rd/API/languages/en/ignore.list old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/en/sintatics.list b/Tests/mind3rd/API/languages/en/sintatics.list old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/en/verbs.list b/Tests/mind3rd/API/languages/en/verbs.list old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/pt/IgnoreFormsTest.php b/Tests/mind3rd/API/languages/pt/IgnoreFormsTest.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/pt/InflectTest.php b/Tests/mind3rd/API/languages/pt/InflectTest.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/pt/VerbalizerTest.php b/Tests/mind3rd/API/languages/pt/VerbalizerTest.php old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/pt/ignore.list b/Tests/mind3rd/API/languages/pt/ignore.list old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/pt/sintatics.list b/Tests/mind3rd/API/languages/pt/sintatics.list old mode 100644 new mode 100755 diff --git a/Tests/mind3rd/API/languages/pt/verbs.list b/Tests/mind3rd/API/languages/pt/verbs.list old mode 100644 new mode 100755 diff --git a/docs/Diagrams/Classes/Mind-Classes.png b/docs/Diagrams/Classes/Mind-Classes.png old mode 100644 new mode 100755 diff --git a/docs/Diagrams/Deploiment/BasicDeploiment.png b/docs/Diagrams/Deploiment/BasicDeploiment.png old mode 100644 new mode 100755 diff --git a/docs/Diagrams/Deploiment/Layers.png b/docs/Diagrams/Deploiment/Layers.png old mode 100644 new mode 100755 diff --git a/docs/Diagrams/MindMap/MindMap-Mind-1.png b/docs/Diagrams/MindMap/MindMap-Mind-1.png old mode 100644 new mode 100755 diff --git a/docs/Diagrams/MindMap/MindMap-Mind-2.png b/docs/Diagrams/MindMap/MindMap-Mind-2.png old mode 100644 new mode 100755 diff --git a/docs/Diagrams/Sequence/Cortex.png b/docs/Diagrams/Sequence/Cortex.png old mode 100644 new mode 100755 diff --git a/docs/Diagrams/UseCase-Activity/Interface.png b/docs/Diagrams/UseCase-Activity/Interface.png old mode 100644 new mode 100755 diff --git a/docs/Diagrams/UseCase-Activity/MainAPI.png b/docs/Diagrams/UseCase-Activity/MainAPI.png old mode 100644 new mode 100755 diff --git a/docs/Diagrams/tests/testPasses-lexer.png b/docs/Diagrams/tests/testPasses-lexer.png old mode 100644 new mode 100755 diff --git a/docs/drafts/1-1 possibilities.txt b/docs/drafts/1-1 possibilities.txt old mode 100644 new mode 100755 diff --git a/docs/drafts/workflow.txt b/docs/drafts/workflow.txt new file mode 100755 index 0000000..e69de29 diff --git a/docs/en/example-1.mnd b/docs/en/example-1.mnd old mode 100644 new mode 100755 diff --git a/docs/help/main.php b/docs/help/main.php old mode 100644 new mode 100755 diff --git a/docs/ide/README b/docs/ide/README old mode 100644 new mode 100755 diff --git a/docs/pt/Relatorio parcial - TCC-I-5.odt b/docs/pt/Relatorio parcial - TCC-I-5.odt old mode 100644 new mode 100755 diff --git a/docs/pt/exemplo-1.mnd b/docs/pt/exemplo-1.mnd old mode 100644 new mode 100755 diff --git a/docs/pt/mind3rd-tcc1-odp.odp b/docs/pt/mind3rd-tcc1-odp.odp old mode 100644 new mode 100755 diff --git a/mind3rd/API/L10N/en.php b/mind3rd/API/L10N/en.php index 2e1392c..3c8f4bf 100755 --- a/mind3rd/API/L10N/en.php +++ b/mind3rd/API/L10N/en.php @@ -33,6 +33,7 @@ class En { $this->messages['no_such_file'] = Mind::message("\nMain: No such command '%s'", "[Fail]", false); $this->messages['auth_fail'] = Mind::message("\nAuth: Wrong user or password", "[Fail]", false); $this->messages['bye'] = "Logging out...\n"; + $this->messages['thinking'] = "Please wait while I'm thinking...\n"; $this->messages['invalidCreateParams'] = Mind::message("Main: Invalid parameters", "[Fail]", false); $this->messages['invalidOption'] = Mind::message("Invalid option '%s'", '[Fail]', false); $this->messages['projectAlreadyExists'] = Mind::message("There is, already, another project with the same name", '[Fail]', false); @@ -43,6 +44,8 @@ class En { $this->messages['currentProjectRequired'] = Mind::message("You must open a project first", '[Fail]', false); $this->messages['sourceFileNotFound'] = Mind::message("The source '%s' was not found for the current project.", '[Fail]', false); $this->messages['currentProjectRequiredTip']= "You can use the command\n use project \n"; + $this->messages['analyseFirst'] = "You will need to analyze the project. It has not been analyzed yet.Execute the 'analyze' command.\n"; + $this->messages['permissionDenied'] = Mind::message("Permission denied to change/create/delete files.\nPlease, allow the system to change files in mind's root directory", '[Fail]', false);; $this->messages['http_invalid_requisition'] = <<messages['no_such_file'] = Mind::message("\nMain: Não conheço tal comando: '%s'", "[Fail]", false); $this->messages['auth_fail'] = Mind::message("\nAuth: Usuário ou senha inválidos", "[Fail]", false); $this->messages['bye'] = "Saindo, até logo...\n"; + $this->messages['thinking'] = "Por favor aguarde, enquanto eu penso...\n"; $this->messages['invalidCreateParams'] = Mind::message("Main: Parâmetros inválidos", "[Fail]", false); $this->messages['invalidOption'] = Mind::message("Opção inválida '%s'", '[Fail]', false); $this->messages['projectAlreadyExists'] = Mind::message("Lamento mas já existe um projeto de mesmo nome.", '[Fail]', false); @@ -49,7 +50,9 @@ class pt { $this->messages['projectOpened'] = Mind::message("Acessando projeto '%s'", '[Ok]', false); $this->messages['currentProjectRequired'] = Mind::message("Primeiro você precisará abrir um projeto.", '[Fail]', false); $this->messages['currentProjectRequiredTip']= "Tente com o comando\n use project \n"; + $this->messages['analyseFirst'] = "Você precisará analisar o projeto, primeiro. O projeto ainda não foi analizado. Execute o comando 'analyze'.\n"; $this->messages['sourceFileNotFound'] = Mind::message("O arquivo fonte '%s' não foi encontrado para o projeto atual.", '[Fail]', false); + $this->messages['permissionDenied'] = Mind::message("Permissão negada pra acessar, criar, alterar ou excluir um arquivo.\nPor favor, libere acesso ao sistema para o diretório raíz do Mind.\n", '[Fail]', false); $this->messages['http_invalid_requisition'] = <<name]= $tmpObj; + } + $f= fopen($relations, 'r'); + while (($buffer = fgets($f, 51200)) !== false) + { + if($tmpObj= @unserialize($buffer)) + Analyst::$relations[$tmpObj->name]= $tmpObj; + } + } + Mind::write('projectOpened', true, $p['name']); return true; } @@ -113,6 +132,7 @@ class MindProject extends VersionManager{ public static function setUp() { + parent::setUp(); self::$sourceContent= false; self::$currentSource= null; self::$sourceContent= Array(); @@ -160,6 +180,8 @@ class MindProject extends VersionManager{ "s\n"; $memory= ((memory_get_usage() / 1024)/1024); $memory= number_format($memory, 2); - echo $memory."MBs\n"; + echo "Memory: ".$memory."MBs\n"; + + self::cleanUp(); } } \ No newline at end of file diff --git a/mind3rd/API/classes/MindProperty.php b/mind3rd/API/classes/MindProperty.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/classes/MindRelation.php b/mind3rd/API/classes/MindRelation.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/classes/MindSpeaker.php b/mind3rd/API/classes/MindSpeaker.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/classes/MindTimer.php b/mind3rd/API/classes/MindTimer.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/classes/VersionManager.php b/mind3rd/API/classes/VersionManager.php old mode 100644 new mode 100755 index 8990af0..102425e --- a/mind3rd/API/classes/VersionManager.php +++ b/mind3rd/API/classes/VersionManager.php @@ -11,4 +11,40 @@ // situation of the current project echo "COMMITING"; } + + public static function setUp() + { + } + + public static function cleanUp() + { + $path= Mind::$currentProject['path']."/temp/"; + $entities= $path."entities~"; + $relations= $path."relations~"; + + $fEnt= fopen($entities, "w+"); + $fRel= fopen($relations, "w+"); + if(!$fEnt) + { + Mind::write('permissionDenied'); + return; + } + ftruncate($fEnt, 0); + ftruncate($fRel, 0); + @chmod($entities, 0777); + @chmod($relations, 0777); + + + foreach(Analyst::$entities as &$entity) + { + file_put_contents($entities, serialize($entity)."\n", FILE_APPEND); + } + + foreach(Analyst::$relations as &$relation) + { + file_put_contents($relations, serialize($relation)."\n", FILE_APPEND); + } + fclose($fEnt); + fclose($fRel); + } } \ No newline at end of file diff --git a/mind3rd/API/cortex/Darwin/Darwin.php b/mind3rd/API/cortex/Darwin/Darwin.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/cortex/analyst/Analysis.php b/mind3rd/API/cortex/analyst/Analysis.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/cortex/analyst/Analyst.php b/mind3rd/API/cortex/analyst/Analyst.php old mode 100644 new mode 100755 index 0d99bd7..7e38929 --- a/mind3rd/API/cortex/analyst/Analyst.php +++ b/mind3rd/API/cortex/analyst/Analyst.php @@ -75,8 +75,8 @@ class Analyst extends Analysis { public static function getUniverse() { return Array( - 'entities'=>self::$entities, - 'relations'=>self::$relations + 'entities'=>&self::$entities, + 'relations'=>&self::$relations ); } @@ -84,64 +84,81 @@ class Analyst extends Analysis { * Prints out the analyzed content * @param boolean $detailed Pass true if it should show detailed * information about the entities and properties. + * @param boolean $showEntities=true + * @param boolean $showRelations=true */ - public static function printWhatYouGet($detailed=true) + public static function printWhatYouGet($detailed=true, + $showEntities=true, + $showRelations=true) { $props= 0; - echo "ENTITIES: ".sizeof(self::$entities)."\n"; - foreach(self::$entities as $k=>$entity) + if($showEntities) { - if($detailed) + echo "ENTITIES: ".sizeof(self::$entities)."\n"; + foreach(self::$entities as $k=>$entity) { - echo " ".$entity->name. - "\n"; - //echo "[".$k."]\n"; - } - foreach($entity->properties as $prop) - { - $details= false; - $details= Array(); - if($prop->size) - $details[]= $prop->size; - if($prop->uinque) - $details[]= "unique"; - if($prop->key) - $details[]= "key"; - if($prop->required) - $details[]= "not null"; - if(!is_null($prop->default) && trim($prop->default) != '') - $details[]= ($prop->default!= AUTOINCREMENT_DEFVAL)? - '"'.$prop->default.'"': - "AUTO_INCREMENT"; - if(sizeof($prop->options) > 0) + if(!$detailed) { - $details[]= "{".implode("|", array_keys($prop->default))."}"; - } - - $props++; - echo " ".$prop->name. - ":".$prop->type. - "(". - implode(", ", $details). - ")". - ($prop->refTo? " => ".$prop->refTo->name: ""). - "\n"; + echo " ".$entity->name. + "\n"; + }else{ + echo " ".$entity->name. + "\n"; + foreach($entity->properties as $prop) + { + $details= false; + $details= Array(); + if($prop->size) + $details[]= $prop->size; + if($prop->uinque) + $details[]= "unique"; + if($prop->key) + $details[]= "key"; + if($prop->required) + $details[]= "not null"; + if(!is_null($prop->default) && trim($prop->default) != '') + $details[]= ($prop->default!= AUTOINCREMENT_DEFVAL)? + '"'.$prop->default.'"': + "AUTO_INCREMENT"; + if(sizeof($prop->options) > 0) + { + $opts= "{".implode("|", array_keys($prop->default))."}"; + $details[]= $opts; + } + + $props++; + echo " ".$prop->name. + ":".$prop->type. + "(". + implode(", ", $details). + ")". + ($prop->refTo? " => ".$prop->refTo->name: ""). + "\n"; + } + } } + if($detailed) + echo "PROPERTIES: ".$props."\n"; } - echo "RELATIONS:".sizeof(self::$relations)."\n"; - foreach(self::$relations as $k=>$rel) + if($showRelations) { - if(!$rel) - continue; - echo " ". - $k.': '. - $rel->rel->name.' -> '. - $rel->focus->name. - ($rel->uniqueRef? "[pk]": ""). - "\n"; + echo "RELATIONS:".sizeof(self::$relations)."\n"; + foreach(self::$relations as $k=>$rel) + { + if(!$rel) + continue; + echo " ".$rel->name; + if($detailed) + { + echo ': '. + $rel->rel->name.' -> '. + $rel->focus->name. + ($rel->uniqueRef? "[pk]": ""). + "\n"; + } + } + echo "Relations: ".sizeof(self::$relations)."\n"; } - echo "Properties: ".$props."\n"; - echo "Relations: ".sizeof(self::$relations)."\n"; } /** diff --git a/mind3rd/API/cortex/analyst/Normal.php b/mind3rd/API/cortex/analyst/Normal.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/cortex/analyst/Normalizer.php b/mind3rd/API/cortex/analyst/Normalizer.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/cortex/syntaxer/Syntaxer.php b/mind3rd/API/cortex/syntaxer/Syntaxer.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/cortex/tokenizer/Token.php b/mind3rd/API/cortex/tokenizer/Token.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/cortex/tokenizer/Tokenizer.php b/mind3rd/API/cortex/tokenizer/Tokenizer.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/en/IgnoreForms.php b/mind3rd/API/languages/en/IgnoreForms.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/en/Verbalizer.php b/mind3rd/API/languages/en/Verbalizer.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/en/datatypes.xml b/mind3rd/API/languages/en/datatypes.xml old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/en/ignore.list b/mind3rd/API/languages/en/ignore.list old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/en/lexics.xml b/mind3rd/API/languages/en/lexics.xml old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/en/qualifiers.xml b/mind3rd/API/languages/en/qualifiers.xml old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/en/quantifiers.xml b/mind3rd/API/languages/en/quantifiers.xml old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/en/sintatics.list b/mind3rd/API/languages/en/sintatics.list old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/en/verbs.list b/mind3rd/API/languages/en/verbs.list old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/pt/datatypes.xml b/mind3rd/API/languages/pt/datatypes.xml old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/pt/qualifiers.xml b/mind3rd/API/languages/pt/qualifiers.xml old mode 100644 new mode 100755 diff --git a/mind3rd/API/languages/pt/sintatics.list b/mind3rd/API/languages/pt/sintatics.list old mode 100644 new mode 100755 diff --git a/mind3rd/API/plugins/PluginTwo/PluginTwo.php b/mind3rd/API/plugins/PluginTwo/PluginTwo.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/programs/Analyze.php b/mind3rd/API/programs/Analyze.php index f39642b..5029269 100755 --- a/mind3rd/API/programs/Analyze.php +++ b/mind3rd/API/programs/Analyze.php @@ -38,6 +38,7 @@ EOT return false; $this->nameSpace= $input->getArgument('namespace'); $this->autoCommit= $input->getOption('commit'); + Mind::write('thinking'); $this->runAction(); } diff --git a/mind3rd/API/programs/Create.php b/mind3rd/API/programs/Create.php index 7212f4e..c3fdc51 100755 --- a/mind3rd/API/programs/Create.php +++ b/mind3rd/API/programs/Create.php @@ -115,6 +115,7 @@ EOT } Mind::copyDir(Mind::$modelsDir.'mind/', $this->projectfile); + chmod($this->projectfile, 0777); $db= new MindDB(); $qr_newProj= "INSERT into project diff --git a/mind3rd/API/programs/Show.php b/mind3rd/API/programs/Show.php index 74a18be..f53cad0 100755 --- a/mind3rd/API/programs/Show.php +++ b/mind3rd/API/programs/Show.php @@ -78,6 +78,30 @@ EOT $this->printMatrix($userList); } break; + case 'entities': + $entities= Analyst::getUniverse(); + $entities= $entities['entities']; + if(sizeof($entities) >0) + if($this->detailed) + Analyst::printWhatYouGet(true, true, false); + else + echo " ".implode("\n ", array_keys($entities)); + else + echo " No entities to show"; + echo "\n"; + break; + case 'relations': + $relations= Analyst::getUniverse(); + $relations= $relations['relations']; + if(sizeof($relations) >0) + if($this->detailed) + Analyst::printWhatYouGet(true, false, true); + else + echo " ".implode("\n ", array_keys($relations)); + else + echo " No relations to show"; + echo "\n"; + break; default: Mind::write('invalidOption', true, $this->whatToShow); return false; diff --git a/mind3rd/API/utils/command.php b/mind3rd/API/utils/command.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/utils/constants.php b/mind3rd/API/utils/constants.php old mode 100644 new mode 100755 diff --git a/mind3rd/API/utils/header.php b/mind3rd/API/utils/header.php old mode 100644 new mode 100755 diff --git a/mind3rd/env/setup/Setup.php b/mind3rd/env/setup/Setup.php old mode 100644 new mode 100755 diff --git a/mind3rd/env/setup/UnixSetup.php b/mind3rd/env/setup/UnixSetup.php old mode 100644 new mode 100755 diff --git a/mind3rd/env/setup/WinSetup.php b/mind3rd/env/setup/WinSetup.php old mode 100644 new mode 100755 diff --git a/mind3rd/env/setup/wizard/installation-1.php b/mind3rd/env/setup/wizard/installation-1.php old mode 100644 new mode 100755 diff --git a/mind3rd/env/setup/wizard/installation-2.php b/mind3rd/env/setup/wizard/installation-2.php old mode 100644 new mode 100755