« first day (223 days earlier)      last day (4949 days later) » 
02:00 - 15:0015:00 - 21:00

02:34
wonderful morning... it's raining!!
 
2 hours later…
04:38
@Radu , please dont use LIKE if you are not 100)% sure that it is the only way
the LIKE condition is really really , REALLY slow
05:35
hi all
does anyone know of a reporting module in Drupal ?
06:10
posted on May 27, 2011 by Christian Weiske

At work, we used a SVN server and enforced our project coding standard with a pre-commit hook on the server that ran PHP_CodeSniffer. Whenever a developer tried to commit some code that does not match the standard, he got it rejected. To be able to check in legacy code, our commit hook recognized special commit message tags like "SKIP_CS". Developers using

 
2 hours later…
07:58
Good morning Folks
very good morning
Hi @dskanth
08:19
morning
Hello @KamilTomšík
hi @Robik ;)
How are you?
08:35
good, I've just woke up, what about you?
Fine, but that damn flu...
tht sucks...
sick*
:)
go back to sleep guys
Are there any patterns to design my app that are not kind-of MVC?
08:42
What's wrong with MVC?
I hate it
If there's none i have to use classic file-pattern (viewtopic.php etc.)
Invent your own rules for including files etc.
It doesn't matter how pattern is called rather than how organized code is
Well, i can see the critic like: Use MVC otherwise it Sucks
well, it's just a bunch of code that more than 1 people found suitable and logical
It doesnt have to be that way
MVC sucks - now it's 2 on 1 ;)
08:49
You mean you don't like MVC too @KamilTomšík?
@Robik yes, but actually - you don't like MVC Model2, I don't like both MVC and MVC Model2 :)
what model2???
@.@
Yeah, what's model 2?
From whole MVC i like only Models, that's all.
@Phelios in a nutshell - MVC Model2 is MVC for web (for true MVC you would need comet - php wouldn't die after request)
so now comet come into picture
hmm
08:53
I guess it was not best example - it simply means that in true MVC, when you change model, all listeners (viewing users) will be noticed and their screens will be updated - instantly
MVC is typically implemented as a "Model 2" architecture in Sun parlance en.wikipedia.org/wiki/…
and even with comet it's not easily achievable using php
@KamilTomšík that make Model even cooler
@Phelios MVC Model2 == Model2, MVC == MVC, MVC != MVC Model2
@Phelios wiki's wrong
you can find MVC in Java Swing, Google Web Toolkit, Smalltalk, Self and derivates
screw the terms man
whatever they call it
08:58
@Phelios but that's the purpose of design patterns - to have names for specific architecture - and when you say MVC, I'll imagine Model with changeListeners, View with uiEventListeners and Controller which simply listens for uiEvents and calls appropriate model methods (ALL of business logic stays on model, nothing is in controller), and View will just listen for changes on model. Do you have listeners in your "MVC" application? I doubt about that, which means it's not MVC
quibble!
@KamilTomšík I am still really new to the term MVC... so don't expect me to understand what you are talking about!! :)
@Phelios this is hard to get if you haven't ever done anything other than php. so just remember there is no PHP MVC framework right now. only Model2 ones.
@Gordon morning ;)
ok, today is my first time heard about Model2 :)
thanks @KamilTomšík
btw
09:04
CakePHP, is it MVC or Model2 or none?
if it's something, then it's surely Model2 :)
@Gordon Hi
and now why I don't like MVC itself... @Gordon interested?
@Robik, you are saying that I'm a spammer here? lol
great, I'm a spammer
@Phelios it's quibble. all the people telling you this or that is not MVC but Model2, HMVC or MVP fail to acknowledge that a pattern doesnt have an implementation.
09:06
No, i didn't mean you're spammer @Phelios
@Gordon quibble is a new word for me also today. Thanks @Gordon :)
Anyway sorry, it was ambiguity @phelios
@Gordon it does :-P there is Model class in smalltalk, there is controller (closure), there is Widget class
don't worry @Robik, I was kidding :P
"-,-
09:09
@KamilTomšík I don't understand this statement
@KamilTomšík I have to agree with @gordon here. It's just a pattern.
PHP wasn't even around when MVC was designed. And the modern web was just a dream in people's heads.
@Phelios MVC splits user interface interaction into three distinct roles. Understand the roles and that the most important split is between M and VC. How you implement that is up to you.
2
MVC was born in smalltalk, then they've written paper about their work and MVC "pattern" was born. Important part was instant-feedback - that was all what MVC was about. They allowed multiple class browsers updating themself instantly when new class was added to system (without need for "refresh"). You can't ignore ST background when you're talking about MVC, it's like talking about Unit of Work without having clue about transactions.
You're talking about the MVC pattern in the context of Smalltalk. The whole point of a pattern is that it's not tied down to one language. It isn't owned by anyone. It's just a regular way to solve a problem that a person has
4
ok now I kind of get it
this all pattern thing
is like SDLC
or Software Development Model
09:18
@JohnP have you ever worked with smalltalk? because I had the same feeling about MVC before that experience - but after few minutes (!!) I've reconsidered everything about MVC.
@KamilTomšík nope. But what I say still stands because MVC in the context of Small Talk is probably what you describe
not everybody will apply or follow the pattern 100%
This is because that was what it's based on. But it's a pattern. Most people probably use it without even knowing it's called MVC
I guess what I'm saying is that it doesn't have to be rigid. It's not a specification.
allright - I'll try to explain why MVC is not golden hammer (agree?) and maybe you'll get the point. MVC was designed for this specific case (multiple browsers working on top of the same model). This is also why I don't like it - because you usually don't need (nor want) multiple views for one model. It's harder to read, follow, work with, etc., etc. It's just pain, it's like writing every action using Command pattern, just because. You want to separate UI from business logic, that's all.
and DI does the trick much better.
is tempted to create a SmallTalk room and move Kamil there
09:26
:D
:D
@Gordon :)
@KamilTomšík those terms don't have any context in PHP :) Are you saying that MVC in the context that PHP uses should be called something else?
There is a lengthy article written by Fowler in 2006 about the evolution of MVC from it's SmallTalk roots over to the various derivates that appeared over the years. In case anyone wants to read that: martinfowler.com/eaaDev/uiArchs.html
09:28
@JohnP Model2, but let's not continue on this, it's imho pointless. and I've said it too many times over and over again.
@Gordon I will, later, but thx.
WORK-IN-PROGRESS: - this material is still under development <-- :P
now if you're interested... why would you want to use MVC or Model2 in your applications? @Gordon I'm especially curious about your opinion :-P
@KamilTomšík let's discontinue this and rejoice in the fact that it's Friday evening!
There is also a collection of articles by Trygve Reenskaug about MVC at at heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html
@JohnP I feel sad!!! I am working on Saturday!! T.T
I agree @JohnP, let's discontinue this
09:31
@JohnP it's not even noon ;) but I agree as well
@Phelios I feel for you. I usually freelance, but I've got a break for a couple of weeks
I'll rejoice tmrw night... Barca vs MU!!
@Gordon Friday evening ± 5 hours :D
let's discontinue this and rejoice in the fact that it's 1306488843
anyway
is there going to be a Internet Time Zone?
09:34
woot!
one particular time that is agreed to be for everyone online
wouldn't that be GMT?
is it?
Anonymous
hmm
there was an attempt to establish something like that with Swatch time.
Anonymous
09:36
quick question... got a varchar field in the db, with a value of certainwebsite.org.uk
Swatch Internet Time (or beat time) is a decimal time concept introduced in 1998 and marketed by the Swatch corporation as an alternative, decimal measure of time. One of the goals was to simplify the way people in different time zones communicate about time, mostly by eliminating time zones altogether. Instead of hours and minutes, the mean solar day is divided up into 1000 parts called ".beats". Each .beat lasts 1 minute and 26.4 seconds. Times are notated as a 3-digit number out of 1000 after midnight. So, @248 would indicate a time 248 .beats after midnight representing 248/1000 of a...
Anonymous
that's http://certainwebsite.org.yk
yeah, heard bout that one
Anonymous
*uk.
Anonymous
when read out of the db it var_dumps as http:///certainwesbite.org.uk
Anonymous
09:36
any idea where this extra slash be coming from lads?
Anonymous
parse_url throws a paddy
@SkippyChalmers there's nothing in the middle doing any transforming?
Anonymous
nope.
Anonymous
straight fetch_assoc
Anonymous
and then var_dump
09:40
oracle?
Anonymous
nope. mysql
Anonymous
on codeigniter btw
Anonymous
CI2
@JeffAtwood hello
the Jeff himself visits us
hmm. never come across it
@JeffAtwood woah!
Anonymous
09:41
weird one hey. no idea how to sort it :(...
must be a missclick.
Anonymous
@JohnP oooh. looks like some aggressive query caching
@SkippyChalmers you had old data like that?
Anonymous
yeah apparently. but i went in and changed it.
Anonymous
quit and re-opened sequel pro and viewed results again... the actual record contained three slashes, even though I had already modified it. probably a bug with the program rather than anything else. cheers guys!
09:44
it kind of happen to me once
but can't remember the exact scenario
it's like I retrieve from db
can't remember what function I uses
with @JeffAtwood being here it can only mean one thing: ASP.NET doesnt scale and he wants to know how to port StackExchange to PHP ;)
then I save it again
Anonymous
lol.
then it become weird
Hello @JeffAtwood
09:46
@Gordon that will be great!!
Yeah :D
@Phelios just kidding
so they are using asp.net ?
Maybe because here was a starring chaos ;)
or this is also a joke?
lol
09:47
No, they are using ASP.NET
96
Q: Which tools and technologies build the Stack Exchange Network?

