« first day (679 days earlier)      last day (4269 days later) » 

12:00 AM
@Darius - The upload gets stored in a temporary file.
 
so we don't exactly know how much RAM each video upload can take?
or do we assume 100 MB ram for 100 MB video
Again, I apologize that these questions seem far fetched. I almost got the grasp I feel.
 
Sam
nope; I don't believe you can calculate exactly how much memory each video will take
you also need to factor in bandwidth issue
 
Alright, so the RAM issue is clear in my head. Bandwidth issue, we're going to be using Amazon's Cloud for distributing the videos
 
@Darius I doubt youtube runs on PHP, but my guess it running on Python. Don't know whether PHP is the best tool for the job
 
Sam
have you ever tried downloading a file that large from sites before?
 
12:03 AM
so that bandwidth won't hurt us, but the uploading bandwidth I agree is a concern
 
@PeeHaa interesting
 
@PeeHaa Indeed interesting
@Sam Yeah, they somehow limit download speeds
 
@PeeHaa I'd guess Rails
no wait, when did it come out
 
If download speeds can be limited, I'm guessing upload speeds can be limited too to preserve some bandwidth
 
nope, it's python @PeeHaa, your intuition was correct :O
 
12:04 AM
@Lusitanian How did you find out that fast :P
 
magic
 
:)
 
brb getting laptop charger before it dies and makes me sad
apple was awarded a billion dollars in "damages" wth
 
kk
@Lusitanian yep
 
@Shaquin: I just commented on your answer
 
12:05 AM
@PeeHaa youtube doesn't, but youporn does :D
 
@NikiC Lol (thumbs up)
Now for the awkward silence and hysterical laughing question followed by it... Can php and python work together..? Handle all by php except uploads (for future thought) or must the whole site be reprogrammed
 
@NikiC It is? Also the uploading scripts?
 
@Shaquin my link is much funnier
 
@PeeHaa No idea what exactly of it. I just know that it is build using Symfony2
 
@NikiC what's that?!?!
 
12:08 AM
@Jocelyn It is! The most useful part of it is realizing that you can use bitly to link to LMGTFY.
 
@NikiC Now that's some useful trivia
:)
 
@PeeHaa @NikiC i read that a whiel ago
it's actually on the symfony2 wikipedia article
 
@PeeHaa It sure is. PHP is controlling the world :P
 
lol
> The site is obviously not safe for work (well your work not mine).
 
@Jocelyn People seem to be using my answer as a place to talk to each other....
 
12:08 AM
I mean, who cares about Facebook if you can have YouPorn ^^
@PeeHaa :D
 
:D :D :D
dirty business hehe
 
Drupal's code looks significantly refactored for 8.x
 
Sorry to ask again, but if I plan to use python in the future, means the whole site will need to be rewritten or can php and python work in harmony
 
It no longer looks quite as bad
@Darius they can work in harmony
as can pretty much any web technologies that can run on the same OS
i.e. ASP .NET and PHP on a linux box won't work all that well :P
 
Sam
ASP .NET should not work on Linux
 
12:12 AM
Thank you. :D Alright my approach will be to use php upload max limit and just add hardware if I start seeing things slowing down or RAM is exhausted. After that... we'll see...
 
Sam
it needs .NET framework on the server
 
I think that's an ok first approach, consensus?
 
@Sam not entirely true because of Mono
 
Sam
as they say.....you build it, and then throw memory at it
@Lusitanian who has Mono on their Linux server?
 
@Sam So agreed? :D
 
12:14 AM
@Sam hopefully no one :)
 
Why ASP.NET when you can have PHP? :-)
 
Sam
@ShaquinTrifonoff exactly
@Darius agreed to what?
 
xamarin.com/monoforandroid --- this is sweet though
 
my approach will be to use php upload max limit and just add hardware if I start seeing things slowing down or RAM is exhausted. After that... we'll see...

This is the simple way to start off, and sounds *cough* reasonable
 
i'd way rather develop for android in C# than java
 
Sam
12:18 AM
and reduce your file size limit........
 
2AM here already. Good night!
 
@Jocelyn Gnight, thanks again.
 
@Jocelyn later
 
@Sam 100MB is too much for a video in your opinion, what should i set it to?
to get things rolling
 
