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

Adapter #2

Merged
merged 4 commits into from Feb 8, 2012
Merged

Adapter #2

merged 4 commits into from Feb 8, 2012

Conversation

stof
Copy link
Contributor

@stof stof commented Feb 8, 2012

As discussed per mail, I added some extension point using the adapter pattern to make it easier to integrate with other frameworks.
The Zend adapter for the access to request params and cookies could probably be improved as I'm quite sure they have an abstraction for cookies too but I never worked with ZF and so someone else will have to improve it later. Currently, it only does special things for the request param (like the previous implementation)

Sorry for the whitespace changes. My IDE is configured to strip trailing whitespaces automatically when saving. You can view the diff without them by adding ?w=1.

The Symfony2 bundle will be available soon

marcguyer added a commit that referenced this pull request Feb 8, 2012
@marcguyer marcguyer merged commit 3085c43 into marcguyer:master Feb 8, 2012
@marcguyer
Copy link
Owner

Very nicely done. The only drawback is that anyone using ZF1 previously would now need to specify the Zend adapter(s). Not really a big deal.

Looking forward to seeing the Symphony adapter(s).

@stof
Copy link
Contributor Author

stof commented Feb 8, 2012

The bundle is here It does not contain the Symfony adapters yet, only the integration with the config but it will come.

What is exactly the goal of the static setMarketingCookie method ? I'm wondering how I should integrate it with Symfony as the phpdoc says it may be used for all request so maybe the bundle should run it automatically.

@marcguyer
Copy link
Owner

Just pushed some changes, fyi: 848a5d7

I was tempted to change the naming convention to be more ZF-ish like so:

CheddarGetter/Http/Adapter/Interface.php
CheddarGetter/Http/Adapter/Native.php
CheddarGetter/Http/Adapter/Zend.php
CheddarGetter/Client/Adapter/Interface.php
CheddarGetter/Client/Adapter/Curl.php
CheddarGetter/Client/Adapter/Zend.php

...but that's not really a big deal. Maybe what you've done there is more Symphony-like. The ZF1 autoloader works either way.

What is exactly the goal of the static setMarketingCookie method ? I'm wondering how I should integrate it with Symfony as the phpdoc says it may be used for all request so maybe the bundle should run it automatically.

That cookie stores data about a site's raw traffic from the top of the funnel. The method is intended to be used for every request to the marketing site (not existing users' requests). When that cookie is used, CG is informed about how a customer found the client's site and when. With that information, CG can report on the best market sources, time to conversion, real ROI for marketing dollars, effectiveness of promotions/coupons, etc.

@stof
Copy link
Contributor Author

stof commented Feb 8, 2012

Well, ZF2 also uses the way I did it, because it cannot use CheddarGetter\Http\Adapter\Interface for namespaced code (the short class name would be a reserved keyword)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants