« first day (240 days earlier)      last day (4723 days later) » 
02:00 - 13:0013:00 - 00:00

2:09 AM
mep
 
Tek
rep
 
he there
 
 
3 hours later…
4:45 AM
morning everyone
 
4:57 AM
hi @teresko, good afternoon
 
ehh .. i hate to shave .. off to bathroom
 
neither do I
 
PHP
5:42 AM
Good morning
 
6:22 AM
hey guys , from the stand-point of OOP : what is the relationship between Document and a Draft of said document ?
do i assign draft to the document , or document to a draft ?
 
A draft IS A document? (It's just not published yet?)
I guess.. first thing that came to mind
 
you have an existing document , you make an edition to it , but not publish it yet
so it becomes a draft which is connected to existing document
 
and that draft is the document itself
 
if your cms allows that.. yeah. You create a new document based on an existing one meant to replace it in the future
 
6:38 AM
in that case, what is the relationship between document and draft ?
 
@edorian ping
 
is document aware of the drafts , or draft aware of document
 
a draft is a document that wasnt published yet
 
@Gordon yaaay
@teresko I'd rather thing about it in a "multiple version of the document" way. Where one is a publishedDocument and others are drafts
and i don't think they are aware of each other (as each represents one state.. or something)
 
then how draft knows which document to replace ?
 
6:42 AM
a draft is just an early version. make it versionable
 
PHP
@Gordon..you are ZCE.. can you please tell me ..what is good time or after how much exp. .its good to do ZC?
 
could you all please stop suggesting things that are already implemented
 
should the draft its self replace a document when you tell it to ->publish() or do you tell a manager instance to ->publish($theDraft) ?
 
@teresko if these things are already implemented, then you should not have to bother about drafts being drafts because they are the same thing as documents.
 
i want to implement ability to find current draft for existing document
 
6:44 AM
@teresko I though we are supposed to do the right thing only?
 
that why i am asking , what the relationship between them is
 
@teresko - By "draft" you mean a "version" of the document, perhaps?
 
@teresko select * from documents where publishing_date is null
 
@PHP when you feel you can pass it. there is no time X needed. it takes as long as it takes :)
 
6:45 AM
and you got the answer already @teresko
 
order by id desc limit 1
 
PHP
@Gordon actually one of zend book says itself..you need some exp. in PHP..and am just wondering whats the mean of it?
 
eml
Morning all o/
It's Monday... again.
 
Good morning :)
 
PHP
@eml yeah :) May Code bless you
 
6:48 AM
@PHP i didnt write that book, so i dont know what they mean by it. all i can tell you is that you should base it on your own experience and gut feeling. do you think you are experienced enough? are you familiar with the topics in the study guide?
 
PHP
morning
 
Say, anyone wonder why PDO isn't that uniform?
 
@eml monday but also holiday
 
PHP
@Gordon yeah am familiar with all these topics
 
I'd expected db_list(), table_list() etc to say the least.
 
eml
6:49 AM
@Gordon Holiday? What are we celebrating? =)
 
Seems I still have to abstract it further :( this sucks
 
@eml pentecost, whitmonday, monday of the holy spirit
 
@Gordon - Wait, what?
 
PHP
@gordon ..its really gonna help for me.. just finding these stuffs.. thanks a ton! :)
 
eml
@Gordon Never heard of that before. Ascension Thursday is a holiday in Finland though
 
6:52 AM
@PHP np
@eml ascension thursday was on june 2nd
 
eml
@Gordon Yep, and Pentecost is 10 days after ascension thursday is 10 days after that. :-P
 
@eml in germany the monday is a holiday as well
Whit Monday or Pentecost Monday (also known as Monday of the Holy Spirit) is the holiday celebrated the day after Pentecost, a movable feast in the Christian calendar. It is movable because it is determined by the date of Easter. Whit Monday gets its English name for following "Whitsun", the day that became one of the three baptismal seasons. The origin of the name "Whit Sunday" is generally attributed to the white garments formerly worn by those newly baptized on this feast. Observance in European countries Until 1973, Whit Monday was a public holiday in Ireland. It was a bank holiday...
 
Code's a-calling. Cya later guys.
 
eml
Question: Does one "do unpaid internship"? I'm not sure of the wording, I need to explain to a potential freelancing employer that I'm at a company & doing unpaid internship. I want to get it right.
 