Sam
lol......you'll decide that yourself, analyze all the requirements of the site, test different file sizes, and choose the most appropriate
 
12:23 AM
xD Thanks! Will do.
Can't thank you enough, cleared my head up.
 
I'm starting to see why people don't use free hosting.
My website is going on and off, with 'Connection Reset' errors...
 
@ShaquinTrifonoff Just setup your own server and host it yourself or get a VPS :)
 
I can't have my computer on all the time, though.
I might have to create a network of sites, and have one reliable one that fetches the files with FTP...
 
h-wh-y not?
I'm getting a pretty bad cold...damn. Wait, there's now a cure for it, I forgot: $.cureDisease('cold').type('common').success( function() { alert('cold cured.'); } );
 
Sam
12:32 AM
lol....your code is incomplete
shouldn't it include some pills taken?
 
github.com/AOP-PHP/AOP @PeeHaa this is the best implementation of aspect-oriented programming php i've seen
which unfortunately isn't saying much
considering several of theexamples i've seen are class Singleton extends Aspect
 
@Lusitanian I like that idea.
 
It's a project to watch, I'll probably compile it and play with it at some point
I've seen pure PHP implementations often but they mainly suck
 
It does handle it pretty nicely indeed
 
very concise API. the term "advice" seems like someone couldn't come up with a name though :P
 
12:44 AM
@ShaquinTrifonoff Why not change it to prepared statements when you are writing such an lengthy answer?
 
@PeeHaa I already commented on that hehehe
I really need that jQuery cold cure ):
 
@PeeHaa Because I haven't learnt prepared statements yet - I've seen the basics, but I haven't really learnt it yet.
@Lusitanian Why is it still vulnerable to SQL injection?
 
@ShaquinTrifonoff It's really not hard to learn. Just grab some beers, 1 tutorial and 15 minutes and you will get it
:-)
 
also consider this
12
Q: SQL injection that gets around mysql_real_escape_string()

Richard KnopIs there an SQL injection possibility even when using mysql_real_escape_string() function? Consider this sample situation. SQL is constructed in PHP like this: $login = mysql_real_escape_string(GetFromPost('login')); $password = mysql_real_escape_string(GetFromPost('password')); $sql = "SELECT...

well, the answer to it
bound params are always safer
granted the chances of you getting hit are pretty low but it's not worth taking that risk
 
Besides that they also make your code more readable instead of having all those mysqli_real_escape_string() functions everywhere. @ShaquinTrifonoff
I'm off. later all
 
12:57 AM
night
 
Yeah, everyone logs off at 1pm here...
 
1:21 AM
---
Strange thing is, my website is visible through a proxy...
 
1:44 AM
... but the host's homepage is down...
 
1:59 AM
Can anyone help me make this check if the user is uploading an image only? (PNG, JPG, GIF, etc) pastebin.com/eVv7KvQV
 
@AlexCastro Yeah, I'll have a look...
 
Thanks @ShaquinTrifonoff
 
@ShaquinTrifonoff Make an array of white-listed file types
and you can use in_array() and filetype() to determine whether the uploaded image is valid or not
or actually, don't do that. use the ['typle'] attribute off the $_FILES array. quackit.com/php/tutorial/php_upload_file.cfm
 
0
A: SQL injection that gets around mysql_real_escape_string()

ircmaxellThe short answer is yes, yes there is a way to get around mysql_real_escape_string(). for certain obscure edge-cases The long answer isn't so easy. It's based off an attack demonstrated here. The Attack So, let's start off by showing the attack... mysql_query('SET NAMES GBK'); $var = mysql_re...

:-D
 
2:24 AM
@ShaquinTrifonoff have you given it a look?
 
+20 more until I get a gold Populist badge :-D
 
@AlexCastro Sorry, I was getting distracted. If you can find a list of MIME types somewhere, make an array and do what @Nile said earlier. Make sure it contains the IE-only types, too. IE is a nuisance.
@ircmaxell That's cool!
 
@ShaquinTrifonoff I'm back again (video upload guy). I was wondering do you understand how init_set works? I set init_set(max_upload_size) to 50MB and it timed out, my php.ini conifgs have it set to default of 3MB i believe. I thought that init_set overrode those settings, am I wrong?
and I set timeout time to 600 seconds too*
 
ini_set?
 
