« first day (615 days earlier)      last day (4333 days later) » 

can anyone think of any massive downsides to using a static class to store site configuration data? I've spent the morning trying to poke holes in my ideas...
 
@orourkek Yeah . . . it's static.
 
@LeviMorrison yeah, well it's all stored in the session now
the var_dump of the session took 8 pages to print out @ font size 9
 
@orourkek I had a huge debate on this here
47
Q: Why is Global State so Evil?

TruthBefore we start this, let me say I'm well aware of the concepts of Abstraction and Dependency Injection. I don't need my eyes opened here. Well, most of us say, (too) many times without really understanding, "Don't use global variables", or "Singletons are evil because they are global". But what...

For most global settings, just use a constant
 
@Truth I forgot about that one until now :]
 
9:02 PM
@orourkek The problem with a static class, is that anyone can change it
 
The only caveat to my tale is that we've got 70% of the code still procedural
 
That's a problem a constant eliminates, plus it gives you the nice readability (and efficiency) boost.
 
the class could also rope in a few functions that are now global
 
@orourkek Sounds like me a year ago.
 
Basically I could leave everything how it is, or start to force a transition to MVA/MVC
I'd rather do the latter
 
9:05 PM
Don't do either.
 
Well, in this specific case, the session stuff has to be changed, it's getting out of hand
 
MVC is a GUI design pattern, not an application architecture.
 
anytime any site setting is needed, it goes into this one massive site data file that has hundreds of session variables initialized
 
Sounds awful.
 
For now I'll keep my questions related to just how to best store site settings :]
@Truth I should add that we use in-house CMS to control site settings, does that change your thoughts on using constants at all?
 
9:09 PM
Trivial question, which coding standard do you use, pear or ZF or none?
 
@orourkek Nope. You have a single file filled with constant definitions, and simply include it with ever page which needs it
Using constants is much much MUCH more efficient than sessions, that's for sure.
It also looks nicer in your code
 
that much i know :]
 
MAX_PAGES_OPENED instead of $_SESSION["max_pages_opened"]
 
I think I was trying to do too big of a leap initially
 
@Truth MAX_PAGED_OPENED shouldn't be a constant though
Constants should be for constant values
E.g. PI is a constant value
 
9:12 PM
@NikiC It's a constant containing the maximum amount of pages a user can have
 
but DB_PASS is not a constant (you probably have different passwords in production / development)
 
@NikiC I can see the merits of his point, though
 
@Truth Which is not constant...
 
It's the first example that jumped into my head
@NikiC It is on an application-wide scale
 
@Truth If you are using constants for non-constant values you again have the testing problem
 
9:12 PM
but we have site_id, site_name, site_email, etc all stored in every session
its just a huge mess
 
You may want to test how your app behaves if the "constant" value changes
 
@orourkek Home made CMS With 70% procedural code?!
 
E.g. what happens when the number of pages is very small or very large
 
@Truth basically, yes. However, the platform is fairly stable :P
"fairly"
the webroot has about ~125 php files in it
 
@orourkek "Fairly" Probably the same as PHP's == "Fairly Equals"
 
9:14 PM
perfect example :D
On a related note, nearly every comparison is ==
 
@orourkek Didn't expect any less :)
 
A better == implementation might be return [true, false][mt_rand(0, 1)]
6
 
:D
however, working with code like this has forced me to think outside of the box
 
while there are instances, when procedural code is ok .. something as large as CMS should not be written like that =/
and i got a problem
 
@tereško Hmm?
 
9:17 PM
@tereško the mighty teresko has a problem?
 
It's not a full cms, it's basically a site settings manager. Not much better, but still
 
tomorrow and day after that in Latvia we have midsummer celebration
 
@tereško ..So?
 
that basically means an Octoberfest with Caucasian meat , caraway cheese and bonfires
 
Heh, what I really hate is some code segfaults, but not in debug mode. Makes debugging it very unpleasant because most stuff is optimized away.
 
9:20 PM
which means that i am in a countryside , in a home with enough beer that cannot even drink it all alone in 3 days
 
@tereško So.. invite some friends over?
 
that's planned for tomorrow night
(oh , and FYI , i can drink a LOT of beer)
 
@tereško Wouldn't expect less from a Latvian.
 
@tereško I still don't quite see the problem...
 
well .. i drunk three bottles and got an urge to resume work on that damned framework i always forget to work on
and i'm getting thirsty again
 
9:29 PM
@tereško bad magic link
 
fixed it ... but no magic
 
Jāņi (pronounced ) is a Latvian festival held in the night from 23 June to 24 June to celebrate the summer solstice (Midsummer), the shortest night and longest day of the year. The day of Līgo () (23 June) and the day of Jāņi (pronounced ) (24 June) are public holidays, and people usually spend them in the countryside. The festival's eve Jāņu vakars () is held in the evening of 23 June and goes on all through the night Jāņu nakts (), where people Līgo (sway) into the following day. Jāņi is an ancient festival originally celebrated in honour a Latvian pagan deity Jānis, referred to as a "S...
that one works
 
10:03 PM
Which option would you guys like better, top or bottom?
@tereško @ircmaxell @rdlowrey @Gordon @NikiC @salathe (Ping me later if you aren't here, I'm interested in what you guys think)
 
Bottom one, I'd say.
 
@LeviMorrison I predict that nearly everyone will say bottom
 
@LeviMorrison lower because it conveys more information directly
 
10:20 PM
neither
also , the top one is WRONG .. you are breaking the grid there
thus making it a flawed test
@LeviMorrison , also , i am tempted to say "dont talk to us until you are done reading this book"
 
this book is for graphical design, what PoEAA is for application architecture
 
@LeviMorrison Bottom. @tereško is right with the grid, people will notice this, even if they don't realize it.
 
@tereško I didn't even make those pictures.
 
well, then forward the complaint to the one who did
 
10:29 PM
Although I thought the test was biased anyways because the downloads portion isn't the same in each picture.
Too many variables.
 
@LeviMorrison , wrong .. the download was exactly in the same position
 
@tereško But the background color was changed.
 
grid was changed
uno momento
i am gonna try to host few materials for you
no .. i cannot .. it will take ages
 
btw if those are official plans for the much needed php.net redesign then thats the first I heard of it
 
I WANT OPERA-UNITE BACK !!!
why should it be so damned hard to share few files
 
10:38 PM
I'm trying to take that ^ and get it ready to launch. Still a lot to do.
 
@LeviMorrison it doesn't seem very original, makes me think of open source web-frameworks, mostly reminding me of jquery.com with documentation in the same general area (not saying that is a bad thing)
 
i know it might sound scary, but , i agree with @sg3s
it's for jquery page would look, if it was made in 2005th
what you have there is a dead horse
no matter how you try to decorate it, the horse will still be dead
 
So what would you recommend?
 
go back to drawing board
and start by making concepts
and for every concept make both landing page and manual page
 
@tereško That's sort of what we're doing.
 
10:43 PM
I don't know how many concepts there have already been, but it is better to make dozens of wireframe a-la what you have now than go further down this path getting stuck in something that doesn't apeal
 
(with "concepts" i mean wireframes)
 
@sg3s Not many. It's been pretty piece-meal until now. I finally have a UX/UI designer helping.
 
echo strtolower($word) ."-". strtolower($find);
if(strtolower($word) == strtolower($find))
{
echo 'SUC';
}

The words are exactly the same, why wont it return true and output SUC
 
@LeviMorrison , each time you come up with a new concept , look at this picture
 
@tereško I actually work for a university, ironically enough.
 
10:45 PM
lol
 
lol
 
@tereško I wish you were on our phone conversation yesterday. We talked about why users come to the php.net homepage.
 
@LeviMorrison brilliant, then you should be familiar with the problem of somehow not being able to find the phone number of the front desk
 
We are trying to fix the issue.
 
good , but as i see it, you cannot fix in the current design
 
10:47 PM
@tereško Depends what you are including in that statement.
 
IMO, finding a "store locator" button is much more difficult than finding something on a uni page :P
 
here is what I come for to php.net, in order; documentation, changelogs/new builds, news
 
@sg3s Exactly what we identified, in the same order.
 
well, you're doing something right
 
Fortunately, the documentation pages are doing better than the home page.
 
10:48 PM
better, but not great imo
 
@LeviMorrison , compare the prototype to : yiiframework.com
 
@LeviMorrison That's not really evident, given the four massive buttons that have nothing to do with any of those, smack dab in the middle
 
