pomm-project / pomm-symfony-bridge Goto Github PK
View Code? Open in Web Editor NEWPomm2 shared elements for profiler between Silex and Symfony.
Pomm2 shared elements for profiler between Silex and Symfony.
The bridge is using by Symfony and Silex, but Silex will be end of life the 18 june 2018
https://symfony.com/blog/the-end-of-silex
And the bridge have a big inconvenient, when we develop a functionality it's not easy to test impact on Symfony Bundle.
When building an API, there is no need for Twig. It may be needed in the dev environment because of the profiler but in production, even though the profiler extension is not loaded, Pomm still requires the twig service to be present & configured.
When no twig configuration is set, Symfony throws the following exception
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
The service "pomm.twig_extension" has a dependency on a non-existent service "twig.loader".
The function denormalize
get the Model to construct flexibleEntity, but we have the same result with
new ObjectEntity($data)
If we have the same result, the Symfony Serializer enough.
@sanpii ?
$this->pomm['default']
->getModel('AppBundle\\Model\\Db\\PublicSchema\\TeleinfoModel')
->findWhere('created = $*', [new \DateTime('2014-02-17 22:05:06.566862')]);
Explain this query throw an error:
Catchable Fatal Error: Object of class DateTime could not be converted to string in vendor/pomm-project/foundation/sources/lib/Session/Connection.php line 401
Add pomm in timeline of profiler
In the profiler, add a link to display/hide the runnable query.
Hi,
It seems that the PropertyInfo TypeExtractor
does not handle array subtype.
In a structure like the following
<?php
namespace App\Model\Test\PublicSchema\AutoStructure;
use PommProject\ModelManager\Model\RowStructure;
class Asset extends RowStructure
{
public function __construct()
{
$this
->setRelation('public.asset')
->setPrimaryKey(['id'])
->addField('id', 'int4')
->addField('typedarray', 'text[]')
;
}
}
With API Plateform, when I want to generate the swagger file with:
bin/console api:swagger:export --output=swagger_specification.json
It throws an error:
In FileLoader.php line 168:
Invalid text[] in . (which is being imported from "/var/www/config/routes/api_platform.yaml"). Make sure there is a loader supporting the "api_platform" type.
In TypeExtractor.php line 93:
Invalid text[]
After some digging, in TypeExtractor.php, the function getPommType()
does not get the proper array subtype.
private function getPommType(Session $session, $sql_type)
{
$pomm_types = $session->getPoolerForType('converter')
->getConverterHolder()
->getTypesWithConverterName();
if (!isset($pomm_types[$sql_type])) {
throw new \RuntimeException("Invalid $sql_type");
}
return $pomm_types[$sql_type];
}
If I replace with the code below, it works as expected.
private function getPommType(Session $session, $sql_type)
{
$pomm_type = $session
->getClientUsingPooler('converter', $sql_type)
;
if (!isset($pomm_type)) {
throw new \RuntimeException("Invalid $sql_type ");
}
return $pomm_type;
}
It seems to be multiple path to get a converter, I don't know if this is the right thing to do.
After this PR the icon in the profiler is Pomm logo.
I think it is important to chose a picto that illustrates in the more accurate way that is a database related profiler. I thought a Postgresql related logo would be nice, what do you think ?
Key "time_ms" for array with keys "sql, parameters, session_stamp" does not exist.
in vendor/pomm-project/pomm-symfony-bridge/views/Profiler/db.html.twig (line 54)
User Deprecated: Implementing "Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface" without the "reset()" method is deprecated since version 3.4 and will be unsupported in 4.0 for class "PommProject\SymfonyBridge\DatabaseDataCollector".
There are no errors, but the query count is always 0 and the report always empty. I will inspect this.
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.