« first day (404 days earlier)      last day (4544 days later) » 

12:00 AM
Zend Framework 1.0
 
i can't understand a word of that code
 
$ssl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on');
seems to be the accepted standard now
 
Hey guys
 
that's all i put in my index.php?
 
12:04 AM
@KevinPeno so i just put the one line into my index.php file?
 
@Purmou that will tell you if SSL is enabled. What you need to do with it is totally dependent on you
 
Does anybody really know what " Paris with Idiorm " is?
))
 
@KevinPeno what will it return?
 
@TuralTeyyuboglu I see this on their github page:
 
true, false, on, off?'
 
12:05 AM
$person = ORM::for_table('person')->find_one(5);

// The following two forms are equivalent
$person->set('name', 'Bob Smith');
$person->age = 20;

// Syncronise the object with the database
$person->save();`
 
and what's advantage?
 
@TuralTeyyuboglu I don't understand. I answered your question no?
This is typically how active record type systems work
 
@KevinPeno , you are mixing the responsibilities there
 
@tereško I'm not doing anything buddy. This comes from the crappy library he's using
 
and that is the main reason why active record is considered to be a bad pattern
oh
then nevermind
 
well that's not my question at all))
 
oh god
 
0
Q: How to make a "find and update" query in Paris

andreiI am using Paris with Idiorm and I am having problems finding in the documentation a clear instruction on how to find and update a table. I don't want to insert a sql query into the script. Is there any other way? Paris is an Active Record implementation based on Idiorm. Idiorm is an object-re...

 
I just wonder, what is that
 
@TuralTeyyuboglu Your question was how to find and update a record. That's how.
 
12:11 AM
why oh why people are so willing to use activerecord ?
 
0
A: How to make a "find and update" query in Paris

Kevin PenoI found this on their github site: Updating records To update the database, change one or more of the properties of the object, then call the save method to commit the changes to the database. Again, you can change the values of the object's properties either by using the set method or by settin...

 
it is painful to watch
 
@Kevin open the question, and take a look, who actually posted the q
That's not my question
 
@TuralTeyyuboglu my fault :)
So what is your question then. I'll reset :P
 
My question is: what's paris with idiorm? I have no idea what's it
 
12:15 AM
Paris implements the ActiveRecord pattern on top of Idiorm: en.wikipedia.org/wiki/Active_record_pattern
Basically it lets you work with objects, make changes, and save them from within the object
 
all while, theoretically, abstracting away from the underlying data source
 
something like php preapred statements?
 
@TuralTeyyuboglu way higher level than that
 
Paris with Idiorm is like a shit , with vomit stuffing
 
12:17 AM
@tereško pretty much :P
 
.. now try to get that image out of your mind
 
)))
loool
 
12:30 AM
@tereško why do you feel active record is mixing responsibilities. I have my own opinion. I'm just curious of yours
Or do yours match the concerns on the wiki page?
 
it contains both domain business logic and storage logic
and i have no idea what is in the wiki page
 
@tereško So you would rather see something like?

$storage = new Storer();
$record = new Record();
//set some stuff`
$storage->save( $record );
grrr I have to brush up on my chat formatting heh
 
yes , but with less typos
 
This guy needs some love:
 
12:35 AM
also known as datamapper , @KevinPeno
 
1
Q: Modify JavaScript code to use on dynamic pages

Chris MossI have a Joomla website where I need a radio stream to run constantly while the user broswers the pages. The only way I can do this is using frames ( as AJAX would be far too complicated for me). I found a code on the web that will ensure the site always stays in frames and also will take the use...

@tereško eventing is data mappings friend
 
i am pretty sure that "eventing" is not a word
oh .. it is , in that case , what the hell you meant by that , @jcolebrand ?
 
Yo
 
12:53 AM
hallo
 
Good lord, anyone using netbeans?
 
yes
 
@ircmaxell I use save-on-upload and I always get this: Upload Files On Save failed.
The FTP log only has this

220 FTP Server ready.
USER tagebuch
331 Password required for tagebuch
PASS ******
230 User tagebuch logged in.
TYPE I
200 Type set to I
CWD /public_html
250 CWD command successful
CWD /public_html/Testbed
250 CWD command successful
The IDE log does not get anything new
 
