« first day (1054 days earlier)      last day (3885 days later) » 

3:01 PM
@rdlowrey FYI Plugged in Artax as an HTTP Client option in my project, took about 6 minutes and everything just worked :)
 
user895378
@Orangepill Cool, glad to hear it.
 
hey guys, I'm trying to look for all the logs created by one ip
i have this (^87\.126\.233\.83.*?\n) but i need to negate that so i can delete all lines not having that IP
how am i supposed to do that?
i have downloaded the access log in a text file already.. i just need to see the lines with that IP
and delete the lines from all others
 
less complex to match the lines and put them in another file, delete the original file and rename the created one ...
@DaveRandom any suggestions/ideas from you, did you get all the way through without getting bored ?
have I taken briefness too far ?
 
@reikyoushin vpscorner.co.uk, they're not bad
@reikyoushin I do mission critical stuff on my colo's though.
 
one of the cooler parallax sites i've seen: Inception Explained
 
3:08 PM
gotcha! ^((?!87\.126\.233\.83).*\n)
@SweetieBelle do they help you with maintenance stuff or is it unmanaged?
^ oops, it's openvz.. T-T i need a kvm or xen one..
 
m59
3:24 PM
Would you dudes use my answer (array_keys()) or the foreach loop?
0
A: Checking first level of JSON array

m59$data = json_decode(' { "articles": [ {"ID": 5, "NAME": "BIKE"}, {"ID": 6, "NAME": "CAR"} ] }'); $keys = array_keys((array)$data); echo $keys[0]; //displays: articles Here is your data as a valid json (your code is invalid). This typecasted $data as an array so that array_keys() wi...

I wanted to criticize the foreach, but I got to thinking that maybe there's a reason to use that instead?
maybe performance?
 
@reikyoushin Unmanaged, they only do reboots if my panel wont
@reikyoushin Get a dedi.
 
@SweetieBelle is there a cheap one? not kimsufi.. btw
 
@reikyoushin idk, cheap usually = bad
Especially with dedis
 
kimsufi are okay, use em for testing servers sometimes ...
couldn't ask for them to get cheaper ...
they got one for £2 now ... that'd be crap, but not as crap as equivalent vps ...
 
If you just need a dev box, buy a server off ebay and plug it in at home.
If you need a live server, be willing to pay the going rate for one.
I bought a 2x Quad Core Xeon L5410 with 16GB RAM for €180, I just run load tests etc on that on my home line if it's for development use.
 
3:32 PM
For my development I run VM Ware so I have different versions of PHP running to do the tests in
 
Or a Raspberry Pi
if your needs are smaller
 
