{"id":13519780,"url":"https://github.com/dg/ftp-php","last_synced_at":"2025-12-24T21:48:34.016Z","repository":{"id":800228,"uuid":"501271","full_name":"dg/ftp-php","owner":"dg","description":"FTP Wrapper Class for PHP 5","archived":false,"fork":false,"pushed_at":"2023-07-17T14:30:50.000Z","size":20,"stargazers_count":203,"open_issues_count":1,"forks_count":78,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-10T16:41:30.678Z","etag":null,"topics":["ftp","php"],"latest_commit_sha":null,"homepage":"https://nette.org","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mouseed/uploadcare","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dg.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"dg","custom":"https://nette.org/make-donation?to=ftp-php"}},"created_at":"2010-02-03T20:39:45.000Z","updated_at":"2024-12-16T16:19:09.000Z","dependencies_parsed_at":"2024-06-18T13:40:14.101Z","dependency_job_id":"a27e8f16-58e8-4673-9f86-303add1c1fdf","html_url":"https://github.com/dg/ftp-php","commit_stats":{"total_commits":18,"total_committers":7,"mean_commits":"2.5714285714285716","dds":"0.33333333333333337","last_synced_commit":"c59130cd52e54df62a9e047ed10314f0bad95539"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dg%2Fftp-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dg%2Fftp-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dg%2Fftp-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dg%2Fftp-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dg","download_url":"https://codeload.github.com/dg/ftp-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246482955,"owners_count":20784802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ftp","php"],"created_at":"2024-08-01T05:02:03.095Z","updated_at":"2025-12-24T21:48:34.007Z","avatar_url":"https://github.com/dg.png","language":"PHP","readme":"FTP for PHP\n===========\n\n[![Downloads this Month](https://img.shields.io/packagist/dm/dg/ftp-php.svg)](https://packagist.org/packages/dg/ftp-php)\n[![Latest Stable Version](https://poser.pugx.org/dg/ftp-php/v/stable)](https://github.com/dg/ftp-php/releases)\n[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/dg/ftp-php/blob/master/license.md)\n\nFTP for PHP is a very small and easy-to-use library for accessing FTP servers.\n\nIt requires PHP 8.1 or newer and is licensed under the New BSD License.\nYou can obtain the latest version from our [GitHub repository](https://github.com/dg/ftp-php/releases)\nor install it via Composer:\n\n```\nphp composer.phar require dg/ftp-php\n```\n\nIf you like it, **[please make a donation now](https://nette.org/make-donation?to=ftp-php)**. Thank you!\n\n\nUsage\n-----\n\nOpens an FTP connection to the specified host:\n\n```php\n$ftp = new Ftp;\n$host = 'ftp.example.com';\n$ftp-\u003econnect($host);\n```\n\nLogin with username and password\n\n```php\n$ftp-\u003elogin($username, $password);\n```\n\nUpload the file\n\n```php\n$ftp-\u003eput($destinationFile, $sourceFile, Ftp::Binary);\n```\n\nClose the FTP stream\n\n```php\n$ftp-\u003eclose();\n// or simply unset($ftp);\n```\n\nFtp throws exception if operation failed. So you can simply do following:\n\n```php\ntry {\n\t$ftp = new Ftp;\n\t$ftp-\u003econnect($host);\n\t$ftp-\u003elogin($username, $password);\n\t$ftp-\u003eput($destinationFile, $sourceFile, Ftp::Binary);\n\n} catch (FtpException $e) {\n\techo 'Error: ', $e-\u003egetMessage();\n}\n```\n\nOn the other hand, if you'd like the possible exception quietly catch, call methods with the prefix `try`:\n\n```php\n$ftp-\u003etryDelete($destinationFile);\n```\n\nWhen the connection is accidentally interrupted, you can re-establish it using method `$ftp-\u003ereconnect()`.\n\n\n-----\n(c) David Grudl, 2008, 2023 (http://davidgrudl.com)\n","funding_links":["https://github.com/sponsors/dg","https://nette.org/make-donation?to=ftp-php"],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdg%2Fftp-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdg%2Fftp-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdg%2Fftp-php/lists"}