Sounds right to me but I'm not sure I'd mention that it was unpaid
 
PHP
6:58 AM
@Gordon shop.zend.com/en/php-certification.html?src=greybox what about all these books?
all these are necessary or the few one?
 
@eml unpaid internship is unacceptable imo
 
eml
@edorian Why not? Isn't that common? In Finland it is, especially during the first one or two years in college
@Gordon really?
 
Ok, if thats normal in Finland then fine :)
I got 11€/h for my first internship (5 years ago)
 
@eml if you work for a company, they should pay you. everything else is not much better than slavery
@PHP these are not books. they are the voucher and various trainings.
 
I wasn't aware "unpaid interships" still existed in the programming environment.. but if you say thats normal in Finland i don't see much of a problem with it.
 
eml
7:02 AM
@Gordon I somewhat agree. Since I'm working on a real project I see this as an opportunity to get a real project on my shoulders and a reference.
 
If you apply for a job in another country maybe make sure it's the same there and if it isn't leave the "unpaid" out.
 
eml
@edorian Thanks for the heads up!
 
@eml everyone has to cover their expenses. im not saying companies should pay the full salary someone would get, but paying nothing is just not okay. interns have to pay rent and eat, too.
 
Because tbh. if someone applied at my workplace (and i get to see the resumes) I'd raise an eyebrow if someone explicitly states that he works for free. (I'd rather work with people that know their worth [and so on])
 
eml
@edorian Never thought of it that way.
I had to pick between not getting government 'allowance' (which we get for studies) or not getting anything at all (since I couldn't find work). So in a way I still get paid, just not by the company and way below what I should be paid.
 
7:05 AM
should element know about its parent , or parent be aware of all the child elements ?
 
@edorian did you already get response for froscon cfp?
 
@teresko child aware of parents
and parents don't normally know who are their children lol
 
dunno , dunno
$parent->addElement( $child ); seems to make more sense
 
are you still talking about parent class and child class?
or DOM?
 
@Gordon Nope
 
7:13 AM
why would i be talking about DOM ?!
 
$parent->addElement( $child ); <--- this looks like DOM functions instead :)
 
PHP
@Gordon oops! sorry wrong link.. am not getting that book link.. will show you when get..I found it when I was searching some books on google
anyways thanks for now
 
when we create a class, we probably don't know who will extends it
 
why are you now mixing even inheritance in this ?!?
 
@teresko You said not to suggest things you already implemented .. so I'm kinda confused but if you already implemented "versionable" why do you reimplement the "find releationship" part? (Or did i misunderstand your ... comment there?)
 
7:18 AM
I'm confused too
 
@Phelios , i was talking about a tree like structure
 
well, I thought you are talking about inheritance since you asked about OOP, relationship between 2 objects, and parent child relationship
about the "awareness"
and the example you gave "$parent->addElement( $child );"
 
@edorian , because documents are already "versionable" , but drafts might or might not be linked to an existing document , and each user can have only one draft for one document , while at the same time this user can own multiple version in the document history
 
$parent will know about its children as in $parent->children()
and the $child might know its parent too. $child->parent
 
.. i think im over-complicating things again
 
7:25 AM
So if the draft is just another version of the document I'd tend to use the existing versioning system (it's newer but not published so don't display). But if the draft is a "copy" that is meant to replace it's original (but not really versioned) i'd store are a $basedOfVersionId or something in the draft. Just a simple approach until you know where you want to end up... something like this. It seems your usecase is more complicated
 
.. you could say "over-engineered"
but the bases of the question still stays
do i assign document to draft or draft to document
 
if your documents are already in a versioning I'd rather add the complexity to the drafts
and say "find me all the drafts that have this document as a base" to get the "my draft" button or where ever that leads you
 
-7
Q: Spam spam spam spam spam spam

BanglaSpam spam spam spam spam spam spam spam

 
@teresko is it "do I put Document Id on the drafts, or the draft id on Documents" your question?
 
2
A: New TDD project Do's and Dont's - Phphunit

