Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow install via composer #5

Merged
merged 7 commits into from
Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions owa-autoloader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

$mapping = [
'OwaSdk\sdk' => __DIR__ . '/src/sdk.php',
'OwaSdk\OwaClient' => __DIR__ . '/src/OwaClient.php',
'OwaSdk\Tracker\TrackerClient' => __DIR__ . '/src/Tracker/TrackerClient.php',
'OwaSdk\Tracker\State' => __DIR__ . '/src/Tracker/State.php',
'OwaSdk\Tracker\TrackingEvent' => __DIR__ . '/src/Tracker/TrackingEvent.php'

];


spl_autoload_register(function ($class) use ($mapping) {

if (isset($mapping[$class])) {

require $mapping[$class];
}

}, true);

require_once( __DIR__ . '/vendor/autoload.php' );

?>
4 changes: 2 additions & 2 deletions src/Tracker/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function get($store, $name = '') {
}
}

function setState($store, $name = '', $value, $store_type = '', $is_perminent = false) {
padams marked this conversation as resolved.
Show resolved Hide resolved
function setState($store, $name, $value, $store_type = '', $is_perminent = false) {

sdk::debug(sprintf('populating state for store: %s, name: %s, value: %s, store type: %s, is_perm: %s', $store, $name, print_r($value, true), $store_type, $is_perminent));

Expand Down Expand Up @@ -153,7 +153,7 @@ function isCdhRequired($store_name) {
}
}

function set($store, $name = '', $value, $store_type = '', $is_perminent = false) {
function set($store, $name, $value, $store_type = '', $is_perminent = false) {

if ( ! isset($this->stores[$store] ) ) {
$this->loadState($store);
Expand Down
2 changes: 1 addition & 1 deletion src/Tracker/TrackerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public function trackPageview($event = '') {
return $this->trackEvent($this->pageview_event);
}

public function trackAction($action_group = '', $action_name, $action_label = '', $numeric_value = 0) {
public function trackAction($action_name, $action_group = '', $action_label = '', $numeric_value = 0) {
padams marked this conversation as resolved.
Show resolved Hide resolved

$event = $this->makeEvent();
$event->setEventType('track.action');
Expand Down
25 changes: 0 additions & 25 deletions src/owa-autoloader.php

This file was deleted.