why are you using ftp?
what is this, 1980?
 
@ircmaxell :(
 
1:01 AM
:-D
 
@ircmaxell come on. I use gopher:// all the time
 
LOL
 
@ircmaxell Well okay SFTP works, but still.
Now I always get the prompt that wants me to verify the RSA fingerprint
 
no, you can fix that
 
Woot, beer-thirty.
Love regular company sponsored alcohol events :P
 
1:07 AM
@ircmaxell Well it works with SFTP
 
very nice
 
happy thanksgiving folks. Catch you on the flip-side
 
And the same to you
 
Thanksgiving?
 
American Holiday
 
1:21 AM
Heard of it but all we Germans usually know is that it's turkey slaughtering and eating day
 
God my internet connection sucks lately
, (Canada); November , (Liberia); November , (Norfolk Island); November , (USA) |date = October , (Canada); November , (Liberia); November , (Norfolk Island); November , (USA, Puerto Rico) }} Thanksgiving Day is a holiday celebrated primarily in the United States and Canada. Thanksgiving is celebrated each year on the second Monday of October in Canada and on the fourth Thursday of November in the United States. In Canada, Thanksgiving falls on the same day as Columbus Day in the United States. Because of the longstanding traditions of the holiday, the celebration often exten...
 
We have the Erntedankfest, which is in October
 
 
2 hours later…
3:32 AM
@tereško You missed me earlier. What did I mean by what?
 
3 hours ago, by jcolebrand
@tereško eventing is data mappings friend
 
Aye
> Its responsibility is to transfer data between the two and also to isolate them from each other.
Eventing is one of the best forms of loose coupling
"Do this thing and tell me when you're done"
For instance, you'll never know how long it should take to finish a certain operation. If the backend is a new couch-db instance, it may be extremely fast. If it's an old MySQL without indexes and lots of data, it may be very slow.
 
Eventing (also known as horse trials) is an equestrian event comprising dressage, cross-country, and show jumping. This event has its roots in a comprehensive cavalry test requiring mastery of several types of riding. The competition may be run as a one-day event (ODE), where all three events are completed in one day (dressage, followed by show jumping and then cross country) or a three-day event (3DE), which is more commonly now run over four days, with dressage on the first two days followed by cross country the next day and then show jumping in reverse order on the final day. Eventin...
 
You should never write code where you anticipate how long it will take to do some operation, that'll cause failures or race condiations. And you should never wait on a response from the storage engine if you can help it.
In computer programming, event-driven programming or event-based programming is a programming paradigm in which the flow of the program is determined by events—i.e., sensor outputs or user actions (mouse clicks, key presses) or messages from other programs or threads. Event-driven programming can also be defined as an application architecture technique in which the application has a main loop which is clearly divided down to two sections: the first is event selection (or event detection), and the second is event handling. In embedded systems the same may be achieved using interru...
 
that is a completely different term
 
3:36 AM
@tereško well I didn't know you were gonna read about horse racing :p
 
 
5 hours later…
8:45 AM
Does anyone know how to solve the XML declaration allowed only at the start of the document error?
 
@Evan this sounds familiar even tho PHP is not my forte
hit me with an error message
 
You've heard of it?
I'm just trying to get my jqGrid example to work, honestly.
 
It sounds like you're sending more data besides the XML declaration at the beginning of your response.
Hence my "hit me with an error message"
Not "Evan's interpretation of the error message" but "the actual error text"
and when you paste it here press ctrl+k before enter
 
That was the EXACT error message
Invalid Markup: XML declaration allowed only at the start of the document
It's not a big deal, I'm going to use jSon rather than the xml version of jGrid
 
Guys, is there a way to make a database column immutable in MySQL? I know this is rather database-ish and not belongs here
But from what I have learned database consistency should be enforced by the database as much as possible rather than the program using it
 
8:56 AM
post a Q with some detail of what you've tried.
@Evan I was hoping there was something on there about a line #
 
@jcolebrand I don't even know where to start... Maybe a trigger that compares the old and the new value, and if it changes, deny the transaction
 
@Evan it definitely sounds like something in the PHP is echoing or writing or outputting or whatever, before the XML runs
 
Because forcing consistency in the DB is always better
 
