cvs: pecl /phar phar_object.c
| From: | Greg Beaver | Date: | Sun, 23 Mar 2008 19:03:14 +0000 |
| Subject: | cvs: pecl /phar phar_object.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-10036@lists.php.net to get a copy of this message | ||
cellog Sun Mar 23 19:03:14 2008 UTC
Modified files:
/pecl/phar phar_object.c
Log:
add Phar->getPath() for retrieving the full path to the phar archive.
this is useful for renaming and also always returns the realpath()
http://cvs.php.net/viewvc.cgi/pecl/phar/phar_object.c?r1=1.189&r2=1.190&diff_format=u
Index: pecl/phar/phar_object.c
diff -u pecl/phar/phar_object.c:1.189 pecl/phar/phar_object.c:1.190
--- pecl/phar/phar_object.c:1.189 Sun Mar 23 17:36:56 2008
+++ pecl/phar/phar_object.c Sun Mar 23 19:03:14 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: phar_object.c,v 1.189 2008/03/23 17:36:56 cellog Exp $ */
+/* $Id: phar_object.c,v 1.190 2008/03/23 19:03:14 cellog Exp $ */
#include "phar_internal.h"
#include "func_interceptors.h"
@@ -2020,6 +2020,17 @@
}
/* }}} */
+/* {{{ proto int Phar::getPath()
+ * Returns the real path to the phar archive on disk
+ */
+PHP_METHOD(Phar, getPath)
+{
+ PHAR_ARCHIVE_OBJECT();
+
+ RETURN_STRINGL(phar_obj->arc.archive->fname, phar_obj->arc.archive->fname_len, 1);
+}
+/* }}} */
+
/* {{{ proto bool Phar::setAlias(string alias)
* Sets the alias for a Phar archive. The default value is the full path
* to the archive.
@@ -3598,6 +3609,7 @@
PHP_ME(Phar, delete, arginfo_phar_delete, ZEND_ACC_PUBLIC)
PHP_ME(Phar, delMetadata, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getAlias, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(Phar, getPath, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getMetadata, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getModified, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getSignature, NULL, ZEND_ACC_PUBLIC)