diff --git a/CREDITS b/CREDITS deleted file mode 100644 index 6f9c6d2..0000000 --- a/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -pcsc -Johann Dantant, Johannes Findeisen, Marco Schuster, Calvin Buckley diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..68ab9e7 --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,11 @@ +# Contributors + +## In alphabetical order: + + * Johann Dantant (Original author) + * Anatol Belski (Contributor) + * Calvin Buckley (Contributor) + * Remi Collet (Contributor) + * Johannes Findeisen (Maintainer) + * Marco Schuster (Contributor) + diff --git a/README.md b/README.md index 43ab2d3..de9fc05 100644 --- a/README.md +++ b/README.md @@ -1,90 +1,96 @@ -

About

+# PC/SC for PHP -

This is the only extension for using PC/SC based smart cards with PHP. It is a wrapper to the wonderful and free project by Ludovic Rousseau, PCSC-Lite, which is the middleware to access a smart card using SCard API (PC/SC). Since PCSC-Lite is compatible to the winscard API it should be possible to compile this extension using a Windows or macOS operating system.

+## About -

Thanks are going to Johann Dantant! He provides a PC/SC extension for PHP since 2005 and I reused some of his code. He allowed me to relicense these parts under the terms of the PHP license so I could integrate PCSC-Lite natively into PHP.