yeah
ini_set
 
2:32 AM
you can't set that with ini_set
because the limit is hit before the php code is executed
it happens at boot time
 
Have you got access to your own host (i.e. can you edit the server config)?
 
That's what I was afraid of.. :\ Is there a way to set it for a specific folder/directory?
yeah I have my own colocated dedicated server
full control over it
 
use an ini file, htaccess or the like
 
@ircmaxell Avoid .htaccess whenever possible.
 
me too
use a per-directory ini file then
 
2:33 AM
Use <Directory "/path/to/dir/">.
In the httpd.conf.
 
@ShaquinTrifonoff That's what I was looking to hear, thank you.
but wait. if the /tmp file holds the uploads first
then i move them to the folder I need it to upon successful upload
i would alter the /tmp directory
 
You'll have to test it.
 
right?
 
I don't know how it would work.
 
since taht's where the uploads are going to originally
Ok, i'll test it. Thank you!
 
2:35 AM
no, the directory where php is executed
 
oh..
Mind hazy then, I'm using zend framework, calling an action uploadprocess, the controller takes care of the upload, then a model takes care of all the database inputs. So then I would set the uploadprocess View or Controller php script directory to increase the max upload?
or the folder that the file/video gets uploaded to
php executed sounds like the controller
 
the directory of the entrance point to PHP
 
and controllers hold alll the website page processes, making the upload file size executed for the whole site
 
so /index.php in that case most likely
 
@Darius Why not increase the limit for the entire site?
 
2:39 AM
@ShaquinTrifonoff I don't want photos uploaded of more than 3MB, if I increase the limit to 64MB I'll have enormous photos
 
@Darius Ahhhh.
 
theoretically I could, since I delete the original after I convert.
It's just that it would tie up the server's RAM and etc that we talked about earlier today
 
Reasonable right?
 
@Darius Yes.
Can you use PUT?
(instead of POST?)
That way you can "stream" the file, show a progress bar, and stop if it gets over a size limit.
 
user895378
2:42 AM
POST vs. PUT makes no difference regarding whether you can stream upload a file
 
user895378
You can stream any HTTP message data
 
@ShaquinTrifonoff I've never tried it, but I'm sure it can be implemented.
 
Hey guys, would this work to show a file extension?
echo pathinfo($_FILES['photo']['name'], PATHINFO_EXTENSION);
 
@rdlowrey Okay, I was just getting that information from a comment in the PHP docs :-)
 
can't test it since the rest of the page isn't done.
 
user895378
2:44 AM
@AlexCastro It will work only if the file had an extension on the client machine AND the user-agent (browser) saw fit to pass that information along in the HTTP request message
 
@rdlowrey Could you recommnend a better way?
 
user895378
And that's not something that can be relied upon anyway, because the user agent can send any data it wants to. Just because a message says it's uploading a file that's in .doc format doesn't mean that it is. It could be anything. You have to verify mime types for yourself.
 
@Darius Have a look at the Common Pitfalls. There is information on max_* stuff.
 
@ShaquinTrifonoff Yeah, I've been reading that and coming up with different ideas. Have yet to find the perfect solution. Thanks again.
 
user895378
@AlexCastro If you have >= PHP5.3 you can use the finfo_* functions to check the mime type of a file.
 
2:47 AM
Just found a funny animated GIF:
 
@rdlowrey According to cPanel I'm on PHP Version 5.3.8
 
What would you configure your ini file to if this is the layout:
/application/controllers/mycontroller.php (takes care of $_POST and $_GET and other variables, this is the file that calls the model that uploads the file)

/applications/views/scripts/index/index.phtml (displays what the controller ended up with)

/applications/models/model.php (takes care of what the controller requests)

/index.php (all php files seem to go through this file everytime a page is called)
@ShaquinTrifonoff Totally me today
 
user895378
@AlexCastro then you should be able to check the mime/type of uploaded files using those functions.
 
What, are you talking about the deprecated mime_content_type??
 
2:51 AM
hola
 
Hopefully you have found this. @AlexCastro
 
user895378
@ShaquinTrifonoff no. The not-deprecated mime detection function: the file info functions. I'm saying you can't rely on the mime type values in the $_FILES superglobal.
 
---
Hi, @Lusitanian!
 
