https://github.com/moesif/moesif-symfony1.4-example
https://github.com/moesif/moesif-symfony1.4-example
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/moesif/moesif-symfony1.4-example
- Owner: Moesif
- Created: 2019-06-22T01:37:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-26T22:13:07.000Z (almost 6 years ago)
- Last Synced: 2025-01-05T21:11:59.115Z (9 months ago)
- Language: PHP
- Size: 49.8 KB
- Stars: 1
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Symfony(1.4) Example
Moesif is an API analyatics and monitoring platform. [moesif-symfony1.4](https://github.com/Moesif/moesif-symfony1.4)
is a middleware that makes integration with Moesif easy for Symfony1.4 based applications.This is an example of an API built on Symfony (1.4) with Moesif integrated.
## How to enable MoesifFilter
Create a custom filter `MyCustomFilter` which extends MoesifFilter and you would be able to view all the API calls being captured.
```php
getContext()->getUser();
return $user->getAttribute("user_id");
}/**
* Get sessionToken
*/
function identifySessionToken($request, $response){
return $request->getHttpHeader('Authorization');
}
}
```Update the filters.yml files to enable capturing API calls.
`config/filters.yml`
```yaml
MyCustomFilter:
class: MyCustomFilter
param:
applicationId: Your Moesif Application Id
debug: 'true'
logBody: 'true'
```Your Moesif Application Id can be found in the [_Moesif Portal_](https://www.moesif.com/).
After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.You can always find your Moesif Application Id at any time by logging
into the [_Moesif Portal_](https://www.moesif.com/), click on the top right menu,
and then clicking _Installation_.## How to run this example
1. Install the dependencies `composer update` or `composer install`.
1. Update the files `config/filters.yml` with your Moesif Application Id .
2. Change to `web` directory.
3. Run `php -S localhost:8888` to start the server.
4. Hit the server with this route - `http://localhost:8888/index.php` and you would see the event is captured in Moesif.