@JoeWatkins i need a dev server + vpn server at the same time.. could kimsufi handle that? my budget is between 5-10 usd per month only.. (i don't know if any exists haha)
 
Anonymous
> PLEASE HELP ME. I'm 13 years old and nobody can help me.
 
Anonymous
0
Q: Stuck with social networking site

Husnain JavedI'm making a social network like facebook but now I'm stuck so please help me. I want make a expand system like twitter for every status I post and put the thumbnail (avatar) next to every status. I tried putting the thumbnail but when I visit someone else's profile, it shows the other person's a...

 
3:40 PM
@Fabien is there a raspberry pi hosting? or is that just a local dev server? i don't get it. all i see is a chip on all the searches i've done
 
@reikyoushin dev server. it's just a tiny pc. You can buy or make your own case for it.
The Raspberry Pi was created to have an affordable PC solution for undeveloped countries/schools etc.
 
@Fabien but i need it to be connected to the net
 
The Pi is a crazy piece of hardware. It runs off an SD card so you can install a flavour of *unix on it and run a web server... I believe there is a blog somewhere that is hosted by one of them?
 
@reikyoushin there's an ethernet slot on one of the models.
 
@Fabien still that would mean i will have to get a static ip and a good isp for that
 
which is rare here in PH. (stupid ISPs cost too much and is unreliable)
 
@reikyoushin It's better for local testing.
 
not really meant for this sort of thing ...
 
@Fabien for local, i could consider it.. yeah
 
@reikyoushin prolly ...
 
3:44 PM
but ill just setup my other PC as a server instead if i want a local one for testing..
still, i need a live one, and my thoughts were into a vps or cheap dedi
 
@reikyoushin Is this just for you to dev around on?
 
yes, and 2 or 3 more basically.. but not all the time.
 
@reikyoushin Considered the free tier of AWS?
 
@Simon_eQ that's basically "you, 6 month ago"
 
@Fabien not in my list though.. it requires a CC
 
Anonymous
3:49 PM
@tereško lol
 
Anonymous
I wish I was 13 years old, 6 months ago
 
I'm talking about attitude, not the physical age =P
... and now I will get back to reading manhwa
 
Anonymous
I know. And I was just making a wish. I was never that desperate though
 
@tereško Why korean?
 
because that's what I am currently reading
 
Anonymous
3:54 PM
wow
 
user895378
@JoeWatkins Disregard the segfault I mentioned earlier -- user stupidity.
 
user895378
(insert joke about @rdlowrey here)
 
4:14 PM
hi all
 
Anonymous
4:33 PM
what happens if I enable all the libraries in PHP.ini
 
@Simon_eQ im no expert. lmgtfu
hmm
nohting. I'd say it may be a security risk, but thats just a guess. why?
 
Anonymous
just tried it, you get like 100 errors
 
@Simon_eQ hmmm what kind?
 
Anonymous
unable to load library xxx
 
idk. I could guess but I may just confuse you.
the experts seem to be away right now
 
4:44 PM
@Simon_eQ You dont have them compiled, most likely
 
Anonymous
Yea, that was my initial guess.
 
Anonymous
since they error was pretty clear anyway
 
thats what I thought
 
how do I setup git such that I need to supply username and password every time I push?
 
Anonymous
PHP FATAL error: Uncaught exception 'Doctrine_Connection_Mysql_Expception' with message 'SQLSTATE[23000]:Integrity constraint violation: 1062 Duplicate entery 2600074 for backtrace'
 
Anonymous
4:47 PM
Anyone had that problem?
 
@iroegbu Use ssh repo with a password protected private key
 
Anonymous
brb
 
m59
If you store a json in a database, what should it look like when actually stored (like if you view that field in phpmyadmin)?
hmm, nm. I can make an assoc array and json it, store it
 
@m59 Why would you want to store a json in a database?
 
m59
@SweetieBelle I haven't thought of a better way in this case. It's some small configuration stuff that is always accessed as a group - no need for individual manipulation
 
4:49 PM
@m59 How many jsons are you expecting to store in that table?
1 or lots?
 
m59
1 in every row
 
If it were me I'd store the values seperately and create an assoc
 
m59
so, make another table just of configs?
 
The overheads of encoding & decoding json are not negligible
@m59 Yes, or extra cols
 
m59
ohhhhh that won't work, I think.
the content is crazy variable
 
4:50 PM
or serialize a PHP array and store as a blob
Has smaller overheads than dealing with JSON
Sounds like serialize and unserialize are what you're looking for.
 
@SweetieBelle Food for thought, this guy says the opposite: php.net/manual/en/function.serialize.php#92284
 
@ChunkyBaconPlz Now run unserialize and json_decode :P
 
@SweetieBelle yes they are.
at least in relation to any other serialization format
 
@SweetieBelle Just an interesting tidbit. I doubt either take as long as singing 99 buckets of oats
 
@ChunkyBaconPlz :D
 
4:56 PM
@ChunkyBaconPlz it's a claim about speeds without any benchmark results or benchmark code, so it's worthless
 
@Jasper I wasn't vouching for its validity, just wanted to bring it up.
 
@Jasper so are most claims about speed, and so are most benchmarks
 
(of course, @SweetieBelle provided neither of those as well, so her claim is worthless as well)
@ircmaxell I very much agree, but a claim without anything to reproduce it, or even numbers to see the significance of the difference is even more worthless than it could be
 
@ChunkyBaconPlz Serialize is slightly slower to encode but ~40% faster to decode in my experience
 
actually, I consider it just as worthless as ones with code (because they are that bad)
 
4:59 PM
with code, you can at least see if they are bad or not and why so, without code you can't
 
codepoets.co.uk/2011/php-serialization-igbinary Similar results to mine @ChunkyBaconPlz
@Jasper

JSON (json_encode/json_decode):

JSON encoded in 2.18 seconds
JSON decoded in 9.83 seconds
serialized “String” size : 13993

Native PHP :

PHP serialized in 2.91 seconds
PHP unserialized in 6.43 seconds
serialized “String” size : 20769
Though that blog suggests igbinary if you can install extensions.
 
user895378
The only benchmark that matters is the one you run using your code in your representative environment under your representative load conditions. Everything else is just marketing.
 
@Jasper the point is, that in 99.99% of cases, the code is bad, even if it looks good, because it is not your specific use-case
@SweetieBelle they are doing something very different. Especially if there are objects in the serialization
 
@ircmaxell very true
 
@rdlowrey exactly
 
5:05 PM
@ircmaxell I have been thinking about a suggestion for php that I might turn into an RFC someday (if I have the time). Would you mind giving some early feedback?
 
feel free to ask, but I'm pretty much shut that side of my brain off
 
Ah, ok.
Well, this code shows what's different in my suggestion from now:
class A
{
    final private function bla()
    {
        //...
    }
}

class B extends A
{
    private function bla()
    {
        //...
    }
}
now, it generates an error
 
I'm doing a lot of off-by-one errors
where "one" is anywhere between -2 and 2, of course
 
my suggestion would be to just have it work, with the consideration that in any place you can only know of the one "bla" function OR the other
The idea would be to have it only work if the base class function is private and final, whereas the child function can be just about anything
 
@Jasper You must have an error in one of the two places
Either you say "final private" is meaningless and we forbid it
Or you say it is not meaningless, in which case you can't implement it in a child class...
Seeing that people currently use things like private final __construct for singletons, I'd say that people do not consider the "final private" concept as meaningless
As such, I would not change this.
 
5:12 PM
@NikiC The child class function would not override the base class function, but exist alongside it. If the function is called from the case class, the base class version would be called, while in other places it doesn't know about this function so it would (try to) call the child class function
 
Why does the wikipedia page for ASCII say that the data set contains 128 characters when its actually 127?
 
@Jasper So you are saying that the "final private" concept is meaningless, right? That was the other option that I gave
 
The concept exists in other languages (though languages tend to do it somewhat differently from oen another) and the use of the final keyword for it seems like it would be the best way to do this without backwards incompatibility problems or introducing new keywords.
@NikiC No. Let me show a code example which illustrates the difference.
 
user895378
pthreads is awesomer than awesome.
 
@rdlowrey Is it also bestest and awesomest?
@TheGuyWhoCouldn'tTalkToTheGirl why would it contain only 127? Did you count NUL?
 
5:17 PM
@TheGuyWhoCouldn'tTalkToTheGirl 0-127 -- that's 128 characters
 
okay Im a noob, but am learning. With php how would I setup a socket connection with a client application? Is there some good tutorial or termedgly or anything? THank
s
 
Yeah, I didn't realize it starts from 0.
 
user895378
@NikiC It's the super-duper zomg bestest awesomest!!!11 @JoeWatkins is a hero.
 
@NikiC here's some code that would show the difference between using final and not using final, with the proposed change pastebin.com/nptqCkZ7 (fixed typo)
 
@Jasper your first example is not correct
It should output "a" then "b"
 
Anonymous
5:24 PM
@PeeHaa where did you get those? I like the blue one. just for fun
 
Anonymous
I'm saying "fun" cause, I don't know if you guys actually play with those :)
 