aleembPicking up from the blog, what are all the details on tools and technologies used to build the Stack Exchange Network? Return to FAQ index

great to know that :)
I bet the ASP.NET room was just next to PHP when @JeffAtwood loaded the chat room.
Please save our room!
:D
ok, whats the problem
09:50
yeah, what's the problem?
Is storing images in DB good idea?
not really
static content
I'm thinking about creating file that shows images, and that can limit copying of the images
if the image shows up on the page, it can be copied
09:51
Yes i know
@Robik it's idea, it's not bad or wrong, it depends on your situation.
it has at least one benefit: easy backup whole db including all attachments
But i see a pros of it
the only thing you could do is put 1 extra barrier to stop people from copying/saving the image
I can show resized image without using html ;)
Anonymous
@Robik how will this stop anyone copying your image?
09:52
@Robik another one could be: querying, indexing, etc. using the very same interface you're using for the rest of your application.
It won't
Anonymous
@Robik watermark your images... otherwise leave off it :)
Anyway i will have a list of images in DB i so was thinking adding content there will be good idea too :D
make them pay to view the fullsize image :P
If i will lock folder with images with htacces they wont be able to save them (excluding thumbnail on website)
Watermarks, adding source and make avaible watching images only for logged users.
09:55
Saving the image in a folder doesn't mean you can't read it with PHP and serve it
put it in a folder, serve it through a file. The PHP file will have the checks
you can also have the thumbnail script work off it
Anonymous
@Robik if you show the image to the user in any form, then they can "save" it. My advice: don't bother.
don't be like the RIAA :P
what kind of images are they btw?
Yes, but if it will be resized by the script, they can save only that resized.
Anonymous
unless you show a smaller low-resolution watermarked version and serve protected high res versions from a non-public directory via a php script to authorised users.
09:57
why so stingy?
They will be uploaded by user.
Anonymous
@Robik okay no offense, but is there anything you need help with?
I just wanted to ask for opinions
Anonymous
okay :) we.. i think trying to stop people "saving" / "copying" anything on your site is a waste of time :)
Anonymous
but your idea to show them watermarked low-res versions should hold back most users.
Anonymous
10:00
and should work fine. rather than rely on basic auth, put your images outside of the public folder for your site.
Anonymous
pull them back in with the php script.
Okay i will have script to preview images, now store them IN db or in folder? :)
I'm not good in .htaccess
Anonymous
IMO folder... but others might disagree?
Anonymous
dont bother with .htaccess, like i said store the images outside of your website's public folder.
Well, it will be opensource, ppl can see the folder name
Anonymous
10:03
that has absolutely nothing to do with it....
put it in a folder. just make sure it's out of your web root
Anonymous
if its outside the web root, people can't access it without going through your php script.
Ok.
I'm designing a site at the moment with similar requirements - on image upload, i assign random filename to small thumbnails, and another random filename - to original, fullsize
any drupal geek here? Wanna have personal chat..
10:04
@dskanth you might have better luck at the drupal site
Anonymous
@dskanth drupal can die in a fire for all i care ;)
what is drupal?
AFAIK it's CMS
@Phelios it's like joomla. a CMS
10:05
@JohnP Thanks
another CMS
cool
Anonymous
in all fairness.. it's actually alright...
Anonymous
i wouldnt use it though...
Anonymous
(he says, cockily)
Firefox is currently taking 1.3gigs of RAM :O
Houston, we have a memory leak :(
In the application I work on, I mean.
10:11
Use Firefox 7.0
(and yes, it does exists)
@.@
why is there a 7 out there?
and also 5 and 6
while the 4th is still on beta
AFAIK it have just improved HTML5 support
they're speeding up releases
Nope, 5 is on beta
They want to release new version each 2nd week, and major every 12/18 months
@Phelios 4th has been out and stable for awhile now
10:13
ok sorry, 4 is released
haven't use firefox lately :)
I think the problem is on the sites I work on
1,3 GB ram? Ouch i have 1 GB ram here :/
from the roadmap: Ship Firefox 4, 5, 6 and 7 in the 2011 calendar year
at which point we'll have chrome v36
they are trying to catch up with chrome
12
They forgot about performance
10:18
dinner time soon
cya all!!
have a great weekend (not for me)
@Phelios laters
Later @Phelios
Anonymous
11:10
@Phelios later
hi guyz! anybody could point me to any good imagemagick -magickWand for PHP documentation?
11:25
Hi @luca
@Robik Hi =)
12:08
maybe I've been coding too much...I've been ending my sentences with ; instead of .
I've it all time
And i've writing senences like: hi I'm From Poland
( camelCase)
Hello @teresko
hates camelCase
yea, good afternoon to you too , @Robik
is having one of those FML days.
You like underscores?
or, since it's an emote, FHL, depending.
12:15
yes
its much easier to read
i personally think camelCase is cleaner, but to each his own, i suppose
Not really xP
well it also depends
i use PascalCase for classnames and underscore notatation for methods
getValue is okay, but loadIniConfig file not that much
i prefer load_ini_config_file :d
and same rules for TableName - collumn_name rules
essentially i stick to same convention for all the code i write
12:17
Well, PascalCace (didn't know the name) for class names, camelCase or PascalCase for methods, underscores for consts
( except in JS i put { on the same line as the control-structure )
i tend to use underscore notation for databases, since tables are usually case insensitive, and camelCase for case-sensitive applications, like code
posted on May 27, 2011

Popular posts from PHPDeveloper.org for the past week:Lorna Mitchell's Blog: PHP OAuth Provider: Request Tokens NetTuts.com: Create WordPress Plugins with OOP Techniques Timothy Boronczyk's Blog: Spaghetti Code Considered Harmful Slawek Lukasiewicz's Blog: Zend Framework: logging with Firebug and FirePHP Jani Hartikainen's Blog: You don't need a service layer: Fat controllers are okay Symfony B

so 2 - 1 :D
Anonymous
this is a funny one
12:18
@UniqueKey table names for mysql is case-insensitive only if you host it on windows
Anonymous
camelCase is only really useful when you have short-ish method / variable names
on NIX hosting mysql table names are case-sensitive
@teresko touché.
Anonymous
usually underscored names somehow seem more readable
but then i prefer to develop on MS servers, anyway.
Anonymous
12:19
@UniqueKey ew.
hey, sue me. i like it better that way <.<
i personally think IIS is a great tool for keeping all ducks in a neat row. also, often businesses run on an AD domain, so that makes things easier
you might be working in some strange niche development corner
because most of real sites are hosted on NIX servers
not really, i'm currently developing intranet tools for a windows-centric business
if your main focus is intranet projects , then the balance might be a bit different
indeed.
13:01
@JeffAtwood how do we treat answers like stackoverflow.com/questions/5232900/… - the OP replied to his own question with a more or less nonsense solution and didnt accept any of the given answers. There is a bunch of those at SO. There is also a variation of those where the OP says "thanks for all the answers. This is how I ended up:", followed by the OPs solution.
wrong window?
No @JeffAtwood here :/
It was a rant
huh, he's right up there in the list
hmpf.. gone after reloading the chat
bug
there was an update yesterday
that could cause it
13:19
Is anyone here familiar with the CI platform
got a couple of questions
?
Anonymous
@CodemasterDarklord go for it mate..
@SkippyChalmers I am having a bit of problem with the CI pagination
All the code seems to run fine but the links created using create_links() method are not working properly
Anonymous
How are they not working? as in.. no html output...?
@SkippyChalmers the links are displayed properly but they donot work fine like if i click on page 2, the results are displayed properly but the current link remains on 1 which should be 2 once the operation is completed.
Anonymous
hmm
Anonymous
13:24
in the config check your values for uri_segment and page_query_string
I m using the default method for CI. PHP query string are not enabled.
the other values seems to be perfect
i did made a post on the StackOverflow website for the same
should i post the link to the query made
just check the codeigniter tag on stackoverflow forum, its the 2nd query from the top with the Title - Codeigniter Pagination
Should I build objects in my DAL, or should I pass the data to some factory method?
Anonymous
@CodemasterDarklord sorry didn't notice you'd replied
Anonymous
post me an example link that the create_links() function spits out
Anonymous
btw i mean the validation config... not application config
Anonymous
13:47
@Greg factory method seems a sensible enough way? IMO not 100% though, I like the idea of the DAL handling all that, but it does seem "cleaner" to have the DAL actually just deal with data, and then a separate library for object creation.
@SkippyChalmers Was just wondering because I'm starting a new project and thought to myself "why is this being done in the DAL?"
@SkippyChalmers I figured it out... there was a bit of a problem with the uri_segment
got it now... neways thanks for the help
Anonymous
@Greg technically.... your data abstraction layer can be a remote API. An api shouldn't return objects.. (as in... class instances) so yes.. it does make sense to pass data through to a factory method.
the solution is posted in on Stack Overflow
Anonymous
@CodemasterDarklord lol.. no probs... you do realise that's what I told you to check though? :P
Anonymous
13:51
brilliant.. good on you mate :) you'll save other people the trouble in future :)
Another thing. Regarding MySQL - would you recommend using a linked list or a single integer column for implementing a Sort Order?
Anonymous
@Greg but... meh :P IMO i wouldn't be too btohered if it was a small application.
@SkippyChalmers nah I'll leave it like it is for the time being.
Anonymous
@Greg yeah.. i think i would be tempted to do that too ;)
posted on May 27, 2011

