# Installation

> The package requires PHP 8.3+ and Yii ~2.0.55 || ^22.0@dev: Yii 2.0.55 or later within the 2.0 line, or Yii 22.

## Dependencies

The package requires PHP 8.3+ and Yii `~2.0.55 || ^22.0@dev`: Yii 2.0.55 or later within the 2.0 line, or Yii 22. The
selected framework release may require a newer PHP version; check its resolved requirements.

The built-in archiver uses the `zip` extension. It is needed only when an export produces several files or sets
`forceArchive`; single CSV files and custom archivers work without it.

```bash
composer require yii2-extensions/csv-export:^0.1
```

Applications running Yii 2.0 must keep their existing source for Yii's Bower assets, such as Asset Packagist, in the
application's root `composer.json`. CSV Export does not provide those assets. This step is not needed for Yii 22.

To install the development branch from Packagist instead of the stable version, require
`yii2-extensions/csv-export:dev-main`.

Check the installed version with `composer show yii2-extensions/csv-export`.

## Upgrading from yii2tech/csv-grid

This line is a breaking migration, not a drop-in replacement. The Composer name is `yii2-extensions/csv-export` and the
namespace is `yii2\extensions\csvexport`; there are no legacy class aliases and no Composer `replace`.

## Runtime directory

Exports are written to a private child of `@runtime/csv-export`. The application must define the `@runtime` alias, which
every Yii application does, and the process must be able to create directories there. Change the parent with
`resultConfig.basePath` as described in [configuration](/docs/extensions/csv-export/configuration/index.md#temporary-files-and-cleanup).

Continue with [configuration](/docs/extensions/csv-export/configuration/index.md), [usage examples](/docs/extensions/csv-export/examples/index.md), or the
[agent skill installation](/docs/extensions/csv-export/agents/index.md).

[Back to documentation](/docs/extensions/csv-export/index.md#documentation)