+This is the only extension for using [PC/SC](http://www.pcscworkgroup.com/) based smart cards with [PHP](http://www.php.net). It is a wrapper to the wonderful and free project by Ludovic Rousseau, [PCSC-Lite](https://pcsclite.apdu.fr/), which is the middleware to access a smart card using SCard API (PC/SC). Since PCSC-Lite is compatible to the winscard API it should be possible to compile this extension using a Windows or macOS operating system. -

Installation

+Thanks are going to Johann Dantant! He provided a PC/SC extension for PHP since 2005 and I reused some of his code. He allowed me to relicense these parts under the terms of the PHP license so I could integrate PCSC-Lite native into PHP. -

I recommend to install the PECL extension the "PHP" way:

+## Installation -
pecl install pcsc-beta
+I recommend to install the PECL extension the "PHP" way: -

You can install the latest code by downloading the sources and compile yourself too.

+``` +pecl install pcsc-beta +``` -
git clone https://github.com/pcsc-for-php/pcsc.git
+You can install the latest code by downloading the sources and compile yourself too.
+
+```
+git clone https://github.com/pcsc-for-php/pcsc.git
 cd pcsc
 phpize
 ./configure
 make
-make install
+make install +``` -

After that you have all needed files in ./modules/

+After that you have all needed files in ./modules/ . -

API

+## API -

The extension currently provides the following API:

+The extension currently provides the following API: -

scard_establish_context();

+### scard_establish_context">scard_establish_context(); -

Returns the application $context to the PC/SC resource manager.

+Returns the application $context to the PC/SC resource manager. -

scard_is_valid_context($context);

+### scard_is_valid_context">scard_is_valid_context($context); -

Returns TRUE if $context is valid or FALSE if $context is not valid.

+Returns TRUE if $context is valid or FALSE if $context is not valid. -

scard_release_context($context);

+### scard_release_context">scard_release_context($context); -

Releases the application $context.

+Releases the application $context. -

scard_list_readers($context);

+### scard_list_readers">scard_list_readers($context); -

Returns an array of available readers or FALSE.

+Returns an array of available readers or FALSE. -
Example:
+#### Example: -
array(3) {
-  [0]=>
+```
+array(3) {
+  [0]=>
   string(26) "OMNIKEY CardMan 5x21 00 00"
-  [1]=>
+  [1]=>
   string(26) "OMNIKEY CardMan 5x21 00 01"
-  [2]=>
+  [2]=>
   string(76) "SCL01x Contactless Reader [SCL01x Contactless Reader] (21161009200722) 00 00"
 }
-
+``` -

scard_connect($context, "OMNIKEY CardMan 5x21 00 00");

+### scard_connect">scard_connect($context, "OMNIKEY CardMan 5x21 00 00"); -

Connects to a card. Returns the $connection to a reader or FALSE.

+Connects to a card. Returns the $connection to a reader or FALSE. -

scard_reconnect($connection);

+### scard_reconnect">scard_reconnect($connection); -

Returns the $connection to a reader or FALSE.

+Returns the $connection to a reader or FALSE. -

scard_disconnect($connection);

+### scard_disconnect">scard_disconnect($connection); -

Disconnects the $connection to a card. Returns the TRUE if disconnecting was succesful or FALSE.

+Disconnects the $connection to a card. Returns the TRUE if disconnecting was succesful or FALSE. -

scard_transmit($connection, $apdu);

+### scard_transmit">scard_transmit($connection, $apdu); -

Returns the response $apdu as string or FALSE.

+Returns the response $apdu as string or FALSE. -

scard_status($connection);

+### scard_status">scard_status($connection); -

Returns the status or FALSE.

+Returns the status or FALSE. -

scard_cancel($context);

+### scard_cancel">scard_cancel($context); -

License

+## License -

This code is licensed under the terms of the PHP License version 3.01. PCSC-Lite is licensed in a way where it is possible to integrate it native in the PHP environment.

+This code is licensed under the terms of the PHP License version 3.01. PCSC-Lite is licensed in a way where it is possible to integrate it native in the PHP environment. - +## Links + + * [PECL Project Page](http://pecl.php.net/package/pcsc) - Page for package download at PHP.net + * [PC/SC Worgroup](http://www.pcscworkgroup.com/) - Homepage and definition file downloads + * [PC/SC](http://en.wikipedia.org/wiki/PC/SC) - PC/SC at Wikipedia + * [PC/SC-Lite](https://pcsclite.apdu.fr/) - The free and open implementation of the PC/SC SCard API for UNIX + * [PCSC sample in PHP5](http://ludovicrousseau.blogspot.de/2015/01/pcsc-sample-in-php5.html) - Ludovic Rousseau about "PC/SC for PHP" - diff --git a/TODO b/TODO deleted file mode 100644 index 644bbb0..0000000 --- a/TODO +++ /dev/null @@ -1,15 +0,0 @@ -Implement important missing PC/SC functions: - - - SCardControl(), - SCardGetStatusChange(), - SCardBeginTransaction(), - SCardEndTransaction() - -Implement less important missing PC/SC functions: - - - SCardGetAttrib(), - SCardSetAttrib(), - SCardListReaderGroups(), - SCardReconnect - -Write complete API documentation diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..2c2cdab --- /dev/null +++ b/TODO.md @@ -0,0 +1,17 @@ +# TODO + +## Implement important missing PC/SC functions and write documentation: + + * SCardControl() + * SCardGetStatusChange() + * SCardBeginTransaction() + * SCardEndTransaction() + * Write complete API documentation + +## Implement less important missing PC/SC functions: + + * SCardGetAttrib() + * SCardSetAttrib() + * SCardListReaderGroups() + * SCardReconnect + diff --git a/package.xml b/package.xml index 0596307..1077076 100644 --- a/package.xml +++ b/package.xml @@ -20,10 +20,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> calvin@cmpct.info yes - 2021-02-20 - + 2021-02-21 + - 0.5.0 + 0.5.1 0.3.1 @@ -31,11 +31,11 @@ http://pear.php.net/dtd/package-2.0.xsd"> stable PHP - Updated for PHP 8 compatibility. + Added and updated content like README.md; No bug or feature updates. - + @@ -43,7 +43,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> - + + diff --git a/php_pcsc.h b/php_pcsc.h index bf607f5..e91ff4e 100644 --- a/php_pcsc.h +++ b/php_pcsc.h @@ -4,7 +4,7 @@ extern zend_module_entry pcsc_module_entry; #define phpext_pcsc_ptr &pcsc_module_entry -#define PHP_PCSC_VERSION "0.5.0" +#define PHP_PCSC_VERSION "0.5.1" #ifdef PHP_WIN32 #define PHP_PCSC_API __declspec(dllexport)