edorianIt's kinda hard to come up with a list that I view as "complete" but I guess the question is specific enough to be answered. Create a phpunit.xml.dist file Don't write your own PHPUnit runner, configure it using an xml file. It will make contributing to your project much easier (if it's open so...

anything i forgot?
 
7:32 AM
@Gordon haha.. this is cute :P
 
free flag weight is free
 
i bet he just wanted to collect few "bad" badges .. and you guys walked right into it
 
Or loose his account ,) (but it's his first question, so just noise i guess)
 
actually the spamspamspam part was edited in by another user
 
jep, just noticed
but the original content wasn't any better
 
7:35 AM
yeah, but im tempted to rollback because the edit feels like vandalism
 
yeah
 
@Phelios question dvs are free nowadays
 
@Gordon what is dvs?
 
dv = downvote, cv = closevote
 
ow.. i see...
:)
@Gordon but probably remove the spam link on the post
wait.. it's not a link. just a signature lol
 
7:44 AM
New blog post: References suck! - Let's fix MySqli prepared statements! http://post.ly/2CbzE #mysql #php #references #blog
 
since when can i see other people's flag weight?
 
I can see yours too
 
@Phelios as this is within a Model , the code does not deals in IDs but in composition of Domain Objects
 
breakfast now
 
8:01 AM
@Gordon: people have been able to see each other's flag weight for a while. just not their history
AFAIK you only see it if it's higher or lower than the starting weight, though (that is, if they've done some flagging)
 
8:13 AM
@teresko - Draft to document. Would you assign Daughter to Mother or Mother to Daughter?
 
8:31 AM
@edorian great post, however references suck much more from the "debugging" point of view - they're time bombs - like closures with private acces to instance variables. (not sure, if php can do it, but other langs can and it's... it's cool, but it can cause a lot of headaches)
 
ok guys .. i need a bit of code-review-thing , if anyone can spare the time
how bad idea is this ( it a Model for interaction with documents .. the public API of it , at least )
 
@teresko remove empty ctor
 
@teresko why is "$mapper = new CategoryMapper;" in every method? it could be instance variable and it could be injected as well...
 
because it is not in every method
 
inject dependencies instead of creating them in the methods. these are collaborators graphs not creator graphs
 
8:38 AM
show me some link to learn MVC using php with some examples
 
yeah , i will add the factories for Domain Object and for Mappers
 
huh, sorry, it's not everywhere, I've mislooked, but it's pretty similar code... I'd think about some abstraction
 
but for now , this makes the code look cleaner and easier to follow .. for now
 
library is a pretty meaningless name
 
also storeCategory( RequestAdapter $request ) and storeDocument( RequestAdapter $request ) accept the very same parameter - which smells like missing object / or misplaced methods
 
8:42 AM
yeah , that part requires some additional work
@Gordon , well , it is a name for Model that deals with Documents
 
btw: why $library->getCategoryByDocumentId($document->id) instead of $document->getCategory()?
 
@Gordon any better suggestions ?
 
$mapper = new CategotryTreeMapper; //possible typo?
 
it is .. editing
 
@teresko well, name it after what it represents or does
 
8:44 AM
I don't know - 600 lines? smells a little
 
@balpha are you there?
 
@KamilTomšík , so you would suggest splitting that model up in smaller structures ?
 
@Gordon that could be difficult, because it IMHO does more than it should.
 
@Kamil: Consider that half those lines are blank space. actual code lines: about 300.
 
@teresko I would suggest rich domain model, but @Gordon would probably disagree with me
@cHao still pretty much (for few queries)
 
8:46 AM
@KamilTomšík i'd rather say finding a proper name and finding that it does too much goes hand in hand here
 
@KamilTomšík , how would "rich domain model" be different from what i have ATM ?
 
@Gordon yes
 
@KamilTomšík i wont disagree to a rich domain model.
 
pokes at the code
 
@teresko less parameters, less indirection
 
someone hates you
> who did you offend today
 
@Gordon or somebody is jealous :)
 
likely the guy who plasted spamspamspam over a poor question
thanks for compensating. whoever of you did that :)
 
PHP
upvoted :)
 
I don't think he has enough reps to dv
 
8:52 AM
@Phelios not the guy who asked the question, but the guy who vandalised it with spamspamspam
 
@teresko sorry to say that, but that code does not look like OO, methods should operate on instance data - I can't see even one $this
 
oh ok...
 