@rdlowrey Asked Teresko a question and he said you would possibly know the answer, I'm sending out API/http calls to amazon for products and when I do 2 requests it can take time 2-6 seconds to load a page because it takes a while for one http request to send and receive info, then when I get the first one back it sends out the 2nd and waits for the reply again. Is there a way to shotgun 2 requests and get both back simulatenously, like dual sending and receiving?
 
@rdlowrey Okay.
 
2:53 AM
@Darius yes
 
curl_multi
 
multiple ways
 
curl_multi which sucks, or use the Artax HTTP client
 
user895378
@Darius hehehe. Yes -- implementing it yourself is very ... umm ... tricky. On the other hand you have the curl_multi functionality which sucks.
 
2:53 AM
which has a far more advanced multi-request API
 
:D so Artax HTTP client or something else? since curl_multi sucks
 
user895378
For the last few weeks I've been finalizing my own library to handle it (which @Lusitanian just mentioned)
 
oh, sweet.
 
@Darius he finally finalized the API
 
just in time! ;)
 
2:54 AM
I stick to the built-in stuff.
 
after three weeks of me watching instead of helping like i should have :P
 
user895378
@Darius I'm hesitant to give you the full green light to use it just because I'm not finished with full and exhaustive testing.
 
@ShaquinTrifonoff php_curl isn't built in...
and curl is just disgustingly awful
 
user895378
However, I haven't been able to break it yet ...
 
since i always seem to be able to, i'll try it later
I still am looking for a jQuery plugin that cures colds, @webarto can you point me in the right direction?
 
user895378
2:55 AM
@Darius If you want to use it though, I can walk you through the setup (should take 5 seconds if you have git installed on your machine)
 
@Lusitanian Sure, sure. But it comes with most server installations, and it is well-known. You don't have to worry about compatibility so much.
 
Artax uses truly built-in PHP functionality [sockets]
 
@rdlowrey Let me check if I do. Once you finish and update it, I should be able to update it too right?
 
no. don't use curl_multi. you'll end up crying alone.
 
user895378
2:56 AM
@ShaquinTrifonoff actually, that's not true at all -- libcurl can be particularly difficult to get functioning in windows environments.
 
Yeah, php_curl on windows is awful; but if you use windows for PHP then a lot of stuff is headache-inducing like PECL
 
I have cURL running fine on my computer. Windows.
 
user895378
2 mins ago, by Shaquin Trifonoff
I stick to the built-in stuff.
 
It's easy: remove one semicolon.
 
@rdlowrey Ahh, I don't have it installed. I'm not too comfortable installing stuff on my own, but if it's straight forward maybe I could, would installing git be a simple yum intall git?
 
user895378
2:57 AM
Not true, you have to have libcurl on your windows: not standard
 
@rdlowrey not true
 
user895378
curl is an extension and thus, by definition, it is not "the built-in stuff"
 
not if you have the php_Curl.dll
precompiled
but it's certainly not built in :) --- and the API is dated as hell
 
user895378
@Lusitanian synonymous -- that's what I mean
 
user895378
2:58 AM
@Darius yeah, if you don't use git it's no problem. No need, I can point you to a zip file download
 
Okay, I give up. We all have our own opinions...
 
indeededly.. most. indeededly.
 
@rdlowrey Lets try it.
 
user895378
It's okay, I'm just saying that curl is an extension :)
 
@Darius if you don't have git the zip is here: github.com/rdlowrey/Artax/zipball/master
 
2:59 AM
skype me if you'd like to keep it private karaliusdrb
 
@rdlowrey As is MySQL/MySQLi/PDO...
 
got it.
 