On the Box UK site there's a recent post where they "unbox" Silex the recent micro-framework release from Fabien Potencier and the Symfony community. They test things out by creating a sample application, a simple feedback form. "Silex is a PHP micro-framework for PHP 5.3. It is built on the shoulders of Symfony2 and Pimple and also inspired by sinatra." - description from the Silex website

Anonymous
13:55
@Greg regarding mysql, single integer is going to be faster. I've never really run into the 'linked list' issues before... if that's what i think you mean, i'd avoid sub queries like the plague. However saying that, if you're queries are cached up to the eyeballs then do whatever makes the most developmental sense.
Anonymous
anyone else have an opinion on this?
I would like to know if people prefer linked lists to single integers.
I have just opinion that "linked" list in common is named "adjacency list" ;-)
Linked lists seem to make more sense for this kind of application - only having to update 2 records when inserting a record into the middle of a sortable list, rather than having to update every record ahead of the inserted one.
@Greg: how to select according the order then?
mysql does not support recursive queries
13:57
@zerkms Exactly...
just curious how many records in one set you have
and how often the insertions in the begin of the list are
@Greg: ? ;-)
My current application has > 10,000 records, and users move items around in the order quite frequently to the top of the list
(issue tracking priority)
uhm
and all that issues belong to one list?
the same list?!
Anonymous
depending on your structure, can you not jsut do a join and use mutiple order by clauses? :S
@SkippyChalmers: 1 join == 1 level
for 10 items it will be query with 10 joins and 10 * n fields
yesterday, by edorian
Presenting: "The HipHop for PHP Decision Tree"

	<Are you facebook?>
	 |              |
	Yes             No
	 |              |
	You need it     You don't need HipHop