@teresko and if method does not operate on object, it's usually misplaced
 
@KamilTomšík , yeah
hooray for next iteration
 
@teresko sorry for that - I don't like code-reviews... :-/
 
8:58 AM
well , they are useful
because when you look at your own code for more then hour , you get really biased
 
@teresko yes, for me, and probably even for you, but sometimes it makes people angry to hear complaints...
 
Well code review is not about complaining. It's about finding the difference in expectations between 2 programmers and getting insights by discussing those differences
Like when someone asks you about a piece of code and you say "doesn't look/feel enough like $functionalProgrammingLanguageOfYourChoice" ;)
He there @MartinBean
 
@edorian oKamil
 
@edorian yes, but sometimes it's more like - look on my uber code... and then it's not good idea to complain. :)
@Gordon funny ;)
 
@KamilTomšík Well if people ask just to get a pat on the back then yeah.. that usually doesn't work out at all :)
 
9:10 AM
0
Q: Can anyone help how to integrate file manager

haiderCan anyone help how to integrate file manager thingie with zend-framework.

i promise. one day i will code file manager thingie and doesntworkexception
2
 
heheh
 
eml
:D
 
@ChristianSciberras I don't want to start that flame again (chat.stackoverflow.com/transcript/message/827272#827272), but I've just looked on K2F (which I believe is your baby) and... @teresko is right about global state, you shouldn't use static methods, variables, anything - and namespaces actually don't solve anything - except polluting global space
@ChristianSciberras imagine mock testing db::query(...) vs. $db->query(...), it's much much harder to do in the first case. (expecting INJECTED $db, because $db = new Db() is pointless)
 
9:32 AM
looks like someone really dislikes me. two new dvs at stackoverflow.com/questions/6294840/… and stackoverflow.com/questions/6294840/…. what a tard sigh
 
eml
@Gordon those two links are the same.
 
i think I know who it was, but let's just hope he continues with it. not sure what the threshold is for triggering the serial voting script
 
@Gordon who?
 
@KamilTomšík not calling names :)
 
@Gordon why not? :)
 
9:39 AM
because its not important and hes not here anyways
 
name and shame I say!
 
so it's php chat visitor?
 
but lets say that person had 8 votes today when i checked his profile first time and now has ten and last activity is around the time i got those two. and first time was around his question got closed.
 
you have prove?
keep answering question :)
 
@edorian Erm, hi?
 
9:42 AM
Just said hi because i didn't see you around before :)
 
Ah, no worries. I think I've dipped in a couple of times, but ultimately new to chatting on StackOverflow.
 
@KamilTomšík because i had $category = $library->getCategoryByDocumentId( $_GET['id']); .. or something along the lines
 
eml
Anyone here a gTalk user? I'm interested in knowing how loggings works if I use an outside client and how far back it logs.
 
where Category acted as Domain Object and not a Model
 
@teresko I don't follow - and... domain objects should be always part of model
 
9:49 AM
i guess by that you mean " they should never leave the model "
 
@teresko yes, they shouldn't, but I meant - every domain object can be model for some view, so it should act as model all the time
@teresko need for that code is imho caused by url like "categories/do-something-with-category-for-document/document-id" - one controller for all category actions

but what about url like "documents/id/do-something-with-category"? it's still "document" action, because you will just delegate to $document->doSomethingWithYourCategory()
and $document knows $category, so it's okay to have method there - as well as have url mapping like this.
 
heh .. this is the point where the design of Yii will rise his ugly head
the URL mapping here is extremely limited
i already had to replate the URLManager class just to get some basic functionality from it
 
@teresko which don't restrict you to write your own - it's imho worth of improved design
 
its all well and nice in theory , but not when you smash against hardcoded dependencies
 
yes - but you have choice, it's up to you if you prefer headaches now or in future.
 
10:04 AM
i prefer finishing the whole thing ASAP , and hoping that next project will not require a specific framework
 
@teresko okay - if it's "just get it done" project, however I have one long-process project (which is already running for a year or so) where I've favored "controller for all xxx actions" and it's alwas pain to change anything. I've also made few other (good-looking) mistakes - like separated repositories and query builders...
 
10:39 AM
hmm ... i think i know how to make a DCI in PHP without global state
 
10:49 AM
@teresko care to share that idea? :)
 
