• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ftp_chmod函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ftp_chmod函数的典型用法代码示例。如果您正苦于以下问题:PHP ftp_chmod函数的具体用法?PHP ftp_chmod怎么用?PHP ftp_chmod使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ftp_chmod函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: preparePath

 private function preparePath($subfolder)
 {
     if (!ftp_chdir($this->stream, $this->path)) {
         $this->throwException('Cannot change directory to path "%s"', $this->path);
     }
     $p = $path = $this->path . $subfolder;
     $folders = array();
     while ($p != $this->path) {
         if (!ftp_chdir($this->stream, $p)) {
             $folders[] = basename($p);
             $p = dirname($p);
         } else {
             krsort($folders);
             foreach ($folders as $folder) {
                 $p .= '/' . $folder;
                 if (!ftp_mkdir($this->stream, $p)) {
                     $this->throwException('Cannot create path "%s"', $p);
                 }
                 ftp_chmod($this->stream, 0777, $p);
             }
             break;
         }
     }
     ftp_chdir($this->stream, $path);
 }
开发者ID:windieselz,项目名称:php-remote-image-uploader,代码行数:25,代码来源:Host.php


示例2: putFile

 function putFile($filename)
 {
     if (!$this->connection || !$this->login_result) {
         $this->connect();
     }
     $directories = dirname($filename);
     $file = basename($filename);
     $dir_array = explode('/', $directories);
     $empty = array_shift($dir_array);
     // Change into MIRROR_REMOTE_DIR.
     ftp_chdir($this->connection, MIRROR_REMOTE_DIR);
     // Create any folders that are needed.
     foreach ($dir_array as $dir) {
         // If it doesn't exist, create it.
         // Then chdir to it.
         if (@ftp_chdir($this->connection, $dir)) {
             // Do nothing.
         } else {
             if (ftp_mkdir($this->connection, $dir)) {
                 ftp_chmod($this->connection, 0775, $dir);
                 ftp_chdir($this->connection, $dir);
             } else {
                 NDebug::debug('Cannot create a folder via ftp.', N_DEBUGTYPE_INFO);
             }
         }
     }
     // Put the file into the folder.
     $full_path = $_SERVER['DOCUMENT_ROOT'] . $filename;
     if (ftp_put($this->connection, $file, $full_path, FTP_BINARY)) {
         ftp_chmod($this->connection, 0775, $file);
         NDebug::debug("FTP Mirror: {$filename} was uploaded successfully", N_DEBUGTYPE_INFO);
     } else {
         NDebug::debug("FTP Mirror: {$filename} was NOT uploaded successfully", N_DEBUGTYPE_INFO);
     }
 }
开发者ID:nonfiction,项目名称:nterchange,代码行数:35,代码来源:ftp_mirror.php


示例3: chmod

 /**
  * Set folder permission
  * @param  string $folderChmod folder name
  * @param  integer $permission permission value
  * @return string              success message
  */
 public function chmod($folderChmod, $permission)
 {
     if (ftp_chmod($this->conn, $permission, $folderChmod) !== false) {
         return true;
     }
     return false;
 }
开发者ID:hmc-soft,项目名称:mvc,代码行数:13,代码来源:Ftp.php


示例4: ftp_chmod

 public function ftp_chmod($mode, $file)
 {
     if (!$this->ftp_conn) {
         return false;
     }
     return @ftp_chmod($this->ftp_conn, $mode, $file);
 }
开发者ID:Calit2-UCI,项目名称:IoT_Map,代码行数:7,代码来源:ftp_model.php