Is the XML being generated from its own file?
@sinni800 Ok, so go post a Q with what you know and what you've tried. I'll get someone to be nice and help you out. Just give me the Q after you've posted it.
 
@jcolebrand Awesome, thanks!
 
8:59 AM
And you'll have the +100 association bonus, so you can jump into here directly:

 The Heap™ – Consultancy ©®

General on- and off-site discussion for dba.stackexchange.com....
(actually, if you just have a chat.se acct you can go ahead over there and ask)
 
9:13 AM
@Evan did you figure out if anything was injecting before the XML decl?
 
@jcolebrand I love that +100 rep bonus when associating an account
 
Aye, tis nice
now, not to be too ugly, but I'm gonna dig back into my code
 
That question is stupid..
 
@sinni800 It makes sense though...
...after you forget like 99% of whatever you know about computers :D
 
@ChristianSciberras Hahaha
@ChristianSciberras But seriously though. Wouldn't a long lived call make the job? Have the call run in an iframe and run indefinitely. Then with Ajax you change a server side resource which is checked by said call... For example a file (works until you get 20 requests per second :D)
 
@sinni800 Delphi's interweb server thingy worked like this.
 
@ChristianSciberras Huh?
 
10:26 AM
When you did a button.onclick = function(){} it got executed server side.
 
@ChristianSciberras ASP.NET works like this too. At least using Webforms
 
it bridged client side / server side concepts nicely.
@sinni800 Wouldn't be surprised.
 
@ChristianSciberras You can attach any form element to server side events and the ASP.NET system will take care of the JS and HTML needed for it
 
Some time, I'll play around with it in some more depth :)
 
@ChristianSciberras It's pretty easy to use, I like it.
But as soon as you are trying to bend the system, you have stress
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Button"></asp:Button> Will for example run the function Button1_Click with the parameters object Sender, System.(...).ButtonEventArgs
I don't remember what the ButtonEventArgs class was called
 
11:16 AM
Morning guys
I have a problem. I have persons date in format yy-mm-dd and age limits. For example person must be from ageA to ageB. Could anyone suggest how to validate that? ageA and ageB are integer numbers. For example ageA = 24 and ageB = 70.
 
@Eugene The persons birthdate is what you have?
@Eugene


<?php
	$ageA = 24;
	$ageB = 70;
	$Date = new DateTime("1974-02-02");
	$Interval = $Date->diff(new DateTime());
	if ($Interval->y > 24 && $Interval->y < 70) {
		echo "true";
	} else {
		echo "false";
	}
?>
This should only count full years of life...
 
@sinni800 +1
 
@Gordon Ah, so I was correct :)
Wait, I specified the age bracket in variables but didn't use them, haha
 
@sinni800 well, yeah and you could use a ternary instead of the if/else but the point got across
 
11:32 AM
@Gordon Right :)
 
@sinni800 you could also use filter_validate_int with min/max options and pass $Interval->y to it
 
@Gordon How would that look?
 
@sinni800 ugly
 
@Gordon O~kay.
Goddamnit, I should stop editing things so much and pinging people
 
@sinni800 If it only wouldn't depend on version of php :(
 
12:27 PM
@sinni800 Is there any other solution?
 
Good Morning
 
@ircmaxell Good day
 
How's it going?
 
12:44 PM
Not to good.
 
that's not good
 
Yes it is.
I earlier described my problem, but I was provided with solution only for PHP 5.3.
Tryed to make my own, but it also failed
 
5.2 is not supported anymore
 
howdy people ! I just came back from #AWStour-india and I am amazed ! I wonder if any PHP devs in this chat room have any experience of AWS
 
Hey im new to the chat rooms here, HI
 
12:54 PM
@ircmaxell I see, but still on server on which I develop there is 5.2 at the moment and there is need to make a large control over all modules before moving to 5.3 or higher. So at the moment I can't use it. But maybe this problem can still be solved in 5.2?
 
1:04 PM
Has anyone here been able to create a class to send emails with attachments before or used a lib successfully ?
 
do you have a time to write your own classes for it ?
 
@StephenWolfe Pear Mail
 
I looked at that and swift mail
 
hey @tereško , @ircmaxell !
 
yay
 
1:07 PM
when i tried to use it my browser gave me some wired error reports
 
