logs archiveIRC Archive / Freenode / #php / 2015 / July / 10 / 1
Bittarman
what problem does that solve for you?
NoiseEee
hey, there's no built-in function to unset multiple array keys at once is there
he asks without checking the manual
Bittarman
yeah, unset
NoiseEee
oh sheet right on
i always thought it took a single key, thanks
Bittarman
yw
shahin8r
I'm uploading a video to an external video hosting through their api and whenever the processing of video is done (by checking json value for progress) it should add the data to the database
it's working now whenever the upload is complete but i don't want it added to database until the video processing is complete
and when user has finished the upload process of the video file i don't want them to wait for the processing
Bittarman
right, so do the upload outside of their request
i.e. they upload to you, you hold it locally in a queue, and have a daemon watch that queue and upload them to the api
shahin8r
well i'm currently using javascript for uploading the video straight to their video hosting
and I don't want any more storage issues on my server since it's large video files
so best solution should be a daemon that check's the api for videos that's not in the database and if processing is done on these videos it should add them to the database
am i right Bittarman?
Bittarman
yes
         

shahin8r
thanks a bunch
candice
i need some assistance with installation of a site on localhost
belea
hey guys, if you were to extract massive amounts of data would with php ... would you start multiple script instances or multicurl?
mchelen1
what do you mean by extract
belea
fetch and process data from a source website
mchelen1
well i would split up the fetching & processing
fetch everything first and store it in a sane manner
then process it all
belea
yes, by extract i meant actually the fetching part
mchelen1
do you know the list of urls to pull?
belea
yes
mchelen1
any reason not to use multicurl?
belea
so you'd go with that instead of starting multiple instances
i suppose that's right, never used multicurl before
mchelen1
what would be the point of multiple instances?
simpler is usually better
belea
im thinking 3 instances / ip i've got 10 ips
so 30 at once
mchelen1
ok
Utils
Not PHP related but is it a good idea to use a wrapper in XML? For instance, if my XML file will only contain <notification ... /> elements? I figure that adding adding to the file on teh fly would be a slower than necessary process if you have to read from the file, turn into an array, append to teh array, and then put back in the file.
burzum2
hi there, has anyone else observed before that crc32 acts different between win 8.1 using a 32bit php version and on a 64bit linux machine (travis-linux-4) with probably a 64bit build as well?
documentation says
Warning
Because PHP's integer type is signed many crc32 checksums will result in negative integers on 32bit platforms. On 64bit installations all crc32() results will be positive integers though.
im looking for a way to ensure im getting the same results :/
DarkElement
How can I print the 'category_name' value here? http://paste.pound-python.org/show/1CmmpYXjcb2raa9W79mA/
Also, hi all.
Bittarman
burzum2, stop using crc32
bango2
DarkElement are you var_dumping this QP_Query object?
WP rather
DarkElement
yes
         

bango2
for each $object as $0 echo $o['category_name'] ?
burzum2
Bittarman thats the plan but i have to deal with the legacy code as well, ive already written a path to use a better method
bango2
DarkElement $object['category_name'] and $object->category_name arent working?
phpNoob
Bittarman: can i query you with a non technical question?
DarkElement
bango2, no, neither of those work. WP_Query doesnt like being used as an array. Anyways, gtg. Be back later :|
tw2113
DarkElement, wouldint it be $wp_query->public['category_name']
er
$wp_query->query['category_name']
noobiwan
Hey guys, when I get rows from the database with PDO fetchAll I get an array of rows numeric indexed. I want to use the ID of the row as the index of the array (thus creating what one might call a dictionary). Is there a built in function for that? Right now I'm looping through the results and building a new array.
sorabji
you'd have to walk the array one way or another
noobiwan:
Chunk2
Yeah mysql doesn't understand anything but rows. The array part is PDO dressing it up for you.
Also not every query has a primary key or even corresponds to a table
caffinated
Chunk2: what does that have to do with anything? clearly his result set has something unique he'd like to index on.
in this case, an "id" column, which is - more often than not - a primary key
Chunk2
If PDO tried to opportunistically index everything it would run into problems more often than not. What should it do if for example you have a composite primary key?
I'm trying to give some context as to why nobody ever put it in there even though it would seem at a certain level completely logical
caffinated
..except this has nothing to do with "opportunistic indexing"
all the variables are known.
sorabji
you could do some fancy with array_combine, array_column, array_keys...
caffinated
I guess what I'm saying here is that you're turning a simple answer about a loop in to something that is more complex sounding than it is.
"loop results, build your final array" is really all there is to his problem's solution.
Chunk2
...are you alright?
If the answer wasn't completely pertinent I apologize I've been working for about ten hours now.
caffinated
It's not that it wasn't correct, it was a case of confusing the point. I'm probably just being too nitpicky.
noobiwan
caffinated is right here, I don't want to do anything automatic from PDO, I was just wondering it there was an array_ function that would do the job for me in a more performant way
but thanks guys
pEYEd
Why can I 'not' var_dump inbound JSON RPC object data? http://paste.ee/p/24unQ
laszlof
holy massive tabs batman!
BrickRoad
Hey gang
Is 7 beta still going to get released today?
wx
o/
Happy_the_Exceed
hi.
(Action) points and laugh at the giantwaffeldonke
Damn freenode name-size limit -___-
caffinated
^ relevant username is relevant
Happy_the_Exceed
(Action) would allow 64 char usernames. Even with allowing 64 multibyte chars!
Chunk2
so functions aren't allowed to be declared in an array literal on a class?
Is this right?
Happy_the_Exceed
Ah, github limits at 39 characters.
pthreat
Sirs o/
Happy_the_Exceed
Me > github
I wonder what influenced them to pick that number.
caffinated
Chunk2: that is correct
Chunk2: you can store it after the fact, but not really in the definition
Sammitch
Happy_the_Exceed: compatibility with $legacy_system
Happy_the_Exceed
:(
Alphos
by the way, i didn't check, can you define a value as an array of arrays of scalars at class declare time ?
or is it limited to arrays of scalars ?
caffinated
Alphos: yeah, you can't really do any kind of expression in the definition. kind of a sore spot.
Alphos
i'm not hearing a "no" :/
Happy_the_Exceed
Alphos, tias :p
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 next »