Des del 2000 compartiendo sobre…

Tag: classes

PHPClasses: VirtualCron, GoogleMaps i InsertFTP

Reading time: 2 – 2 minutes

A través de PHPClasses he trobat aquestes tres classes de PHP que tenen bona pinta així que espero que algún dia li facin servei a algú o a mi mateix:

  • Insert FTP: This class can be used to manage FTP user accounts stored in a MySQL database.It can connect to a MySQL server that has a database of FTP user accounts used by FTP servers like pure-ftpd. It can: add new user accounts, block an user, change account quotas, retrieve the details of an FTP user account.
  • Karatag Google Maps HTTP Request: The Google Maps API is mostly known for being able to present maps of anywhere in the world in any Web site. However, Google Maps API is also able to provide other interesting features, like determining the geographic coordinates of a given address. This class uses the Google Maps API just for the purpose of determining the location associated to an address from PHP programs.
  • Virtual Cron: Many Web applications need to execute periodical tasks, like sending newsletters, processing pending e-commerce orders, etc. Some operating systems come with programs, like cron or at, to execute scheduled tasks. However, under some Web hosting environments these programs cannot be used. This class provides an alternative solution that can be used in more restricted hosting environments. It uses files to keep track of the last time when a periodical task was executed. The site Web page scripts can use the class to check these files. The class can tell when it is time to execute a task again. When it is time, the same script can execute the scheduled task without depending on external programs.

PHP: notes sobre arrays i tres classes (myCurl, barcodes, WSSoapClient)

Reading time: 2 – 3 minutes

A HowtoForge han publicat un howto (local) sobre com funcionen els arrays en PHP que esta molt bé. Realment el que més valoro són les notes sobre les funcions que menys s’acostumen a usar i per tant, les menys documentades o més mal documentades. Tot i que sovint quan les descobreixes ja no pots viure sense elles, funcions de búsqueda, de push, pop, var_dump per depurar, etc.

A més a través de phpClasses he trobat tres classes que els hi he de donar un bon cop d’ull ja que tenen molt bona pinta:

  • MyCurl This class provides an alternative implementation of the cURL extension functions in pure PHP. It automatically detects whether the cURL library is available. If it is not available, it defines several functions with the same names of the cURL extension that use the class to emulate part the original functionality. Currently it implements the functions: curl_init, curl_exec, curl_setopt and curl_close. Several of the most important options can be set with the curl_setopt function.
  • HTML Bar Codes This package can be used to display bar codes using only HTML with CSS styles. It takes a code to represent and generates CSS style definitions and HTML tags to render that code in an HTML page. There are two classes that can render bar codes using the Code39 and Interleave 2 of 5 standards respectively.
  • WSSoapClient This class can add WSSecurity authentication support to SOAP clients implemented with the PHP 5 SOAP extension. It extends the PHP 5 SOAP client support to add the necessary XML tags to the SOAP client requests in order to authenticate on behalf of a given user with a given password. This class was tested with Axis and WSS4J servers.