Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52267 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22992 invoked from network); 11 May 2011 04:02:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2011 04:02:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=sosagabriel@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sosagabriel@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: sosagabriel@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:65219] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/69-04851-04A0ACD4 for ; Wed, 11 May 2011 00:02:09 -0400 Received: by vwl1 with SMTP id 1so88968vwl.29 for ; Tue, 10 May 2011 21:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=SI7QFnHoIwY8osmn70Nja6agyn11HUikZbsNrgnPkrY=; b=mmlXwkF4hBrWkwCCBoaUed0jsJYCYl/xc/HohMSx4tWHgT62NAEYZWBP58lpNc8R1D rK6iB1VYzrqFdfwkvuKRYHSItNyAIMohu8KL2ArKnWZ52FZd4f3fhWxAUXY26AkV82hQ 3I59E/tqxfeMWYJ+iFJRD0modjB/U6+HkBz9U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=czlkldao0R5IrL3lsGFXllVoobljtqABNmcbi+mVAkuMj059/GmI+cIMXpBqEbqjnJ XkvEExerksG1/C50EF+SuHUeOTyxEkc2AtZxxi8pzvE4GGZPYf0cqikeBE8Cc3dg8/Ws g12dRfZ+Ge6NDgOhKWejYuUTWWW0j75lBT258= Received: by 10.220.45.134 with SMTP id e6mr2173178vcf.55.1305086497102; Tue, 10 May 2011 21:01:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.199.8 with HTTP; Tue, 10 May 2011 21:01:17 -0700 (PDT) In-Reply-To: <4DCA0845.1020506@lerdorf.com> References: <4DCA0845.1020506@lerdorf.com> Date: Wed, 11 May 2011 01:01:17 -0300 Message-ID: To: Rasmus Lerdorf Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] making system calls from a php extension From: sosagabriel@gmail.com (Gabriel Sosa) I'm basically using lynx to convert some html into plain text basically replicating the following command: *lynx -pseudo_inlines=off -hiddenlinks=merge -reload -cache=0 -notitle -force_html -dump -nocolor -stdin* I've been looking but I didn't find any other library capable to do the same with "almost" the same quality. Thanks On Wed, May 11, 2011 at 12:53 AM, Rasmus Lerdorf wrote: > On 05/10/2011 08:42 PM, Gabriel Sosa wrote: >> >> hello everyone! >> >> I'm trying to gain some speed by moving a function from PHP legacy >> code to C and making an extension. I'm trying to call *lynx* from the >> command line since their C api isn't something soo nice likely to use >> it as any other libXX > > If it were me I would take a step back and look at what lynx was actually > needed for and whether there are other libraries out there that can do > similar things. Like libcurl + the html parsing available in libxml2, for > example. I'm assuming you are calling lynx in order to use its html parser? > > Moving something from PHP to C for performance reasons, but leaving in the > call to an external program isn't going to buy you much, if anything, since > most of your time is spent forking and launching that external program on > each request. > > -Rasmus > -- Gabriel Sosa Si buscas resultados distintos, no hagas siempre lo mismo. - Einstein