i will better at first check, if it isn't completely wrong
 
ok :)
 
11:22 AM
@KamilTomšík I'm not considering mock-testing K2F core classes.
It's like mock-testing shell_exec(), you just don't do it.
That is not to say that all of the framework was designed correctly, far from it.
 
@ChristianSciberras to be clear - I usually don't write tests, just examples, but testability is great measurement for code quality
 
I'm not saying I don't test it.
I test it mostly via assertions and matching changes with whatever had to change.
 
@ChristianSciberras I am, I don't do tdd, but I'm aware of all benefits (and because of what they're caused)
 
so you are saying that core classes should not be tested because they are core classes and thus are always correct
.. did i get this right
 
@teresko - I'm saying people shouldn't be allowed to test core classes.
That is, they shouldn't have the faculty to do so.
 
11:26 AM
so i did get this right
 
Yes and no. I do test them myself. I even have my own ways of injection :)
But the framework would rather test the environment than itself.
 
@ChristianSciberras how is it possible to use own "config" or whatever else if everything is static? is there some magic behind the scenes?
 
@KamilTomšík - You lost me there.
 
( if by "ways of injection" you mean replacing one core class with a testing class which has the same name )
 
@teresko - No, extending the class and testing it itself.
Gives me access to protected props/mtds
What you suggested is akin to mock testing though.
 
11:29 AM
@ChristianSciberras it's pretty common to realize that core class xxx lacks of something you want - I want to be able to add new methods (without editing your code)
 
i rest my case
 
@ChristianSciberras let's say you have db::query() - now I'd like to log all queries - for example - how can I do that if db class is already loaded? - and I don't want to log only my queries - I'd like to log all queries - including calls from your code
 
The code (classes) follow a pattern. If your changes are that huge, you should write your own replacement module.
If subtle (and useful) I'd eagerly merge them with the distrib.
@KamilTomšík - If you want to do that just once, you're free to edit the code yourself.
 
@ChristianSciberras I think you don't see my point - "if it's so huge" is just excuse - I want every little method placed exactly where it should be.
 
Uhuh, break time.
Can we talk about this later? Sorry :/
Was getting interesting.
 
11:33 AM
and if i replace whole class , how will i know that that class works correctly without unittests ?
 
@teresko - It just have to match method signatures etc.
 
@ChristianSciberras sure, we can - I'll just write one thing... PHP itself suffers from the very same problem - there is no string class, you can't call $string->preg_replaced(pattern, replacement), and even if there were class like this - it would be "static" you can't add new methods -> leading to "utility classes" StrUtils::do_something(str, params)

which is everything but not oo...
@ChristianSciberras using your framework would lead to mydbutils::dosomething_which_should_be_on_db_itself
@ChristianSciberras basically, it's caused by lack of "open classes", but combination of DI and duck-typing is great workaround for this
 
edorian?
 
he @sanders
 
11:38 AM
@edorian tnx for your broad reply
 
I hope to expand that post a little more over time and use it as a reference ;) So: my pleasure
notices that the starred posts now show tags properly and not [tag: foo] like before, neat
 
yes but it's a very difficult subject. And then mainly the database part
 
Yeah, I don't have that experience on the topic and nobody I've spoken too was a really nice generic solution
but none of those really provides a very good answer
 
because i want to build a cms based on the zend framework and want to be sure al my functions to create and modify pages work properly
 
I personally would start of with "integration testing" the db access layer (if you don't use an ORM) and see if that works out
The chapter in the linked book is also quite solid and verbose and the best resource i've read so far.. but it didn't answer all my questions
 
11:47 AM
which book?
hmm ok have to start reading about integration testing
i thought first unit testing,,,,, then integration testing
 
THe first book i have
 
there is a book on creating CMS's on top of ZF ?
 
the second i dont have
 
11:48 AM
mind the one of the first books on Zend Framework
means old and likely outdated
 
not invented here to zhe max
 
and since it's Apress its likely crap anyways
 
@sanders Ok, if you have the first one than I' rather confident that i can't tell you anything you can't look up there (apart from the stuff I already told you)
 
i have both
sorry
lol
 
gotta love copy and paste from adobe reader: 􀀯􀀉􀀖􀀞􀀣􀀇􀀋􀀕􀀞􀀞􀀣􀀇􀀈􀀉􀀋 􀀃􀀰 􀀃􀀇􀀋􀀌 􀀃􀀱 􀀃􀀌􀀉􀀗 􀀃􀀅􀀲􀀥􀀊
 
11:52 AM
@edorian where would you start with developing your cms?
 
I'd start looking into that CMS Framework they are currently building on top of SF2 and Doctrine2
but thats just me ;)
 
