Changeset 3291 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/zip/class-builder.php
- Timestamp:
- 06/02/2016 08:25:35 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/zip/class-builder.php
r3212 r3291 114 114 115 115 // Cleanup any symlinks that shouldn't be there 116 exec( sprintf(116 $this->exec( sprintf( 117 117 'find %s -type l -print0 | xargs -r0 rm', 118 118 escapeshellarg( $build_dir ) … … 133 133 protected function fix_directory_dates() { 134 134 // Find all files, output their modified dates, sort reverse numerically, grab the timestamp from the first entry 135 $latest_file_modified_timestamp = exec( sprintf(135 $latest_file_modified_timestamp = $this->exec( sprintf( 136 136 "find %s -type f -printf '%%T@\n' | sort -nr | head -c 10", 137 137 escapeshellarg( $this->tmp_build_dir ) … … 141 141 } 142 142 143 exec( sprintf(143 $this->exec( sprintf( 144 144 'find %s -type d -exec touch -m -t %s {} \;', 145 145 escapeshellarg( $this->tmp_build_dir ), … … 154 154 // We have to remove the temporary 0-byte file first as zip will complain about not being able to find the zip structures. 155 155 unlink( $this->tmp_build_file ); 156 exec( $cmd =sprintf(156 $this->exec( sprintf( 157 157 'cd %s && find %s -print0 | sort -z | xargs -0 zip -Xu %s 2>&1', 158 158 escapeshellarg( $this->tmp_build_dir ), … … 169 169 * Moves the completed ZIP into it's real-life location. 170 170 */ 171 function move_into_place() {172 exec( sprintf(171 protected function move_into_place() { 172 $this->exec( sprintf( 173 173 'mv -f %s %s', 174 174 $this->tmp_build_file, … … 186 186 * This can also be used for generating a package signature in the future. 187 187 */ 188 function generate_md5() {189 exec( sprintf(188 protected function generate_md5() { 189 $this->exec( sprintf( 190 190 "md5sum %s | head -c 32 > %s", 191 191 escapeshellarg( $this->zip_file ), … … 206 206 } 207 207 if ( $this->tmp_build_dir ) { 208 exec( sprintf( 'rm -rf %s', escapeshellarg( $this->tmp_build_dir ) ) ); 209 } 210 } 208 $this->exec( sprintf( 'rm -rf %s', escapeshellarg( $this->tmp_build_dir ) ) ); 209 } 210 } 211 212 /** 213 * Executes a command with 'proper' locale/language settings 214 * so that utf8 strings are handled correctly. 215 * 216 * WordPress.org uses the en_US.UTF-8 locale. 217 */ 218 protected function exec( $command, &$output = null, &$return_val = null ) { 219 return exec( 'export LC_CTYPE="en_US.UTF-8" LANG="en_US.UTF-8"; ' . $command, $output, $return_val ); 220 } 221 211 222 } 212 223
Note: See TracChangeset
for help on using the changeset viewer.