Permalink
Browse files

Fix climate and CI

  • Loading branch information...
William Entriken
William Entriken committed Jan 1, 2015
1 parent 851528c commit e8cf2dc4c590ddb81a12f3daf710ae64c393da52
View
@@ -21,18 +21,18 @@ before_script:
script:
## PHP_CodeSniffer
- phpcs --report=emacs --standard=PSR2 . --ignore=modules/security/openid/lightopenid/*
- phpcs --report=emacs --standard=PSR2 . --ignore=vendor/*
## PHP Copy/Paste Detector
- php phpcpd.phar --verbose .
## PHP Mess Detector
- phpmd . text cleancode --exclude modules/security/openid/lightopenid
- phpmd . text codesize --exclude modules/security/openid/lightopenid
- phpmd . text controversial --exclude modules/security/openid/lightopenid
- phpmd . text design --exclude modules/security/openid/lightopenid
- phpmd . text naming --exclude modules/security/openid/lightopenid
- phpmd . text unusedcode --exclude modules/security/openid/lightopenid
- phpmd . text cleancode --exclude vendor
- phpmd . text codesize --exclude vendor
- phpmd . text controversial --exclude vendor
- phpmd . text design --exclude vendor
- phpmd . text naming --exclude vendor
- phpmd . text unusedcode --exclude vendor
## PHPLOC
- php phploc.phar .
- php phploc.phar . --exclude vendor
## PHPUNIT
- phpunit .
## LINT
@@ -60,7 +60,7 @@ public function handleGet($get, $post, $files, $cookies)
);
$commentRecords = array();
while ($record = $query->fetchAssoc()) {
$auditTrails[] = $record;
$commentRecords[] = $record;
}
$view->commentRecords = $commentRecords;
@@ -26,10 +26,8 @@ public function handleGet($get, $post, $files, $cookies)
$this->model = Models\Favorites::favoritesForCurrentUser($cookies);
$start = isset($get['start']) ? $get['start'] : 0;
$section = isset($get['section']) ? $get['section'] : NULL;
$this->model->setPage($start);
$photoCount = $this->model->getPhotoCount();
$folderCount = $this->model->getFolderCount();
$gridObjects = $this->model->getPhotos();
/* Set up common page parts */
@@ -36,7 +36,7 @@ protected function htmlFooter()
{
$view = new Views\FooterView;
$view->statsUrl = StatisticsController::getUrl();
$view->analyticsID = Models\Preferences::valueForModuleWithKey('BootstrapTheme', 'analytics');
$view->analyticsId = Models\Preferences::valueForModuleWithKey('BootstrapTheme', 'analytics');
$view->ownerEmail = Models\Preferences::valueForModuleWithKey('CameraLife', 'owner_email');
$view->render();
}
@@ -47,7 +47,7 @@ public function handleGet($get, $post, $files, $cookies)
session_start();
$_SESSION['openid_identity'] = $openid->identity;
$_SESSION['openid_email'] = $attr['contact/email'];
$user = Models\User::userWithOpenId($_SESSION['openid_identity'], $_SESSION['openid_email']);
Models\User::userWithOpenId($_SESSION['openid_identity'], $_SESSION['openid_email']);
header('Location: ' . MainPageController::getUrl());
return;
} else {
@@ -84,6 +84,7 @@ public function handleGet($get, $post, $files, $cookies)
if (!$file) {
$photo->generateThumbnail();
//todo fix
list($file, $temp, $mtime) = $cameralife->fileStore->getFile($bucket, $filepath);
}
@@ -19,7 +19,7 @@ public function __construct($id)
if (!Models\Photo::photoExists(intval($id))) {
header("HTTP/1.0 404 Not Found");
$cameralife->error("Photo #" . intval($_GET['id']) . " not found.");
throw new \Exception('Photo #' . intval($id) . ' not found.');
}
$this->model = Models\Photo::getPhotoWithID($id);
@@ -52,7 +52,8 @@ public function handleGet($get, $post, $files, $cookies)
$this->htmlHeader($cookies);
if ($this->model->get('status') != 0) {
$cameralife->security->authorize('admin_file', 'This file has been flagged or marked private');
//todo check privs
throw new \Exception('This file has been flagged or marked private');
}
$this->model->set('hits', $this->model->get('hits') + 1);
@@ -355,7 +355,7 @@ public function handlePost($get, $post, $files, $cookies)
Models\Database::setupTables();
Models\Preferences::setFactoryDefaults();
$user = Models\User::userWithOpenId($_SESSION['openid_identity'], $_SESSION['openid_email']);
Models\User::userWithOpenId($_SESSION['openid_identity'], $_SESSION['openid_email']);
Models\Database::update('users', ['auth'=>5], 'email="'.$_SESSION['openid_email'].'"'); //todo security
header('Location: ' . MainPageController::getUrl());
//todo URL / url http://www.teamten.com/lawrence/writings/capitalization_of_initialisms.html
@@ -262,7 +262,7 @@ public static function update($table, $values, $condition = '1', $extra = '')
{
empty(self::$pdoConnection) && self::connect();
$setstring = '';
foreach ($values as $key => $value) {
foreach (array_keys($values) as $key) {
$setstring .= "`$key` = ?, ";
}
$setstring = substr($setstring, 0, -2); // chop off last ', '
@@ -285,7 +285,7 @@ public static function update($table, $values, $condition = '1', $extra = '')
* @param string $extra (default: '')
* @return integer
*/
public static function insert($table, $values, $extra = '')
public static function insert($table, $values)
{
empty(self::$pdoConnection) && self::connect();
$columns = '`' . implode('`,`', array_keys($values)) . '`';
@@ -459,6 +459,7 @@ public static function update()
*/
public function fsck()
{
//todo update, and is this used?
global $cameralife;
$files = $cameralife->fileStore->ListFiles('photo', $this->path, false);
if (!is_array($files)) {
View
@@ -186,7 +186,7 @@ private function imagerotateRightAngle($imgSrc, $angle)
} elseif ($angle == 180) {
for ($x = 0; $x < $srcX; $x++) {
for ($y = 0; $y < $srcY; $y++) {
imagecopy($imgDest, $imgSrc, $srcX - $x - 1, $srcy - $y - 1, $x, $y, 1, 1);
imagecopy($imgDest, $imgSrc, $srcX - $x - 1, $srcY - $y - 1, $x, $y, 1, 1);
}
}
}
Oops, something went wrong.

0 comments on commit e8cf2dc

Please sign in to comment.