Indeed.
i'm not saying it's that bad, but there are more modern alternatives (:
look at how monolithic guzzle is and has to be to wrap it nicely
 
user895378
@Darius No need: download this zip file, put the contents somewhere you can access from your script: github.com/rdlowrey/Artax/zipball/master
 
although it has built in support for cookies, but that seems somewhat pointless to be honest
i don't know why a web service client would need that...
 
3:01 AM
Okay done.
 
Is there a way using Finfo_file to determine size?
I want to make sure the size is 100KB or under of a file
 
@AlexCastro completely unneccesary :P
 
user895378
@Darius Okay, are you familiar with how the use statement works with namespaces or no? (It's okay if not, just getting a gauge so I can give you code that you can copy and paste)
 
filesize('yourfile.txt');
 
user895378
@ShaquinTrifonoff fair enough :)
 
3:03 AM
@rdlowrey Don't fully understand namespace declaration, I know how to load classes and etc. like $object = new someclass(); If you show me some code, I can figure it out.
 
user895378
@Darius no problem
 
So @Lusitanian, would something like ($_FILES['file']['size']); work?
 
user895378
In the top level directory of the zip you extracted , there's a file, Artax.php -- you'll need to include that in your script before using any of the code:
 
user895378
require '/path/to/Artax.php'; // hard path to the artax bootstrap file
 
@AlexCastro why wouldn't it? ineed it does
 
user895378
3:06 AM
@Darius actually, let me just type up an example script then I can just give you a link to it.
 
@lusitanian thanks just checkin
 
kk
why do so many of these exist?
 
@lustanian if (($_FILES['file']['size']) < 10000)
 
i unfortunately have uses the doctrine one a bit which is at least has a somewhat normal query api
 
would that work like that for 100kb?
 
3:10 AM
that's 9.7 kilobytes
 
user895378
@Darius Here are some basic examples: gist.github.com/3459690
 
user895378
@Darius if you want to see a bit more advanced stuff: gist.github.com/3251540
 
@AlexCastro bit.ly/RLeum4 :-P
you're looking for 102400 (:
 
@rdlowrey Thank you. I will test this out and let you know how it goes.
 
Ah cool. I didn't even know you could put a number there, that was my major question, lol.
thanks
 
user895378
3:12 AM
@Darius Cool -- I'm always in here, so if you have troubles with it I'm usually around to help out
 
@rdlowrey Great, thank you.
 
@AlexCastro you got it
@rdlowrey check this out: github.com/AOP-PHP/AOP
 
@rdlowrey /library/Artax/vendor/PHP-Datastructures/bootstrap.php): failed to open stream: No such file or directory in ..... etc there's no bootstrap.php file in there.
 
i told peehaa it's the cleanest implementation of AOP i've seen in PHP, may be something you're interested in --- considering you're interested in...programming...which is why you're here
let's see how many other obvious statements I can make...
 
@Lusitanian Can you recommend a simple way to resize with scale an uploaded image?
 
3:16 AM
do you already know how to resize an image?
 
