Download the PHP package sorexalpinus/cubify without Composer

On this page you can find all versions of the php package sorexalpinus/cubify. 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 cubify

Cubify

Cubify your SQL query

Cubify package creates a patch over standard MySQL/MariaDB behaviour where CUBE function is not available. All you need to do is choose your DBMS and provide your query, along with dimensions, measures and masks.

Example

The table "spotted_animals" tracks animals spotted in different areas in Banff NP Canada in winter:

Year Transect Species Snow depth Num animals
2015 Dog Loop NULL 30 0
2014 Cascade fox 2 1
2016 Hoodoos elk 26 2
2015 Airfield elk 11 7
2015 Dog Loop deer 11 1
2016 Airfield coyote 14 3
2015 Airfield deer 16 2
2016 Healy North deer 24 1
2016 40 Mile coyote 12 1
more rows...
To find:

average snow depth and total number of animals spotted:

use MysqlCube:

5 arguments were passed:

  1. MySQL database connection
  2. Base query - this is a statement you want to cubify (use CUBE)
  3. Masks represent grouping sets with regard to dimensions` order (see table below)
  4. Dimensions are "GROUP BY" columns
  5. Measures are numbers to be aggregated by per each combination
Mask Transect Year Species Snow depth Num animals
111 value value value AVG(Snow depth) SUM(Num animals)
110 value value (total) AVG(Snow depth) SUM(Num animals)
101 value (total) value AVG(Snow depth) SUM(Num animals)
Use output:

Method getResultDataset() returns array which can be translated to a following table:

Mask Transect Year Species Snow depth Num animals
101 Cascade (total) fox 18.0000 10
101 Dog Loop (total) elk 25.7895 44
101 Dog Loop (total) fox 21.5000 2
110 Cascade 2014 (total) 15.5444 122
110 Cascade 2015 (total) 18.4649 114
110 Cascade 2016 (total) 19.3472 116
110 Dog Loop 2014 (total) 10.1221 127
110 Dog Loop 2015 (total) 25.7264 102
110 Dog Loop 2016 (total) 21.3565 172
111 Cascade 2014 elk 21.4118 90
111 Cascade 2014 fox 2.0000 2
111 Cascade 2015 elk 19.7500 57
111 Cascade 2015 fox 22.5714 8
111 Cascade 2016 elk 21.6875 46
111 Dog Loop 2014 elk 6.5000 6
111 Dog Loop 2015 elk 31.0000 19
111 Dog Loop 2016 fox 21.5000 2
more rows...

Output methods

getCubeQuery() returns final query that can be used for further SQL operations

getResult() returns SQL result object

getResultDataset() returns the complete dataset as an array

Known limitations


All versions of cubify with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
ext-mysqli Version *
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 sorexalpinus/cubify contains the following files

Loading the files please wait ....