Re: [PHP-DEV] Unserializes, inheritance and allows_classes

2019-01-17 Thread Marco Pivetta
se that > one has to opt between flexible design or security. > > Em qui, 17 de jan de 2019 às 22:24, Marco Pivetta > escreveu: > >> >> On Fri, Jan 18, 2019 at 12:49 AM Marcos Passos < >> marcospassos@gmail.com> wrote: >> >>> Hi internals

Re: [PHP-DEV] Unserializes, inheritance and allows_classes

2019-01-17 Thread Marco Pivetta
plex filter/ruleset. Also: nothing denies an attacker from defining a subtype to your class, then passing a malicious instance to your application. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-15 Thread Marco Pivetta
;equals($ref2) as an *additional* convenience method, > but it would not replace the getId() API. > I'd say that if the indexing is a fairly common scenario (seems like it, coming from Nicolas, who is the most direct API consumer here), the `->matches()` isn't needed at all. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-15 Thread Marco Pivetta
There seems to be a lot of design around `ReflectionReference#getId()` to avoid leaking internal pointer information: can it be completely dropped, if we have `$ref1->matches($ref2)` instead? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Tue, Jan 15, 2019 at 11:16

Re: [PHP-DEV] Making stdClass iterable

2019-01-14 Thread Marco Pivetta
as > json_decode(). > > Ben > This. `stdClass` can't die due to a lot of backwards compatibility in existing code (wordpress loves it), but in any code I've written over the past 5 years, the first thing I'd do with it is get rid of it as fast as possible. Making it more powerful will just make

Re: [PHP-DEV] Re: [RFC] [VOTE] Typed properties v2

2019-01-11 Thread Marco Pivetta
> > https://github.com/php/php-src/commit/e219ec144ef6682b71e135fd18654ee1bb4676b4 Great news! Just in time to ruin the weekend with some OSS work :D Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [doctrine-user] Doctrine doesn't allow now DESCENDANT indexes, WHY ?

2019-01-04 Thread Marco Pivetta
ine developers group" and I ended in this group. o_O > > Do you have a url? > > I think doctrine coul easily convert this "undocumented feature" in a > "valid feature" to translate > "=" > > Thanks > > > El viernes, 4 de enero de

Re: [doctrine-user] Doctrine doesn't allow now DESCENDANT indexes, WHY ?

2019-01-04 Thread Marco Pivetta
Doctrine only targets cross-platform compliant features. The undocumented "feature" you are using was working because of incorrect DBAL quoting semantics in DDL: if you need it, I suggest opening a pull request with a failing test, for discussion/inclusion in the tooling. On Fri, 4 Jan 2019,

Re: [doctrine-user] Json format - Reverse the relation owner

2018-12-26 Thread Marco Pivetta
This doesn't seem to be a doctrine-related questions, but rather something for the serialisation layer/library you rely upon. On Wed, 26 Dec 2018, 14:53 Jose Julian Hi, i use Donctrine 2.6.3 on a symfony 4.2 proyect(REST API). > and i have som trouble with some json generated > Theres is 2 basic

Re: [PHP-DEV] Typed properties - feature request

2018-12-13 Thread Marco Pivetta
Hi Ben, Such logic is already possible by casting the object to `(array)`, and therefore receiving a list of all properties that are explicitly set. Also, this seems like something I've already started from Doctrine 3 (but couldn't pursue further due to time constraints). Marco Pivetta http

Re: [PHP-DEV] [RFC] FFI - Foreign Function Interface

2018-12-11 Thread Marco Pivetta
ely flawed. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Tue, Dec 11, 2018 at 4:37 PM Dmitry Stogov wrote: > Hi Marco, > > > Some API and naming issues may be changed, e.g. FFI::array_type() was > renamed to FFI::arrayType(). > > Changing FFI into

Re: [PHP-DEV] [RFC] FFI - Foreign Function Interface

2018-12-06 Thread Marco Pivetta
. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Thu, Dec 6, 2018 at 4:54 PM Dmitry Stogov wrote: > Hi Internals, > > > I would like to start discussion of FFI RFC https://wiki.php.net/rfc/ffi > > > This extension allows calling C function

Re: [doctrine-user] Composite Key Order?

2018-11-30 Thread Marco Pivetta
t; order, why is it trying to reorder them at all then? > > A manual migration isn't going to help me here... I don't want to change > anything, I want to prevent doctrine from thinking it needs to change > something. > > > On Wednesday, November 28, 2018 at 9:40:59 AM UTC-8, Marco

