Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
7737918c
Commit
7737918c
authored
Jan 14, 2019
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PSR-1 violations, add Travis command
parent
50ca17ab
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
51 additions
and
40 deletions
+51
-40
.travis.yml
.travis.yml
+1
-0
emails.php
qa-include/app/emails.php
+1
-0
UserMessages.php
qa-src/Controllers/User/UserMessages.php
+3
-3
UserPosts.php
qa-src/Controllers/User/UserPosts.php
+8
-5
UserProfile.php
qa-src/Controllers/User/UserProfile.php
+8
-5
UsersList.php
qa-src/Controllers/User/UsersList.php
+5
-5
ExceptionHandler.php
qa-src/Exceptions/ExceptionHandler.php
+1
-2
Email.php
qa-src/Notifications/Email.php
+3
-3
AbstractStep.php
qa-src/Recalc/AbstractStep.php
+2
-2
RecalcMain.php
qa-src/Recalc/RecalcMain.php
+10
-10
RefillEventsRefill.php
qa-src/Recalc/RefillEventsRefill.php
+9
-5
No files found.
.travis.yml
View file @
7737918c
...
@@ -34,6 +34,7 @@ before_script:
...
@@ -34,6 +34,7 @@ before_script:
script
:
script
:
# PHP_CodeSniffer
# PHP_CodeSniffer
-
php phpcs.phar --report=emacs --extensions=php --standard=qa-tests/phpcs/ruleset.xml .
-
php phpcs.phar --report=emacs --extensions=php --standard=qa-tests/phpcs/ruleset.xml .
-
php phpcs.phar --report=emacs --extensions=php --standard=qa-tests/phpcs/ruleset-strict.xml qa-src/
# PHPUnit
# PHPUnit
-
php phpunit.phar --bootstrap qa-tests/autoload.php qa-tests
-
php phpunit.phar --bootstrap qa-tests/autoload.php qa-tests
...
...
qa-include/app/emails.php
View file @
7737918c
...
@@ -70,6 +70,7 @@ function qa_send_notification($userid, $email, $handle, $subject, $body, $subs,
...
@@ -70,6 +70,7 @@ function qa_send_notification($userid, $email, $handle, $subject, $body, $subs,
return
$sender
->
sendMessage
(
$subject
,
$body
,
$subs
,
$html
);
return
$sender
->
sendMessage
(
$subject
,
$body
,
$subs
,
$html
);
}
}
/**
/**
* Send the email based on the $params array - the following keys are required (some can be empty): fromemail,
* Send the email based on the $params array - the following keys are required (some can be empty): fromemail,
* fromname, toemail, toname, subject, body, html
* fromname, toemail, toname, subject, body, html
...
...
qa-src/Controllers/User/UserMessages.php
View file @
7737918c
...
@@ -21,13 +21,13 @@ namespace Q2A\Controllers\User;
...
@@ -21,13 +21,13 @@ namespace Q2A\Controllers\User;
use
Q2A\Http\Exceptions\PageNotFoundException
;
use
Q2A\Http\Exceptions\PageNotFoundException
;
use
Q2A\Middleware\Auth\InternalUsersOnly
;
use
Q2A\Middleware\Auth\InternalUsersOnly
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'app/messages.php'
;
class
UserMessages
extends
\Q2A\Controllers\BaseController
class
UserMessages
extends
\Q2A\Controllers\BaseController
{
{
public
function
__construct
()
public
function
__construct
()
{
{
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'app/messages.php'
;
parent
::
__construct
();
parent
::
__construct
();
$this
->
addMiddleware
(
new
InternalUsersOnly
());
$this
->
addMiddleware
(
new
InternalUsersOnly
());
...
...
qa-src/Controllers/User/UserPosts.php
View file @
7737918c
...
@@ -20,16 +20,19 @@ namespace Q2A\Controllers\User;
...
@@ -20,16 +20,19 @@ namespace Q2A\Controllers\User;
use
Q2A\Http\Exceptions\PageNotFoundException
;
use
Q2A\Http\Exceptions\PageNotFoundException
;
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
class
UserPosts
extends
\Q2A\Controllers\BaseController
class
UserPosts
extends
\Q2A\Controllers\BaseController
{
{
protected
$userid
;
protected
$userid
;
protected
$userhtml
;
protected
$userhtml
;
public
function
__construct
()
{
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
}
/**
/**
* @param string $handle
* @param string $handle
*
*
...
...
qa-src/Controllers/User/UserProfile.php
View file @
7737918c
...
@@ -20,16 +20,19 @@ namespace Q2A\Controllers\User;
...
@@ -20,16 +20,19 @@ namespace Q2A\Controllers\User;
use
Q2A\Http\Exceptions\PageNotFoundException
;
use
Q2A\Http\Exceptions\PageNotFoundException
;
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
class
UserProfile
extends
\Q2A\Controllers\BaseController
class
UserProfile
extends
\Q2A\Controllers\BaseController
{
{
private
$userid
;
private
$userid
;
private
$userhtml
;
private
$userhtml
;
public
function
__construct
()
{
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
}
public
function
index
()
public
function
index
()
{
{
$handle
=
qa_get_logged_in_handle
();
$handle
=
qa_get_logged_in_handle
();
...
...
qa-src/Controllers/User/UsersList.php
View file @
7737918c
...
@@ -22,15 +22,15 @@ use Q2A\Auth\NoPermissionException;
...
@@ -22,15 +22,15 @@ use Q2A\Auth\NoPermissionException;
use
Q2A\Middleware\Auth\InternalUsersOnly
;
use
Q2A\Middleware\Auth\InternalUsersOnly
;
use
Q2A\Middleware\Auth\MinimumUserLevel
;
use
Q2A\Middleware\Auth\MinimumUserLevel
;
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
class
UsersList
extends
\Q2A\Controllers\BaseController
class
UsersList
extends
\Q2A\Controllers\BaseController
{
{
public
function
__construct
()
public
function
__construct
()
{
{
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
parent
::
__construct
();
parent
::
__construct
();
$this
->
addMiddleware
(
new
InternalUsersOnly
(),
array
(
'newest'
,
'special'
,
'blocked'
));
$this
->
addMiddleware
(
new
InternalUsersOnly
(),
array
(
'newest'
,
'special'
,
'blocked'
));
...
...
qa-src/Exceptions/ExceptionHandler.php
View file @
7737918c
...
@@ -21,12 +21,11 @@ namespace Q2A\Exceptions;
...
@@ -21,12 +21,11 @@ namespace Q2A\Exceptions;
use
Exception
;
use
Exception
;
use
Q2A\Http\Exceptions\PageNotFoundException
;
use
Q2A\Http\Exceptions\PageNotFoundException
;
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
class
ExceptionHandler
class
ExceptionHandler
{
{
public
function
__construct
()
public
function
__construct
()
{
{
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
}
}
public
function
handle
(
Exception
$exception
)
public
function
handle
(
Exception
$exception
)
...
...
qa-src/Notifications/Email.php
View file @
7737918c
...
@@ -31,11 +31,11 @@ class Email
...
@@ -31,11 +31,11 @@ class Email
private
function
__construct
(
$email
,
$handle
)
private
function
__construct
(
$email
,
$handle
)
{
{
$this
->
email
=
$email
;
$this
->
handle
=
$handle
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
//required for qa_db_select_with_pending()
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
//required for qa_db_select_with_pending()
require_once
QA_INCLUDE_DIR
.
'app/options.php'
;
//required for qa_opt()
require_once
QA_INCLUDE_DIR
.
'app/options.php'
;
//required for qa_opt()
$this
->
email
=
$email
;
$this
->
handle
=
$handle
;
}
}
/**
/**
...
...
qa-src/Recalc/AbstractStep.php
View file @
7737918c
...
@@ -18,8 +18,6 @@
...
@@ -18,8 +18,6 @@
namespace
Q2A\Recalc
;
namespace
Q2A\Recalc
;
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
//required for qa_number_format()
abstract
class
AbstractStep
abstract
class
AbstractStep
{
{
protected
$state
;
protected
$state
;
...
@@ -27,6 +25,8 @@ abstract class AbstractStep
...
@@ -27,6 +25,8 @@ abstract class AbstractStep
public
function
__construct
(
State
$state
)
public
function
__construct
(
State
$state
)
{
{
require_once
QA_INCLUDE_DIR
.
'app/format.php'
;
// for qa_format_number()
$this
->
state
=
$state
;
$this
->
state
=
$state
;
}
}
...
...
qa-src/Recalc/RecalcMain.php
View file @
7737918c
...
@@ -54,16 +54,6 @@
...
@@ -54,16 +54,6 @@
namespace
Q2A\Recalc
;
namespace
Q2A\Recalc
;
require_once
QA_INCLUDE_DIR
.
'db/recalc.php'
;
require_once
QA_INCLUDE_DIR
.
'db/post-create.php'
;
require_once
QA_INCLUDE_DIR
.
'db/points.php'
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'db/admin.php'
;
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'app/options.php'
;
require_once
QA_INCLUDE_DIR
.
'app/post-create.php'
;
require_once
QA_INCLUDE_DIR
.
'app/post-update.php'
;
class
RecalcMain
class
RecalcMain
{
{
protected
$state
;
protected
$state
;
...
@@ -73,6 +63,16 @@ class RecalcMain
...
@@ -73,6 +63,16 @@ class RecalcMain
*/
*/
public
function
__construct
(
$state
)
public
function
__construct
(
$state
)
{
{
require_once
QA_INCLUDE_DIR
.
'db/recalc.php'
;
require_once
QA_INCLUDE_DIR
.
'db/post-create.php'
;
require_once
QA_INCLUDE_DIR
.
'db/points.php'
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'db/admin.php'
;
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'app/options.php'
;
require_once
QA_INCLUDE_DIR
.
'app/post-create.php'
;
require_once
QA_INCLUDE_DIR
.
'app/post-update.php'
;
$this
->
state
=
new
\Q2A\Recalc\State
(
$state
);
$this
->
state
=
new
\Q2A\Recalc\State
(
$state
);
}
}
...
...
qa-src/Recalc/RefillEventsRefill.php
View file @
7737918c
...
@@ -18,13 +18,17 @@
...
@@ -18,13 +18,17 @@
namespace
Q2A\Recalc
;
namespace
Q2A\Recalc
;
require_once
QA_INCLUDE_DIR
.
'app/events.php'
;
require_once
QA_INCLUDE_DIR
.
'app/updates.php'
;
require_once
QA_INCLUDE_DIR
.
'util/sort.php'
;
class
RefillEventsRefill
extends
AbstractStep
class
RefillEventsRefill
extends
AbstractStep
{
{
public
function
__construct
(
State
$state
)
{
require_once
QA_INCLUDE_DIR
.
'app/events.php'
;
require_once
QA_INCLUDE_DIR
.
'app/updates.php'
;
require_once
QA_INCLUDE_DIR
.
'util/sort.php'
;
parent
::
__construct
(
$state
);
}
public
function
doStep
()
public
function
doStep
()
{
{
$questionids
=
qa_db_qs_get_for_event_refilling
(
$this
->
state
->
next
,
1
);
$questionids
=
qa_db_qs_get_for_event_refilling
(
$this
->
state
->
next
,
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment