PHPackages                             sekretenko/php-vast - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. sekretenko/php-vast

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

sekretenko/php-vast
===================

Generator and parser for VAST documents

0.4.8(7y ago)0335↓33.3%MITPHPPHP ^5.3 | ^7.0

Since Jan 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sekretenko/php-vast)[ Packagist](https://packagist.org/packages/sekretenko/php-vast)[ RSS](/packages/sekretenko-php-vast/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (14)Used By (0)

PHP-VAST
========

[](#php-vast)

[![Build Status](https://camo.githubusercontent.com/b1f6d1630a17f7c8813d6309b9ac229dd69a7f9fb05ddce270e42de479577e3f/68747470733a2f2f7472617669732d63692e6f72672f736f6b696c2f7068702d766173742e706e673f6272616e63683d6d61737465722631)](https://travis-ci.org/sokil/php-vast)[![Total Downloads](https://camo.githubusercontent.com/fedc3f7728b61c26909ece99e566e0a9b2505d94029d340d772715b1624af68c/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f6b696c2f7068702d766173742e7376673f31)](https://packagist.org/packages/sokil/php-vast)[![Coverage Status](https://camo.githubusercontent.com/e3cc8f8109c0acf2efb6113d5a44e50f814c136361747dac98a3ac70add7c26f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736f6b696c2f7068702d766173742f62616467652e7376673f6272616e63683d6d61737465722631)](https://coveralls.io/github/sokil/php-vast?branch=master)

VAST Ad generator and parser library on PHP.

Specs
-----

[](#specs)

- VAST 2.0 Spec: [http://www.iab.net/media/file/VAST-2\_0-FINAL.pdf](http://www.iab.net/media/file/VAST-2_0-FINAL.pdf)
- VAST 3.0 Spec: [http://www.iab.com/wp-content/uploads/2015/06/VASTv3\_0.pdf](http://www.iab.com/wp-content/uploads/2015/06/VASTv3_0.pdf)
- VAST 4.0 Spec:
    - [http://www.iab.com/wp-content/uploads/2016/01/VAST\_4-0\_2016-01-21.pdf](http://www.iab.com/wp-content/uploads/2016/01/VAST_4-0_2016-01-21.pdf)
    - [https://www.iab.com/wp-content/uploads/2016/04/VAST4.0\_Updated\_April\_2016.pdf](https://www.iab.com/wp-content/uploads/2016/04/VAST4.0_Updated_April_2016.pdf)
- [VAST Samples](https://github.com/InteractiveAdvertisingBureau/VAST_Samples)

Install
-------

[](#install)

Install library through composer:

```
composer require sokil/php-vast

```

Quick start
-----------

[](#quick-start)

```
// create document
$factory = new \Sokil\Vast\Factory();
$document = $factory->create('2.0');
// or, if you have at least PHP5.4
$document = (new \Sokil\Vast\Factory())->create('2.0');
// creating through Document::create and other factory methods are now deprecated:
$document = \Sokil\Vast\Document::create('2.0');

// insert Ad section
$ad1 = $document
    ->createInLineAdSection()
    ->setId('ad1')
    ->setAdSystem('Ad Server Name')
    ->setAdTitle('Ad Title')
    ->addImpression('http://ad.server.com/impression', 'imp1');

// create creative for ad section
$linearCreative = $ad1
    ->createLinearCreative()
    ->setDuration(128)
    ->setVideoClicksClickThrough('http://entertainmentserver.com/landing')
    ->addVideoClicksClickTracking('http://ad.server.com/videoclicks/clicktracking')
    ->addVideoClicksCustomClick('http://ad.server.com/videoclicks/customclick')
    ->addTrackingEvent('start', 'http://ad.server.com/trackingevent/start')
    ->addTrackingEvent('pause', 'http://ad.server.com/trackingevent/stop');

// add 100x100 media file
$linearCreative
    ->createMediaFile()
    ->setProgressiveDelivery()
    ->setType('video/mp4')
    ->setHeight(100)
    ->setWidth(100)
    ->setBitrate(2500)
    ->setUrl('http://server.com/media1.mp4');

// add 200x200 media file
$linearCreative
    ->createMediaFile()
    ->setProgressiveDelivery()
    ->setType('video/mp4')
    ->setHeight(200)
    ->setWidth(200)
    ->setBitrate(2500)
    ->setUrl('http://server.com/media2.mp4');

// get dom document
$domDocument = $document->toDomDocument();

// get XML string
echo $document;
```

This will generate:

```

            Ad Server Name
            Ad Title]]>
            http://ad.server.com/impression]]>

                        00:02:08

                            http://entertainmentserver.com/landing]]>
                            http://ad.server.com/videoclicks/clicktracking]]>
                            http://ad.server.com/videoclicks/customclick]]>

                            http://ad.server.com/trackingevent/start]]>
                            http://ad.server.com/trackingevent/stop]]>

                                http://server.com/media1.mp4]]>

                                http://server.com/media2.mp4]]>

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~134 days

Recently: every ~38 days

Total

13

Last Release

2880d ago

PHP version history (2 changes)0.4PHP ^5.3|^7.0

0.4.5PHP ^5.3 | ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca30b011def13c423835282129b2c05df2e1deb84fa62164ce83e69fc05d4868?d=identicon)[sekretenko](/maintainers/sekretenko)

---

Top Contributors

[![sokil](https://avatars.githubusercontent.com/u/1829948?v=4)](https://github.com/sokil "sokil (93 commits)")[![dorantor](https://avatars.githubusercontent.com/u/391611?v=4)](https://github.com/dorantor "dorantor (25 commits)")[![simoheinonen](https://avatars.githubusercontent.com/u/3840367?v=4)](https://github.com/simoheinonen "simoheinonen (4 commits)")[![fb-ts](https://avatars.githubusercontent.com/u/24866129?v=4)](https://github.com/fb-ts "fb-ts (2 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sekretenko-php-vast/health.svg)

```
[![Health](https://phpackages.com/badges/sekretenko-php-vast/health.svg)](https://phpackages.com/packages/sekretenko-php-vast)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[meyfa/php-svg

Read, edit, write, and render SVG files with PHP

54613.9M42](/packages/meyfa-php-svg)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