@Jasper Maybe the behavior you want is already the implemented one...?
 
@NikiC looks like it :P I was surprised to find out that it wasn't, so I started comparing languages in that respect and ended up looking for a syntax that would work in php. So I really thought I did try it out, but that was several weeks ago, so I'm not 100% sure anymore
 
Anonymous
Aug 31 at 11:07, by Simon _eQ
user image
 
Anonymous
feedbacks
 
5:32 PM
^cache the results of all those queries with memcache
 
Anonymous
@ChunkyBaconPlz you think so?
 
HDMI 2.0 officially announced. 18Gbps 4k @ 60fps :)
 
Anonymous
You mean the queries that don't change when page is refreshed?
 
Now I just need a TV that can play 4k :(
 
@Simon_eQ Depends on how many visitors you expect. Do you wanna make SQL calls every time someone accesses the page?
@Simon_eQ What I usually do is have a dedicated box that constantly refreshes the memcache daemons, the web frontends never touch the DB itself
 
Anonymous
5:35 PM
@ChunkyBaconPlz First time yes, queries should be made, but second time only like 1% of the data should be refreshed, others are just the same
 
Anonymous
@ChunkyBaconPlz arghh, I never read about memcache.
 
@Simon_eQ It is, to put it bluntly, the shit.
 
Anonymous
I hear cornish is better but, not sure if it caches the front-end only
 
@NikiC I see how I came to the wrong conclusion now... I saw how php gives a (strict) error when the two functions don't have compatible signatures, and assumed that the function was overwritten. However, it is not (which means that the error makes absolutely no sense). Thanks for helping me not putting effort into the wrong thing :D
 
Anonymous
@ChunkyBaconPlz :)
 
5:36 PM
@Jasper php's signature validation does many a thing that makes no sense ;)
 
@NikiC Fair enough. My next suggestion: remove that error :P
Should be much less work :D
 
Anonymous
@ChunkyBaconPlz memcache easy tut?
 
Anonymous
feed me :|
 
5:53 PM
@Simon_eQ Don't be a help vampire!
3
Q: how to use memcache with php

R.Raj PrashanthI am new to this memcache stuff. I read that it saves a lot of page load time by caching the database key. I have my php application and i want to use memcache as it takes toomuch time for myt application to retrieve the whole set of results from database. please help me as i am a beginer in this...

Start with that ^
 
Any of you guys or perhaps ladies sporting a moustache out there?
 
Anonymous
lol for the lousiest help ever.
 
@Simon_eQ I'm not Google, try asking him.
 
Hi All
I have issue with URL . in codeigniter my url is like http://example.com/controllername/methodname and i want to show it like : http://example.com/methodname
I have tried with this rule :
RewriteRule ^(home(/index)?|index(\.php)?)/?$ / [L,R=301]
RewriteRule ^(.*)/index/?$ $1 [L,R=301]
but failed
please help
 
@HarshalMahajan mod_rewrite is a fickle mistress, but at first glance at your rewrite rule, you're not even close.
 
5:59 PM
@ChunkyBaconPlz than where i am going wrong ?
 
If you want the URL as a $_GET variable, try something like this: RewriteRule (.*)$ /index.php?&page=$1
 
no there is no GET variables in my application
 
So you're using $_SERVER['REQUEST_URI'] I assume?
 
currently my rule in .htaccess is :
RewriteRule ^(.*)$ index.php/home/$1 [L]
which works for index.php
 
Anonymous
In just 2 days, In installed/removed/re-installed WAMP/PEAR/PHPUnit 9 times.
 
@Jasper that sounds reasonable
From which I conclude that it likely won't happen :P
 
Hello there! Could anyone suggest a secure php downloading script with download cap?
 
no, it's something you write yourself for the specific requirements that you have
 
@JoeWatkins By the way, glad you decided to hang out in this room.
 
@tereško Lol, I meant something you could find/purchase online, ready made?
 
you certainly can buy "something" but, unless your requirements are really generic, it won't be doing what you want exactly
 
6:43 PM
@NikiC haha
 
@tereško I just need it to get a file off of a folder and spit it out, so I don't reveal my folder to the public and have my bandwidth off the top. Anything you could recommend?
 
@GoogleGuy Haven't seen you around lately. Just sending a ping.
 
Anonymous
wow you search for an error and this is what you get
 
@Simon_eQ hmmm?
 
Anonymous
6:45 PM
I guess, errors do a good seo ranking
 
@HarshalMahajan would all of your 'methodname' be in one controller?
 
Anonymous
@Neal what ?
 
@Simon_eQ wazzat?
 
Anonymous
I pasted my error online, and that was on top of Google. Didn't know, errors could make your site rank well in Google.
 
Anonymous
:)
 
6:46 PM
@Simon_eQ ooo ok
 
is it possible to run php exe like this ? php.exe -f "C:\file.php?var1=true"
 
@Simon_eQ if your error is unique, then yes
 
file.php works fine alone but with the variable it says could not open input file
 
Anonymous
I am bad with SEO, so I guess, I should throw an exception deliberately called, "Come to me, and buy from my store"
 
@Simon_eQ unless your target audience are the one looking for that same error.. then go. haha
 
Anonymous
 
Anonymous
Doctrine sucks.
 
@Simon_eQ not disabling errors in your production environment sucks
 
Anonymous
@Jasper errors in general suck.
 
Anonymous
I see as much as 30/40 errors a day on average.
 
@Simon_eQ no, errors mean your code sucks :P
 
Anonymous
6:59 PM
(trying to be modest)
 
Anonymous
@Jasper then, I suppose you suck too
 
Anonymous
^* your code
 
Anonymous
Because, its unlikely anyone can and will write anything without errors
 
Hm... I suppose. Though I was joking, there's an actual argument behind what I said: Blaming the error is misguided. Not getting the errors would be worse (i.e. silently failing). Of course, I'm ignoring the whole errors vs Exceptions and non-fatal errors debates, both of which are on an entirely different level.
 
7:05 PM
@Simon_eQ we are going to have to reschedule for saturday... my dumb ass did the math backwards... it will be 6am here when it is 2 pm there.
 
Anonymous
This error is really SEo-friendly.
 
Anonymous
@Orangepill lol. I was a bit curious too, anyway I hope you've got it right now
 
@Simon_eQ what's the latest you would be willing to do?
 
Anonymous
@Orangepill I'm in for any
 
@Orangepill I do have this trick for when I'm working with an international team: put a clock online somewhere and call it "Projectname time" and use it for everything relating tot he project. It prevents miscommunications (because of lack of a time zone) and people tend to calculate more easily when they have a clock like that in front of them rather than the abstractness of time zone identifiers.
Of course, it doesn't really apply when it's just about a single meeting
but I still felt like sharing my story :P
 
Anonymous
@Simon_eQ Store names and extract them. Is there a database somewhere on the internet with a list of names that I can purchase to match words from the sentence? Or is there another method? — jkushner 3 mins ago
 
Anonymous
 
@LeviMorrison As a user who doesn't use dark themes for programming at all, that'll take some getting used to. (I do use it for system administration every once in a while, though, I don't know how it would be for someone who never uses a dark theme for text editing at all.) In the end, though, I do think the dark background is good for the examples, though I like it less for the signature.
 
@Jasper Yeah, hence a possible after.
 
@Jasper @LeviMorrison I always use light editors. The only exception is my terminal being green on dark. This is maybe why I dislike the dark background…
 
Anonymous
7:21 PM
 
@LeviMorrison I know, just giving some (supposedly welcome :P) feedback
 
Anonymous
> Once your go black, you never go back
 
@Jasper It is welcome. I'm trying hard to make a 'dark' theme that will work well with the website. It will mean some changes on the website to allow for the deeper colors but overall I think it will be better. But if I can't pull it off then we'll stick to light background.
 
a booking widget in wordpress allows me to add location name and address , i want to edit that widget to add a new longitude field in it in the dashboard , what is the best possible way for that ?
which file to alter ?
I am new to wordpress
there is a booking folder in the theme section of the wp-content
hello somebody help me please :)
@Simon_eQ can you please help me in editing a wordpress widget ?
 
@LeviMorrison Just pulling your leg with the supposedly. I think you're really close to making the dark background work. Overall, I like the new site and am grateful for your work on it. It was just that which stood out as the new thing since I saw it last. (I'd still like > over / in the bread crumb, but you can't have everything I suppose :D)
 
Anonymous
7:26 PM
@Divyanshunegi editing is as easy as clicking the edit link
 
Anonymous
other than that, I'm not sure what you mean
 
@Simon_eQ Is that a Microsoft IDE?
 
Anonymous
@TheGuyWhoCouldn'tTalkToTheGirl who said anything about Microsoft?
 
@Simon_eQ The one in that image looks like it, that is why I asked.
 
@TheGuyWhoCouldn'tTalkToTheGirl it says "PhpStorm" in the top right block, which is the name of an IDE, meaning it's probably that
 
7:29 PM
Didn't see that, sorry
 
@Simon_eQ a widget allows me to add a location in the database saved in postmeta table of wordpress , the page is post-new.php?post_type=bizz_locations , i want to edit the page so that there should be a new input tag as longitude and i can save that too in the database
 
Anonymous
@Divyanshunegi Honestly I hate WP to even talk about it, why not ask it on SO?
 
Anonymous
@TheGuyWhoCouldn'tTalkToTheGirl Yeah, the upper one was phpstorm. A php editor.
 
thnks by the way
 
Anonymous
7:34 PM
no problem
 
Anonymous
good luck
 
7:48 PM
@Simon_eQ I'll be available 5pm-7pm your time on saturday.
 
posted on September 04, 2013 by Christopher Jones

I've recently been working with the in-built DTrace code in PHP 5.4 and PHP 5.5, specifically stabilizing its configuration on Solaris and Oracle Linux. DTrace is an always-available, low overhead, tracing framework that has just celebrated its 10th Birthday. DTrace support in PHP was originally via a separate PECL extension. In PHP 5.4 David Soria Parra (then at Sun) merged DTrace function

 
8:04 PM
well ... DTrace support failed to compile with 5.5.2 and I have not tried again
 