示例5: Upload

 protected function Upload($dir, $files)
 {
     global $lang;
     $sum = 0;
     foreach ($files as $key => $val) {
         $sum += $_FILES[$val]['size'];
     }
     if ($sum <= 2097152) {
         $rel_dir = 'Uploads/';
         $make_dir = FALSE;
         if (get_setting('ftp', 'use_ftp') || intval(get_setting('ftp', 'use_ftp')) == 1) {
             if ($conn_id = ftp_connect(get_setting('ftp', 'server'))) {
                 if (@ftp_login($conn_id, get_setting('ftp', 'username'), get_setting('ftp', 'password'))) {
                     @ftp_mkdir($conn_id, $rel_dir . $dir);
                     @ftp_chmod($conn_id, 0777, $rel_dir . $dir);
                     $make_dir = TRUE;
                 }
             }
         } else {
             if (@mkdir($rel_dir . $dir)) {
                 $make_dir = TRUE;
             }
         }
         if ($make_dir) {
             foreach ($files as $key => $file) {
                 @move_uploaded_file($_FILES[$file]['tmp_name'], $rel_dir . $dir . '/' . $_FILES[$file]['name']);
             }
         }
     } else {
         return SetError::Set($lang['L_ERRORFILESTOOBIG']);
     }
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb,代码行数:33,代码来源:posting.class.php


示例6: prepare

 /**
  *  preprocess Index action.
  *
  *  @access    public
  *  @return    string  Forward name (null if no errors.)
  */
 function prepare()
 {
     /*		$this->af->setApp('xoops_cookie_path', '/itoh/hodajuku/html');
     		$this->af->set('xoops_root_path', '/home/smbuser/Site/main/public_html/itoh/hodajuku/html');
     		$this->af->set('xoops_trust_path', '/home/smbuser/Site/main/public_html/itoh/hodajuku/xoops_trust_path');
     		$this->af->setApp('result', 1);
             return 'json_copyfile';	 */
     if ($this->af->validate() == 0) {
         $username = $this->af->get('ftp_username');
         $password = $this->af->get('ftp_password');
         // let's copy
         if ($conn_id = ftp_connect('localhost')) {
             if (ftp_login($conn_id, $username, $password)) {
                 $ftp_root = $this->seekFTPRoot($conn_id);
                 $chroot = substr(BASE, strlen($ftp_root));
                 $xoops_root_path = substr($this->af->get('xoops_root_path'), strlen($ftp_root));
                 $remote_path = $chroot . '/tmp/html';
                 $this->ftpPut($remote_path, $xoops_root_path, $conn_id);
                 $xoops_trust_path = substr($this->af->get('xoops_trust_path'), strlen($ftp_root));
                 $remote_path = $chroot . '/tmp/xoops_trust_path';
                 $this->ftpPut($remote_path, $xoops_trust_path, $conn_id);
                 //// after script
                 $dir777 = array($xoops_root_path . '/uploads', $xoops_root_path . '/uploads/fckeditor', $xoops_root_path . '/uploads/wizmobile', $xoops_trust_path . '/templates_c', $xoops_trust_path . '/cache', $xoops_trust_path . '/templates_c', $xoops_trust_path . '/uploads', $xoops_trust_path . '/session', $xoops_trust_path . '/log', $xoops_trust_path . '/tmp', $xoops_trust_path . '/modules/protector/configs', $xoops_trust_path . '/uploads/d3downloads', $xoops_trust_path . '/uploads/pico');
                 foreach ($dir777 as $_d) {
                     ftp_chmod($conn_id, 0777, $_d);
                 }
                 /// mainfile.php
                 ftp_chmod($conn_id, 0666, $xoops_root_path . '/mainfile.php');
                 ftp_close($conn_id);
                 return null;
             }
         }
     }
     return 'json_error_reload';
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:41,代码来源:Copyfile.php


示例7: doChmod

 protected function doChmod($remote_file, $chmod_code)
 {
     // try to chmod
     $chmod_code = octdec(str_pad($chmod_code, 4, '0', STR_PAD_LEFT));
     $chmod_code = (int) $chmod_code;
     return ftp_chmod($this->getConnection(), $chmod_code, $remote_file);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:7,代码来源:ftpMgr.class.php


示例8: changeMode

 public static function changeMode($path, $chmodValue)
 {
     $fake = new ftpAccessWrapper();
     $parts = $fake->parseUrl($path);
     $link = $fake->createFTPLink();
     $serverPath = AJXP_Utils::securePath($fake->path . "/" . $parts["path"]);
     ftp_chmod($link, $chmodValue, $serverPath);
 }
开发者ID:BackupTheBerlios,项目名称:ascore,代码行数:8,代码来源:class.ftpAccessWrapper.php


示例9: chmod

 public function chmod($mode = '0755', $file = '')
 {
     $this->dirlink = $file;
     if (FALSE === ftp_chmod($this->link, $mode, $this->dirlink)) {
         $this->errormsg = "Can't change this File/Dir";
         return FALSE;
     }
     return TRUE;
 }
开发者ID:knowsee,项目名称:uoke_framework,代码行数:9,代码来源:ftp.class.php


示例10: ftp_image_put_file

 static function ftp_image_put_file($destFileName, $sourceFileName, $mode = FTP_BINARY)
 {
     if (self::ftp_image_connect()) {
         if (@ftp_put(ImageLib::$ftp_image_connect_id, $destFileName, $sourceFileName, $mode)) {
             @ftp_chmod(ImageLib::$ftp_image_connect_id, 0777, $destFileName);
             return true;
         }
     }
     return false;
 }
开发者ID:duynhan07,项目名称:elink,代码行数:10,代码来源:ImageLib.php


示例11: myftpchmod

/**
 * write the compiled resource
 *
 * @param string $compile_path
 * @param string $compiled_content
 * @return true
 */
function myftpchmod($file)
{
    $ftp_server = fvSite::$fvConfig->get("ftp.server_name");
    $ftp_user_name = fvSite::$fvConfig->get("ftp.user");
    $ftp_user_pass = fvSite::$fvConfig->get("ftp.pass");
    $file = $file;
    $conn_id = ftp_connect($ftp_server);
    $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
    $result = ftp_chmod($conn_id, 0777, $file);
    ftp_close($conn_id);
    return $result;
}
开发者ID:newnamecomua,项目名称:engineown,代码行数:19,代码来源:core.write_compiled_resource.php


示例12: myftpchmod

 function myftpchmod($file)
 {
     $ftp_server = "spo.ua";
     $ftp_user_name = "spo";
     $ftp_user_pass = "8i7PgfG1";
     $file = $file;
     $conn_id = ftp_connect($ftp_server);
     $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
     $result = ftp_chmod($conn_id, 0777, $file);
     ftp_close($conn_id);
     return $result;
 }
开发者ID:newnamecomua,项目名称:engineown,代码行数:12,代码来源:core.write_cache_file.php


示例13: chmod

 public function chmod($mode, $file)
 {
     if ($this->_ftpStream) {
         if (function_exists('ftp_chmod')) {
             return ftp_chmod($this->_ftpStream, $mode, $file);
         } else {
             //echo "<h1>$file</h1>";
             return ftp_site($this->_ftpStream, "chmod {$mode} {$file}");
             //return ftp_exec($this->ftpStream, "chmod $mode $file");
         }
     }
     return false;
 }
开发者ID:ssrsfs,项目名称:blg,代码行数:13,代码来源:Ftp.php


示例14: changeMode

 /**
  * Changes element CHMOD
  * 
  * The param can be also instance of cFTP_Chmod
  *
  * @param int $chmod CHMOD
  * @throws cFTP_Exception
  */
 public function changeMode($chmod)
 {
     if($chmod instanceof cFTP_Chmod)
         $chmod = $chmod->getChmod();
     
     
     $success = @ftp_chmod($this->handle, $chmod, $filename);
     
     if( !$success )
         throw new cFTP_Exception( "Could not change element CHMOD" );
     
     return $this;
 }
开发者ID:robik,项目名称:cFTP,代码行数:21,代码来源:Item.php


示例15: doLog

 /**
  * Log-Methode der erweiterten Query-Methode.
  * 
  * Für jeden Monat wird eine Log-Datei erstellt.
  * Jede SQL-Anfrage wird protokolliert mit SQL-Anfrage, Zeitpunkt und Urheberskript.
  * 
  * @param string $sqlQuery:  SQL-Anfrage
  */
 private function doLog($sqlQuery)
 {
     //Datei zum Schreiben bestimmen
     $logfile = PROJECT_DOCUMENT_ROOT . '/log/DB/dbEvents' . date('m_Y') . '.txt';
     //Lokale Variable an globales FTP-Objekt anbinden
     $FTP = $GLOBALS['FTP'];
     ftp_chmod($FTP->FTPConn, 0757, PROJECT_DOCUMENT_ROOT . '/log/DB');
     //String bereitstellen inkl. escapen
     $data = date("d.m.Y H:i:s", time()) . ' : ' . $sqlQuery . ' [' . $_SERVER['SCRIPT_FILENAME'] . ']' . "\n";
     if (!file_put_contents($logfile, $data, FILE_APPEND)) {
         echo "Daten konnten nicht in Datei geschrieben werden.";
     }
     ftp_chmod($FTP->FTPConn, 0750, PROJECT_DOCUMENT_ROOT . '/log/DB');
 }
开发者ID:alterego,项目名称:naturmedicine,代码行数:22,代码来源:class.MySQL.php


示例16: ftp_mksubdirs

 function ftp_mksubdirs($ftpcon, $ftpbasedir, $ftpath)
 {
     @ftp_chdir($ftpcon, $ftpbasedir);
     // /var/www/uploads
     $parts = explode('/', $ftpath);
     // 2013/06/11/username
     foreach ($parts as $part) {
         if (!@ftp_chdir($ftpcon, $part)) {
             ftp_mkdir($ftpcon, $part);
             ftp_chdir($ftpcon, $part);
             ftp_chmod($ftpcon, 0777, $part);
         }
     }
 }
开发者ID:ricardo93borges,项目名称:mdt-upload,代码行数:14,代码来源:Upload.php


示例17: set_permission

 function set_permission($file, $mode)
 {
     $myreturn = '';
     if ($this->op_mode == 'disk') {
         $myreturn = @chmod($file, $mode);
     } elseif ($this->op_mode == 'ftp') {
         $file = str_replace(_BASEPATH_ . '/', _FTPPATH_, $file);
         $old_de = ini_get('display_errors');
         ini_set('display_errors', 0);
         if (function_exists('ftp_chmod')) {
             $myreturn = @ftp_chmod($this->ftp_id, $mode, $file);
         } else {
             $myreturn = ftp_site($this->ftp_id, "CHMOD {$mode} {$file}");
         }
         ini_set('display_errors', $old_de);
     }
 }
开发者ID:babae,项目名称:etano,代码行数:17,代码来源:fileop.class.php


示例18: sendPorFtp

 function sendPorFtp(&$strRespuesta, $rutaArchivoFtp, $rutaArchivoTmp)
 {
     require_once 'Global.php';
     $global = new G();
     $conFtp = ftp_connect($global->getFtpServer()) or die("Error de conexion servidor de archivos");
     $loginResultado = ftp_login($conFtp, $global->getFtpUserName(), $global->getFtpUserPass()) or die("Error de login");
     if (!$conFtp || !$loginResultado) {
         die("La conexión a servido ftp no funciono!!");
     }
     if (ftp_put($conFtp, $rutaArchivoFtp, $rutaArchivoTmp, FTP_BINARY)) {
         ftp_chmod($conFtp, 0775, $rutaArchivoFtp);
         $strRespuesta = $this->respOk . ": Archivo subido al repositorio";
         ftp_close($conFtp);
         return true;
     } else {
         $strRespuesta = $this->respError . ": Problemas con el servidor de archivos";
         ftp_close($conFtp);
         return false;
     }
 }
开发者ID:obrianhc,项目名称:memestime,代码行数:20,代码来源:uploadAction.php


示例19: uploadTestdata

 public static function uploadTestdata($judger, $data_config)
 {
     $prob_name = $data_config['name'];
     $testdata_path = MDL_Config::getInstance()->getVar('judger_testdata') . $prob_name . '/';
     $temp_file = tempnam(sys_get_temp_dir(), 'Vakuum');
     unset($data_config['id']);
     unset($data_config['title']);
     $xml = BFL_XML::Array2XML($data_config);
     file_put_contents($temp_file, $xml);
     $pftp = self::connect($judger);
     if (ftp_chdir($pftp, $judger->getConfig()->getTestdataPath()) === false) {
         throw new MDL_Exception_Judge_FTP(MDL_Exception_Judge_FTP::TESTDATA_UPLOAD);
     }
     if (@ftp_chdir($pftp, $prob_name) === false) {
         ftp_mkdir($pftp, $prob_name);
         ftp_chmod($pftp, 0755, $prob_name);
         ftp_chdir($pftp, $prob_name);
     }
     //Upload config.xml
     if (ftp_put($pftp, 'config.xml', $temp_file, FTP_BINARY) === false) {
         throw new MDL_Exception_Judge_FTP(MDL_Exception_Judge_FTP::TESTDATA_UPLOAD);
     }
     if ($data_config['checker']['type'] == 'custom') {
         //Upload checker
         $checker_source = $data_config['checker']['custom']['source'];
         $checker_file = $testdata_path . $checker_source;
         if (ftp_put($pftp, $checker_source, $checker_file, FTP_BINARY) === false) {
             throw new MDL_Exception_Judge_FTP(MDL_Exception_Judge_FTP::TESTDATA_UPLOAD);
         }
     }
     //Upload testdatas
     foreach ($data_config['case'] as $item) {
         foreach (array('input', 'output') as $key) {
             $testdata_file = $testdata_path . $item[$key];
             if (ftp_put($pftp, $item[$key], $testdata_file, FTP_BINARY) === false) {
                 throw new MDL_Exception_Judge_FTP(MDL_Exception_Judge_FTP::TESTDATA_UPLOAD);
             }
         }
     }
     ftp_close($pftp);
 }
开发者ID:thezawad,项目名称:vakuum,代码行数:41,代码来源:FTP.php


示例20: eliminarDeFtp

 public function eliminarDeFtp(&$strRespuesta, $rutaArchivoFtp)
 {
     require_once 'Global.php';
     $global = new G();
     $conFtp = ftp_connect($global->getFtpServer()) or die("Error de conexion");
     $loginResultado = ftp_login($conFtp, $global->getFtpUserName(), $global->getFtpUserPass()) or die("Error de login");
     if (!$conFtp || !$loginResultado) {
         die("La conexión a servido ftp no funciono!!");
     } else {
         ftp_chmod($conFtp, 0777, $rutaArchivoFtp);
     }
     if (ftp_delete($conFtp, $rutaArchivoFtp)) {
         $strRespuesta = $this->respOk . ": Archivo eliminado del repositorio!";
         ftp_close($conFtp);
         return true;
     } else {
         $strRespuesta = $this->respError . ": Problemas con el servidor de archivos";
         ftp_close($conFtp);
         return false;
     }
 }
开发者ID:obrianhc,项目名称:memestime,代码行数:21,代码来源:eliminarContenido.php



注:本文中的ftp_chmod函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ftp_close函数代码示例发布时间:2022-05-15
下一篇:
PHP ftp_chdir函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap