This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Cookie helper for dealing with Zend Http responses. | |
* | |
* @author Bill Shupp <hostmaster@shupp.org> | |
* @copyright 2010 Bill Shupp | |
* @license http://www.opensource.org/licenses/bsd-license.php FreeBSD | |
*/ | |
class MS_Cookie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/public_html/index.php b/public_html/index.php | |
index 2d6a659..9fba63c 100644 | |
--- a/public_html/index.php | |
+++ b/public_html/index.php | |
@@ -3,9 +3,26 @@ | |
require_once '../RandomString.php'; | |
require_once 'HTML/QuickForm.php'; | |
+ | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WRONG | |
class Foo1 | |
{ | |
public function bar() | |
{ | |
$cache = Cache::singleton('Memcached'); | |
$result = $cache->get('keyname'); | |
// do some stuff with the result | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Auth_Driver_OpenIDTest extends PHPUnit_Framework_TestCase | |
{ | |
protected function getCache() | |
{ | |
return $this->getMock('stdClass', array('get', 'set')); | |
} | |
protected function getUserClient() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo | |
{ | |
// @codeCoverageIgnoreStart | |
protected function getCache() | |
{ | |
return Cache::singleton('MyCacheDriver'); | |
} | |
// @codeCoverageIgnoreEnd | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$base = dirname(__FILE__); | |
set_include_path("{$base}:{$base}/tests:" . get_include_path()); | |
require_once 'PHPUnit/Util/Filter.php'; | |
PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); | |
require_once 'PHPUnit/TextUI/Command.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php runTests.php --coverage-html coverage OpenID_AllTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP version of SimpleGeo's foursquare integration example: | |
// http://blog.simplegeo.com/2010/07/09/explore-your-foursquare-checkins-on-a-map-with-simplegeo/ | |
// | |
// by Bill Shupp | |
// http://blog.shupp.org/2010/07/10/importing-foursquare-checkins-into-simplegeo-with-php/ | |
require_once 'Services/SimpleGeo.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'ControllerTestCase.php'; | |
require_once APPLICATION_PATH . '/controllers/ErrorController.php'; | |
class ErrorControllerTest extends ControllerTestCase | |
{ | |
public function test404Action() | |
{ | |
$this->getRequest()->setMethod('GET'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Example check at the top of your application for enabling profiling | |
if (isset($_SERVER['WWW_PROFILE']) && extension_loaded('xhprof')) { | |
$xproflib = APPLICATION_PATH . '/../public/build/xhprof/xhprof_lib'; | |
include_once $xproflib . '/utils/xhprof_lib.php'; | |
include_once $xproflib . '/utils/xhprof_runs.php'; | |
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); | |
function stop_xhprof_profiling() |
OlderNewer