From owner-freebsd-ports@FreeBSD.ORG Mon Dec 3 14:49:31 2007 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8F5A16A41A for ; Mon, 3 Dec 2007 14:49:31 +0000 (UTC) (envelope-from attos.janus@gmail.com) Received: from rn-out-0102.google.com (rn-out-0910.google.com [64.233.170.190]) by mx1.freebsd.org (Postfix) with ESMTP id 753D213C47E for ; Mon, 3 Dec 2007 14:49:31 +0000 (UTC) (envelope-from attos.janus@gmail.com) Received: by rn-out-0102.google.com with SMTP id e5so2471316rng for ; Mon, 03 Dec 2007 06:49:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=fo4s26KTYXJE0Z3kWtAupb+2TCoLOj8rDI/GNvP6wCQ=; b=DfISYCT5SErhcIT5n4YOr/DBG+/n3cVCXceqZuHZoNp4ZXmPtx7llW+9y5Y5xG+jx4RokG8AfpDd9VYISNZzS1/W+QvS34pXr9RSiTTR8wrHahHV9ZxkdcHivYT2MitnKDdqZ7uIlLlBDlS/JBtIoItzbmV6TVWNbd4OOB2AN8I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KBoVpn7wCDzVtfNQjTFV5AxdLNJp0NLmlxKGWmYsdBunCDIFh6pUIqy6pa33KyFMqFx3T1qIuiOiDnM04Kyi3NHMquGDkYwvCdZJM6vMhVHtguHyByOW4lqFNCdlGeCIEb5ehF+kyv6Jcg9VL+RM/5v1zRMZghbNke6C2L/uX5M= Received: by 10.150.153.19 with SMTP id a19mr2750630ybe.1196691692347; Mon, 03 Dec 2007 06:21:32 -0800 (PST) Received: by 10.150.199.10 with HTTP; Mon, 3 Dec 2007 06:21:32 -0800 (PST) Message-ID: <5297d6fd0712030621l25916c7et9fe487b76c557dd4@mail.gmail.com> Date: Mon, 3 Dec 2007 09:21:32 -0500 From: Attos To: jekillen , freebsd-ports In-Reply-To: <4751A84A.2070007@infracaninophile.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4751A84A.2070007@infracaninophile.co.uk> Cc: Subject: Re: PHP ClamAV Lib X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2007 14:49:31 -0000 You can execute ClamAV from PHP and parse the result. The exec() function can do the job. This is the description from the PHP manual: exec (PHP 3, PHP 4, PHP 5) exec -- Execute an external program Description string exec ( string command [, array &output [, int &return_var]] ) exec() executes the given command. Parameters command The command that will be executed. output If the output argument is present, then the specified array will be filled with every line of output from the command. Trailing whitespace, such as \n, is not included in this array. Note that if the array already contains some elements, exec() will append to the end of the array. If you do not want the function to append elements, call unset() on the array before passing it to exec(). return_var If the return_var argument is present along with the output argument, then the return status of the executed command will be written to this variable. Return Values The last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function. To get the output of the executed command, be sure to set and use the output parameter. Examples Example 1. An exec() example On Dec 1, 2007 1:30 PM, Matthew Seaman wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > jekillen wrote: > > Hello: > > I am looking for PHP ClamAV Lib > > in ports and I do not know of hand > > where to find it. I did not find it in > > /usr/ports/security. And if it exists in > > ports, what would it be called for a > > find command? > > My aim is to use it for scanning files > > uploaded to web sites in php scripts. > > I installed ClamAV, Amavisd-new, > > and Cyrus-sasl-saslauthd > > from /usr/ports/security. > > FreeBSD v 6.2 > > Thanks in advance > > Jeff K > > Unfortunately it seems that you are not in luck. There does > not appear to be a PHP related ClamAV module in the ports. Apache, > Perl or python, yes. PHP, no. > > happy-idiot-talk:/usr/ports:% make search name=clamav display=name,path > Port: p5-Mail-ClamAV-0.20 > Path: /usr/ports/mail/p5-Mail-ClamAV > > Port: clamav-0.91.2_1 > Path: /usr/ports/security/clamav > > Port: clamav-devel-20071011 > Path: /usr/ports/security/clamav-devel > > Port: p5-File-Scan-ClamAV-1.8_1 > Path: /usr/ports/security/p5-File-Scan-ClamAV > > Port: py25-clamav-0.4.0_1 > Path: /usr/ports/security/py-clamav > > Port: mod_clamav-0.21_1 > Path: /usr/ports/www/mod_clamav > > Perhaps you could view this as your chance to contribute something > back to the project. Take a gander at the Porter's Handbook -- > http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html > and look at some of the proir art already in the ports system and > see if you can't put together a pecl-clamav or pear-ClamAV port. > > Submit it via send-pr so that all can share. > > Cheers, > > Matthew > > - -- > Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard > Flat 3 > PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate > Kent, CT11 9PW > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.4 (FreeBSD) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHUahK8Mjk52CukIwRCGhQAJ4zey/5RU44g2sYGpSg12GYJeSITACePjOH > UQOX7vLvDVuk5nRchPyWBR4= > =gW4S > -----END PGP SIGNATURE----- > > _______________________________________________ > freebsd-ports@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" > -- Attos Janus