sorry I had to live yesterday, though I had real good discussion with you :)
 
Sup
 
Sid
Hi guys, how do I use str_replace to replace double quotes in a string?
 
amazed by AWS , and also thinking about how to write applications for Cloud infrastructure
@Sid : str_replace('"', '', $string) ? use single quotes around double quotes :)
 
Sid
@Sudhi sudhi awesome, thanks!
 
1:12 PM
@Sid : your welcome :)
/me Yay! my first help on SO !
you're* welcome , geesh, embarrassing typo!
any recommendation for SOAP/RESTful API design/coding/howto ? As usual, beginner level here, NULL knowledge about RPC and stuff (yes, I read the wiki so I know the buzzwords). I will be deploying my code over an API so I might as well learn about them
 
Hi everyone
 
hello Robik, Stephen !
 
1:28 PM
Morning
 
does anyone now how to make a input button in html open a new window rather than the same on
what i have atm is...
 
Hi @edorian, @Sudhi, @StephenWolfe
 
<input name="product_forms" type="button" value="Email" onClick="location.href='sample.php'" />
 
Sometimes i think I'm having to much fun playing with mock objects
0
Q: Phpunit - mocking SoapFault->getMessage()

AineI'm connecting to a third party service using SOAP. This service will return SoapFaults some times. Because this is expected, I want to test this, by mocking the SoapFaults. There are five standard SoapFaults it will return. Here is the start of a real SoapFault: object(SoapFault)#7 (11) { ["...

 
lol whats that
soap?
 
1:31 PM
@StephenWolfe onclick="window.open(
If you really want to do that for some reason
 
@edorian why wouldnt i? i have a form and i want a button to open a new page for sending an email
 
@edorian lol
 
Awesome it works, (i tried that code before, and forgot the '' so assumed it didn't work) cheers
 
popups of any kind are usually not that nice to work with? I don't really care but usually this is done with div overlays today (google will through enough 'omg don't use popups' at you in case you want to read up on it)
You're welcome :)
 
Its just for a local database thing im working on, not for google or SEO
can a div overlay run script?
lol googled Div Overlay Tutorial and all it comes up with are myspace tutorials fml
 
1:40 PM
I was referring to something like this javascripttoolbox.com/lib/popup/example.php
Except pretty ;)
 
:-D
 
