« first day (954 days earlier)      last day (4216 days later) » 

16:20
stupid PHP. Y U NO LET ME DO (new Foo)()
yiz
yiz
But it's PHP, that's why >_<
@Gordon Via __invoke()?
@Bracketworks that's what it's supposed to do
stupid PHP. Y U NO LET ME DO ['foo' => function ($arg) { var_dump($arg); }]['foo']('bar');
@Bracketworks huh? how would that work?
16:23
@Bracketworks that's understandable. PHP thinks you want add a subarray foo instead of accessing foo to call the lambda
@Gordon What? Really? I don't think so, 5.5 was fixed for the array dereferencing, but it still borks on the call.
@Ocramius 1) Create array. 2) Dereference array. 3) Call result.
@Gordon 3v4l.org/3KnpI takes a poop, but 3v4l.org/3Bug8 works.
Hi can some one help me out please?
@Bracketworks hmm. true
3v4l.org/GXY4V takes a poop too, trying to explicitly call __invoke()
Basically, any dereferencing/calling token after the array-dereference takes a poop.
ermmmm
I have a question, my cache lite setup is throwing an error on every run
ive been thru my code and it seems fine to me.
but its still giving an error Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Cache\Lite.php on line 549
16:30
20
A: Error message Strict standards: Non-static method should not be called statically in php

