yiisoft / yii-cycle Goto Github PK
View Code? Open in Web Editor NEWCycle ORM support for Yii
Home Page: https://www.yiiframework.com/
License: BSD 3-Clause "New" or "Revised" License
Cycle ORM support for Yii
Home Page: https://www.yiiframework.com/
License: BSD 3-Clause "New" or "Revised" License
See #141
Need to increase coverage and fix mutants.
I'm thinking about adding the EntityWriter class.
Do you think this will be useful?
Should there be a separate interface for this? (EntityWriterInterface implements DataWriterinterface
)
These mappers are not compatible with ORM v2
They should be updated or deleted.
Code for update can be copied from here:
https://github.com/cycle/orm/blob/2.0/tests/ORM/Fixtures/TimestampedMapper.php
https://github.com/cycle/orm/blob/2.0/tests/ORM/Fixtures/SoftDeletedMapper.php
@roxblnfk, will there be any difficulties with updating?
It was renamed in Yii Data.
In order to be able to get the repository from the container, we need to create a factory for each repository.
We need to explore the possibility of implementing automatic declaration of repositories in the container or creating a basic repository for autowiring
There should be used \Spiral\Attributes\AttributeReader
After a migration up/down action, the AfterMigrate event is dispatched.
Depending on how the schema is stored, the cache needs to be cleared (or schema file to be rebuilded)
Make lazy loading of dependencies
We need to create generator that will convert a schema object (\Cycle\ORM\SchemaInterface
) into a \Cycle\Schema\Registry
object
Then we will be able to generate migrations based on a ready-made scheme or use other generators
Cycle ORM documentation has been updated. We should refresh links in our docs
Expand all cycle/* versions
We need to redesign the single file schema provider (FromFileSchemaProvider
) so that it can not only read the schema from the file, but also write it to the file in readable format like result of the cycle/schema/php
command
FromFileSchemaProvider
to deprecated in favor of FromFilesSchemaProvider
SchemaToPHP
helper and integrate it with the FromFileSchemaProvider
FromFileSchemaProvider
to PhpFileSchemaProvider
Cycle ORM v2 supports custom collections in relations.
We need to add related options in the params.php
:
https://gist.github.com/roxblnfk/c6dbd42ac2a45d60eca43a2e13388ffa#custom-collections
We have a SchemaProviderPipeline class for sequential schema reading from providers.
We need to add a provider that will read parts of the schema from several providers in parallel and merge them into a single schema.
This way, we can connect schemas from different sources using existing providers: for example, annotations in the application and files in vendor packages.
Waiting for: yiisoft/files#46
Class Yiisoft\Yii\Cycle\Data\Reader\FilterHandler\AllHandler contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Yiisoft\Data\Reader\FilterHandlerInterface::getFilterClass)
Q | A |
---|---|
Version | 1.0.? |
PHP version | 8.2 |
Operating system | Windows 11 |
This error does not appear if I do not update composer.
Steps taken to try and avoid this error:
config\web\di\middleware-dispatcher
<?php
declare(strict_types=1);
/**
* @var array $params
*/
use Yiisoft\Definitions\Reference;
use Yiisoft\Input\Http\HydratorAttributeParametersResolver;
//use Yiisoft\Input\Http\Request\Catcher\RequestCatcherParametersResolver;
use Yiisoft\Middleware\Dispatcher\CompositeParametersResolver;
use Yiisoft\Middleware\Dispatcher\ParametersResolverInterface;
return [
ParametersResolverInterface::class => [
'class' => CompositeParametersResolver::class,
'__construct()' => [
Reference::to(HydratorAttributeParametersResolver::class),
//Reference::to(RequestCatcherParametersResolver::class),
],
],
];
config\web\params... middleware stack ... The RequestCatcherMiddleware::class has been moved out of input-http as indicated in the above parameterResolverInterface and into the middleware stack:
'middlewares' => [
ErrorCatcher::class,
SentryMiddleware::class,
SessionMiddleware::class,
CookieMiddleware::class,
CookieLoginMiddleware::class,
Locale::class,
Router::class,
**RequestCatcherMiddleware::class**, <---------------------------
]
I have been dealing with grids recently including filters on the grids and they are functioning beautifully. I have not accessed any of the functions mentioned in the error above although I shall be trying to do so and implement at least one of these functions in association with the grid. It would appear that this is an intialization error. When I do a composer update .... trying to get to the next stage of development ... I get the above error.
We need to implement support for wildcards in FromFileSchemaProvider
All classes like Yiisoft\Yii\Cycle\Data\Reader\Processor\*
are broken because there were changes in the yiisoft/data
packages. Need to fix it
Cycle ORM 2 was released.
We should update the composer.json
.
Queries to the database are not logged when this option is enabled 'query-logger' => \Yiisoft\Log\Logger::class
yii-cycle/src/Data/Reader/EntityReader.php
Line 208 in a67841b
There is the new generator in the schema-builder package. Need to add it in documentation and schema conveyor.
Data reader and filters should be moved. (Data directory)
Add no interaction
flag for migrate
commands
When a big schema compiling
Create an ORM instance when running RR server once
Creates an ORM instance each request serving
Invokeable factories used some core packages as well
Instead of using definitions and di packages, custom exceptions could be defined. That would:
That should be better way to solve #122.
Waiting:
Need to fix Psalm issued before release.
The way to configure the package should be changed.
vendor-name/package-name
as key for config groupEntityReader::count()
method does not apply filters until withFilterHandlers()
is called.
Solution is to call resetCountCache()
when withFilter()
is called?
Migration option isSafe() (set in $params['yiisoft/yii-cycle']['migrations']['safe']
) don't work default and should be implements in this package.
Originally posted by @roxblnfk in #152 (comment)
For example, yiisoft/definitions
and yiisoft/di
here:
yii-cycle/src/Factory/RepositoryContainer.php
Lines 11 to 12 in 8acc5db
Add dependency specified in Yii container to repository constructor.
Dependency will be resolved.
Error Undefined class or binding
.
I think need send Yii Factory in config.
Sync a generator list in SchemaConveyors with https://cycle-orm.dev/docs/annotated-prerequisites/2.x/en#compiler-pipeline
$ git clone https://github.com/yiisoft/yii-demo.git
$ cd yii-demo
$ composer install
$ ./vendor/bin/yii serve
Go to index page. Then...
$ ./vendor/bin/yii fixture/add 20
No errors.
Warning: Uncaught Error in exception handling during call to Error::__tostring() in /home/ricardo/web/yii-demo/vendor/cycle/orm/src/Command/Traits/ContextTrait
.php on line 0
Call Stack:
0.0001 412128 1. {main}() /home/ricardo/web/yii-demo/vendor/yiisoft/yii-console/bin/yii:0
0.0001 412448 2. {closure:/home/ricardo/web/yii-demo/vendor/yiisoft/yii-console/bin/yii:12-87}() /home/ricardo/web/yii-demo/vendor/yiisoft/yii-consol
e/bin/yii:87
0.1889 17802928 3. Yiisoft\Yii\Console\Application->run($input = NULL, $output = class Yiisoft\Yii\Console\Output\ConsoleBufferedOutput { private strin
g $buffer = ''; private ${Symfony\Component\Console\Output\ConsoleOutput}stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resou
rce(860) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = clas
s Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private ${Symfony\Component\Console\Output\ConsoleOutput}consoleSectionOutputs = []; private $
{Symfony\Component\Console\Output\StreamOutput}stream = resource(859) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; priva
te ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = FALSE; private $style
s = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } } }) /home/ricardo/web/yii-demo/vendor/yiisoft/yii
-console/bin/yii:80
0.1931 17813864 4. Yiisoft\Yii\Console\Application->doRun($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'fixture/a
dd', 1 => '20']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $req
uiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = TRUE; private $options = [...]; private $shortcuts = [...] }; protected $stream = N
ULL; protected $options = []; protected $arguments = ['command' => 'fixture/add', 'count' => '20']; protected $interactive = TRUE }, $output = class Yiisoft\Yi
i\Console\Output\ConsoleBufferedOutput { private string $buffer = ''; private ${Symfony\Component\Console\Output\ConsoleOutput}stderr = class Symfony\Component
\Console\Output\StreamOutput { private $stream = resource(860) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Sy
mfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private ${Symfony\Component\Console\Outp
ut\ConsoleOutput}consoleSectionOutputs = []; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(859) of type (stream); private ${Symfony
\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\Output
Formatter { private $decorated = FALSE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ..
. } } }) /home/ricardo/web/yii-demo/vendor/symfony/console/Application.php:166
0.1973 18173368 5. Yiisoft\Yii\Console\Application->doRunCommand($command = class App\Command\Fixture\AddCommand { private Yiisoft\Yii\Cycle\Command\Cy
cleDependencyProxy $promise = class Yiisoft\Yii\Cycle\Command\CycleDependencyProxy { private Psr\Container\ContainerInterface $container = class Yiisoft\Yii\De
bug\Proxy\ContainerProxy { ... } }; private Faker\Generator $faker = class Faker\Generator { protected $providers = [...]; protected $formatters = [...] }; pri
vate array $users = [0 => class App\User\User { ... }, 1 => class App\User\User { ... }, 2 => class App\User\User { ... }, 3 => class App\User\User { ... }, 4
=> class App\User\User { ... }, 5 => class App\User\User { ... }, 6 => class App\User\User { ... }, 7 => class App\User\User { ... }, 8 => class App\User\User
{ ... }, 9 => class App\User\User { ... }, 10 => class App\User\User { ... }, 11 => class App\User\User { ... }, 12 => class App\User\User { ... }, 13 => class
App\User\User { ... }, 14 => class App\User\User { ... }, 15 => class App\User\User { ... }, 16 => class App\User\User { ... }, 17 => class App\User\User { ..
. }, 18 => class App\User\User { ... }, 19 => class App\User\User { ... }, 20 => class App\User\User { ... }]; private array $tags = [0 => class App\Blog\Entit
y\Tag { ... }, 1 => class App\Blog\Entity\Tag { ... }, 2 => class App\Blog\Entity\Tag { ... }, 3 => class App\Blog\Entity\Tag { ... }, 4 => class App\Blog\Enti
ty\Tag { ... }, 5 => class App\Blog\Entity\Tag { ... }, 6 => class App\Blog\Entity\Tag { ... }, 7 => class App\Blog\Entity\Tag { ... }, 8 => class App\Blog\Ent
ity\Tag { ... }, 9 => class App\Blog\Entity\Tag { ... }, 10 => class App\Blog\Entity\Tag { ... }, 11 => class App\Blog\Entity\Tag { ... }, 12 => class App\Blog
\Entity\Tag { ... }, 13 => class App\Blog\Entity\Tag { ... }, 14 => class App\Blog\Entity\Tag { ... }, 15 => class App\Blog\Entity\Tag { ... }, 16 => class App
\Blog\Entity\Tag { ... }, 17 => class App\Blog\Entity\Tag { ... }, 18 => class App\Blog\Entity\Tag { ... }, 19 => class App\Blog\Entity\Tag { ... }, 20 => clas
s App\Blog\Entity\Tag { ... }]; private ${Symfony\Component\Console\Command\Command}application = class Yiisoft\Yii\Console\Application { private Psr\EventDisp
atcher\EventDispatcherInterface $dispatcher = class Yiisoft\Yii\Console\SymfonyEventDispatcher { ... }; private ${Symfony\Component\Console\Application}command
s = [...]; private ${Symfony\Component\Console\Application}wantHelps = FALSE; private ${Symfony\Component\Console\Application}runningCommand = ...; private ${S
ymfony\Component\Console\Application}name = 'Yii Console'; private ${Symfony\Component\Console\Application}version = '3.0'; private ${Symfony\Component\Console
Q | A |
---|---|
Version | HEAD |
PHP version | PHP 7.4.13 (cli) (built: Nov 28 2020 06:24:59) ( NTS ) |
Operating system | Ubuntu 20.04.1 LTS |
This should work like schema/clear
command + build and save new schema
Display the scheme of all entities, add the ability to display the scheme of a specific entity or several entities at once.
Source issue: cycle/migrations#47
Reason: cycle/migrations#47 (comment)
Need to fix container confg to autoreset EntityManager for demonized apps
To reset EM, \Cycle\ORM\EntityManager::clean()
should be called.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.