Skip to content

Commit

Permalink
Merge pull request #1048 from jonasraoni/feature/main/housekeeping-up…
Browse files Browse the repository at this point in the history
…dates

Feature/main/housekeeping updates
  • Loading branch information
jonasraoni committed Jan 10, 2022
2 parents 451153d + be96316 commit 2015d1d
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 37 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ script:
- ./lib/pkp/tools/travis/run-tests.sh

after_failure:
- cat error.log
- tail -n 200 error.log
- sudo apt-get install sharutils
- tar cz cypress/screenshots | uuencode /dev/stdout

after_success:
- tail -n 200 error.log
3 changes: 0 additions & 3 deletions classes/author/DAO.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

namespace APP\author;

use APP\core\Application;
use PKP\db\DAORegistry;
use stdClass;
use Illuminate\Support\Facades\DB;
use APP\monograph\Chapter;

Expand Down
3 changes: 1 addition & 2 deletions classes/author/Repository.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use APP\core\Request;
use PKP\Services\PKPSchemaService;
use Illuminate\Support\Facades\App;
use APP\monograph\Chapter;

class Repository extends \PKP\author\Repository
Expand All @@ -28,7 +27,7 @@ public function __construct(DAO $dao, Request $request, PKPSchemaService $schema
/** @copydoc DAO::getCollector() */
public function getCollector(): Collector
{
return App::make(Collector::class);
return app(Collector::class);
}

/**
Expand Down
12 changes: 6 additions & 6 deletions classes/facades/Repo.inc.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @file classes/facade/Repo.inc.php
* @file classes/facades/Repo.inc.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2000-2021 John Willinsky
Expand All @@ -24,26 +24,26 @@ class Repo extends \PKP\facades\Repo
{
public static function publication(): PublicationRepository
{
return app()->make(PublicationRepository::class);
return app(PublicationRepository::class);
}

public static function submission(): SubmissionRepository
{
return app()->make(SubmissionRepository::class);
return app(SubmissionRepository::class);
}

public static function user(): UserRepository
{
return app()->make(UserRepository::class);
return app(UserRepository::class);
}

public static function author(): AuthorRepository
{
return app()->make(AuthorRepository::class);
return app(AuthorRepository::class);
}

public static function submissionFile(): SubmissionFileRepository
{
return app()->make(SubmissionFileRepository::class);
return app(SubmissionFileRepository::class);
}
}
4 changes: 0 additions & 4 deletions classes/install/Install.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

namespace APP\install;

// Default installation data
define('INSTALLER_DEFAULT_CONTACT', 'common.omp');
define('INSTALLER_DEFAULT_MIN_PASSWORD_LENGTH', 6);

use PKP\install\PKPInstall;

class Install extends PKPInstall
Expand Down
3 changes: 1 addition & 2 deletions classes/migration/upgrade/OMPv3_3_0UpgradeMigration.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use APP\core\Application;
use APP\core\Services;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use PKP\core\EntityDAO;
Expand Down Expand Up @@ -101,7 +100,7 @@ private function _settingsAsJSON()

// Account for new EntityDAOs
if (!$dao) {
$dao = App::make($daoName);
$dao = app($daoName);
if (!$dao) {
throw new Exception("${daoName} could not be created when migrating serialized settings");
}
Expand Down
3 changes: 1 addition & 2 deletions classes/publication/DAO.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use APP\core\Application;
use PKP\db\DAORegistry;
use stdClass;

class DAO extends \PKP\publication\DAO
{
Expand All @@ -39,7 +38,7 @@ class DAO extends \PKP\publication\DAO
/**
* @copydoc SchemaDAO::_fromRow()
*/
public function fromRow(stdClass $primaryRow): Publication
public function fromRow(object $primaryRow): Publication
{
$publication = parent::fromRow($primaryRow);
$publication->setData('publicationFormats', Application::getRepresentationDao()->getByPublicationId($publication->getId())->toArray());
Expand Down
2 changes: 1 addition & 1 deletion classes/statistics/StatisticsHelper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ protected function getReportObjectTypesArray()

if (!PKP_STRICT_MODE) {
class_alias('\APP\statistics\StatisticsHelper', '\StatisticsHelper');
define('STATISTICS_DIMENSION_SERIES_ID', \StatisticsHelper::STATISTICS_DIMENSION_SERIES_ID);
define('STATISTICS_DIMENSION_SERIES_ID', StatisticsHelper::STATISTICS_DIMENSION_SERIES_ID);
}
8 changes: 4 additions & 4 deletions classes/template/TemplateManager.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ public function setupBackendPage()
];

$index = array_search('submissions', array_keys($menu));
if ($index === false || count($menu) <= ($index + 1)) {
if ($index === false || count($menu) <= $index + 1) {
$menu['catalog'] = $catalogLink;
} else {
$menu = array_slice($menu, 0, $index + 1, true) +
['catalog' => $catalogLink] +
array_slice($menu, $index + 1, null, true);
$menu = array_slice($menu, 0, $index + 1, true)
+ ['catalog' => $catalogLink]
+ array_slice($menu, $index + 1, null, true);
}
}

Expand Down
2 changes: 1 addition & 1 deletion config.TEMPLATE.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; <?php exit(); // DO NOT DELETE?>
; <?php exit; // DO NOT DELETE?>
; DO NOT DELETE THE ABOVE LINE!!!
; Doing so will expose this configuration file through your web site!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
2 changes: 1 addition & 1 deletion lib/pkp
Submodule pkp updated 136 files
4 changes: 2 additions & 2 deletions pages/catalog/CatalogBookHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public function download($args, $request, $view = false)
if ($view) {
if (HookRegistry::call('CatalogBookHandler::view', [&$this, &$submission, &$publicationFormat, &$submissionFile])) {
// If the plugin handled the hook, prevent further default activity.
exit();
exit;
}
}

Expand All @@ -392,7 +392,7 @@ public function download($args, $request, $view = false)
$inline = $request->getUserVar('inline') ? true : false;
if (HookRegistry::call('CatalogBookHandler::download', [&$this, &$submission, &$publicationFormat, &$submissionFile, &$inline])) {
// If the plugin handled the hook, prevent further default activity.
exit();
exit;
}
$returner = true;
HookRegistry::call('FileManager::downloadFileFinished', [&$returner]);
Expand Down
8 changes: 4 additions & 4 deletions plugins/importexport/csv/CSVImportExportPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ public function executeCLI($scriptName, &$args)

if (!$filename || !$username) {
$this->usage($scriptName);
exit();
exit;
}

if (!file_exists($filename)) {
echo __('plugins.importexport.csv.fileDoesNotExist', ['filename' => $filename]) . "\n";
exit();
exit;
}

$data = file($filename);
Expand All @@ -115,7 +115,7 @@ public function executeCLI($scriptName, &$args)
$user = Repo::user()->getByUsername($username);
if (!$user) {
echo __('plugins.importexport.csv.unknownUser', ['username' => $username]) . "\n";
exit();
exit;
}

$pressDao = Application::getContextDAO();
Expand Down Expand Up @@ -145,7 +145,7 @@ public function executeCLI($scriptName, &$args)

if (!$genre) {
echo __('plugins.importexport.csv.noGenre') . "\n";
exit();
exit;
}
if (!$authorGroup) {
echo __('plugins.importexport.csv.noAuthorGroup', ['press' => $pressPath]) . "\n";
Expand Down
2 changes: 1 addition & 1 deletion plugins/paymethod/manual/ManualPaymentPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function handle($args, $request)
'backLinkLabel' => 'common.continue'
]);
$templateMgr->display('frontend/pages/message.tpl');
exit();
exit;
}
parent::handle($args, $request); // Don't know what to do with it
}
Expand Down
4 changes: 2 additions & 2 deletions tools/bootstrap.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
* to index.php for web requests).
*/

define('INDEX_FILE_LOCATION', dirname(dirname(__FILE__)) . '/index.php');
require(dirname(dirname(__FILE__)) . '/lib/pkp/classes/cliTool/CommandLineTool.inc.php');
define('INDEX_FILE_LOCATION', dirname(__FILE__, 2) . '/index.php');
require dirname(__FILE__, 2) . '/lib/pkp/classes/cliTool/CommandLineTool.inc.php';
2 changes: 1 addition & 1 deletion tools/fixFilenames.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct($argv = [])
$this->dryrun = false;
} else {
$this->usage();
exit();
exit;
}
}

Expand Down

0 comments on commit 2015d1d

Please sign in to comment.