@orourkek Sigh. . . I'm really new on this project. I didn't put them there!
 
@LeviMorrison I figured as much, just saying :]
 
But, I know what you mean.
@tereško In what way? I'm not sure what you want me to compare.
 
10:51 PM
structure
they are the same (on the top)
 
Hi guyss
 
@tereško just checking: you are saying that is bad?
 
any one familiar with Magento ?
 
@tereško I don't think that page is an excellent example of web design, might be intentional but colours are too faint. I can see them well enough but I know monitors are rarely calibrated with the right gamma/brightness to actually see them... :s
 
10:52 PM
@AlirezaSeifi what is your question?
 
What function is equal to mysql_num_rows in Magento?
 
@sg3s , i actually think it is horrid piece of turd
 
:)
 
but it is better then prototype
what i like from that page is that they have books in the landing page
 
I'm trying to use mysql_num_rows in Magento to fetch data from database
I know there is fetchAll($query);
I need mysql_num_rows function
:)
 
10:55 PM
@AlirezaSeifi depends where you want to use it... note that you're never really directly interacting with the database tables but collections and objects build from data in it... it's better if you understand it that way too with EAV tables and other gems in their normalization
 
.. you definition of "gem" might be a bit .. emm ... off
 
What do you mean by that?
is there any function for mysql_num_rows?
does the same thing?
 
@tereško Is there some site out there that has the structure you want?
 
Lagging as hell, if my messages arrive 20 minutes late, sorry >.<
 
you are asking the wrong question
 
10:57 PM
@tereško sarcasm
 
@tereško are you talking to me?
 
why would i be talking to you ?
 
caz I asked a question :)
 
@tereško You are a user, and I want to know what users think. So far, you've basically said everything is **** but haven't really told me much more than that. Maybe I just missed it. I'm doing several tasks at once right now.
 
elllo govner
 
11:01 PM
@LeviMorrison , no , there is not a single page that i would point to and say: "make it like this"
with some nice adjustments the current tutorial-link/download panel is ok , because that is the primary goal of page
 
@tereško Do you go to php.net with the same priority list: documentation, recent releases/changelog, recent news?
 
the big slide-out menu should turn in a fat footer
i go to php.net mostly for docs , but i use an opera's built in search mechanic
basically i write "p in_array" , and it opens the documentation page
 
@tereško I do something similar in Chrome.
@tereško So when you go to the homepage, why do you go?
 
do get the latest version , and to check if i have latest version
if i was a noob, i would hope to find a tutorial or step-by-step installation guide there
 
@LeviMorrison as a side note, for the documentation pages, get them to make optimal use of my monitor, I'll be relatively pissed if I lose the full width there, though comments and text in general should probably not violate guidelines which exists (fill up the space with other stuff!)
 
11:07 PM
and one thing i do not look for (but which should be important) are the latest conferences with related videos from them
 
@sg3s In the documentation pages, the thing that floats over in the right sidebar is going away.
 
... the guideline he's talking about is that text line should not exceed 80 chars , because then you start loosing the current-line while reading
actually the optimal length is said to be ~66
 
And if longer, you need more line-spacing
 
doesn't really help much
actually , it might be smarter to now fix the footer a bit , and ignore the middle part
that would give page some "solidity"
 
anybody knows how can I use mysql_num_rows in Magento ?
 
11:12 PM
@AlirezaSeifi you're probably looking for ->count() or something magentocommerce.com/wiki/1_-_installation_and_configuration/…
if you want an example of how not to do your documentation then magentocommerce.com is the perfect example btw
 
@sg3s Thank you
let me take a loot at the link u've sent
there you go
you are the best
 
I know. :p
 
I hate it when people downvote your question for, well, a valid reason, but hate it more that NOBODY seems to come back to take that downvote away when you FIX the problem in your answer.
 
there is a time limit
 
11:25 PM
@tereško It's reset on edit ;)
 
and how do you know that i was edited ?
 
@tereško You don't ^^ That's the problem :)
 
I told the guy he was right and I fixed it, he was kind enough to leave a comment telling me what was wrong (something trivial which he could have edited out tbh)
 
11:56 PM
@LeviMorrison like the second one more
 

« first day (615 days earlier)      last day (4333 days later) »