Changeset 3291
- Timestamp:
- 06/02/2016 08:25:35 AM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tools/class-svn.php
r3215 r3291 33 33 $esc_url = escapeshellarg( $url ); 34 34 35 $output = s hell_exec( "svn import $esc_options $esc_path $esc_url 2>&1" );35 $output = self::shell_exec( "svn import $esc_options $esc_path $esc_url 2>&1" ); 36 36 if ( preg_match( '/Committed revision (?P<revision>\d+)[.]/i', $output, $m ) ) { 37 37 $revision = (int) $m['revision']; … … 64 64 $esc_destination = escapeshellarg( $destination ); 65 65 66 $output = s hell_exec( "svn export $esc_options $esc_url $esc_destination 2>&1" );66 $output = self::shell_exec( "svn export $esc_options $esc_url $esc_destination 2>&1" ); 67 67 if ( preg_match( '/Exported revision (?P<revision>\d+)[.]/i', $output, $m ) ) { 68 68 $revision = (int) $m['revision']; … … 94 94 $esc_url = escapeshellarg( $url ); 95 95 96 $output = s hell_exec( "svn ls $esc_options $esc_url 2>&1" );96 $output = self::shell_exec( "svn ls $esc_options $esc_url 2>&1" ); 97 97 98 98 $errors = self::parse_svn_errors( $output ); … … 163 163 return false; 164 164 } 165 166 /** 167 * Executes a command with 'proper' locale/language settings 168 * so that utf8 strings are handled correctly. 169 * 170 * WordPress.org uses the en_US.UTF-8 locale. 171 */ 172 protected static function shell_exec( $command ) { 173 return shell_exec( 'export LC_CTYPE="en_US.UTF-8" LANG="en_US.UTF-8"; ' . $command ); 174 } 165 175 } -
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.