perfect!
14:07
@zerkms aha yeah they are all in the same list. This is for a multinational manufacturing company - not my bug list!
let me stress I do not have 10,000 bugs :) ...yet
@Greg: still cannot imagine any issues list of 10k items long
anyway - you can use order field with spaces
with 10 step
and all possible movings will be done fast
@zerkms they throw everything in there, packaging, customer relations
and re-do space once a week for example
or even 100. 100 is more than enough I bet
Anonymous
@zerkms yeah fair enough
Anonymous
okay if I'm honest you've all lost me.
Anonymous
14:10
think my idea of your db structure was all wrong.
@zerkms yeah that's a good idea actually ... spacing them out on low activity times.
yup
it could be also "smart scheduling". as long as your "moving-script" cacthes the cases when the any space was filled - you can schedule the rearranging for next night
to go to bed or not to go to bed
14:35
btw, getting captcha at SO for every single answer this evening
seems like jeff and joel know about me more than myself
posted on May 27, 2011

On Elated.com there's a new introduction to working with inheritance in PHP for object-oriented applications. They work through some of the basic concepts including parent/child classes, final and abstract classes and interfaces. In this article we're going to explore the idea of inheritance in object-oriented programming, and how inheritance works in PHP. With inheritance, your objects an

ugh. I wish these guys would hurry up and send me the information, so I could start working on a quote
Hello
Does php only support soap 1.1?
> The SOAP extension can be used to write SOAP Servers and Clients. It supports subsets of » SOAP 1.1, » SOAP 1.2 and » WSDL 1.1 specifications.
Anonymous
@gms8994 :P remember to over estimate! haha
14:46
ok, I am not a php dev, so I was just curious, I accessed a WCF service with a php soap client, but was told that I can only access basic http bindings which are soap 1.1
19
A: If Singletons are bad why a Service Container is good?

GordonI'd say it boils down to these four differences (at least I can't think of any others right now): Single Responsibility Principle Service Container does not violate Single Responsibility Principle like Singleton does. Singletons mix object creation and business logic, while the Service Containe...

pah! didnt get AA nor bounty
at least i got more upvotes
Anonymous
@Gordon that you did. +!
Yeah +
thanks. I see it positive though. Since stackoverflow.com/questions/2551718/… is lacking the sufficient upvotes to get me Populist, this one might offer another chance :)
What are SO events about?
02:00 - 15:0015:00 - 21:00

« first day (223 days earlier)      last day (4949 days later) »