From: Greg Beaver Date: Sun, 23 Mar 2008 19:03:15 +0000 (+0000) Subject: add Phar->getPath() for retrieving the full path to the phar archive. X-Git-Tag: RELEASE_2_0_0a1~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cac70206f27c1c8937236dd9750e5b0b4655909a;p=php add Phar->getPath() for retrieving the full path to the phar archive. this is useful for renaming and also always returns the realpath() --- diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 8f529a1ab9..9f8fc01781 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -2020,6 +2020,17 @@ PHP_METHOD(Phar, getAlias) } /* }}} */ +/* {{{ 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 @@ zend_function_entry php_archive_methods[] = { 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)