2017 © Pedro Peláez
 

library phpolap

phpOlap is a php API for OLAP (XMLA)

image

instaclick/phpolap

phpOlap is a php API for OLAP (XMLA)

  • Tuesday, January 21, 2014
  • by danilo.cabello
  • Repository
  • 15 Watchers
  • 1 Stars
  • 1,828 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 24 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

README

phpOlap is a php API for OLAP (XMLA), (*1)

phpOlap can be used to explore schema (cubes, dimensions, hierarchies, levels, ...) and execute MDX Query, generate layout, ..., (*2)

phpOlap is only supported on PHP 5.3.2 and up., (*3)

API : http://phpolap.org/, (*4)

Database exploration

``` php 'Provider=Mondrian;DataSource=MondrianFoodMart;' 'CatalogName' => 'FoodMart', 'schemaName' => 'FoodMart' ) ); // for Microsoft SQL Server Analysis Services /* $connection = new Connection( new SoapAdaptator('http://192.168.1.12/olap/msmdpump.dll', 'julien', 'juju'), array( 'DataSourceInfo' => null, 'CatalogName' => 'Adventure Works DW 2008R2 SE' ) ); */ $cube = $connection->findOneCube(null, array('CUBE_NAME' => 'Sales')); ?>, (*5)

getName() ?>, (*6)

  • Measures
      getMeasures() as $measure): ?>
    • getCaption() ?>
  • getDimensionsAndHierarchiesAndLevels() as $dimention): ?> getType() != 'MEASURE') : ?>
  • getCaption() ?>
      getHierarchies() as $hierarchy): ?>
    • getCaption() ?>
        getLevels() as $level): ?>
      • getCaption() ?>

Query ----- ``` php <?php require_once '../autoload.php'; use phpOlap\Mdx\Query; $query = new Query("[Sales]"); $query->addElement("[Measures].[Unit Sales]", "COL"); $query->addElement("[Measures].[Store Cost]", "COL"); $query->addElement("[Measures].[Store Sales]", "COL"); $query->addElement("[Gender].[All Gender].Children", "COL"); $query->addElement("[Promotion Media].[All Media]", "ROW"); $query->addElement("[Product].[All Products].[Drink].[Alcoholic Beverages]", "ROW"); $query->addElement("[Promotion Media].[All Media].Children", "ROW"); $query->addElement("[Product].[All Products]", "ROW"); $query->addElement("[Time].[1997]", "FILTER"); echo $query->toMdx();

Layout

``` php <?php require_once '../autoload.php';, (*7)

use phpOlap\Xmla\Connection\Connection; use phpOlap\Xmla\Connection\Adaptator\SoapAdaptator; use phpOlap\Layout\Table\HtmlTableLayout; use phpOlap\Layout\Table\CsvTableLayout;, (*8)

$connection = ..., (*9)

$resultSet = $connection->statement(" select Hierarchize(Union(Union({([Measures].[Unit Sales], [Gender].[All Gender], [Marital Status].[All Marital Status])}, Union(Union(Crossjoin({[Measures].[Store Cost]}, {([Gender].[All Gender], [Marital Status].[All Marital Status])}), Crossjoin({[Measures].[Store Cost]}, Crossjoin([Gender].[All Gender].Children, {[Marital Status].[All Marital Status]}))), Crossjoin({[Measures].[Store Cost]}, Crossjoin({[Gender].[F]}, [Marital Status].[All Marital Status].Children)))), Crossjoin({[Measures].[Store Sales]}, Union(Crossjoin({[Gender].[All Gender]}, {[Marital Status].[All Marital Status]}), Crossjoin({[Gender].[All Gender]}, [Marital Status].[All Marital Status].Children))))) ON COLUMNS, Crossjoin(Hierarchize(Crossjoin(Union({[Promotion Media].[All Media]}, [Promotion Media].[All Media].Children), Union(Union({[Product].[All Products]}, [Product].[All Products].Children), [Product].[Food].Children))), {[Store].[All Stores]}) ON ROWS from [Sales] where {[Time].[1997]}, (*10)

");, (*11)

// html table $table = new HtmlTableLayout($resultSet); echo $table->generate();, (*12)

// csv header("Content-type: application/vnd.ms-excel"); header("Content-disposition: attachment; filename=\"export.csv\""); $csv = new CsvTableLayout($resultSet); print($csv->generate()); exit;, (*13)

The Versions

21/01 2014

dev-master

9999999-dev

phpOlap is a php API for OLAP (XMLA)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julien Jacottet

21/01 2014

1.0.1

1.0.1.0

phpOlap is a php API for OLAP (XMLA)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julien Jacottet

22/08 2013

v1.0.0

1.0.0.0

phpOlap is a php API for OLAP (XMLA)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julien Jacottet