^^ that (:
 
@rdlowrey The vendor folder has 2 empty folders just looked
 
user895378
I'm anti-PECL ... Honestly, I'm not crazy about AOP. I believe that -- even though it's not dead-simple -- with appropriate inversion of control you can successfully deal with cross-cutting concerns with traditional OOP.
 
anti-PECL? even anti-dill-PECL? <-- terrible joke ends there. interesting, i find it to be a cool concept but i've not seen it implemented well in PHP and haven't played with it enough in any other language
 
user895378
3:18 AM
@Darius ah -- I've never tried downloading the zip file before. You only need to download one of them and stick it in there. (this is where git is helpful) one sec, I'll get you a link
 
@Lusitanian I've got a basic idea but want to do it the right way
 
user895378
@Lusitanian I just avoid extensions whenever possible. Non-standard === extra complication
 
@AlexCastro i'm lazy. here's a code snippet from the PHP manualc omments which seems reasonable, but you'll want to modify the output format.
function scaleImageFileToBlob($file) {

    $source_pic = $file;
    $max_width = 200;
    $max_height = 200;

    list($width, $height, $image_type) = getimagesize($file);

    switch ($image_type)
    {
        case 1: $src = imagecreatefromgif($file); break;
        case 2: $src = imagecreatefromjpeg($file);  break;
        case 3: $src = imagecreatefrompng($file); break;
        default: return '';  break;
    }

    $x_ratio = $max_width / $width;
    $y_ratio = $max_height / $height;

    if( ($width <= $max_width) && ($height <= $max_height) ){
 
user895378
@Darius you need to put the contents of this zip file in the PHP-Datastructures directory
 
user895378
@Lusitanian that said, I'll check it out and get back to you :)
 
3:22 AM
@rdlowrey "The ARTAX_CONFIG_FILE constant must be defined to continue". Up to me now, or this still more files?
 
user895378
@Darius no, you've included the wrong file if you're getting that message -- you need to include only Artax.php -- NOT Artax-Framework.php
 
doh!
 
@rdlowrey whenever you have time. it's a newer project.
 
at night i always scroll through the SO 2.0 careers list longingly
 
user895378
3:24 AM
@Darius Artax.php just loads an autoloader -- the other one is for running a full-blown framework (which is still highly experimental) :)
 
@rdlowrey Kk, green light now :)
 
user895378
@ShaquinTrifonoff haha nice
 
@rdlowrey It's my own invention :-)
 
user895378
@Lusitanian Just focus on learning as much as possible -- you're way ahead of the game. I didn't write a line of code until I was 22. You'll get out what you put in.
 
heh. yeah. i also get frustrated because so many of these listings say "experience with MVC frameworks like codeigniter"
 
user895378
3:28 AM
Those aren't jobs worth having anyway.
 
that i agree with
 
@rdlowrey Fatal error: Class 'StdRequest' not found in /application/controllers/MyController.php on line 201, this something I had to install in php?
 
user895378
@Darius Oh sorry, I left off the namespace declaration in the example code I hammered out for you. Should be:
 
codeigniter is to mvc as basketball is to soccer
 
user895378
@Darius StdRequest --- change to ---> \Artax\Http\StdRequest
 
3:30 AM
or in british PHP
 
@rdlowrey Fatal error: Using $this when not in object context in /library/Artax/src/Artax/Http/Client.php on line 480
 
How do you do, Artax\Http\TheQueensRequest, may I call you StdRequest?
 
stack trace?
 
user895378
@Darius doh. One second, lemme upload a fix for my stupid use of $this inside a lambda
 
heh
 
3:32 AM
This is quite exciting, testing out a new framework ^_^
 
can't you do that in 5.4?
 
user895378
@cHao Yeah -- which is why I didn't catch it because I was developing in 5.4
 
ahh
 
user895378
But supposed to be compatible with 5.3
 
$me = $this;
function(signature) use($me)
 
user895378
3:33 AM
yup
 
javascript's closures are much nicer than php's tbh
in that they're actually closures :)
 
yep
js's closures are awesome, really
downside being, they're so awesome that they're just fun to play with, and they end up used where they don't have to be, and scope becomes quite a rats' nest
 
user895378
@Darius updated files here: github.com/rdlowrey/Artax/zipball/master -- be careful not to override the PHP-Datastructures directory or you'll need to re-download that dependency
 
@rdlowrey So upload everything except that directory. got it.
 
user895378
@Darius btw if you do a yum install git you can just do this anytime to get the current master version and all dependencies:
 
user895378
3:37 AM
git clone --recursive git://github.com/rdlowrey/Artax.git
 
kk.
@rdlowrey Fatal error: Call to protected method Artax\Http\Client::isComplete() from context '' in /library/Artax/src/Artax/Http/Client.php on line 481
 
user895378
@Darius this is why I need to test on < 5.4 soon :)
 
@rdlowrey :D Alright, keep me updated! I could really use this framework. Looking forward to it.
 
user895378
@Darius one second, I'll just do it without the lambda and that will guarantee it works :)
 
user895378
@Darius github.com/rdlowrey/Artax/zipball/master <-- should be good now. Just do the same as before.
 
