logs archiveIRC Archive / Freenode / #php / 2015 / August / 2 / 1
teresko
hi everyones
so, I am working on this HTTP abstration thing as a deoendency for something else
does this API make sense? http://pastie.org/10324511
sorabji
what's your motivation for rolling your own here?
what's the something else
teresko
are routing system
I am kinda sick an tired of routers that also act as dispatchers
jj15
teresko: You using this? https://github.com/fracture/http/blob/master/src/Fracture/Http/RequestBuilder.php">https://github.com/fracture/http/blob/master/src/Fracture/Http/RequestBuilder.php
teresko
jj15: I am taking a second look at it
whether there is a point in keeping it and if that is a case, how to document it
jj15
Huh?
Are you using this pkg? https://github.com/fracture/http ... and whats the problem you require a solution for?
teresko
I wrote that pkg
I am thinking what to do with it: kill it or document it
jj15
Oooh my bad. Will take a look :)
Distraught
$content = preg_replace('/<div class="dd_post_share">.*/i', '', $content);
$content is a php string with html. I want to remove everything after <div class="dd_post_share">.
is the syntax I wrote correct?
         

sorabji
Distraught: consider using DOM instead of regex to handle html
jj15
Distraught
y sorabji but it's a single line though
teresko
Distraught: http://stackoverflow.com/q/1732348/727208
sorabji
the number of lines don't matter
jj15
teresko: Love that answer.
teresko
ok .. maybe aI need a different approach
doea anyone know a HTTP abstraction lib which has good documenttion?
*does
sorabji
teresko: symfony httpfoundation
teresko
hmm ... lemme see
jj15
teresko: http://laravel.com/api/5.0/Illuminate/Http/Request.html
http://laravel.com/api/5.0/Illuminate/Http.html I meant
teresko
jj15: that's API doc
it's not really what I am looking for
sorabji
laravel uses symfony's lib
teresko
jj15
Doesn't LV use this? https://github.com/illuminate/http
I cant find the docs for it.
DDG gives me awful results.
" The Laravel Illuminate\Http\Request extends the Symfony\Component\HttpFoundation\Request class" so it does.
teresko
fu*k laravel
(oh, the auto-kick bot has been removed some time in past 5 years)
jj15
teresko: Are you looking for examples to implement your own or to use in your own package?
teresko
I am looking for example how to dopcument a package well
*document
jj15
Explain what the package does. Explain how to use it. What requirements it needs. How it solves the problem you're attempting to solve. Be clear. Consise.
voodooKobra
morning
verumequals
evening
         

z4c
How do I get the current app instance in Slim 3?
In Slim 2 you just do \Slim\Slim::getInstance(), but that does not work in S3
sorabji
z4c: can ask in #slimphp or check their docs
CapnKlutch
Can I please get some help?
Why doesn't this work?
droid909
CapnKlutch: yes
CapnKlutch
if($zName . $direction != 'Z1E' || $zName . $direction != 'Z1W')
droid909
CapnKlutch: whats the error
CapnKlutch
But this does - if($zName . $direction == 'Z1E' || $zName . $direction == 'Z1W')
No error
Just doesn't exclude Z1E or Z1W
droid909
CapnKlutch: do codepad.org
CapnKlutch
droid909, not working - http://codepad.org/HqX1D593
droid909, you can run that code on http://phpfiddle.org/
jj15
CapnKlutch: Runs now http://codepad.org/IdSz3KBR
Ah, you repasted.
CapnKlutch
jj15, thanks
But it's still not working
jj15
What's the issue you're having?
CapnKlutch
It shouldn't echo Z1E or Z1W
Can someone please explain why
Dustin|Work
Capn
http://codepad.viper-7.com/E0Zo0O
use AND
nor OR
not*
CapnKlutch
Thank you!
Dustin|Work
no problem
Purefan
Hello
Im having a weird issue, with this code http://pastebin.com/raw.php?i=LRThJign the exception is still thrown and the script stops executing. It doesn't seem to be reaching the catch block
voodooKobra
does it throw a SoapFault or an Exception?
try adding } catch (Exception $e) { var_dump($e); } and see what type it is
Purefan
a SoapFault
Im on it
same thing, it doesnt reach either of the catch blocks :/
I checked and the file is the correct one (added a syntax error on purpose)
sorabji
what happened when you added a syntax error?
Purefan
the script failed, it didnt run. I did it just to make sure that the file I was editing was the one I was running
I dont understand why it isnt catching the exception...
sorabji
can you paste the stacktrace from the log?
Purefan
yes, just a sec
biberu
Purefan: you didn't mean \SoapFault?
Purefan
Hhaaaa....that could be it!
biberu: You were right! I forgot about namespaces scope... Thanks!!
gsiou
is there anything ready i could use to avoid creating my own login/register systems?
Dustin|Work
gsiou, Something like this, https://github.com/PHPAuth/PHPAuth ?
gsiou
Dustin|Work: i think that will do, thanks!
Dustin|Work
No prob
droid909
what is the best way to convert this date 7/30/1973 to 1973-07-30 split? and then check if there 2 or 1 character and add 0 to the one with 1 char?
tw2113
date( 'Y-m-d', strtotime( '7/30/1973' ) );
Dustin|Work
^
droid909
hmm, that easy
thank you
« prev 1 2 3 4 5 6 7 8 9 10 next »