r69078 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69077‎ | r69078 | r69079 >
Date:22:39, 5 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Work on porting WP filesystem abstraction classes
Modified paths:
  • /trunk/extensions/Deployment/includes/Filesystem.php (modified) (history)
  • /trunk/extensions/Deployment/includes/filesystems/FtpFilesystem.php (modified) (history)
  • /trunk/extensions/Deployment/includes/filesystems/Ssh2Filesystem.php (added) (history)

Diff [purge]

Index: trunk/extensions/Deployment/includes/filesystems/FtpFilesystem.php
@@ -277,6 +277,7 @@
278278 $type = FTP_BINARY;
279279
280280 // TODO: port wp_tempnam
 281+ die( __METHOD__ . ' TODO: port wp_tempnam' );
281282 $tempFileName = wp_tempnam( $file );
282283 $temp = fopen( $tempFileName , 'w+' );
283284
@@ -286,7 +287,8 @@
287288
288289 wfSuppressWarnings();
289290 $ftp_fget = ftp_fget( $this->connection, $temp, $file, $type );
290 - wfRestoreWarnings();
 291+ wfRestoreWarnings();
 292+
291293 if ( !$ftp_fget ) {
292294 return false;
293295 }
@@ -515,6 +517,7 @@
516518
517519 /**
518520 * 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.
519522 */
520523 protected function parseListing( $line ) {
521524 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
1204 + native
Index: trunk/extensions/Deployment/includes/Filesystem.php
@@ -17,8 +17,8 @@
1818 * @defgroup Filesystem Filesystem
1919 */
2020
21 -define('FS_CHMOD_DIR', 0755 );
22 -define('FS_CHMOD_FILE', 0644 );
 21+define( 'FS_CHMOD_DIR', 0755 );
 22+define( 'FS_CHMOD_FILE', 0644 );
2323
2424 /**
2525 * Base class providing a way to access filesystems.
@@ -270,7 +270,7 @@
271271 public function __construct() {
272272 // TODO
273273 }
274 -
 274+ /*
275275 public static function findFolder() {
276276 // TODO
277277 }
@@ -278,7 +278,7 @@
279279 private static function searchForFolder() {
280280 // TODO
281281 }
282 -
 282+ */
283283 public function getContentsArray() {
284284 return explode( "\n", $this->getContents() );
285285 }

Status & tagging log