Index: trunk/extensions/Deployment/includes/filesystems/FtpFilesystem.php |
— | — | @@ -277,6 +277,7 @@ |
278 | 278 | $type = FTP_BINARY; |
279 | 279 | |
280 | 280 | // TODO: port wp_tempnam |
| 281 | + die( __METHOD__ . ' TODO: port wp_tempnam' ); |
281 | 282 | $tempFileName = wp_tempnam( $file ); |
282 | 283 | $temp = fopen( $tempFileName , 'w+' ); |
283 | 284 | |
— | — | @@ -286,7 +287,8 @@ |
287 | 288 | |
288 | 289 | wfSuppressWarnings(); |
289 | 290 | $ftp_fget = ftp_fget( $this->connection, $temp, $file, $type ); |
290 | | - wfRestoreWarnings(); |
| 291 | + wfRestoreWarnings(); |
| 292 | + |
291 | 293 | if ( !$ftp_fget ) { |
292 | 294 | return false; |
293 | 295 | } |
— | — | @@ -515,6 +517,7 @@ |
516 | 518 | |
517 | 519 | /** |
518 | 520 | * Function copied from wp-admin/includes/class-wp-filesystem-ftpext.php in WP 3.0. |
| 521 | + * Only made it conform to the general MW guidelines, might still be messy at places though. |
519 | 522 | */ |
520 | 523 | protected function parseListing( $line ) { |
521 | 524 | static $is_windows; |
Index: trunk/extensions/Deployment/includes/filesystems/Ssh2Filesystem.php |
— | — | @@ -0,0 +1,202 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * File holding the Ssh2Filesystem class. |
| 6 | + * |
| 7 | + * @file Ssh2Filesystem.php |
| 8 | + * @ingroup Deployment |
| 9 | + * @ingroup Filesystem |
| 10 | + * |
| 11 | + * @author Jeroen De Dauw |
| 12 | + */ |
| 13 | + |
| 14 | +/** |
| 15 | + * Filesystem class for file and folder manipulation over SSH2. |
| 16 | + * |
| 17 | + * @author Jeroen De Dauw |
| 18 | + */ |
| 19 | +class Ssh2Filesystem extends Filesystem { |
| 20 | + |
| 21 | + /** |
| 22 | + * Constructor. |
| 23 | + */ |
| 24 | + public function __construct() { |
| 25 | + |
| 26 | + } |
| 27 | + |
| 28 | + /** |
| 29 | + * @see Filesystem::connect |
| 30 | + */ |
| 31 | + public function connect() { |
| 32 | + |
| 33 | + } |
| 34 | + |
| 35 | + /** |
| 36 | + * @see Filesystem::changeDir |
| 37 | + */ |
| 38 | + public function changeDir( $dir ) { |
| 39 | + |
| 40 | + } |
| 41 | + |
| 42 | + /** |
| 43 | + * @see Filesystem::changeFileGroup |
| 44 | + */ |
| 45 | + public function changeFileGroup( $file, $group, $recursive = false ) { |
| 46 | + |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * @see Filesystem::chmod |
| 51 | + */ |
| 52 | + public function chmod( $file, $mode = false, $recursive = false ) { |
| 53 | + |
| 54 | + } |
| 55 | + |
| 56 | + /** |
| 57 | + * @see Filesystem::chown |
| 58 | + */ |
| 59 | + public function chown( $file, $owner, $recursive = false ) { |
| 60 | + |
| 61 | + } |
| 62 | + |
| 63 | + /** |
| 64 | + * @see Filesystem::delete |
| 65 | + */ |
| 66 | + public function delete( $path, $recursive = false ) { |
| 67 | + |
| 68 | + } |
| 69 | + |
| 70 | + /** |
| 71 | + * @see Filesystem::doCopy |
| 72 | + */ |
| 73 | + protected function doCopy( $from, $to ) { |
| 74 | + |
| 75 | + } |
| 76 | + |
| 77 | + /** |
| 78 | + * @see Filesystem::doMove |
| 79 | + */ |
| 80 | + protected function doMove( $from, $to ) { |
| 81 | + |
| 82 | + } |
| 83 | + |
| 84 | + /** |
| 85 | + * @see Filesystem::exists |
| 86 | + */ |
| 87 | + public function exists( $file ) { |
| 88 | + |
| 89 | + } |
| 90 | + |
| 91 | + /** |
| 92 | + * @see Filesystem::getChmod |
| 93 | + */ |
| 94 | + public function getChmod( $file ) { |
| 95 | + |
| 96 | + } |
| 97 | + |
| 98 | + /** |
| 99 | + * @see Filesystem::getContents |
| 100 | + */ |
| 101 | + public function getContents() { |
| 102 | + |
| 103 | + } |
| 104 | + |
| 105 | + /** |
| 106 | + * @see Filesystem::getCreationTime |
| 107 | + */ |
| 108 | + public function getCreationTime( $file ) { |
| 109 | + |
| 110 | + } |
| 111 | + |
| 112 | + /** |
| 113 | + * @see Filesystem::getCurrentWorkingDir |
| 114 | + */ |
| 115 | + public function getCurrentWorkingDir() { |
| 116 | + |
| 117 | + } |
| 118 | + |
| 119 | + /** |
| 120 | + * @see Filesystem::getGroup |
| 121 | + */ |
| 122 | + public function getGroup( $file ) { |
| 123 | + |
| 124 | + } |
| 125 | + |
| 126 | + /** |
| 127 | + * @see Filesystem::getModificationTime |
| 128 | + */ |
| 129 | + public function getModificationTime( $file ) { |
| 130 | + |
| 131 | + } |
| 132 | + |
| 133 | + /** |
| 134 | + * @see Filesystem::getOwner |
| 135 | + */ |
| 136 | + public function getOwner( $file ) { |
| 137 | + |
| 138 | + } |
| 139 | + |
| 140 | + /** |
| 141 | + * @see Filesystem::getSize |
| 142 | + */ |
| 143 | + public function getSize( $file ) { |
| 144 | + |
| 145 | + } |
| 146 | + |
| 147 | + /** |
| 148 | + * @see Filesystem::isDir |
| 149 | + */ |
| 150 | + public function isDir( $path ) { |
| 151 | + |
| 152 | + } |
| 153 | + |
| 154 | + /** |
| 155 | + * @see Filesystem::isFile |
| 156 | + */ |
| 157 | + public function isFile( $path ) { |
| 158 | + |
| 159 | + } |
| 160 | + |
| 161 | + /** |
| 162 | + * @see Filesystem::isReadable |
| 163 | + */ |
| 164 | + public function isReadable( $file ) { |
| 165 | + |
| 166 | + } |
| 167 | + |
| 168 | + /** |
| 169 | + * @see Filesystem::isWritable |
| 170 | + */ |
| 171 | + public function isWritable( $file ) { |
| 172 | + |
| 173 | + } |
| 174 | + |
| 175 | + /** |
| 176 | + * @see Filesystem::listDir |
| 177 | + */ |
| 178 | + public function listDir( $path, $includeHidden = true, $recursive = false ) { |
| 179 | + |
| 180 | + } |
| 181 | + |
| 182 | + /** |
| 183 | + * @see Filesystem::makeDir |
| 184 | + */ |
| 185 | + public function makeDir( $path, $chmod = false, $chown = false, $chgrp = false ) { |
| 186 | + |
| 187 | + } |
| 188 | + |
| 189 | + /** |
| 190 | + * @see Filesystem::touch |
| 191 | + */ |
| 192 | + public function touch( $file, $time = 0, $atime = 0 ) { |
| 193 | + |
| 194 | + } |
| 195 | + |
| 196 | + /** |
| 197 | + * @see Filesystem::writeToFile |
| 198 | + */ |
| 199 | + public function writeToFile( $file, $contents ) { |
| 200 | + |
| 201 | + } |
| 202 | + |
| 203 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Deployment/includes/filesystems/Ssh2Filesystem.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 204 | + native |
Index: trunk/extensions/Deployment/includes/Filesystem.php |
— | — | @@ -17,8 +17,8 @@ |
18 | 18 | * @defgroup Filesystem Filesystem |
19 | 19 | */ |
20 | 20 | |
21 | | -define('FS_CHMOD_DIR', 0755 ); |
22 | | -define('FS_CHMOD_FILE', 0644 ); |
| 21 | +define( 'FS_CHMOD_DIR', 0755 ); |
| 22 | +define( 'FS_CHMOD_FILE', 0644 ); |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Base class providing a way to access filesystems. |
— | — | @@ -270,7 +270,7 @@ |
271 | 271 | public function __construct() { |
272 | 272 | // TODO |
273 | 273 | } |
274 | | - |
| 274 | + /* |
275 | 275 | public static function findFolder() { |
276 | 276 | // TODO |
277 | 277 | } |
— | — | @@ -278,7 +278,7 @@ |
279 | 279 | private static function searchForFolder() { |
280 | 280 | // TODO |
281 | 281 | } |
282 | | - |
| 282 | + */ |
283 | 283 | public function getContentsArray() { |
284 | 284 | return explode( "\n", $this->getContents() ); |
285 | 285 | } |