there nice,
im creating myself a little crm, nothing special just wanted to see what i could get it todo
been having issues trying to work out how to get swift mailer or pearmail to work though :(
anyone like dubstep?
 
2:01 PM
What do you think about following API?
$path = 'http://sstatic.net/stackoverflow/img/logo.png';

$rect = new Rectangle();
$rect->setSize  (new Area(50, 70))
     ->setColor (new Color('0000FF85'))
     ->fill     (true);

$img = new Image();
$img->load   ($path)
    ->draw   ($rect)
    ->render ('png');
Code is kinda chaotic I guess.
 
does anyone here use MVC?
 
hi
 
Hi @NikiC
 
hi @Robik
 
Dose any one no why nice forms dosnt work with grid 960?
 
2:24 PM
@StephenWolfe no , we use Model2 MVC
@StephenWolfe maybe because gs960 is crap
 
2:35 PM
do you use ur own framework?
 
not yet .. though i have been trying to write one for almost a year
 
I need to lean more fast!
i still code my views in with my php :(
 
what ? that sentence did not make any sense
 
d.w
what i ment is, i need to start using mvc as when i write code all the views and script is in the same file
 
then maybe you should start by learning more about OOP in general
@StephenWolfe , maybe this list could be useful : google.com/bookmarks/…
i am not sure who made it , but it was one of the php channels regulars
 
2:44 PM
@StephenWolfe Start by separating the View from everything else. The distinction between Model and Controller is very vague and nobody really knows what to put where, so just don't make that distinction. Only separate View <-> everything else
 
oh .. and this link might be useful too : codeangel.org/articles/simple-php-template-engine.html
 
I will give this a bit of a read later
think its going to be a long road till i bring my self up to scatch
scratch
 
2:57 PM
Hell, why can't we allow xmlhttprequests to go crossdomain..
 
3:09 PM
did i miss something? is it worth scrolling up?
 
Not really
 
@Gordon Well I missed something, Eugene said something... Well too bad for him, needing to use 5.2
 
Everybody who ever mentored in GCI please say hey.
 
3:29 PM
"your xml isn't valid because there is no dtd", "xml doesn't need a dtd but there is shema at...", "NO! If i call DomDocument::validate(); on it it tells me that there isn't a dtd!"
 
link?
 
Quick question: Should text coordinates be passed to write function or they should be in Text class?
$txt = new Text(...);
$txt->setPosition(new Point(..));
$img->write($txt);

// or
$img->write($txt, new Point(..))
 
@edorian lol
 
"Call to undefined function imap_open()"
does this mean imap isnt enabled for my webhost?
 
@Nadal yes
 
3:45 PM
any idea where I should look for in phpinfo for IMAP settings?
because I see no IMAP setting in phpinfo
 
@Nadal look in php.ini and enable the extension directive
 
@Nadal ;extension=php_imap.dll something like that
 
Trivia Time!!!
namespace Foo;
include 'someclass.php';
class TestClass extends \SomeClass
{
    public function TestClass() {
        echo __CLASS__;
    }
}
new TestClass;
class SomeClass
{
    public function SomeClass() {
        echo __CLASS__;
    }
}
what is the result of new TestClass;?
in PHP > 5.3.3
 
Some error as class named constructors are deprecated, right?
 
@Willempie wrong.
 
3:58 PM
\Foo\TestClass ?
 
Does anyone know of dreamweaver cs5 has the ability to indent code correctly?
 
@Sudhi wrong, too.
 
Wait for me!
I guess it will be Foo\SomeClass
 
As of PHP 5.3.3, methods with the same name as the last element of a namespaced class name will no longer be treated as constructor. This change doesn't affect non-namespaced classes. so: no output?
 
@Robik wrong, too
@NikiC @edorian you want to guess, too?
 
4:01 PM
One more chance!
TestClass ?
 
Nothing I'd assume, or maybe "SomeClass" because it wouldn't be funny it was was just nothing
 
@edorian go for maybe ;)
 
SomeClass
 
it will be SomeClass indeed
 
oops
 
4:03 PM
pretty fubar :)
 
but I don't understand why, TestClass() didn't call its parent ctor ! ?
 
Aww
There's no parent::__construct()
 
Well TestClass does not have a constructor
 
@Sudhi look at what @Willempie said. its a quote from the manual
 
Is your sample cheating gordon?
 
4:05 PM
No constructor present in class: so it calls the parent constructor instead if it exists?
 
Is SomeClass in another non namespaced file?
Then it would make perfect sense, else i don't really get it
 
@edorian yes, as implied by include 'someclass.php' on top
 
huh what are you people taking about?
 
Well then it's not all that fubar imho. The extending class has no construct so the parent classes constrcut is called by default
 
but wait a minute, when you say new TestClass; you are implying to create an object from class TestClass , now I don't know about methods with same name as class names, but in my book, that means calling ctor of TestClass ... this is confusing :(
 
4:08 PM
yes in non namespaced code
 
@Sudhi classes inside namespaces can only have __construct as a constructor not a function named as the class
 
As to why "As of PHP 5.3.3, methods with the same name as the last element of a namespaced class name will no longer be treated as constructor. This change doesn't affect non-namespaced classes. " was implemented, can't think of a reason, any guesses?
 
if the class is in a namespace legacy constructors aren't interpreted anymore ;)
 
@Willempie : to maintain compatibility with non-namespaced codebase
 
Which was the right way to go about things btw (imho )
 
4:08 PM
@edorian its fubar when you have to write a filteriterator for it ;)
 
I don't really get the fubar about it
It's perfectly expected behavior imho
 
@edorian : ohhk wait, so public function TestClass() isn't the ctor of TestClass so PHP says how the heck am I going to instantiate this object ? and then goes on to look at its parent class and calls it's ctor ?
 
@NikiC that depends on the perspective I guess. When we remove old style ctors from namespaced classes then why do we allow calling the old style ctors in non namespaced parents?
 
@Gordon But ->getDeclaringClass()->inNamespace() should still work shouldn't it?
 
@NikiC I understand the behavior technically but not the reasoning in that combination
@edorian sorry?
 