8:19 PM
Anyone want to chat on Skype about PHP, TDD, Rest, BDD, Agile, Continuous Integration, Unit Tests, and others?
 
nope
we use chat .. this chat
 
^ XP
 
Talk with mic. :)
 
also, REST has nothing to do with rest all other of terms there
 
after talking about PHP and TDD, you rest, then continue with bdd.. jk
 
8:22 PM
Yes, i know, it's just subjects :)
that i want to talk.
hahaha, for sure @reikyou
 
do you realize that only ~4 people in this chat are native english speakers?
 
It's not a problem, be native does not mean that you don't know how to speak. :)
 
i think you are actually looking for ChatRoulette
 
its way easier for me to type than to speak english. LOL
 
Anyone know if there is a non-trivial performance gain to compiling extensions statically?
 
8:26 PM
ChatRoulette? lol
 
More like SausageRoulette.
 
8:42 PM
ChatRoulette?
anyone know any free private proxy?
 
@Danack it's php startup which is faster (less i/o)… but when php is used for example in apache where the process is long alive it isn't significant.
 
@bwoebi k - thanks.
 
@Danack as long as it aren't loads of modules and extensions, then you might be annoyed by the latency there.
 
@bwoebi Latency? You mean on function calls?
 
8:58 PM
@Danack startup on cli for example
 
well , JS.next will be pretty good
.. though, I probably will be getting ready for retirement by the time it is supported on all popular IE versions
 
@Bracketworks then, describe us your features of php 6 :-P
@tereško compability layer per jquery etc…^^
 
9:18 PM
@Bracketworks So what's the new features planned for PHP 6?
 
9:34 PM
PHP6 isn't planned ...
@Danack about static vs shared, well it depends, if you have a lot of extensions then theoretically you could avoid some I/O on every request, in reality however because of modern I/O buffers no gain can really be seen in the real world. Now it might be that some extensions use API' sonly available to a static library - of which there are many, it's not likely and shouldn't occur, so you shouldn't try to prepare for it ... that said, I still prefer to compile static everything possible ....
some things cannot be compiled static, some things cannot be compiled shred, leaving you no choice ... the good thing about building shared is you can have cli load one configuration and apache/fpm another .... that is all ...
 
@JoeWatkins Thanks. Pretty much the only thing I switch on/off for cli and web is allow_url_fopen - I'll have another go at compiling it statically, but compiling PHP is so slow on centos in a vagrant VM on osx.
 
you are using -j option for make ?
I compile PHP & std extensions in <1 minute ... always use -j switch, and install and configure ccache
 
Yes - I think it's the IO that's the problem....even with an SSD it takes over 20 minutes to compile.
 
I compile on ssds in raid 0
[joe@fiji pthreads]$ sudo hdparm -tT /dev/md0

/dev/md0:
 Timing cached reads:   24788 MB in  2.00 seconds = 12412.89 MB/sec
 Timing buffered disk reads: 1418 MB in  3.00 seconds = 472.23 MB/sec
:D
I do everything on SSD in RAID0 actually ... is very very fast ... to hell with reliability ... although it's never actually failed and I've been doing it for years now ...
 
m59
10:05 PM
What the heck? if I make an ajax call like url: 'api' all my input is gone, but api/ works.
what's that all about?
the api directory has index.php, btw, so that link is accessing that file
 
Yeah, I've never known someone to run a RAID configuration for reliability; they always choose performance or capacity, never reliability >.<
 
m59
DOH
I've been through this issue before, now that I think about it.
The url rewrites to add the slash and doesn't forward post data.
I can't remember if there was a solution?
I don't have to have it, it'd just be nice to know
 
sleep time now ... nite boyz
 
0
Q: Possible way of isolating PHAR execution

DaGhostman Dimitrov Is there a way to isolate the execution of a PHAR-ed application controlled from a main application sitting in front of it? How deep isolation could be achieved? TL;DR I have build an application that by design should trigger the execution of a PHAR packed applications. My question goes to t...

Anyone :D ?
 
10:16 PM
OK hate me ... I didn't get the point of the link u gave me @Danack
could you evaluate a bit more
 
"system — Execute an external program and display the output" ?
You can call the phar application from your main PHP script via system("php packedapp.pha"); and it will run in a separate process.
 