Re: [doctrine-user] Composite Key Order?

2018-11-28 Thread Marco Pivetta
I'd avoid YML mappings overall, since they are deprecated and removed from ORM `master`. Still, order of columns in a key is not guaranteed anywhere in the ORM, so there's no real way to enforce the DDL to match your requirements. Consider using manually crafted doctrine migrations instead. On

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-25 Thread Marco Pivetta
v 25, 2018 at 7:03 AM Marco Pivetta wrote: > Adding to the pile of "it's an edge case", since the preload scripts will > be procedural, wouldn't it be sufficient to call > `opcache_invalidate(__FILE__)` at the end of them? > > That would actually not do anything useful -

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-25 Thread Marco Pivetta
Even if there were definitions in said script, the same issue would arise with a directive. On Sun, 25 Nov 2018, 18:35 Larry Garfield On Saturday, November 24, 2018 11:03:01 PM CST Marco Pivetta wrote: > > Adding to the pile of "it's an edge case", since the

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-24 Thread Marco Pivetta
Adding to the pile of "it's an edge case", since the preload scripts will be procedural, wouldn't it be sufficient to call `opcache_invalidate(__FILE__)` at the end of them? On Sat, 24 Nov 2018, 20:57 Stanislav Malyshev Hi! > > >> I'm not sure if you're missing anything fundamental - it's just

Re: [doctrine-user] Re: MySQL 8 Connection Refused Issue resolved - But why?

2018-11-19 Thread Marco Pivetta
I don't think this has anything to do with Doctrine at all: this is a known quirk of ext-pdo. On Mon, 19 Nov 2018, 22:15 David Stokes One of our developers informed me that libmysql and all derived clients > interpret "localhost" to mean "don't use TCP/ip, but Unix domain socket" > > Is there

Re: [doctrine-user] MySQL 8 Connection Refused Issue resolved - But why?

2018-11-19 Thread Marco Pivetta
That's PDO trying to outsmart things and trying to use a local socket when localhost is used: not something Doctrine can really fix. On Mon, 19 Nov 2018, 19:42 David Stokes Hi All, > > I am using Doctrine with MySQL 8.0.13 and ran into what looks like > something odd to me. I am using an

Re: [doctrine-user] What is the best way to reset dbal querybuilder setMaxResults?

2018-11-01 Thread Marco Pivetta
n our case it is injected into the class constructor. Are you suggesting that each method within a class/model has a instance? On Thu, Nov 1, 2018, 8:11 PM Marco Pivetta I didn't even know you could "reset" a query builder: why not simply > making a new instance? Note that builder

Re: [doctrine-user] What is the best way to reset dbal querybuilder setMaxResults?

2018-11-01 Thread Marco Pivetta
I didn't even know you could "reset" a query builder: why not simply making a new instance? Note that builder objects aren't usually services/injectables. On 1 Nov 2018 18:27, "Nate Braner" wrote: Hey everyone, So we are using doctrine/dbal outside of Symfony as we gear up to move the project

Re: [PHP-DEV] Composition over inheritance: native support for "delegating" methods?

2018-10-21 Thread Marco Pivetta
implement decorators correctly 2. the addition of a `delegate` functionality would cause more confusion for something that is already really trivial to implement/test/read The suggestion requires some stronger foundations/reasoning in order to be turned into a valuable RFC. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [doctrine-user] Pre load data on install

2018-10-12 Thread Marco Pivetta
For deployment environments, I use migrations to seed the initial state (if it is common to all deployment environments). For testing, I rely heavily on data-fixtures. On Fri, 12 Oct 2018, 10:05 Plamen Vasilev, wrote: > Hi all, > > what should I do to load data (like users, roles and etc.)

Re: [PHP-DEV] Class name resolution for \array::class

2018-10-01 Thread Marco Pivetta
They are still not classes On Mon, 1 Oct 2018, 14:24 Marcos Passos, wrote: > Rowan, thank you for sharing your thoughts. > > You can also see it as a language construct that expects a type at the > left-hand side of the name resolution operator. In that sense, primitive > types are perfectly

Re: [PHP-DEV] Class name resolution for \array::class

2018-09-30 Thread Marco Pivetta
Since `array` is not a class, it doesn't make sense to resolve its type. What's the use-case for such pseudo-constant in your code? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Mon, Oct 1, 2018 at 1:30 AM Marcos Passos wrote: > Currently, class name resolut

