ziparchive

php 7.2 ZipArchive class not having setEncryptionName function

不羁岁月 提交于 2019-12-07 00:20:29
Have upgraded my php version from 5.6 to 7.2 but i dont see new php functions like setEncryptionName for ZipArchive class. i confirm this by echoing get_class_methods('zipArchive'). Do i need to do anything else in order to use the new set of functions the newer php version provides? Please help. The ZipArchive class is part of the zip PECL extension for PHP You will need version 1.14.0 is higher for the setEncryptionName() function See changelog here: https://pecl.php.net/package/zip/1.14.0 The zip extension depends on libzip >= 1.2.0 NOTE: many Linux distributions ship an older version of

zipArchive unzip to document folder on iOS

吃可爱长大的小学妹 提交于 2019-12-06 09:28:12
I'm using ZipArchive to unzip but its unzipping the contents of the zip to a subdirectory of my documents named after the zip file instead of directly into my documents folder. Does anyone know what I can change to make sure its saves to the directory that I want? -(void) unZipUpdateArchiveAtPath: (NSString *)zipPath { NSLog(@"UNZIP Update PATH: %@", zipPath); ZipArchive *zipArchive = [[ZipArchive alloc] init]; if ([zipArchive UnzipOpenFile:zipPath]) { if ([zipArchive UnzipFileTo:[self documentDirectory] overWrite:YES]) { NSLog(@"Archive unzip success"); [zipArchive UnzipCloseFile]; } else {

Symfony ZipArchive PHP Extension Class Not Found

妖精的绣舞 提交于 2019-12-06 08:19:25
问题 I tried this code var_dump(class_exists('ZipArchive')); $zip = new ZipArchive(); well, the output is like this. bool(true) Fatal error: Class 'MyProject\ProjectBundle\Controller\ZipArchive' not found in \path\to\my\Controller.php on line 83 Anyone can help me how to solve this? I have installed php-pear php5-dev libcurl3-openssl-dev libevent-dev pecl-http all i need have been installed and i have put the extension to my php.ini then restart my apache But i still get that error. Then I tried

Read Xlsx file in PhpSpreadsheet

故事扮演 提交于 2019-12-06 06:35:11
问题 I want to read an xlsx file that was created in Microsoft Excel, but when I run the following code... $Source_File = "test.xlsx"; $Spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($Source_File); ...I receive the following error: Fatal error: Uncaught PhpOffice\PhpSpreadsheet\Reader\Exception: Unable to identify a reader for this file in /var/www/html/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php:163 Stack trace: #0 /var/www/html/vendor/phpoffice/phpspreadsheet/src

Extract folder content using ZipArchive

怎甘沉沦 提交于 2019-12-06 05:33:00
问题 I have compressed_file.zip on a site with this structure: I want to extract all content from version_1.x folder to my root folder: How can I do that? is possible without recursion? 回答1: It's possible, but you have to read and write the file yourself using ZipArchive::getStream: $source = 'version_1.x'; $target = '/path/to/target'; $zip = new ZipArchive; $zip->open('myzip.zip'); for($i=0; $i<$zip->numFiles; $i++) { $name = $zip->getNameIndex($i); // Skip files not in $source if (strpos($name,

ZipArchive Library Is Not Enabled When Using PHPExcel

余生长醉 提交于 2019-12-05 10:17:48
I am using CodeIgniter and PHPExcel to read and write to excel files. Everything worked fine in localhost, but when I uploaded my PHP CodeIgniter application to the server in pagodabox I got the below message when I tried to read data from excel files. Fatal error: Uncaught exception 'Exception' with message 'ZipArchive library is not enabled' in /var/www/application/libraries/PHPExcel/Reader/Excel2007.php For writing, PHPExcel does provide PCLZip as an alternative to ZipArchive. You can configure it to use this by calling PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP); But if you

NSOpenPanel get filename in Objective-C?

╄→гoц情女王★ 提交于 2019-12-04 19:55:58
When I create an NSOpenPanel, like this: int i; NSOpenPanel* openDlg = [NSOpenPanel openPanel]; [openDlg setCanChooseFiles:YES]; [openDlg setCanChooseDirectories:YES]; if ([openDlg runModalForDirectory:nil file:nil] == NSOKButton) { NSArray* files = [openDlg filenames]; for( i = 0; i < [files count]; i++ ) { NSString* fileName = [files objectAtIndex:i]; NSLog(fileName); NSString *catched = fileName; [self performSelector:@selector(decompresss2z:) withObject:catched]; } } And when I log fileName , it is correct and prints my file full directory, but when I try to use it with my void, it gets

“Include of non-modular header inside framework module” in C header of SSZipArchive

社会主义新天地 提交于 2019-12-04 17:01:07
I'm trying to use SSZipArchive objc library in my Swift iOS Project. What I did: Created an Objective-C "Cocoa Touch Framework" Followed this guide to import SSZipArchive's objective C and C files into it. Changed all C headers to public as per this answer Change build settings to allow non-modular includes as per this answer The framework compiles fine. I'd manage to use objective C libraries in Swift projects using this way before so I guess the steps are correct? The problem right now is when I try do Import SSZip in my project and try to compile, it gives "Include of non-modular header

Read Xlsx file in PhpSpreadsheet

社会主义新天地 提交于 2019-12-04 12:50:24
I want to read an xlsx file that was created in Microsoft Excel, but when I run the following code... $Source_File = "test.xlsx"; $Spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($Source_File); ...I receive the following error: Fatal error: Uncaught PhpOffice\PhpSpreadsheet\Reader\Exception: Unable to identify a reader for this file in /var/www/html/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php:163 Stack trace: #0 /var/www/html/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php(93): PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile('file:///home

Symfony ZipArchive PHP Extension Class Not Found

安稳与你 提交于 2019-12-04 12:36:40
I tried this code var_dump(class_exists('ZipArchive')); $zip = new ZipArchive(); well, the output is like this. bool(true) Fatal error: Class 'MyProject\ProjectBundle\Controller\ZipArchive' not found in \path\to\my\Controller.php on line 83 Anyone can help me how to solve this? I have installed php-pear php5-dev libcurl3-openssl-dev libevent-dev pecl-http all i need have been installed and i have put the extension to my php.ini then restart my apache But i still get that error. Then I tried this $z = new /ZipArchive(); from this page and then i got this error : Parse error: syntax error,