3:47 AM
@rdlowrey Kk it's loading. Question: When I send out multiple requests in parallel, the foreach array that gets outputted is in the order it received the info back? Meaning first one to respond gets the first spot in the array?
@rdlowrey Doh! :( Fatal error: Call to undefined method Artax\Http\Exceptions\TransferException::getBodyStream() in /library/Artax/src/Artax/Http/Client.php on line 842
 
user895378
@Darius It's not about the order, it's about the keys. But yes, they're in the same order.
 
user895378
@Darius lol this is great. Users find the most creative ways to break things that you never thought possible. One second.
 
Hahaha :D
 
user895378
Also, if you don't mind, could you post the relevant code that caused that one?
 
user895378
I know what the problem is, but I'm curious to see how you got there.
 
3:51 AM
Loaded the file
Zend_Loader::loadFile('../library/Artax/Artax.php', $dirs=null, $once=false);

The action in the controller that called the function
$request = $this->getRequest();
$productid = $request->getParam('productid');

$connMgr = new \Artax\Http\ConnectionManager;
$mediator = new \Spl\HashingMediator;
$client = new \Artax\Http\Client($connMgr, $mediator);


// MULTI-REQUESTS IN-PARALLEL
$requests = array(
new \Artax\Http\StdRequest('http://stackoverflow.com', 'GET'),
new \Artax\Http\StdRequest('http://news.google.com', 'GET'),
 
user895378
Ah, so you're still using the example code. Okay, lemme see what I can do.
 
That what you wanted?
kk.
Just to let you know, incase it helps I'm using Cent OS 6 and PHP 5.3.16
 
user895378
@Darius I'm having trouble reproducing on my end. Can you change this line:
 
user895378
$multiResponse = $client->sendMulti($requests);
 
user895378
to this:
 
user895378
3:59 AM
try {
    $multiResponse = $client->sendMulti($requests);
} catch (\Exception $e) {
    echo $e;
}
 
user895378
And paste the echoed output so I can see the full exception trace?
 
Still same output.
@rdlowrey Fatal error: Call to undefined method Artax\Http\Exceptions\TransferException::getBodyStream() in /library/Artax/src/Artax/Http/Client.php on line 842
 
user895378
@Darius but there's not any more output besides that message?
 
none.
 
user895378
k, working on it.
 
user895378
4:10 AM
@Darius Since I can't reproduce the error, can you do me a favor and add a couple of lines to one of your files so I can get an idea of what's causing the problem on your end?
 
sure
 
user895378
Replace line 842 in the Client.php file to this:
 
user895378
} elseif ($state->response instanceof Exception) {
    echo $state->response;die;
} elseif (!$responseBodyStream = $state->response->getBodyStream()) {
 
user895378
And send me the output you get when running after changing that if you don't mind
 
sure, i don't mind. i appreciate you letting me try it
 
user895378
4:13 AM
It's difficult because when you're doing multiple requests at the same time you don't want a failure in one request to break all the other ones. So I have to catch any exceptions that occur, or this debugging would be simpler. When an exception happens it should mark the request as complete and stop processing it. But that's clearly not happening in this case.
 
exception 'Artax\Http\Exceptions\TransferException' with message 'Response retrieval error: transfer failed after bytes received' in /library/Artax/src/Artax/Http/Client.php:824 Stack trace: #0 /library/Artax/src/Artax/Http/Client.php(739): Artax\Http\Client->receiveHeaders(Object
(stdClass)) #1 /library/Artax/src/Artax/Http/Client.php(435): Artax\Http\Client->readResponse(Object(stdClass)) #2 /library/Artax/src/Artax/Http/Client.php(229): Artax\Http\Client->doMultiStreamSelect(Array) #3 /application/controllers/ShopController.php(207): Artax\Http\Client->sendMulti(Array) #4 /library/Zend/Controller/Action.php(516): ShopController->viewproductAction() #5 /library/Zend/Controller/Dispatcher/Standard.php(295):
Zend_Controller_Action->dispatch('viewproductActi...') #6 /library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #7 /library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch() #8 /library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #9 /public/index.php(26): Zend_Application->run() #10 {main}
 
user895378
Aha, that's what I needed. Thank you.
 
user895378
@Darius Do you know if you're behind a proxy server by any chance?
 
I am not.
Hmm.. I do have iptables setup, but it's not blocking the request.
 
user895378
4:36 AM
@Darius I'm having a hard time figuring out where the problem is because I can't duplicate it myself. Mind redownloading the library from github.com/rdlowrey/Artax/zipball/master one more time and see if it works?
 
sure
Can I replace the whole artax folder
or should I keep the vendor source in tact
 
user895378
Keep the vendor files in tact
 
@rdlowrey Different error : Fatal error: Call to a member function getUri() on a non-object in /library/Artax/src/Artax/Http/Client.php on line 470
 
user895378
@Darius I appreciate you being a testing guinea-pig -- that error message actually helps me. I've got to get some sleep now, but getting any bugs ironed out is a very high priority for me because I'm already using this code a lot and plan to do so a lot more going forward. I should be able to smooth things over tomorrow. I'll keep you updated.
 
Sounds good. I'll be online here if you want to continue tomorrow.
Thanks for letting me test it out.
 

« first day (679 days earlier)      last day (4269 days later) »