Re: [doctrine-user] Re: Wrong Entity names generated from database (postgres with diferent schemas)

2018-09-21 Thread Marco Pivetta
you said that PHP 5.6 was not supported anymore, I installed a new > server with PHP7, I integrated all doctrine latest projects from github so > now I have an updated doctrine, I ran the command again and the problem > persists. > > El jueves, 20 de septiembre de 2018, 18:54:11 (UTC

Re: [doctrine-user] Re: Wrong Entity names generated from database (postgres with diferent schemas)

2018-09-20 Thread Marco Pivetta
No, you will just need to upgrade your stack: PHP 5.6 is definitely *NOT* supported anymore. On 21 Sep 2018 00:48, "Dunior Socarras" wrote: Yes, I just tried with dbal-2.8.0 and orm-2.6.2, but some errors came out because I'm using PHP 5.6 and in this versions of orm and dbal are using "??"

Re: [doctrine-user] Wrong Entity names generated from database (postgres with diferent schemas)

2018-09-20 Thread Marco Pivetta
Did you already try with newest DBAL/ORM? On Thu, 20 Sep 2018, 06:25 Dunior Socarras, wrote: > I'm using Doctrine 2.5, I have a database in PostgreSQL 6 and my tables > are inside diferent schemas. > When I excecute the command "doctrine orm:convert-mapping --from-database > annotation",

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Marco Pivetta
On Wed, Sep 19, 2018 at 11:46 PM Rowan Collins wrote: > On 19/09/2018 22:30, Marco Pivetta wrote: > > > > At least the approach without nullable properties will lead to a > > Throwable when a read is attempted on an uninitialized object, which > > is still better than

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-19 Thread Marco Pivetta
P] > At least the approach without nullable properties will lead to a Throwable when a read is attempted on an uninitialized object, which is still better than nullability checks all over the place. And yes, constructing an object without going through its constructor is quite common anyway - this was i

Re: [PHP-DEV] [RFC] Pre-Vote: Typed properties

2018-09-08 Thread Marco Pivetta
Hey Bob, Did the implementation change a lot since it was last successfully tested, or is it mostly stabilization changes? Greets, Marco On Fri, 7 Sep 2018, 23:19 Bob Weinand, wrote: > Hey, > > Due to the mailing list downtime this has been delayed a bit ... > > I'd like to push the Typed

Re: [PHP-DEV] Assigning to a reference returned by a function/method

2018-08-31 Thread Marco Pivetta
I'd rather put everything that has to do with references in a pot and throw it at the core of the sun  Expanding features around references, especially since they are known to be problematic, makes them a bigger problem. On Fri, 31 Aug 2018, 20:44 Claude Pache, wrote: > Hi internals, > > >

