Download the PHP package minhyung/mybox without Composer

On this page you can find all versions of the php package minhyung/mybox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mybox

php-mybox

Packagist PHP CI

A framework-agnostic PHP SDK for the Naver MYBOX Open API.

한국어 문서는 README.ko.md를 참고하세요.

Getting started Quick start
Reference Paths
Operating it Custom HTTP wiring
Ecosystem Flysystem adapter

Requirements

PHP 8.2 or newer.

Installation

The SDK talks to whatever PSR-18 HTTP client your project already has, and finds it through php-http/discovery — no wiring needed. If you do not have one yet, any of these will do:

Getting a personal access token

  1. Sign in to MYBOX on the web with your Naver account.
  2. Go to 설정 → 계정 및 개인 액세스 토큰 관리 and click 토큰 생성.
  3. Give the token a name and an expiry of 30, 60, 90, or 180 days.
  4. Copy it immediately — it is shown exactly once.

An account can hold at most five tokens. Treat one like a password: anybody holding it has full access to your drive.

Quick start

Endpoints

Everything is grouped the way the official documentation groups it.

drive() — reading and favourites

Method Endpoint
storage() GET /v1/drive/storage
setTrashAutoDeleteDays(int $days) PATCH /v1/drive/storage
listRoot(?ListOptions) GET /v1/drive/resources
listFolder(string $folderId, ?ListOptions) GET /v1/drive/folders/{folderId}/resources
get(string $resourceId) GET /v1/drive/resources/{resourceId}
favorite(string $resourceId) POST /v1/drive/resources/{resourceId}/favorite
unfavorite(string $resourceId) POST /v1/drive/resources/{resourceId}/unfavorite

listRootAll() and listFolderAll() return a paginator over the same data.

files() — mutations and transfer URLs

Method Endpoint
createFolder(string $name, ?string $parentId) POST /v1/drive/folders
createUploadUrl(UploadRequest) POST /v1/drive/files
createDownloadUrl(string $fileId) GET /v1/drive/files/{fileId}/download
copy(string $resourceId, ?CopyOptions) POST /v1/drive/resources/{resourceId}/copy
delete(string $resourceId) DELETE /v1/drive/resources/{resourceId}
move(string $resourceId, string $parentId, bool $isOverwrite) POST /v1/drive/resources/{resourceId}/move
rename(string $resourceId, string $name) POST /v1/drive/resources/{resourceId}/rename

search() — the search index

Method Endpoint
files(SearchFilesOptions) GET /v1/search/resources/files
folders(SearchFoldersOptions) GET /v1/search/resources/folders

filesAll() and foldersAll() page through the results.

trash()

Method Endpoint
list(?TrashListOptions) GET /v1/drive/trash
restore(string $resourceId, bool $isOverwrite) POST /v1/drive/trash/{resourceId}/restore
purge(string $resourceId) DELETE /v1/drive/trash/{resourceId}
empty() DELETE /v1/drive/trash

listAll() pages through the trash.

Listing and sorting

MYBOX always lists folders before files, whatever you sort by.

Pagination

Uploading

Each returns an UploadResult carrying the stored file's resourceId, name and fileSize. Uploads stream — a 10 GB file uses no more memory than a 10 KB one.

The declared size must match the payload exactly; MYBOX reserves the upload against it and answers 500 on a mismatch. maxFileBytes from storage() is the per-file ceiling.

Sending the bytes is a second call to a separate storage host, and its wire format is not part of the published documentation. It was established against the live service and is written up in docs/transfer-protocol.md.

resume: true asks MYBOX whether it kept part of an earlier, interrupted transfer and continues from there. Two quirks are worth knowing, both handled for you: MYBOX identifies the interrupted upload by the modifiedTime string and only recognises the KST spelling, so the SDK always sends KST whatever timezone you are in; and isOverwrite suppresses the offset, so do not combine the two.

Downloading

Each call issues a fresh URL. MYBOX documents these as single-use and valid for ten minutes. Downloads stream too, so toFile() is bounded by disk rather than by memory.

Searching

A search needs at least one of q, category, or a date bound — the SDK rejects an empty query locally rather than spending one of your quota slots on it. Page size is 20–200 here, not 1–1000.

Paths

MYBOX addresses everything by id. To start from a path instead:

A folder normally resolves in a single search call; when the index has not caught up the resolver walks down from the root instead. Results are memoised per client — call clearCache() after renaming or moving something.

Error handling

Every failure is a MyboxException. The API's own errors are ApiException subclasses carrying the requestId you would quote to support:

HTTP Exception
400 BadRequestException
401 UnauthorizedException
403 ForbiddenException
404 NotFoundException
409 ConflictException
422 UnprocessableEntityException
423 LockedException
429 RateLimitException
500, 502, 503 ServerException
507 InsufficientStorageException

Connection failures and unparseable responses raise TransportException; arguments rejected before any request raise InvalidArgumentException.

Retries

429, 502, and 503 are retried three times with exponential backoff and full jitter, honouring Retry-After when the server sends one. 500 is not retried — MYBOX returns it for genuine faults rather than congestion.

Rate limits

Quotas come from the account's MYBOX plan and are enforced per API, not in aggregate. Daily counters reset each day, per-minute counters each minute.

API 30GB 80GB 180GB–330GB 2TB 5TB 10TB 20TB
Download 500/day 1,000/day 1,000/day 2,000/day 5,000/day 20,000/day 50,000/day
Search 10/min 10/min 30/min 30/min 30/min 30/min 30/min
Delete 60/min 60/min 240/min 240/min 240/min 240/min 240/min
Restore 180/min 180/min 240/min 240/min 240/min 240/min 240/min
Everything else 60/min 60/min 240/min 240/min 240/min 240/min 240/min

MYBOX also states that bursts it reads as abuse can restrict an account without prior warning.

Behaviour worth knowing

What the API does not cover

Custom HTTP wiring

Discovery finds your PSR-18 client automatically, but you can pass one in — useful for proxies, custom timeouts, or logging middleware:

Flysystem

minhyung/flysystem-mybox wraps this SDK in a Flysystem v3 adapter, so MYBOX can be used through League\Flysystem\Filesystem or as a Laravel Storage disk. It passes Flysystem's adapter conformance suite.

Use it when you want portable filesystem code, and this SDK directly when you want the parts Flysystem has no vocabulary for — the trash, favourites, storage quota, search, and resumable uploads.

Contributing

CONTRIBUTING.md covers the layout, the conventions, how to add an endpoint, and the rules for the integration suite — which talks to a real account and is excluded from composer test.

Changelog

See CHANGELOG.md.

License

MIT. See LICENSE.


All versions of mybox with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
php-http/discovery Version ^1.19
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package minhyung/mybox contains the following files

Loading the files please wait ...