Skip to content

Commit

Permalink
* 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecc-business-account committed Jul 7, 2022
1 parent 7390412 commit 59419f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2035,6 +2035,8 @@ In a nutshell:
>
> Every decimal version means that it patches/fixes/refactoring a previous functionality i.e. 1.5.0 -> 1.5.1 (fix)
* 3.6 2022-07-07
* [CLI] update CLI to 1.1
* 3.5 2022-07-06
* [ORM] fixed recursive when "query", "insert","update" and "delete". Now recursive work with aliases.
* _BasePdoOne update to binary version BINARYVERSION. It will require regeneration of repository classes.
Expand Down
4 changes: 2 additions & 2 deletions lib/PdoOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
* @package eftec
* @author Jorge Castro Castillo
* @copyright (c) Jorge Castro C. Dual Licence: MIT and Commercial License https://github.com/EFTEC/PdoOne
* @version 3.5
* @version 3.6
*/
class PdoOne
{
public const VERSION = '3.5';
public const VERSION = '3.6';
/** @var int We need this value because null and false could be a valid value. */
public const NULL = PHP_INT_MAX;
/** @var string Prefix of the tables */
Expand Down
10 changes: 5 additions & 5 deletions lib/PdoOneCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
* @package eftec
* @author Jorge Castro Castillo
* @copyright (c) Jorge Castro C. Dual Licence: MIT and Commercial License https://github.com/EFTEC/PdoOne
* @version 1.0
* @version 1.1
*/
class PdoOneCli
{
public const VERSION = '1.0';
public const VERSION = '1.1';
//</editor-fold>
/**
* @var array
Expand Down Expand Up @@ -382,13 +382,11 @@ public function cliEngine(): void
break;
}
if (!$ok) {// $first->value) {
var_dump('load');
$database = $this->cli->evalParam('databasetype', $interactive, true);
$server = $this->cli->evalParam('server', $interactive, true);
$user = $this->cli->evalParam('user', $interactive, true);
$pwd = $this->cli->evalParam('password', $interactive, true);
$db = $this->cli->evalParam('database', $interactive, true);
var_dump('two');
} else {
$database = $this->cli->getValue('databasetype');
$server = $this->cli->getValue('server');
Expand Down Expand Up @@ -522,7 +520,7 @@ protected function showHelpExport(): void

protected function runCliConnection($force=false): ?PdoOne
{
if (!$this->cli->getValue('databasetype') && $force===false) {
if ($force===false &&!$this->cli->getValue('databasetype')) {
return null;
}
if($force) {
Expand Down Expand Up @@ -755,6 +753,7 @@ public function createPdoInstance(): ?PdoOne {
$pdo->logLevel = 1;
$pdo->connect();
} catch(Exception $ex) {
/** @noinspection PhpUndefinedVariableInspection */
$this->cli->showCheck('ERROR','red',['Unable to connect to database',$pdo->lastError(),$pdo->errorText]);
return null;
}
Expand Down Expand Up @@ -1238,6 +1237,7 @@ protected function databaseScan($tablesmarked, $pdo): void
$pk = '??';
$pk = $pdo->service->getPK($ktable, $pk);
$pkFirst = (is_array($pk) && count($pk) > 0) ? $pk[0] : null;
/** @noinspection PhpUnusedLocalVariableInspection */
[$relation, $linked] = $pdo->generateGetRelations($ktable, $this->columnsTable, $pkFirst, $alias);
foreach ($relation as $colDB => $defs) {
if (!isset($alias[$ktable][$colDB])) {
Expand Down

0 comments on commit 59419f6

Please sign in to comment.