Re: [doctrine-user] Re: Help for Association Mapping, please (->

2018-08-23 Thread Marco Pivetta
Can you be more specific about "nothing works"? Can you maybe put up an example script on gist.github.com? On Fri, 24 Aug 2018, 02:05 , wrote: > Thanks, but nothing works ... > > Le jeudi 23 août 2018 18:55:23 UTC+2, breth...@gmail.com a écrit : >> >> Hi, >> >> I read all I can read about this

Re: [doctrine-user] Re: Help for Association Mapping, please (->

2018-08-23 Thread Marco Pivetta
/** @ORM\Id() @ORM\Column() */ public $id; /** @ORM\ManyToOne(targetEntity=User::class, inversedBy="skills") */ public $skills; } Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Thu, Aug 23, 2018 at 9:37 PM wrote: > Tanks for your advises

Re: [doctrine-user] Help for Association Mapping, please (->

2018-08-23 Thread Marco Pivetta
Heya, Could you maybe reduce your examples to something that fits in a mail? What is not working about JoinColumn? Also, do you really need to define a join column? That's usually for later on, when you already built up some experience with the ORM. On Thu, 23 Aug 2018, 18:55 , wrote: > Hi, >

Re: [PHP-DEV] ZEND_ACC_* flags

2018-07-25 Thread Marco Pivetta
This can potentially break some cached flags somewhere, and is a BC break: any rationale behind the change? On Wed, 25 Jul 2018, 17:01 Dmitry Stogov, wrote: > Hi, > > > I tried to fix ZEND_ACC_* flags mess. > > > https://gist.github.com/dstogov/3b6ae377c17524b219670960cf98f8c1 > > > The patch

Re: [PHP-DEV] Non-nullable properties

2018-07-16 Thread Marco Pivetta
There are naturally 3 states in the engine: 1 - value set 2 - value not set (default `null`) 2 - undefined/uninitialised These have been around since 5.0 AFAIK. On Mon, 16 Jul 2018, 16:55 Rowan Collins, wrote: > On 16 July 2018 at 14:28, Marco Pivetta wrote: > > > These don't

Re: [PHP-DEV] Non-nullable properties

2018-07-16 Thread Marco Pivetta
These don't really need explicit tests in most cases, but rather static analysis (currently happening via docblocks). Static analysis tools like vimeo/psalm already pick this up. I'd even be happy to get type hints that only have effect on `ReflectionProperty#getType()` as a massive improvement

Re: [PHP-DEV] [RFC] Typed Properties

2018-07-12 Thread Marco Pivetta
Nope On Thu, 12 Jul 2018, 21:10 Stanislav Malyshev, wrote: > Hi! > > > - As I said earlier, this patch has already been tested against some > > extremely tricky scenarios, so from a userland perspective it is safe for > > inclusion. If you don't have confidence in something related to it, >

Re: [PHP-DEV] [RFC] Typed Properties

2018-07-11 Thread Marco Pivetta
ecosystem quality at large for more than a year. Bob and Nikita got it right, they made something well thought out, well tested, and previously already discussed: give the vote a chance, add a sub-vote for which version to target, if required. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] [RFC] Typed Properties

2018-07-10 Thread Marco Pivetta
want to be the one with a blocker here, and also because > I can write a "degraded mode" for now if that's the plan. > The important bit is to not have functionality that blocks userland scenarios that previously worked. If the try-catch works, then we can surely roll with it. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] Re: [RFC] [VOTE] User-defined object comparison

2018-07-10 Thread Marco Pivetta
and `Ord` operations for a specific class. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Mon, Jul 9, 2018 at 8:57 PM, Rudolf Theunissen < rudolf.theunis...@gmail.com> wrote: > Apologies for that middle discussion link, it was a bad hyperlink from a >

Re: [PHP-DEV] [RFC] Typed Properties

2018-07-10 Thread Marco Pivetta
? Anything blocking missing? - Is the reference issue reported by Nicolas a blocker? Nicolas, can you clarify here? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Tue, Jul 10, 2018 at 7:24 AM, André Rømcke wrote: > On 7 Jul 2018, at 23:13, Zeev Suraski wr

Re: [PHP-DEV] [VOTE] Deprecations for PHP 7.3

2018-07-09 Thread Marco Pivetta
Alright, voted "NO" on that one then - namespaced stuff should have whichever symbol name without colliding with internals Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Mon, Jul 9, 2018 at 4:42 PM, Sara Golemon wrote: > On Mon, Jul 9, 2018 at 5:57 AM,

Re: [PHP-DEV] [VOTE] Deprecations for PHP 7.3

2018-07-09 Thread Marco Pivetta
Something unclear to me here: is the removal of `assert()` affecting also my own`my\assert()` (imported via `use function`)? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Mon, Jul 9, 2018 at 10:47 AM, Nikita Popov wrote: > Hi, > > I would like to sta

Re: [PHP-DEV] [RFC] Typed Properties

2018-07-08 Thread Marco Pivetta
Hi Lester, Typed properties combined with value objects (quite widespread technique) provide a decent level of safety at this point in time. So far, there haven't been many nay-sayers to the patch: it's OK to vote "no" if you don't understand or don't want the feature. Greets, Marco On Sun, 8

Re: [PHP-DEV] [RFC] Typed Properties

2018-07-05 Thread Marco Pivetta
On Thu, Jul 5, 2018 at 11:09 AM, Björn Larsson wrote: > it feels a bit > way off having this to wait for this feature until 2020. > I didn't realise this. Now that I did: AAARGH!

Re: [PHP-DEV] [RFC] Typed Properties

2018-06-26 Thread Marco Pivetta
this happen :-) Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sun, Jun 24, 2018 at 11:05 PM, Rowan Collins wrote: > On 20/06/2018 22:59, Nikita Popov wrote: > >> Hi internals, >> >> Bob and I would like to present a new typed prop

Re: [PHP-DEV] [RFC] Deprecations for PHP 7.3