Why will I want to do that? The stub of the PHAR could be enough to handle the execution of the full application and by application I do refer to packed PHP application
ops.. Ignore what Ive said
Will executing it like that still give access to the $_SERVER vars as well as the $GET and $POST data
 
@DaGhostmanDimitrov No, it would be in a completely separate process. You would have to pass them in, carefully. TBH I have no idea why you would want to isolate them like that. Either you trust the application to run it on your system, or you don't, so not sure why you want to isolate it from your main script.
 
@Danack lol
 
@LeviMorrison I do system administration on a system running RAID1 for reliability. I'm more of the software side myself, though
 
10:30 PM
The result is pretty dumb actually ... The route to each application is "example.com/application-starter" And I need to remove the '/application-starter' part of the request and pass everything else from the URI to the phar app :D.. (Told you it was dumb reason) so I could remove the dependency of which the application itself to remove it from the URI and then running, so it could be running independently in eventual structure change.
 
m59
I can't find a clear explanation. Does anyone know if data can be submitted to site.com/api without being lost because of the added slash? site.com/api/
when site.com/api/index.php is the structure
 
@m59 you should check if a request to the slashless url gets a 301 or 302 response (to the version with a slash) from the server. It might point you in the right direction (I know the handling of 301s and 302s can be messy, but beyond that I do not know what the situation is)
 
m59
ok, I'll see what I can do. Thanks.
 
Is there a clean way to reconstruct the entire request URI? As in: {scheme}://{user}:{pass}@{host}:{port}/{path}?{query} from the current processes' request?
 
10:42 PM
@tereško Awesome, but (I should've specified) sans-PECL.
 
then answer is "no"
 
Ok, I sorta XY-problem'd that actually; how can I get the userinfo credentials specified in the request URI? (not in the headers)
 
For example, retrieving morrisonlevi from http://morrisonlevi@github.com/ ?
 
@LeviMorrison Yessir.
 
parse_url() ?
 
m59
10:46 PM
@Jasper I'm afraid I'm a fail and can't figure out hot to tell if something was redirected...
 
@Bracketworks you have to configure the webserver to pass them to the back end - i think
What web server are you using?
 
Specifically parse_url with PHP_URL_USER and PHP_URL_PASS.
 
@Danack Well, my guess is it'll be Apache at deployment, but I was hoping for something, y'know... that "Just works".
 
or maybe you want to extract it from $_SERVER ?
 
@LeviMorrison Yea, but I'd have to pass it a URL, so back to square one :-(
 
10:48 PM
wat
 
@tereško I'm dumping $_SERVER, it's not in there
 
@Bracketworks Peek around in $_SERVER then.
 
By the number of upvotes here and in the answers, it looks like git needs to add a git commit --undo option — Kyle Heironimus Sep 28 '12 at 21:12
 
it should be in $_SERVER['PHP_AUTH_USER']
 
@tereško Nah, that only gets set by the Authorization header
At least in my config.
 
10:51 PM
You have to tell Apache to pass them in:
7
Q: PHP_AUTH_USER not set?

Newbie_25For some reason, none of the code within if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { // When the above is set, the code that is here will execute of course } is being executed for me. When I enter the correct username and password, the prompt box for the ...

 
Shitty balls.
 
Salty balls?
 
i get the impression that you are doing it all wrong
 
PHP can suck on my chocolate salty balls... white chocolate.
@tereško Who me?
 
10:53 PM
@tereško Wiki-less tag
Anywho, no, I don't think I'm "doing it wrong"; I'm just trying to obtain or reconstruct the full request URI, all components intact.
I know HTTPS + Basic is, well, not cleartext mayhem, but if some credentials come over the wire in the URI, then I should be able to pick them up.
 
Assume I'm working on, say, the Wordpress Gthub repo (pretend it exists). It belongs to Github user "Autommatic" and it's got a site (Drupal based, of course) set up on the gh-pages branch. So, the repo is at https://github dot com/autommatic/wp, and the `gh-page` is set up at url "http://autommatic.github dot io/wp/"

However, the site is propagated to redir. to "wp dot com" - it has a CNAME in the gh-pages branch with exactly that.

If I fork the repo, and the CNAME came with it - it will obviously not redirect my "skopp/wp" fork to wp dot com.
 

« first day (1054 days earlier)      last day (3885 days later) »