SF or ZF?
 
I guess in general I'd start with a vision on what it should to better than existing solutions and for what purpouse i create it
 
ehm... sorry, but I'd start by clarifying what do I really want (specification) - and then drawing sketches and UI
 
then decide on the very very core features and get that going (create a releaseable state)
and after that i assume things will come more naturally
 
11:54 AM
hmm ok. I thought to start writing the page class
 
When it comes to CMS development in php in general the only things i think has a chance of producing something really cool currently is (or hopefully will be) stuff build on top of cmf.symfony.com
 
ok
 
not sure if thats ready to go yet, but it's sure worth a look
 
programming itself is the most time-expensive thing - you should do few "sketch-only" iterations first...
 
but this is self a symfony project
i have chosen for the zf
 
11:58 AM
yeah, but it should be nice to get some ideas
And I agree with @KamilTomšík, first make sure you know where you going and what you really care about
 
thats right
 
even if you end up throwing the mockup away
 
i have a few ideas in my head but just want to start going ;-)
 
@edorian this is cool: github.com/symfony-cmf/symfony-cmf/wiki/Feature-Brainstorming - thx for that :)
it's good to-also-think-about list for general cms development.
 
@KamilTomšík I've met some of those guys at a conference and it seemed like a really well thought out venture. They are even adopting some java standards for storage (and getting that into that storage standard) so it will be able to integrate with java based cms backends
(for which there are pretty darn big storage solutions)
 
12:03 PM
@edorian I'm not java fan anymore, so... :-P
 
The language doesn't matter much, I honor the effort to talk to the guys that build the backends of the biggest CMSs out there
and getting the software to talk to each other
if nothing else than for making it easier for people to migrate ;)
 
@edorian I think it does matter - take open classes as example - it's impossible in java to extend String with new methods. yes, it does not make sense in global sense, but in context of your project - it's... unvaluable
 
12:20 PM
posted on June 13, 2011

Latest PEAR Releases: Net_SMTP 1.6.0

 
@KamilTomšík re. I didn't mean the language itself. I know you have pretty strong views on that subject. I was rather talking about the effort of integrating with existing systems and standards. Something that PHP community doesn't have a very good track record in
> I'm working on simple PHP framework which follows MVC best practices. Core classes (config, request, response, router, dispatcher, db etc) are stored in registry which is also some kind of DIC.
 
@edorian what about rest? it was designed for this purpose. (different languages, different platforms)
 
@edorian dont loose all your hope for humanity
 
@edorian I see your point, but I'm not sure, if it's even possible - for example smalltalk decided to support "primitives" (native methods) in order to integrate with OS and third party libraries, which sounds cool, but actually is not - because it does not fit in big picture. language-specific xmlparser is much easier and intuitive to use than let's say DOM.
it's okay to provide some "common" protocol (low-level), but it should be always wrapped inside language-specific library (high-level).
 
@KamilTomšík Well if everything could be changed / adapted easily we wouldn't need all that "integration" mess, yeah. But still, REST is just a protocol, there still would be an API that would need to be comparable (done right, not relying on specifics)
@teresko Why not, it would make things so much easier sometimes :)
 
12:33 PM
@edorian you can't always integrate two distinct languages without common protocol - for example - passing lambdas vs. returns (and both of them have advantages and are reasonable within context of language)
 
12:52 PM
hi there
 
@teresko :D good one
Yeah, I'm back :)
@KamilTomšík - Still feel like discussing it?
What you mentioned about PHP suffering dynamic extending (prototype-like), I very much agree. Sadly, I can't see a solution that works well with documentation (PHPDoc/DocBlocks).
 
i cannot even express how much i hate when people write database tables in lowercase
 
Likes SELECT * FROM `products` ?
 
02:00 - 13:0013:00 - 00:00

« first day (240 days earlier)      last day (4723 days later) »