2018-06-26 Thread Marco Pivetta
of the free dev-only check is probably way higher > than the number trying to define a function called 'assert' so  Or require a FQN for an imported `assert()`? Importing functions is getting traction. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] [RFC] Typed Properties

2018-06-21 Thread Marco Pivetta
ch is stable for testing, yes. Would appreciate reports about > any bugs you find. > That shall be my weekend task. I'll stress this stuff in the ProxyManager test suite: if it passes there, it really is rock-solid. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] [RFC] Typed Properties

2018-06-20 Thread Marco Pivetta
Hi Nikita, Bob, On Wed, 20 Jun 2018, 23:59 Nikita Popov, wrote: > Hi internals, > > Bob and I would like to present a new typed properties proposal for your > consideration: > > https://wiki.php.net/rfc/typed_properties_v2 > > The proposal allows you to annotate properties with types, which

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-10 Thread Marco Pivetta
The existence of anything that internally relies on `get_defined_vars()` is a blocker for applying further optimisations to the engine (think stack frames), which is probably why Dmitry suggested its removal. On Sun, 10 Jun 2018, 20:42 Hoffman, Zachary Robert, wrote: > >> > >> Hi Gabriel, > >>

Re: [PHP-DEV] Better types without runtime checking

2018-06-08 Thread Marco Pivetta
one of the primary reasons for a downvote of the typed properties RFC ( https://wiki.php.net/rfc/typed-properties) Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] Re: [PHP-DOC] Re: Ambiguity in the oop5 visibility docs

2018-05-25 Thread Marco Pivetta
That's not really a bug, that's expected behaviour on which stuff like friend classes and entire libraries are based upon... On Fri, 25 May 2018, 20:50 Pedro Magalhães, wrote: > On Fri, May 25, 2018 at 6:47 PM, Rowan Collins > wrote: > > > > I'm not

Re: [PHP-DEV] Performance optimization ideas for PHP 7.3

2018-04-19 Thread Marco Pivetta
we lack widespread tooling to properly verify and isolate memory leaks in userland, and many libraries still heavily rely on statics for things that shouldn't be static (yikes!). Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [doctrine-user] Connecting to SQLSrv 2005 using FreeTDS

2018-03-23 Thread Marco Pivetta
FWIW, we just dropped support for that version in the development branch: I suggest simply upgrading to a maintained version of SQL Server first, as you are hereby dealing with something properly ancient. On 23 Mar 2018 04:52, "Leandro Damascena" wrote: > Hi > Can I

Re: [PHP-DEV] Traits with interfaces

2018-02-28 Thread Marco Pivetta
This cannot work for a number of reasons: - a trait is not a type, and does not practically exist at runtime - trait defined API can be imported with changed/aliased names, breaking therefore the contact defined in the interface - due to the previous point, inheriting a type from a trait

Re: [doctrine-user] Connect Informix / Doctrine / PHP

2018-02-26 Thread Marco Pivetta
See https://github.com/doctrine/dbal/issues/1200 On 26 Feb 2018 19:55, "Iury Cardoso" wrote: > Hello, > > I would like a help ... How do I connect to DB informix, with php by > doctrine? > > I've tried every way but I can not in any way. Can someone hug me? > > Thank you

Re: [doctrine-user] How to use polymorphism with Doctrine?

2018-02-15 Thread Marco Pivetta
See https://github.com/doctrine/doctrine2/issues/6072#issuecomment-363038318 Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Thu, Feb 15, 2018 at 3:48 PM, Dennis Matveyev <denny...@gmail.com> wrote: > Consider this code: > public function g

Re: [PHP-DEV][RFC][DISCUSSION] Deprecate the backtick operator

2018-02-13 Thread Marco Pivetta
Aren't those different AST nodes? On 13 Feb 2018 15:34, "Johannes Schlüter" wrote: > On Mo, 2018-02-12 at 14:36 -0600, Michael Morris wrote: > > Any particular reason why "`unicode string `" wouldn't work? > > Because this would be a BC break which is really hard to

Re: [doctrine-user] problem following the tutorial :/

2018-02-12 Thread Marco Pivetta
What's your configuration, and where is the entity located? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Tue, Feb 13, 2018 at 8:53 AM, Christophe G <tof...@gmail.com> wrote: > Hello all, > I have a problem just following the tutorial http://docs.doct

Re: [doctrine-user] One to Many relation between 3 entities

2018-02-08 Thread Marco Pivetta
If you are creating a child entity and never persisting it explicitly, then a cascade should be defined. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Thu, Feb 8, 2018 at 11:52 AM, Sander <sandervanmoo...@gmail.com> wrote: > Hi, > > I'm havi

Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope

2018-02-05 Thread Marco Pivetta
On Mon, Feb 5, 2018 at 3:39 PM, Michael Morris <tendo...@gmail.com> wrote: > > > On Mon, Feb 5, 2018 at 8:33 AM, Marco Pivetta <ocram...@gmail.com> wrote: > >> >> On Mon, Feb 5, 2018 at 3:28 PM, Michael Morris <tendo...@gmail.com> >> wrote: >&g

Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope

2018-02-05 Thread Marco Pivetta
turn global > scoping for functions off. > Argh Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope

2018-02-05 Thread Marco Pivetta
e the situation? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope

2018-02-05 Thread Marco Pivetta
Hey Ivan, On 5 Feb 2018 11:18, "Ivan Enderlin" wrote: Hello :-), Thank you for the RFC. I really appreciate it, for sure, but I would like to raise a concern regarding the atoum test framework [1]. atoum provides 3 mock engines, resp. for class-like entitites,

Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope

2018-02-03 Thread Marco Pivetta
ardcoded in your codebase means that the code relies on hidden shared global state. Can strongly suggest injecting a `Clock` object as is done in https://github.com/lcobucci/clock, for example. Same goes for sources of randomness. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope

2018-02-03 Thread Marco Pivetta
Overall, huge improvement, and also simplifies things quite a lot from a developer PoV by requiring to add explicit references, so this is 100% thumbs up. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sat, Feb 3, 2018 at 9:27 AM, Wes <netmo@gmail.com>

Re: [PHP-DEV] [RFC] [DISCUSSION] Improve null-coalescing operator (??) adding empty check (??:)

2018-01-17 Thread Marco Pivetta
This: echo (isset($foo) && $foo) ? $foo : 'default'; Is equivalent to: echo $foo ?: 'default'; Please don't endorse usage of undefined variables. On 17 Jan 2018 19:00, "Lito" wrote: > Related with Request #75833 https://bugs.php.net/bug.php?id=75833 > > From PHP 7

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-02 Thread Marco Pivetta
uage more > complicated just to catch the bugs that you keep creating. Some of us have > learned how not to write such buggy code in the first place. Please do stop spewing bullshit: some people still want to read meaningful things in this mailing list. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [doctrine-user] Problem with subentities with discriminator column in query result

2017-12-29 Thread Marco Pivetta
, the filtering is subtle because you used a JOIN condition twice, and that implicitly acts as restriction. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Fri, Dec 29, 2017 at 3:24 PM, <ffdede...@gmail.com> wrote: > We have some problems querying an entity with emb

Re: [PHP-DEV] Reflection API: Add ::getFullName() method.

2017-12-11 Thread Marco Pivetta
Weird, that looks wrong to me, so I may be wrong here. When receiving a string containing a symbol, the only sensible approach is to consider it a FQN, as no context is provided with the string. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Mon, Dec 11, 2017 at 10

Re: [PHP-DEV] Reflection API: Add ::getFullName() method.

2017-12-11 Thread Marco Pivetta
On Mon, Dec 11, 2017 at 10:03 AM, Andreas Hennings <andr...@dqxtech.net> wrote: > On 11 December 2017 at 09:16, Marco Pivetta <ocram...@gmail.com> wrote: > > If you really want to expose a symbol's FQN, > > Just to clarify: For me, "FQN" means &

Re: [PHP-DEV] ReflectionContext for imports and namespace

2017-12-11 Thread Marco Pivetta
On 11 Dec 2017 09:10, "Andreas Hennings" <andr...@dqxtech.net> wrote: On 11 December 2017 at 09:05, Marco Pivetta <ocram...@gmail.com> wrote: > On 11 December 2017 at 08:46, Marco Pivetta <ocram...@gmail.com> wrote: > > Indeed that already e

Re: [PHP-DEV] Reflection API: Add ::getFullName() method.

2017-12-11 Thread Marco Pivetta
If you really want to expose a symbol's FQN, I suggest exposing the internal name as per `(array)` cast semantics. namespace A { class B { public $c; private $d; private $e; } } That would be: "A\B#\$c" "A\B#\0*\0\$d" "A\B#\0A\\B\0\$e" Obviously, the `\0` is

Re: [PHP-DEV] Re: Add \Reflection*::getHash()

