These are chat archives for PHPixie/Hotline

21st
Jan 2015
Roman Tsiupa
@dracony
Jan 21 2015 15:10
hey
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:02
Hello
Roman Tsiupa
@dracony
Jan 21 2015 16:05
hey )
caught me off guard =)
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:14
its okay :)
Roman Tsiupa
@dracony
Jan 21 2015 16:18
so do you have smth I could help with
?
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:34
have you ever used docker?
Roman Tsiupa
@dracony
Jan 21 2015 16:35
nope, just digital ocean and the like. But its pretty much same, especially with vagrant provisioning
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:37
ahhh okay
It's more of a design question rather then a framework specific thing to
too*
Roman Tsiupa
@dracony
Jan 21 2015 16:43
Well
imho instead of returning posts your providers should just return data
Malachi Soord
@inverse
Jan 21 2015 16:44
Data being the raw json string?
Roman Tsiupa
@dracony
Jan 21 2015 16:44
They you could have a Post Repository and supply it with DataProviders instead
that actually depends on how complex the structure is
for simple flat stuff you might get away with just normalizing the data to some specific format and return it as array. But if its a bit more complex you could need a separate Postdata class
or
keep raw data as array and put validators on the Post entity itself
Malachi Soord
@inverse
Jan 21 2015 16:46
Hmmm
Roman Tsiupa
@dracony
Jan 21 2015 16:47
also
getPosts could accept a converted query as a parameter
since his part:
Malachi Soord
@inverse
Jan 21 2015 16:47
yaaah
Roman Tsiupa
@dracony
Jan 21 2015 16:47
  $convertedQuery = $this->queryConverter->convert($query);
Malachi Soord
@inverse
Jan 21 2015 16:47
I totally get what you mean
this is the kinda stuff I struggle with atm with SOLID stuff
I need to make the code more single responsibility
this class should just deal with getting the data from the client
Roman Tsiupa
@dracony
Jan 21 2015 16:48
overall it looks really nice actually
Malachi Soord
@inverse
Jan 21 2015 16:48
and then other classes should handle it
Roman Tsiupa
@dracony
Jan 21 2015 16:48
but you might want to inject the converter to
too*
findConverter('\MenschDanke\ApiBundle\Model\BlogDeal');
this is kinda hardcoding it
Malachi Soord
@inverse
Jan 21 2015 16:49
Ahhh
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:49
What are your toughts on mongodb + php ?
Malachi Soord
@inverse
Jan 21 2015 16:49
Thanks for the advice
Roman Tsiupa
@dracony
Jan 21 2015 16:49
well I kinda hate mongodb
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:49
How come?
Roman Tsiupa
@dracony
Jan 21 2015 16:50
PHPixie now fully supports mongo
Malachi Soord
@inverse
Jan 21 2015 16:50
You gonna keep this channel up? Just saw it on reddit and probably will be idling for a while
and asking questions ;)
Roman Tsiupa
@dracony
Jan 21 2015 16:50
and I struggled like hell to make it play nice with the query builder
but it has some really stupid things going on
like you can exact match subdocuments
but not exact match entire documents
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:51
cant you do that with regular expressions?
Roman Tsiupa
@dracony
Jan 21 2015 16:51
so if you want to find a document that is EXACTLY like {a:1} and not {a:1. b:1} you cant do that
you kind of can do it with $where queries and stuff
but you forfeit indexes
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:51
Ahhh okay yes i understant that
Roman Tsiupa
@dracony
Jan 21 2015 16:51
it also wont use indexes on queries with nested $or
so my db driver has to aply deMorgans law to all conditions to make sure they end up without nested ors
and use indexes
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:52
ye realizing that indexies are a big thing in mongo
How does your framework handle crud
Roman Tsiupa
@dracony
Jan 21 2015 16:53
I guess its ok for modeling stuff like inventory items or truly random documents and stuff. But if you are doing DDD you alays have some schema defined internally and it beats the entire purpose of mongo
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:53
DDD domain driven development?
Roman Tsiupa
@dracony
Jan 21 2015 16:53
yup
well its kind of a long story, since ORM 3 is MUCH bigger than ORM 2
245 classes vs like 10 in ORM 2
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:54
Ahhh okay
how come the big jump?
Roman Tsiupa
@dracony
Jan 21 2015 16:54
I'll put up a huge blog post on it when I bring it to 100% coverage
its about 82% now
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:54
ahh okay
awesome
Roman Tsiupa
@dracony
Jan 21 2015 16:55
Well the old one is kind of your generic activerecord thing
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:55
you are useing data mapper now?
Roman Tsiupa
@dracony
Jan 21 2015 16:55
which I kinda hate now. I separated queries from entities and repositories
nope, it's still activerecord sort of
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:55
Okay
Roman Tsiupa
@dracony
Jan 21 2015 16:55
but the actual entities dont do anything with db anymore
calling save() forwards everything through repositories and stuff
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:56
Have you delt with many to many?
Roman Tsiupa
@dracony
Jan 21 2015 16:56
yup
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:56
dealt*
ahh sweet
Roman Tsiupa
@dracony
Jan 21 2015 16:56
I also have multiple strategies for making optimized preloading of many to many
like if you're using the same database it will use subqueries
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:57
what databases do you support so far?
Roman Tsiupa
@dracony
Jan 21 2015 16:57
but if you are preloading entities froma different database ( say you have a many-to-many between a Mysql database and Mongodb) it will do it by fetching ids and then making an IN query etc
Mysql, Pgsql, sqlite and mongo
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:58
ahh nice
i was thinking of building my own ORM
Roman Tsiupa
@dracony
Jan 21 2015 16:59
the database module is kinda separate
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:59
just to get a better understanding of the whole active records and such
and its 100% covered atm =)
Steve Azzopardi
@SteveAzz
Jan 21 2015 16:59
nice mna :)
:shipit:
Roman Tsiupa
@dracony
Jan 21 2015 17:00
well you could actually start by making a DB layer, query builder and stuff
its much less work and gives a lot of insight
diego
@sirdiego
Jan 21 2015 17:02
phew this looks fancy
Steve Azzopardi
@SteveAzz
Jan 21 2015 17:02
might give it a try but im still a
a inexperince developers
wanted to learn mongodb and docker first
Malachi Soord
@inverse
Jan 21 2015 17:04
It's a bit more fancy than IRC oOo
;D
Steve Azzopardi
@SteveAzz
Jan 21 2015 17:04
haha ye
Roman Tsiupa
@dracony
Jan 21 2015 17:07
well whatever works for you =)
some people really like working with it
but you'll also miss out on ACID
which is one day going to bite you real hard)))))))
bit me one day)
this chat is pretty cool too: http://tlk.io/phpixie
I wish I could embed those on the site
Roman Tsiupa
@dracony
Jan 21 2015 18:13
somebody else joined?
I see a new avatar I guess)
Tyler Sommer
@tyler-sommer
Jan 21 2015 18:14
just hanging out :)
Roman Tsiupa
@dracony
Jan 21 2015 18:14
yay)
gitter is pretty cool
I just checked out like 4 other services and this one is probably the best
its kind of strange why they are so fixated on github though
I mean these chatrooms would be usable for reasons other than development too
Malachi Soord
@inverse
Jan 21 2015 19:57
I guess it was created out of ease of having a managed IRC channel for a github project
It's practical - even sends you emails about whats happened when you leave
Chrome Desktop notifications are pretty rad too
Roman Tsiupa
@dracony
Jan 21 2015 20:35
hey
im back