Giter Club home page Giter Club logo

phpharchive's Introduction

PHPHARchive -- A programatic way of getting HAR information

DESCRIPTION

HAR files contain all sorts of interesting information that can be used when automating functional testing of browser-based applications;

  • how many items were downloaded
  • what took the most time to download
  • how many things were not from domains we control
  • were there any 404's
  • how many redirects just happened
  • etc.

Getting a proxy to generate these files is not overly difficult but there was not a project in PHP that could nicely parse and extract information with. So I wrote one.

PHPHARchive should parse and validate both 1.1 and 1.2 schema versions of the HAR specification. Unfortunately it does it rather brute-forcely as the existing projects for doing JSON Schema in PHP either don't seem to work or are not packaged for distribution via PEAR.

INSTALLATION

PHPHARchive has been packaged for distribution via PEAR. So...

    pear channel-discover element-34.github.com/pear
    pear install -f element-34/PHPHARchive

EXAMPLES

  • Getting all Entries for a particular page

      $h = new PHPHARchive_HAR('your.har');
      $entries = $h->get_entries_by_page_ref("page_1_0");
    
  • Looking for a particular status

      $h = new PHPHARchive_HAR('your.har');
      $entries = $h->get_entries_by_page_ref("page_1_0");
      $four_oh_fours = array();
      foreach ($entries as $entry) {
        if ($entry->response->status == 404) {
          array_push($four_oh_fours, $entry);
        }
      }
    

phpharchive's People

Contributors

adamgoucher avatar

Stargazers

Lukas Labryszewski avatar JXianSheng avatar Dario Diaz avatar  avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.