2017-12-11 Thread Marco Pivetta
On 11 Dec 2017 04:04, "Andreas Hennings" wrote: So far this proposal only discusses reflections of PHP declarations / symbols. What would we do for e.g. ReflectionObject? Return the spl_object_hash()? Or return the hash of the instantiated class? Or a hash of the serialized

Re: [PHP-DEV] ReflectionContext for imports and namespace

2017-12-11 Thread Marco Pivetta
On 11 December 2017 at 08:46, Marco Pivetta <ocram...@gmail.com> wrote: > Indeed that already exists at > https://github.com/Roave/BetterReflection/blob/2.0.1/ docs/features.md#analysing-types-from-docblocks > - relatively new lib, so it probably didn't get noticed upfront in here

Re: [PHP-DEV] Reflection API: Add static factories on ReflectionType

2017-12-10 Thread Marco Pivetta
What's the use-case for creating a userland `ReflectionType` instance, besides mocking the reflection API itself? Consider that the subclassing in userland already provides an easy way to perform these operations (although ugly):

Re: [PHP-DEV] ReflectionContext for imports and namespace

2017-12-10 Thread Marco Pivetta
Indeed that already exists at https://github.com/Roave/BetterReflection/blob/2.0.1/docs/features.md#analysing-types-from-docblocks - relatively new lib, so it probably didn't get noticed upfront in here. It would probably be a good idea to address the fact that the current reflection API causes

Re: [PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants.

2017-12-09 Thread Marco Pivetta
The typical usage of `instanceof` is checking a `null|object` API that built an object of a (presumably known) type. Adding a crash there seems silly and overcomplicated. On 9 Dec 2017 07:57, "Andreas Hennings" wrote: > Why is the usage broken? It works :) > In practice,

Re: [doctrine-user] xml namespace prefix for xsd

2017-11-04 Thread Marco Pivetta
Yeah, if you can, you can help also with improving the docs - same as the other thread, just need to get started with GIT and github :-) Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sat, Nov 4, 2017 at 6:39 PM, Артем Мельчук <artyom.melc...@gmail.com> wrote:

Re: [doctrine-user] xml custom-id-generator class attribute type nmtoken

2017-11-04 Thread Marco Pivetta
Probably IRC, yes, although you can refer to https://yangsu.github.io/pull-request-tutorial/ to get started Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sat, Nov 4, 2017 at 6:45 PM, Артем Мельчук <artyom.melc...@gmail.com> wrote: > Thx a lot! What is

Re: [doctrine-user] Entity generation directory layout

2017-11-04 Thread Marco Pivetta
It's not supposed to be hacked - it is intended behavior. If you need the generated files to be moved somewhere else, you will need to do so yourself Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sat, Nov 4, 2017 at 6:47 PM, Артем Мельчук <artyom.melc...@gmail.

Re: [doctrine-user] Entity generation directory layout

2017-11-04 Thread Marco Pivetta
The entities are always generated in a PSR-0 (*not* PSR-4) compliant structure given a root directory. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sat, Nov 4, 2017 at 5:46 PM, MetaAbstract <artyom.melc...@gmail.com> wrote: > I generate entities from xml

Re: [doctrine-user] xml namespace prefix for xsd

2017-11-04 Thread Marco Pivetta
This is normal behavior of the metadata drivers: they can't currently deal with standard NS prefixing. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sat, Nov 4, 2017 at 5:24 PM, MetaAbstract <artyom.melc...@gmail.com> wrote: > By default my IDE a

Re: [doctrine-user] xml custom-id-generator class attribute type nmtoken

2017-11-04 Thread Marco Pivetta
, and that is fixed once you apply your patch to the XSD :-) Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sat, Nov 4, 2017 at 3:51 PM, Артем Мельчук <artyom.melc...@gmail.com> wrote: > it's here: > > > > > > > &g

Re: [doctrine-user] xml custom-id-generator class attribute type nmtoken

2017-11-04 Thread Marco Pivetta
Send a patch with a test  On 4 Nov 2017 13:48, "MetaAbstract" wrote: > Hi, > I define custom id generator and can't define class for custom id > generator because class is nmtoken type not string. XSD checker give error > for class name. > > > >

Re: [doctrine-user] how to inherit an entity behaviour? how write an engine for an applications?

