skyfoxvn / propelbundle Goto Github PK
View Code? Open in Web Editor NEWThis project forked from propelorm/propelbundle
PropelBundle for Symfony.
Home Page: http://propelorm.org/Propel/documentation/#working-with-symfony2
This project forked from propelorm/propelbundle
PropelBundle for Symfony.
Home Page: http://propelorm.org/Propel/documentation/#working-with-symfony2
PHPUnit tests fail after the first ~200 tests with SQLSTATE[08004] [1040] Too many connections.
Each api call will trigger a full Symfony boot sequence, including PropelBundle's boot function, which creates a new connection each time, until the limit is reached.
I assumed, that Propel's ConnectionManagerSingle should close existing connections when new configuration is provided (ConnectionManagerSingle::setConfiguration()) by detaching connection objects. If nobody uses them, objects are destroyed, connections are closed. But not...
In Propel1 there was a !\Propel::isInit() function, this was used in PropelBundle to avoid multiple connection instances, but this has been removed, and the Propel::init() is also deprecated.
I reported this problem for Propel guys, but no answer till now (propelorm/Propel2#1906).
I managed to avoid this problem by emulating Propel1's behaviour by having
private static $isInitialized = false;
/**
* {@inheritdoc}
*/
public function boot(): void
{
try {
if (!self::$isInitialized) {
$this->configureConnections();
if ($this->container->getParameter('propel.logging')) {
$this->configureLogging();
}
self::$isInitialized = true;
}
} catch( \Exception $e ) {
}
}
in PropelBundle, but I'm not convinced that this is the correct solution.
(Symfony 5.4.18, PHP 8.0.24, MySQL 5.7, PHPUnit 9.3.11)
The "Propel" section of the Symfony profiler is inactive, because connection is not in debug mode.
I attempted to fix it by adding
if ($this->container->getParameter('kernel.debug')) {
$connection->useDebug(true);
}
in PropelBundle::configureLogging() to both read and write connections. This worked fine whith browser request, Propel queries appeared correctly in profiler, but caused a huge memory leak when executing queries in phpunit tests. In Propel's ConnectionWrapper::callUserFunctionWithLogging() both $callback(...$args); and $this->log($sqlForLog); increased memory usage by 17K for each query.
(Symfony 5.4.18, PHP 8.0.24, MySQL 5.7, PHPUnit 9.3.11)
Great job by fixing up PropelBundle btw! Really appreciate it!
line - 209 to 230
research and refactoring(if needed) need to be done because this part of code look useless at this point because its doing same as ChoiceType/ModeType option "choice_label"
fzaninotto/faker its deprecated from some time ago and some of the functions/syntax in the code dosant exists anymore and in result of this unit tests fails(github actions)
In commit propelorm/Propel2@a9b02ae of the propel/propel package there was a breaking change that added a constructor with string $name parameter to ConnectionManagerPrimaryReplica
, which is instantiated in the PropelBundle class.
After updating to 294de32 of propelorm/Propel2 (integration of PR #1742), I'm getting a "Database map was not initialized. Please check the database loader script included by your conf" error in a Symfony 4.4 application using PropelBundle. After (manually) including the loadDatabase.php script generated by model:build
in PropelBundle::configureConnections() (line 59), it seems to work. As far as I understood PR #1742 of propelorm/Propel2, the problem is that the loader script generated by model:build
is never included/required
with PropelBundle.
Hi @SkyFoxvn
Would you mind create a 5.0.2 tag on the current version of the 5.0 branch?
And also a 6.0.0 tag on the current version of the 6.0 branch?
Thanks a lot. Best regards
Hello,
Can you update the dependency: "propel/propel" to "2.0.0-beta2"?
Indeed, I cannot install your library because of a version conflict of symfony/yaml used by propel.
Thanks!
Hello,
In "PropelBundlePropelBundleSecurityUserPropelUserProvider", the "UsernameNotFoundException" class no longer exists. It has been replaced by "UserNotFoundException".
Can you update your bundle?
For information, github prevents me to fork your bundle because I already forked an old PropelBundle, so I can't make a pull request.
Thank you.
I've just found another issue with 5.0.1 and beta2 so adding it here for you
Error: Uncaught ArgumentCountError: Too few arguments to function Propel\Runtime\Connection\ConnectionManagerSingle::__construct(), 0 passed in /var/www/vendor/skyfox/propel-bundle/PropelBundle.php on line 81 and exactly 1 expec ted in /var/www/vendor/propel/propel/src/Propel/Runtime/Connection/ConnectionManagerSingle.php:37
Firstly many thanks for this fork of PropelBundle!
After installation and clearing cache I got the following error:
In ContainerBuilder.php line 1030:
You have requested a non-existent service "profiler".
I found that "services_dev.yml" is loaded and that it tried to use the "profiler"-service. I didn't had the profiler installed, thus I was confronted with the exception. As a workaround I installed symfony/profiler-pack, but maybe a check can be added to see if the profiler is installed before loading "services_dev.yml"?
Thanks for forking this bundle and keeping it current.
I'm using it to migrate a large legacy project from SF3 to SF4 then onwards. I am having to use v5.0.1 but I am having an issue:
`Fatal error: Declaration of Propel\Bundle\PropelBundle\DependencyInjection\Configuration::addPathsSection(Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node) must be compatible with Propel\Common\Config\Propel
Configuration::addPathsSection(Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node): void in /var/www/vendor/skyfox/propel-bundle/DependencyInjection/Configuration.php on line 32
addPathsSection
addRuntimeSection
addDatabaseSection
all need a return type of 'void' according to propel/propel 2.0.0-beta2
`
It look's like it should be a simple fix, is this something you can help with or would you like me to submit a PR? I don't have much time on this topic, so it would be great to hear back one way or another
Can you please update the "propel/propel" dependency from "2.0.0-beta2" to "2.0.0-beta3" (at least for the 5.1 and 6.0 branch)? The beta3 contains some interesting enhancements (e.g. Monolog V3 support) and fixes.
Thanks.
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.