This commit is contained in:
as2252258@163.com
2021-08-11 01:04:57 +08:00
parent 63d8eaa4a5
commit 682246df28
219 changed files with 790 additions and 791 deletions
+6 -6
View File
@@ -5,10 +5,10 @@ namespace Gii;
use Exception;
use Snowflake\Abstracts\Config;
use Snowflake\Abstracts\Input;
use Snowflake\Exception\ConfigException;
use Snowflake\Snowflake;
use Kiri\Abstracts\Config;
use Kiri\Abstracts\Input;
use Kiri\Exception\ConfigException;
use Kiri\Kiri;
/**
* Class Command
@@ -31,9 +31,9 @@ class Command extends \Console\Command
public function onHandler(Input $dtl): array
{
/** @var Gii $gii */
$gii = Snowflake::app()->get('gii');
$gii = Kiri::app()->get('gii');
$connections = Snowflake::app()->db;
$connections = Kiri::app()->db;
if ($dtl->exists('databases')) {
return $gii->run($connections->get($dtl->get('databases')), $dtl);
}
+6 -6
View File
@@ -12,10 +12,10 @@ namespace Gii;
use Database\Connection;
use Database\Db;
use Exception;
use Snowflake\Abstracts\Input;
use Snowflake\Exception\ComponentException;
use Snowflake\Exception\ConfigException;
use Snowflake\Snowflake;
use Kiri\Abstracts\Input;
use Kiri\Exception\ComponentException;
use Kiri\Exception\ConfigException;
use Kiri\Kiri;
/**
* Class gii
@@ -123,7 +123,7 @@ class Gii
return $this->makeByDatabases($make, $input);
}
$db = $this->input->get('databases', 'db');
$this->db = Snowflake::app()->db->get($db);
$this->db = Kiri::app()->db->get($db);
return $this->makeByDatabases($make, $input);
}
@@ -138,7 +138,7 @@ class Gii
*/
private function makeByDatabases($make, $input): array
{
$redis = Snowflake::app()->getRedis();
$redis = Kiri::app()->getRedis();
if (!empty($input->get('name'))) {
$this->tableName = $input->get('name');
$redis->del('column:' . $this->tableName);
+2 -2
View File
@@ -11,8 +11,8 @@ use JetBrains\PhpStorm\ArrayShape;
use ReflectionClass;
use ReflectionException;
use Snowflake\Abstracts\Input;
use Snowflake\Core\Json;
use Kiri\Abstracts\Input;
use Kiri\Core\Json;
/**
* Class GiiBase
+5 -5
View File
@@ -6,7 +6,7 @@ namespace Gii;
use Exception;
use ReflectionException;
use Snowflake\Snowflake;
use Kiri\Kiri;
/**
* Class GiiController
@@ -66,13 +66,13 @@ namespace {$namespace};
exit(logger()->addError($Exception, 'throwable'));
}
} else {
$import = "use Snowflake;
$import = "use Kiri;
use Exception;
use Annotation\Target;
use Annotation\Route\Middleware;
use Annotation\Route\Route;
use Snowflake\Core\Str;
use Snowflake\Core\Json;
use Kiri\Core\Str;
use Kiri\Core\Json;
use HttpServer\Http\Request;
use HttpServer\Http\Response;
use HttpServer\Controller;
@@ -127,7 +127,7 @@ use {$model_namespace}\\{$managerName};
unlink($file);
}
Snowflake::writeFile($file, $html);
Kiri::writeFile($file, $html);
return $controllerName . 'Controller.php';
}
+2 -2
View File
@@ -6,7 +6,7 @@ namespace Gii;
use Exception;
use Snowflake\Snowflake;
use Kiri\Kiri;
/**
* Class GiiInterceptor
@@ -91,7 +91,7 @@ class ' . $managerName . 'Interceptor implements Interceptor
throw new Exception('File exists.');
}
Snowflake::writeFile($file, $html);
Kiri::writeFile($file, $html);
return [$managerName . 'Interceptor.php'];
}
+2 -2
View File
@@ -6,7 +6,7 @@ namespace Gii;
use Exception;
use Snowflake\Snowflake;
use Kiri\Kiri;
/**
* Class GiiLimits
@@ -68,7 +68,7 @@ class ' . $managerName . 'Limits implements Limits
throw new Exception('File exists.');
}
Snowflake::writeFile($file, $html);
Kiri::writeFile($file, $html);
return [$managerName . 'Limits.php'];
}
+2 -2
View File
@@ -6,7 +6,7 @@ namespace Gii;
use Exception;
use Snowflake\Snowflake;
use Kiri\Kiri;
/**
* Class GiiMiddleware
@@ -65,7 +65,7 @@ class ' . $managerName . 'Middleware implements Middleware
throw new Exception('File exists.');
}
Snowflake::writeFile($file, $html);
Kiri::writeFile($file, $html);
return [$managerName . 'Middleware.php'];
}
+4 -4
View File
@@ -7,7 +7,7 @@ namespace Gii;
use Database\Db;
use Exception;
use ReflectionException;
use Snowflake\Snowflake;
use Kiri\Kiri;
/**
* Class GiiModel
@@ -57,7 +57,7 @@ class GiiModel extends GiiBase
try {
$className = str_replace('\\\\', '\\', "{$modelPath['namespace']}\\{$managerName}");
$class = Snowflake::getDi()->getReflect($className);
$class = Kiri::getDi()->getReflect($className);
$html = '<?php
namespace ' . $namespace . ';
@@ -87,7 +87,7 @@ namespace ' . $namespace . ';
use Exception;
use Annotation\Target;
use Snowflake\Core\Json;
use Kiri\Core\Json;
use Database\Connection;
use Annotation\Model\Get;
use Annotation\Model\Set;
@@ -147,7 +147,7 @@ use Database\ActiveRecord;
unlink($file);
}
Snowflake::writeFile($file, $html);
Kiri::writeFile($file, $html);
return $managerName . '.php';
}
+2 -2
View File
@@ -7,8 +7,8 @@ namespace Gii;
use Console\Console;
use Exception;
use Snowflake\Abstracts\Providers;
use Snowflake\Application;
use Kiri\Abstracts\Providers;
use Kiri\Application;
/**
* Class DatabasesProviders
+4 -4
View File
@@ -5,7 +5,7 @@ namespace Gii;
use Exception;
use Snowflake\Snowflake;
use Kiri\Kiri;
/**
* Class GiiRpcClient
@@ -41,8 +41,8 @@ use Annotation\Rpc\RpcClient;
use Annotation\Target;
use Exception;
use Rpc\Client;
use Snowflake\Core\Json;
use Snowflake\Snowflake;
use Kiri\Core\Json;
use Kiri\Kiri;
';
@@ -93,7 +93,7 @@ class ' . $managerName . 'Consumer extends \Rpc\Consumer
throw new Exception('File exists.');
}
Snowflake::writeFile($file, $html);
Kiri::writeFile($file, $html);
return [$managerName . 'Middleware.php'];
}
}
+3 -3
View File
@@ -5,7 +5,7 @@ namespace Gii;
use Exception;
use Snowflake\Snowflake;
use Kiri\Kiri;
/**
* Class GiiRpcClient
@@ -38,7 +38,7 @@ use Annotation\Target;
use Exception;
use HttpServer\Controller;
use HttpServer\Exception\RequestException;
use Snowflake\Core\Json;
use Kiri\Core\Json;
';
@@ -73,7 +73,7 @@ class ' . $managerName . 'Producer extends Controller
throw new Exception('File exists.');
}
Snowflake::writeFile($file, $html);
Kiri::writeFile($file, $html);
return [$managerName . 'Producer.php'];
}
}
+2 -2
View File
@@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Gii;
use Exception;
use Snowflake\Snowflake;
use Kiri\Kiri;
/**
* Class GiiModel
@@ -83,7 +83,7 @@ class ' . $managerName . ' implements Task
throw new Exception('File exists.');
}
Snowflake::writeFile($file, $html);
Kiri::writeFile($file, $html);
return [$managerName . '.php'];
}