4:12 PM
@Gordon The parent constructor is called, not the parent legacy constructor. That the parent constructor is a legacy constructor is just incidentally so.
 
Yeah. "Class has no construct, if the class has a parent check if parent class has construct and call that. Repeat until out of parent classes then use empty default construction"
 
@edorian thanks for the explanation
so if I don't declare `__construct()` then I better be ready for my parents to get a call :D
 
but when we say a namespace class may not have the legacy ctor, why do we allow it to have a legacy ctor through inheritance?
 
because the class you inherited from is not in a namespace
and inheritance isn't compiler assisted copy and paste like traits are
 
and you can inherit from old codebase not declared in a namespace
 
4:17 PM
@edorian thats the technical explanation only
 
Thats the logical explanation too
If i write new code in namespaces i don't expect my old non namespaced base classes differently all of a sudden
 
Shouldn't the manual indicate then that it applies only to custom namespaces, as everything else is in the global namespace?
 
@Gordon A::A() and A::__construct() are both A->constructor. Why should they be treated differently?
 
@NikiC because someone decided A:A() shouldnt work anymore when A is in a namespace
 
Yes, B\A::A() is != B\A::__construct(). But why would that change the behavior of \A?
 
4:22 PM
thinking
 
@Gordon lurking
 
@NikiC basically because someone decided some methods behave different when in a namespaced class. in other words namespaced class change the semantics of some methods. if we say b\A behaves as \A then the old style ctor has to be called to ensure that b\A still behaves like \A but when we say namespaced classes dont follow the semantics of old style ctors, then \A:A might be considered a method under that new semantic
so the question is should the implementation of namespaced classes also apply to non-namespaced classes it inherits.
mhmm. i guess it shouldnt. or should it?
 
I really wish we could stop writing \Foo\A::A(), I would like my error_reporting to throw things at me if I accidentally do something like that. However, I might come across this situation when I am refactoring my old codebase to use namespaces. And in this case, this situation/tweak/feature of PHP would be really helpful
 
could anyone follow me at all? Oo
 
I can follow you but I just don't agree :)
 
4:32 PM
@NikiC im not sure I agree to myself :)
 
@Godron I still don't understand why legacy constructors can't function in namespaces, I don't see how they can disrupt non-namespaced functionality.
 
@Gordon : aye !
@Willempie , when you do something like $foo = \my\name\foo(); you expect a function foo() to be called from namespace \my\name;, but if we allow legacy ctors then $foo might be an object instantiated from class foo !
 
@Sudhi Not really
 
@Gordon I don't follow and i think i disagree but I'm not sure as i don't follow
 
It's just that legacy constructors are .. well .. legacy. So they aren't allowed anymore in new code. People that use namespaces don't use legacy constructors anyway
 
4:36 PM
@NikiC errm? you want me to stick a new in a hypothetical example ?
 
It doesn't really matter and it's the best way of going about things 4 => 5.3 (which still happens for codebases)
 
of course you want to discourage legacy behavior, but that doesn't stop people from using it :P
 
Another argument is that Legacy constructors have the same name as the class. As with A\B the class name is actually A\B (not B, that would only be the "shortname" or "local name") the constructor would need to be A\B::A\B which is not possible.
 
@NikiC Gimme namespaces methods
 
If they wanted people to stop using legacy constructors, why didn't they then just simple deprecate the method in 5.3 altogether? And @NikiC then why is this only applied to the last element of the namespace chain?
 
4:39 PM
Given the average amount of methods a php class that :)
They are deprecated in 5.2 and 5.3
raising E_STRICT (iirc)
 
@edorian exactly
 
aren't all methods have namespace appended to them ? so would defining B::B() in namespace \A would be actually mean that you are defining \A\B::A\B() ?
 
@Sudhi no... methods ain namespaced
 
hmm, got it now, methods are different from functions
brb, dinner time
 
hm just noticed that I wasn't using most of the git integration in PhpStorm
 
4:46 PM
I love the rebasing support
 
it has?
I just discovered the convenient branching support in the bottom toolbar
Will need into their Git integration more seriously
Because I have always used the command line til now
 
Thanks for the discussion. Makes sense now. HF guys off to UG
 
UG?
 
UserGroup
 
ah
 

« first day (404 days earlier)      last day (4544 days later) »