2017-10-24 Thread Marco Pivetta
rt mapping associations. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Tue, Oct 24, 2017 at 2:24 PM, OdaepO <oda...@gmail.com> wrote: > >I don't think this has anything to do with the ORM specifically > > sorry if I was not clear... > I was meaning w

Re: [doctrine-user] how to inherit an entity behaviour? how write an engine for an applications?

2017-10-24 Thread Marco Pivetta
Hi there, I don't think this has anything to do with the ORM specifically: you should first design the interactions in your system, and leave the data requirements emerge from that. Persistence/ORM comes after all that stuff is finished. Marco Pivetta http://twitter.com/Ocramius http

Re: [doctrine-user] localhost db vs remote db performance degradation

2017-10-21 Thread Marco Pivetta
Possibly just amount of network time involved: you should at least have the DB close to your server (for less-than-10ms pings). The roundtrip for a high amount of queries is obviously always going to be a disaster. Try attaching an SQL logger and see the query times for both environments? On 21

Re: [doctrine-user] Immutable Entities and Uuids - what should i do ?

2017-10-10 Thread Marco Pivetta
bother asking for your advice/opinion in the first place. On Tuesday, October 10, 2017 at 1:17:16 AM UTC+2, Marco Pivetta wrote: > Why is everyone stuck with this silly performance question? > > Let's talk again when we have 100M+ records, shall we? Until then, it's > 16b vs 2b. >

Re: [doctrine-user] Immutable Entities and Uuids - what should i do ?

2017-10-09 Thread Marco Pivetta
Why is everyone stuck with this silly performance question? Let's talk again when we have 100M+ records, shall we? Until then, it's 16b vs 2b. The fact that you are using PHP is your first performance/memory bottleneck. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com

Re: [doctrine-user] Entity collection changes

2017-09-27 Thread Marco Pivetta
See `UnitOfWork#getScheduledCollectionUpdates()` Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Wed, Sep 27, 2017 at 1:32 PM, Plamen V. Vasilev < plamen.v.vasi...@circles.bz> wrote: > I have changed which have to be the owning side according to th

Re: [PHP-DEV] [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Marco Pivetta
that are not interfaced, and need to be checked for existence every time. This is error-prone and just an annoyance that will likely need abstraction once it reaches "real world" (layers that isolate apps from PDO's inherent radioactivity). Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

Re: [doctrine-user] Entity collection changes

2017-09-27 Thread Marco Pivetta
Only the owning side of the association will then contain changes ;-) Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Wed, Sep 27, 2017 at 10:50 AM, Plamen V. Vasilev < plamen.v.vasi...@circles.bz> wrote: > Sorry, I'm wrong .. the relation is ManyToMany wit

Re: [doctrine-user] Entity collection changes

2017-09-27 Thread Marco Pivetta
Are you sure that you don't have a OneToMany rather than a ManyToOne? OneToMany is completely ignored by the ORM, so you won't get any diffs there. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Wed, Sep 27, 2017 at 9:16 AM, <plamen.v.vasi...@circles.bz>

Re: [doctrine-user] Entity collection changes

2017-09-26 Thread Marco Pivetta
Your message came through clipped: can you re-send it as a new thread? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Tue, Sep 26, 2017 at 4:54 PM, <plamen.v.vasi...@circles.bz> wrote: > > Hi all, > > does any one knows how I can get the entity Ma

Re: [PHP-DEV] [RFC] [Discussion] Class Friendship in PHP

2017-09-21 Thread Marco Pivetta
Hey Dustin, Given the amount of use-cases (very low, so far) this feels much much easier if just implemented in userland via `Closure::call()`, since the scope of the patch complicates the class model of PHP by a whole lot. Another simple solution is to use things such as leedavis81/altr-ego,

Re: [doctrine-user] Odd thing on migration diff and also when doing update:schema --force

2017-09-20 Thread Marco Pivetta
The same suggestions as before apply: do write a test case. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Wed, Sep 20, 2017 at 12:42 PM, Przemyslaw Furtak <przemysl...@gmail.com> wrote: > I forgot to mention that I'm using MySQL engine so this may be

Re: [doctrine-user] Where can I find a list of supported databases?

2017-09-17 Thread Marco Pivetta
See https://github.com/doctrine/dbal/tree/v2.6.2/lib/Doctrine/DBAL/Platforms On 17 Sep 2017 09:33, wrote: > Hello > > Im interested in using Doctrine. But first I want to check that our > prefered database is supported. > Where can I find which databases are supported by

<    1   2   3   4   5   6   7   8   9   10   >