GordonYour methods are missing the static keyword. Change function getInstanceByName($name=''){ to public static function getInstanceByName($name=''){ if you want to call them statically. Note that static methods (and Singletons) are death to testability. Also note that you are doing way too m...

This is beyond my knowledge of php and i really need some help
thats just it I never call the function raiseError()
In summary; stupid PHP, Y U ALWAYS TAKE POOP ON OPERATOR
Lol
:D
@Bracketworks it's a POOPERATOR!!1
funny
but really though
does anyone know why cachelite would be unable to do file operations to run the cache
because i think thats what is causing the funciton to be caused in the first palce
*place
16:33
@Hanut there is two ways to fix it: 1. either make the call to PEAR::raiseError() non-static, e.g. make it call $instance->raiseError or 2. make the method a static method, e.g. make it public static function raiseError()
lol, PHP doesn't have NOOPs; it POOPs.
hmmlet me get back to you on that
function raiseError($msg, $code)
{
include_once('PEAR.php');
return PEAR::raiseError($msg, $code, $this->_pearErrorMode);
}
that seems correct right?
@Hanut Yes, but the calling code is invoking it statically.
PHP...Y U NO PLAY FAIR
hmmm
trueee
@Hanut depends on how you call it. If you call that raiseError statically, then $this does not exist
16:37
$this is never used since the package is calling it in a static context
public static function raiseError($msg, $code)
{
    include_once('PEAR.php');
    return PEAR::raiseError($msg, $code, $this->_pearErrorMode);
}
but that is still borked because like I said, $this does not exist then. so whatever calls this raiseError method should use -> instead of ::
But then you lose the context of $this->_pearErrorMode, which will then need to be injected somehow.
Yea.
borked
:P
well thanks il go bang my head against a wall for a while now. Cheers
16:38
@Hanut you need to find out what calls raiseError there
ps if you wana know what my problem is here --> stackoverflow.com/questions/16770681/…
its mucked my entire project
@Hanut closed with the dupe I gave you. also have a look at stackoverflow.com/q/3737139 for the various meanings and differences of :: and ->
in particular
16
Q: What's the difference between :: (double colon) and -> (arrow) in PHP?

JoeThere are two distinct ways to access methods in PHP, but what's the difference? $response->setParameter('foo', 'bar'); and sfConfig::set('foo', 'bar'); I'm assuming -> (dash with greater than sign or chevron) is used for functions for variables, and :: (double colons) is used for functions...

Evening
evenin'
Anonymous
17:01
evening
mornin'
Anonymous
morning
good afterevenight.
is there any error in the following code
Anonymous
no @Cody
17:03
<?php

if(isset($_SESSION['firstName']) )
{
echo $_SESSION['firstName'] ;
}

else
{
session_start();
$_SESSION['firstName'] = "John";
}

?>
What ?
Anonymous
I don't see errors
Anonymous
What are ya gettin?
@Cody You didn;t start the session
@PeeHaa i set i else part
@Cody And what is above that?
a..... session!
17:05
@Cody session_id() (unless you're running 5.4+) to determine whether a session is started.
It'll return either the session ID, or an empty string if one is not set (no session)
@Gordon : Its not a duplicate really. I dont think you understood what I was asking. And I do understand the difference between the -> and :: operators. The problem is that its giving me that error even though $this is instantiated.
The call to the raiseError functions is made internally by the object itself
if (!session_id()) {
    session_start();
}
if (isset($_SESSION['firstName'])) {
    // do all the things
}
@Bracketwork I know session stated it is actually showing a cookie named PHPSESSID
Anonymous
Tell us what the error is then
Anonymous
Or what you want to do
17:08
me or cody?
@php Noob first else part executed i started a session and set ' firstName' to "John" then now session is set now ( as i expect ) if should execute now , but that's not happening
Anonymous
@Hanut at cody
Anyone else having problems with command-line switches w/ Chrome 27?
okay im trying to work with caching
and im using the cache_lite extension to pear
but when i create my cache object
What is the general consensus on Ruby? And what would be the general consensus on Ruby if it were C-family-syntaxed, optionally-typed, and closed-classed to make it significantly more similar to PHP?
17:11
and try to write a file to cache it throws that error
@PeeHaa埽 I ain't talkin' Rails.
oooowwww sorry :)
@Bracketworks If Ruby would be all that I would stay with PHP
lol Let me reiterate: What is the general consensus on Ruby (read: RUBY dammit, did anyone see Rails in there? No? Me neither.)
anything at all would be helpful..any light that could be shed
17:13
@Hanut then you need to fix that call, either by making the method static or by making the call non-static. That's pretty much a dupe of that. On a side note, PEAR packages are notorious for errors like that. Most of the packages are PHP4 code.
brb foods
Anonymous
<?php
session_start();
if(isset($_SESSION['firstName']) )
{  echo $_SESSION['firstName'] ; }
else  { $_SESSION['firstName'] = "John"; }
@PeeHaa埽 Any particular reason?
@Gordon Did you read the code I had posted?
@gordon ah well dang my life.thanks so its not really a dupe is it. Cache_lite has a bug !
@Hanut it is a dupe. it explains what your error message means and how to fix it
17:16
Reason I ask is: I'm toying with a highly OO, message-passing, optionally-typed, C-family-syntax language. Putting the mess together in via C# .NET, but I'll port to Mono when possible.
Anonymous
@Cody you'r welcome
@php noob What you mean ?
@Hanut "Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Cache\Lite.php on line 549" means function raiseError is called with :: instead of -> and the only way to fix that is either by calling it with -> or by making the method static. But I explained that already.
Anonymous
ARGH, check the code above @Cody
hmmm kay lemme see if changing lite .php fixes it.
17:19
@Gordon I hate seeing these errors. Sadly I see them all the time.
@phpnoob yeah i works but what is the problem with my code and also see this <?php

if( !session_id() )
{
session_start();
$_SESSION['firstName'] = "firstName";
}

else
{
var_dump( $_SESSION['firstName'] );
}

?>
@cspray to be expected with PEAR packages. Most of these were written before E_STRICT existed.
monday is the day where wierd customer get out of the box
Okay quick question: @gordon...should i bug my host to install apc
they dont support it currently
@Gordon Yea, I know it is expected but its still pretty frustrating to work with
Anonymous
17:21
@Cody session_start() must be always placed at the top of the script, if not the page.
@Cody until you do session_start() the $_SESSION variable is inacessible to your script
it will check to see if a current session exists and if it doesnt it will create a new one..check for a value in $_SESSION that is set by your session handling mechanism to validate your session
@Gordon : My hero ? :D
@Hanut depends on what you want to do with it
@gordon any documentation to that?
17:25
Oh, well that's just fabulous.
@phpnoob in php.net they said sesssion should call session_start() before ouputting anything to browser . I did it exactly . Then What's problem ??
certain elements on my site require a lot of db calls but dont need to be updated that often. maybe once a day or once every two days
The custom job I'm working on spews SQL into user-world; has been for years.
Anonymous
@Cody NO, you did exactly the opposite
@Cody You are calling session_start() after session_id();
Anonymous
17:26
session_start() must be declared before outputting ANYTHING
Anonymous
Anything means, simple anything
$cachedFoo = new Cached(new Foo, '/path/to/cache/dir');
$cachedFoo->defineCachingForMethod('bar', 60);
echo $cachedFoo->bar(); // will return cached value for 60 seconds
Anonymous
even <p> tag
session_start()
if(!session_id()){
//add something to the session
}
else{
//do something
}
Anonymous
even <html>
17:27
@gordon method caching?
Anonymous
@Cody do you understand now? session_start() must be declared even before the <html> tag
@phpnoob Above BracketWorks post this
if (!session_id()) {
session_start();
}
if (isset($_SESSION['firstName'])) {
// do all the things
}
@Hanut yes, it's a Decorator pattern
Then it should be Wrong
Anonymous
that is because you are not outputting anything before session_start()
Anonymous
17:29
check it.
Anonymous
Does it output anything?
@Cody Yes, you can use session_id() to determine whether a session has been started or not. In this case, if it weren't, it would call session_start() thus starting the session. After which, a session should always be started, either already, or in that preceding snippet.
Anonymous
if (!session_id()) {
echo 'I am outputting something before session_start()';
session_start();

}
if (isset($_SESSION['firstName'])) {
// do all the things
}
Anonymous
@Cody check the above
I think the problem is that we're not understanding what you're not understanding @Cody.
Anonymous
17:32
I never understand any questions about programming. Mostly, I just improvise.
Nothing like a little ad-lib programming, followed by soft-shoe debugging.
@Gordon oh ive never heard of that -_-
Well now i gotta learn about that
I don't really feel the need to learn about yet another language in the field. Even though there are some things PHP can learn from Ruby I would rather have PHP fixed
Anonymous
weird, mysql is both the easiest and hardest language to learn.
damn my browser is damn slow
Anybody uses tampermonkey in combination with chrome canary?
Anonymous
17:35
@PeeHaa埽 how many languages do you know?
@PeeHaa埽 Likewise, oh likewise.
But sometimes it feels like I'd be more ambitious to wait for the sun to implode.
@Bracketworks ;-)
@PeeHaa埽 jQuery is so easy and fun to learn :P
@PeeHaa埽 In the interim, I'll just try to make my own language ;)
@Hanut if you want to fix your PEAR package, try to change pear.php.net/package/PEAR/docs/1.9.4/__filesource/… to a static method
17:36
@phpNoOb A couple I know and a couple i kinda know how to find my way and a couple I want to learn
@Bracketworks Ya I've a book which says make your own lang
@Mr.Alien I've been through a half-dozen books on compiler theory, parsing, etc.
I'll just take a crack at it; I know what I want it to do, it's just a matter of making it work.
@gordon k lemme check
@Bracketworks This one is short, so what's going to be unique in your lang
nope
now it giving me a list of errors
17:38
@Mr.Alien It'll work?
ive broken php
:D
XD
@Hanut PEAR :)
@gordon could you just give me a primer on how to use your cache version ?
im starting to dislike the damn fruit
17:39
@Bracketworks LOL, that's not enuf
13 mins ago, by Gordon
$cachedFoo = new Cached(new Foo, '/path/to/cache/dir');
$cachedFoo->defineCachingForMethod('bar', 60);
echo $cachedFoo->bar(); // will return cached value for 60 seconds
is really all it takes. It's a very simple cache.
Really though; @Mr.Alien, I feel the C-family syntax is powerful; I'd like to see better support for OO, such as in primitives; method/operator overloading for DDLs; optional-typing, implicitly to object
so let me get this say i have a function within a class and i want to cache its output
17:41
@Hanut "function within a class" is a method
@Bracketworks Basically what will you target? Web, offline? cloud, what?
sorry...method
@Mr.Alien Well, initially I'd like to make it work as a general purpose scripting language, but eventually web.
so does the caching code go within the method definition or outside where the method is called?
Server - Client? Cuz we've got a lot of stuff out there, microsoft releases new shit every year
17:43
@Mr.Alien Sorry, I thought that was implicit ;) Server. Not touching client.
@Bracketworks Basically that and perhaps better performance
@PeeHaa埽 Well, I don't know how well my attempts will fare as far as performance, however I will be able to define a language spec from a prototype.
@Hanut what do you mean by caching code? The caching code is in the Decorator. The configuration is outside.
I really like alot of what Ruby has to offer; but frankly, and I know it's shallow, I don't like the syntactic conventions.
Moreover, the open-class concept is one of those things where you go "Whoah! Whoah?"
@Gordon Where am I supposed to call this? Because normally I would check to see if the cache has expired within the function being cached and then would either return the cached page/block or cache the newly generated page and show it.
17:47
And finally, lack of any parameter-typing; completely duck with respond_to
@Bracketworks Aaaa, hope it gets better than PHP
Aaaaaaaaaaand incoming google glass questions...
@Mr.Alien Maybe one day :)
@Bracketworks All the best :)
Well, once I hit a point where I have the framework laid, I'll push it to github for all to see, help, and disembowel.
17:58
@Hanut normally you define the caching for methods in your bootstrap
precisely but my client has explicitly asked me to not use MVC for whatever godforsaken reason she has
so no bootstrap
huh?
wat!?>
no separation
@Hanut you can have a bootstrap even when not doing MVC
no mvc means no bootstrap now? :P
18:00
really how?
What do you think bootstrap means?
:O
the init code ontop of which the rest of the code runs?
exactly
And what does that have to do with mvc?
okay
@Hanut the simplest would be to put include '/path/to/bootstrap.php' on top of your scripts
18:01
doesnt that fit into the primarcy view controller
From our good friend Wikipedia (for completeness)
It just a single entry point for your application where you setup shit required for your application
> Bootstrapping, any process where a simple system activates a more complicated system, used in computing, linguistics, physics, biology, electronics, statistics, finance, etc.
oooo
dang true
wait wait wait :D first time i have people who actually know what they are doing helping me out. Please gimme time to work with everything you are feeding in here
:D
What else did you expect? It's room 11 a.k.a. the greatest room on SO ;)
18:03
> Please gimme time to work with everything you are feeding in here
you sure you are from India? usually they just say "sir, it's urgent"
lol
damnit somebody has gotten to an xpath question before me
@PeeHaa埽 Was it the Saxon dude?
He's got a mean stache'
is php.net down ??
davmos, London, United Kingdom
1.5k 3 8
Ne'er mind.
18:06
@Cody works for me. Try a mirror nl.php.net
heh, I just discovered a bug in the Cache
@Gordon y2k13 bug ? :)
@Gordon Pardon me "sir" but not everyone fits a stereotype :D
yes normal folk exist everywhere
@PeeHaa埽 there is something wrong with the detection of when the cache is stale. it won't cache when there is a stale cache file. hmmmpf.
@Hanut that gives me hope. you may come more often then ;)
That and i have been MUDding for years...sooooo it kind of wears off on you
@Gordon :)
18:13
@Hanut Aye, I used to MUD; Clandestine & Medievia
Grade 10 computers project, we wrote one in Java; was effin' sweet.
Hehehe
Yeah i worked as a builder
Loved it
My parents were convinced I was becoming a terrorist when they saw me starting at a text filled screen muttering under my breath and then going "MUHAHAHAHAHAHAH"
GOdwars
offtopic sorry
since i am offtopic i make music too :D
@Hanut soundcloud link?
hanutsingh on soundcloud
thats got the newer music
oh no wait soundcloud has em too
ive been coding more than producing of late
thats the link
i really hope im not bothering you with my babble
@Hanut I like the dubstepifsomething one
ooo..really? that was pretty lights vs skrilly vs krewella
while i was high
:P
ahem
18:22
:)
but thank you all the same
okay i figured out what was wrong
@gordon
my call to the cache function is sending it a path that it cant access
FACEPALM
yeah @Gordon it should really throw an exception or something like that (if it doesn't already do that, not sure anympore)
eih, yeah, need to fix it. dont have time for it now. need to prepare dinner. if you find what's wrong with it, send a pull request please. laters
laters @Gordon
enjoy
:D
Later :D
whatcha eating?
im stuck with indian food XD
18:31
I'm stuck with dutch food... wanna trade?
@Hanut just as a side note. the Cache decorator has no unit-tests so if you need this for a real client product, you probably want to switch to something else then. ZF has a caching component. Doctrine has one, too. And I am sure you'll find more recommendations when asking in here.
bbiab
@gordon Im sticking with my own custom cache for now. Will look up zend cache .THanks for all your help :)
@peehaa I dunno about dutch food but your womensssss D
il trade you any day of the week
im 6'4
the females here at 5 6
:(
@peehaa n00b question : if i have to get the path of one folder level above the folder my current pgp file is in, how do i do that?
Anonymous
Ajax http request not working in IE8, and there is No-Way to debug it
18:43
use alerts
and stop supportng ie8
@Hanut /thefolder/../
dont encourage them
ty :)
@phpNoOb Inspect the request using chromes developers tool -> network tab
@Hanut np
Anonymous
@PeeHaa埽 It works in Chrome, and FF
Anonymous
but not in IE
Anonymous
18:45
hmm.. I think we need internet explorer uprising or something
@phpNoOb are you using jquery ajax or normal javascript?
@phpNoOb Or you using console.log without having the console open by any chance?
coz with normal js you have to define the xmlhttpobject differently
for ie
Anonymous
@Hanut No jQuery, just plain Js. @PeeHaa埽 I am using console.log no errors are showing up, (in chrome's console, and FF'f firebug)
@phpNoOb so you have defined it for all browser types?
Anonymous
18:48
Yes.
@phpNoOb 1. what does your code look like 2. when you use console you have to make sure there actually is a console attached
Which in IE means making sure the console is open
Anonymous
The only console I know, of how to open in IE is through f12
Anonymous
@PeeHaa埽 and I did that.
Anonymous
Isn't there any firebug-like plugin for IE
yes it's called f12
meaning no. nobody is going to write activex crap for fun
debugbar tried and failed
Anonymous
18:51
the UI sucks . on a side nore, php.net seems to be down.
IE == Fayul
yes it is
ive been trying with no success
45 mins ago, by PeeHaa 埽
@Cody works for me. Try a mirror nl.php.net
hence my incessant banter on SO
@PeeHaa埽 yep that works ...and yep your directory thingy worked as well :D
any freeware tool to test why one version of my code is running slow on my localhost while an almost exactly same copy is running 200% faster? on local host ??? :(
18:54
microtime(true); is free :D
Also xdebug
Anonymous
YAY xdebug
hehe
okay folks.its late and im tired.I have to work on something a bit easier. Android time :)
cya
catch u lata
Anonymous
later

« first day (954 days earlier)      last day (4216 days later) »