Actions

API16

Difference between revisions of "JFilesystemHelper/ftpChmod"

From Joomla! Documentation

< API16:JFilesystemHelper
(New page: ===Description=== Quick FTP chmod http://www.php.net/manual/en/function.ftp-chmod.php <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JFilesystemHe...)
 
m (removing red link to edit, no existant pages)
 
Line 4: Line 4:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JFilesystemHelper/ftpChmod|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JFilesystemHelper/ftpChmod}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 66: Line 66:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JFilesystemHelper/ftpChmod|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JFilesystemHelper/ftpChmod}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 81: Line 81:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API16]]

Latest revision as of 00:07, 13 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Quick FTP chmod http://www.php.net/manual/en/function.ftp-chmod.php


[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

ftpChmod($url, $mode)
Parameter Name Default Value Description
$url
$mode

Defined in

libraries/joomla/filesystem/helper.php

Importing

jimport( 'joomla.filesystem.helper' );

Source Body

function ftpChmod($url, $mode) {
        $sch = parse_url($url, PHP_URL_SCHEME);
        if (($sch != "ftp") && ($sch != "ftps")) {
                return false;
        }
        $server = parse_url($url, PHP_URL_HOST);
        $port = parse_url($url, PHP_URL_PORT);
        $path = parse_url($url, PHP_URL_PATH);
        $user = parse_url($url, PHP_URL_USER);
        $pass = parse_url($url, PHP_URL_PASS);
        if ((!$server) || (!$path)) { return false; }
        if (!$port) { $port = 21; }
        if (!$user) { $user = "anonymous"; }
        if (!$pass) { $pass = ""; }
        switch ($sch) {
                case "ftp":
                        $ftpid = ftp_connect($server, $port);
                        break;
                case "ftps":
                        $ftpid = ftp_ssl_connect($server, $port);
                        break;
        }
        if (!$ftpid) { return false; }
        $login = ftp_login($ftpid, $user, $pass);
        if (!$login) { return false; }
        $res = ftp_chmod($ftpid, $mode, $path);
        ftp_close($ftpid);
        return $res;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />