summaryrefslogtreecommitdiff
path: root/ext/phar/dirstream.c
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-06-15 18:15:48 +0000
committerGreg Beaver <cellog@php.net>2008-06-15 18:15:48 +0000
commit04e257a8e1556ac7f5673217b24d99708bdf3802 (patch)
treef0907374f5ac874105913c99ad29eeef9fcca261 /ext/phar/dirstream.c
parent04f211e38f92b09c18eba3fe635e2182d63a8b8d (diff)
downloadphp-git-04e257a8e1556ac7f5673217b24d99708bdf3802.tar.gz
HUGE speed improvement, from 19 req/sec to 27 req/sec for phpMyAdmin - now speed with apc+phar.cache_list = on-disk speedcvs diff -u |less This is by generating a list of virtual directories and using those in stat calls instead of scanning the whole manifest hash table. on-disk phpMyAdmin = 28 req/sec
Diffstat (limited to 'ext/phar/dirstream.c')
-rw-r--r--ext/phar/dirstream.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c
index 90f02fc2a1..19ac6f9cef 100644
--- a/ext/phar/dirstream.c
+++ b/ext/phar/dirstream.c
@@ -515,6 +515,7 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, char *url_from, int mode, in
efree(error);
return FAILURE;
}
+ phar_add_virtual_dirs(phar, entry.filename, entry.filename_len TSRMLS_CC);
return SUCCESS;
}
/* }}} */
@@ -589,12 +590,12 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_
entry->is_modified = 1;
phar_flush(phar, 0, 0, 0, &error TSRMLS_CC);
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", entry->filename, phar->fname, error);
- zend_hash_del(&phar->manifest, entry->filename, entry->filename_len);
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", entry->filename, phar->fname, error);
php_url_free(resource);
efree(error);
return FAILURE;
}
+ phar_delete_virtual_dirs(phar, resource->path + 1, strlen(resource->path) - 1 TSRMLS_CC);
php_url_free(resource);
return SUCCESS;
}