updated and fix files using php-cs-fixer

This commit is contained in:
iamflorencejay 2021-05-14 20:10:54 +08:00 committed by Jeremy Kauffman
parent f8b413326c
commit de10165d5e
34 changed files with 394 additions and 395 deletions

View file

@ -2,7 +2,7 @@
class Controller class Controller
{ {
const CACHE_CLEAR_PATH = '/clear-cache'; public const CACHE_CLEAR_PATH = '/clear-cache';
protected static $queuedFunctions = []; protected static $queuedFunctions = [];

View file

@ -2,10 +2,10 @@
class Request class Request
{ {
const GET = 'GET'; public const GET = 'GET';
const POST = 'POST'; public const POST = 'POST';
const HEAD = 'HEAD'; public const HEAD = 'HEAD';
const OPTIONS = 'OPTIONS'; public const OPTIONS = 'OPTIONS';
protected static $method; protected static $method;

View file

@ -2,10 +2,10 @@
class Session class Session
{ {
const KEY_LIST_SUB_ERROR = 'list_error', public const KEY_LIST_SUB_ERROR = 'list_error',
KEY_USER_CULTURE = 'user_culture'; KEY_USER_CULTURE = 'user_culture';
const NAMESPACE_DEFAULT = 'default', public const NAMESPACE_DEFAULT = 'default',
NAMESPACE_FLASH = 'flash', NAMESPACE_FLASH = 'flash',
NAMESPACE_FLASH_REMOVE = 'flash_remove', NAMESPACE_FLASH_REMOVE = 'flash_remove',
USER_ID = 'user_id', USER_ID = 'user_id',

View file

@ -2,7 +2,7 @@
class ContentActions extends Actions class ContentActions extends Actions
{ {
const public const
SLUG_RSS = 'rss.xml', SLUG_RSS = 'rss.xml',
SLUG_NEWS = 'news', SLUG_NEWS = 'news',
SLUG_FAQ = 'faq', SLUG_FAQ = 'faq',

View file

@ -3,8 +3,8 @@
class DownloadActions extends Actions class DownloadActions extends Actions
{ {
//bad, fix me! //bad, fix me!
const ANDROID_STORE_URL = 'https://play.google.com/store/apps/details?id=io.lbry.browser'; public const ANDROID_STORE_URL = 'https://play.google.com/store/apps/details?id=io.lbry.browser';
const IOS_STORE_URL = 'https://apps.apple.com/us/app/odysee/id1539444143'; public const IOS_STORE_URL = 'https://apps.apple.com/us/app/odysee/id1539444143';
public static function executeDownloadPrereleaseAsset(string $repo, string $ext) public static function executeDownloadPrereleaseAsset(string $repo, string $ext)
{ {
@ -49,18 +49,13 @@ class DownloadActions extends Actions
'os' => $os 'os' => $os
]; ];
if ($os === OS::OS_ANDROID) if ($os === OS::OS_ANDROID) {
{
$params['downloadUrl'] = static::ANDROID_STORE_URL; $params['downloadUrl'] = static::ANDROID_STORE_URL;
$params['osScreenshotSrc'] = 'https://spee.ch/@lbry:3f/android-08-homepage.gif'; $params['osScreenshotSrc'] = 'https://spee.ch/@lbry:3f/android-08-homepage.gif';
} } elseif ($os === OS::OS_IOS) {
else if ($os === OS::OS_IOS)
{
$params['downloadUrl'] = static::IOS_STORE_URL; $params['downloadUrl'] = static::IOS_STORE_URL;
$params['osScreenshotSrc'] = 'https://spee.ch/odyseeiosimage.png'; $params['osScreenshotSrc'] = 'https://spee.ch/odyseeiosimage.png';
} } else {
else
{
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $params['preferredExt']); $asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $params['preferredExt']);
$params['downloadUrl'] = $asset ? $asset['browser_download_url'] : null; $params['downloadUrl'] = $asset ? $asset['browser_download_url'] : null;
} }

View file

@ -2,7 +2,6 @@
class ReportActions extends Actions class ReportActions extends Actions
{ {
/** /**
* Handles all routing requests without a claimId as parameter. * Handles all routing requests without a claimId as parameter.
* E.g. /dmca * E.g. /dmca
@ -10,8 +9,8 @@ class ReportActions extends Actions
* @return array * @return array
* @throws Exception * @throws Exception
*/ */
public static function executeDmca() { public static function executeDmca()
{
self::setResponseHeader(); self::setResponseHeader();
self::redirectIfPostRequest(false, ''); self::redirectIfPostRequest(false, '');
@ -35,8 +34,8 @@ class ReportActions extends Actions
* @return array * @return array
* @throws Exception * @throws Exception
*/ */
public static function executeDmcaWithClaimId(string $claimId): array { public static function executeDmcaWithClaimId(string $claimId): array
{
$claimId = htmlspecialchars($claimId); $claimId = htmlspecialchars($claimId);
self::setResponseHeader(); self::setResponseHeader();
@ -63,7 +62,6 @@ class ReportActions extends Actions
*/ */
private static function validateForm(array $values, array $errors) private static function validateForm(array $values, array $errors)
{ {
foreach (['name', 'email', 'rightsholder', 'identifier'] as $field) { foreach (['name', 'email', 'rightsholder', 'identifier'] as $field) {
$value = Request::getPostParam($field); $value = Request::getPostParam($field);
@ -82,7 +80,6 @@ class ReportActions extends Actions
Session::setFlash('success', '<h3>Report Submitted</h3><p>We will respond shortly.</p><p>This ID for this report is <strong>' . $values['report_id'] . '</strong>. Please reference this ID when contacting us regarding this report.</p>'); Session::setFlash('success', '<h3>Report Submitted</h3><p>We will respond shortly.</p><p>This ID for this report is <strong>' . $values['report_id'] . '</strong>. Please reference this ID when contacting us regarding this report.</p>');
return Controller::redirect(Request::getRelativeUri(), 303); return Controller::redirect(Request::getRelativeUri(), 303);
} }
} }
/** /**
@ -101,8 +98,8 @@ class ReportActions extends Actions
* *
* @return array * @return array
*/ */
private static function redirectIfPostRequest(bool $hasClaimId = false, string $claimId = '') { private static function redirectIfPostRequest(bool $hasClaimId = false, string $claimId = '')
{
if ($hasClaimId && !empty($claimId)) { if ($hasClaimId && !empty($claimId)) {
$returnValue = ['report/dmca', ['claimId' => $claimId]]; $returnValue = ['report/dmca', ['claimId' => $claimId]];
} else { } else {

View file

@ -1,4 +1,5 @@
<?php <?php
return array( return array(
0 => 0 =>
array( array(
@ -65,15 +66,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 3, 'comments' => 3,
'created_at' => '2019-01-07T18:50:36Z', 'created_at' => '2019-01-07T18:50:36Z',
'updated_at' => '2019-02-05T23:45:18Z', 'updated_at' => '2019-02-05T23:45:18Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>LBRY released a functional mobile beta in 2018.</p> 'body_html' => '<p>LBRY released a functional mobile beta in 2018.</p>
<p>As soon as possible in 2019 we must release a proper mobile app as well as promotion around it.</p> <p>As soon as possible in 2019 we must release a proper mobile app as well as promotion around it.</p>
@ -158,15 +159,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 6, 'comments' => 6,
'created_at' => '2019-01-07T18:01:17Z', 'created_at' => '2019-01-07T18:01:17Z',
'updated_at' => '2019-02-05T23:50:06Z', 'updated_at' => '2019-02-05T23:50:06Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>A significant majority of people prefer advertisements to paying small fees for content. Adding advertisements would allow users who are in that category to avoid spending LBC for content. Additionally, advertisements would allow new users to watch sufficiently cheap content for free without needing to acquire LBC, reducing startup costs.</p> 'body_html' => '<p>A significant majority of people prefer advertisements to paying small fees for content. Adding advertisements would allow users who are in that category to avoid spending LBC for content. Additionally, advertisements would allow new users to watch sufficiently cheap content for free without needing to acquire LBC, reducing startup costs.</p>
<p>The most likely model for advertisements is:</p> <p>The most likely model for advertisements is:</p>
@ -283,15 +284,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 4, 'comments' => 4,
'created_at' => '2018-12-07T16:24:18Z', 'created_at' => '2018-12-07T16:24:18Z',
'updated_at' => '2019-02-05T23:58:59Z', 'updated_at' => '2019-02-05T23:58:59Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>Lbry.tech only soft-launched at the end of 2018 and the whitepaper and full specification of the protocol are only just being added as 2019 goals are being specified.</p> 'body_html' => '<p>Lbry.tech only soft-launched at the end of 2018 and the whitepaper and full specification of the protocol are only just being added as 2019 goals are being specified.</p>
<p>With these resources ready, LBRY should make a concerted effort to grow its technical reputation and 3rd-party development.</p> <p>With these resources ready, LBRY should make a concerted effort to grow its technical reputation and 3rd-party development.</p>
@ -388,15 +389,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 0, 'comments' => 0,
'created_at' => '2018-12-07T16:23:17Z', 'created_at' => '2018-12-07T16:23:17Z',
'updated_at' => '2019-02-05T23:52:51Z', 'updated_at' => '2019-02-05T23:52:51Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>While the LBRY data network is decentralized and designed to function without LBRY Inc. involvement, theres room for improvement. The LBRY data network must improve incentives for participation and performance and ensure it has zero dependency on LBRY Inc. infrastructure.</p> 'body_html' => '<p>While the LBRY data network is decentralized and designed to function without LBRY Inc. involvement, theres room for improvement. The LBRY data network must improve incentives for participation and performance and ensure it has zero dependency on LBRY Inc. infrastructure.</p>
<p>This means ensuring that proper incentives exist to participate as a host or to fulfill any role that LBRY Inc. currently participates in (e.g. wallet servers).</p> <p>This means ensuring that proper incentives exist to participate as a host or to fulfill any role that LBRY Inc. currently participates in (e.g. wallet servers).</p>
@ -490,15 +491,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 1, 'comments' => 1,
'created_at' => '2018-12-07T16:21:52Z', 'created_at' => '2018-12-07T16:21:52Z',
'updated_at' => '2019-02-05T23:50:36Z', 'updated_at' => '2019-02-05T23:50:36Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>While LBRY has relationships with a large number of creators, many of these are weak or passive relationships.</p> 'body_html' => '<p>While LBRY has relationships with a large number of creators, many of these are weak or passive relationships.</p>
<p>LBRY must seek partnerships with creators that see enough value and potential in LBRY technology to proactively promote it, not just passively co-publish.</p> <p>LBRY must seek partnerships with creators that see enough value and potential in LBRY technology to proactively promote it, not just passively co-publish.</p>
@ -592,15 +593,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 2, 'comments' => 2,
'created_at' => '2018-12-07T16:21:00Z', 'created_at' => '2018-12-07T16:21:00Z',
'updated_at' => '2019-02-05T23:53:00Z', 'updated_at' => '2019-02-05T23:53:00Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>Performance was a focus in 2018 to decent success. Failed streams were reduced by more than 66% and stream performance has improved substantially as well, especially with the final releases of 2018.</p> 'body_html' => '<p>Performance was a focus in 2018 to decent success. Failed streams were reduced by more than 66% and stream performance has improved substantially as well, especially with the final releases of 2018.</p>
<p>All of it is still not enough.</p> <p>All of it is still not enough.</p>
@ -741,11 +742,11 @@ return array (
'site_admin' => false, 'site_admin' => false,
), ),
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 0, 'comments' => 0,
'created_at' => '2018-12-07T16:19:09Z', 'created_at' => '2018-12-07T16:19:09Z',
'updated_at' => '2019-02-05T23:51:10Z', 'updated_at' => '2019-02-05T23:51:10Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>All current primary ways of acquiring and/or converting LBC (rewards, community, and exchanges) are either high effort or inflexible.</p> 'body_html' => '<p>All current primary ways of acquiring and/or converting LBC (rewards, community, and exchanges) are either high effort or inflexible.</p>
<p>If we want creators to take LBC seriously, as well as allow users to participate fully, we need to provide a low friction way of converting to and from LBC to the currency they desire.</p> <p>If we want creators to take LBC seriously, as well as allow users to participate fully, we need to provide a low friction way of converting to and from LBC to the currency they desire.</p>
@ -839,15 +840,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 1, 'comments' => 1,
'created_at' => '2018-12-07T16:18:16Z', 'created_at' => '2018-12-07T16:18:16Z',
'updated_at' => '2019-02-05T23:51:16Z', 'updated_at' => '2019-02-05T23:51:16Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>LBRY is a win for creators in terms of trust and earnings, but we have more to do in terms of the features creators expect out of a content distribution platform.</p> 'body_html' => '<p>LBRY is a win for creators in terms of trust and earnings, but we have more to do in terms of the features creators expect out of a content distribution platform.</p>
<p>This includes giving them more control over the presentation of their work, more insight into how their content is performing, and an ability to provide proof about their identity.</p> <p>This includes giving them more control over the presentation of their work, more insight into how their content is performing, and an ability to provide proof about their identity.</p>
@ -933,15 +934,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 0, 'comments' => 0,
'created_at' => '2018-12-07T16:17:10Z', 'created_at' => '2018-12-07T16:17:10Z',
'updated_at' => '2019-02-05T23:51:23Z', 'updated_at' => '2019-02-05T23:51:23Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>Existing community initiatives have relied too much on LBRY Inc. They do not scale, are resource intensive, require us to pick winners and losers under significant uncertainty, and hinder our ability to get traction internationally or in other areas where were less familiar.</p> 'body_html' => '<p>Existing community initiatives have relied too much on LBRY Inc. They do not scale, are resource intensive, require us to pick winners and losers under significant uncertainty, and hinder our ability to get traction internationally or in other areas where were less familiar.</p>
<p>In Q4 2018, the growth team drafted and began implementing a plan to massively scale community efforts. Currently titled the “swarm plan”, it involves appointing and empowering a large number of community members with explicit roles, responsibilities, and budgets. Swarms are community slices aligned along a geographic area or cultural interest.</p> <p>In Q4 2018, the growth team drafted and began implementing a plan to massively scale community efforts. Currently titled the “swarm plan”, it involves appointing and empowering a large number of community members with explicit roles, responsibilities, and budgets. Swarms are community slices aligned along a geographic area or cultural interest.</p>
@ -1064,11 +1065,11 @@ return array (
'site_admin' => false, 'site_admin' => false,
), ),
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 0, 'comments' => 0,
'created_at' => '2018-12-07T16:12:04Z', 'created_at' => '2018-12-07T16:12:04Z',
'updated_at' => '2019-02-05T23:51:34Z', 'updated_at' => '2019-02-05T23:51:34Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>The LBRY blockchain layer has done an admirable job through 2018. Its seen substantial improvements in terms of claim expiration and normalization, as well as improved performance and organization.</p> 'body_html' => '<p>The LBRY blockchain layer has done an admirable job through 2018. Its seen substantial improvements in terms of claim expiration and normalization, as well as improved performance and organization.</p>
<p>Most importantly, the LBRY blockchain has remained secure, and the security of the blockchain layer is always goal number one.</p> <p>Most importantly, the LBRY blockchain has remained secure, and the security of the blockchain layer is always goal number one.</p>
@ -1219,11 +1220,11 @@ return array (
'site_admin' => false, 'site_admin' => false,
), ),
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 3, 'comments' => 3,
'created_at' => '2018-12-07T16:09:29Z', 'created_at' => '2018-12-07T16:09:29Z',
'updated_at' => '2019-02-05T23:51:41Z', 'updated_at' => '2019-02-05T23:51:41Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>One downside of giving the publisher exclusive control over the metadata stored in the LBRY blockchain is that the publisher has exclusive control over the metadata stored in the LBRY blockchain. Less tautologically, metadata can sometimes be inaccurate, malicious, or immutable due to lost keys (<del>though expiration handles this eventually</del> we dont have expiration...).</p> 'body_html' => '<p>One downside of giving the publisher exclusive control over the metadata stored in the LBRY blockchain is that the publisher has exclusive control over the metadata stored in the LBRY blockchain. Less tautologically, metadata can sometimes be inaccurate, malicious, or immutable due to lost keys (<del>though expiration handles this eventually</del> we dont have expiration...).</p>
<p>The strongest solution to this problem is to allow community-based updates to metadata. Sometimes called “metadata overlays”, these are suggested changes or corrections to publisher-provided metadata. Such corrections could range from correcting errors, to correctly marking a file as containing adult content, to attributions that a file is maligned via a tag.</p> <p>The strongest solution to this problem is to allow community-based updates to metadata. Sometimes called “metadata overlays”, these are suggested changes or corrections to publisher-provided metadata. Such corrections could range from correcting errors, to correctly marking a file as containing adult content, to attributions that a file is maligned via a tag.</p>
@ -1373,11 +1374,11 @@ return array (
'site_admin' => false, 'site_admin' => false,
), ),
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 1, 'comments' => 1,
'created_at' => '2018-12-07T16:08:19Z', 'created_at' => '2018-12-07T16:08:19Z',
'updated_at' => '2019-02-05T23:51:54Z', 'updated_at' => '2019-02-05T23:51:54Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>Even with a mobile application in an early beta, we ran into user experience issues and confusion around the locality of wallets and other user data.</p> 'body_html' => '<p>Even with a mobile application in an early beta, we ran into user experience issues and confusion around the locality of wallets and other user data.</p>
<p>Regardless of the underlying architecture of LBRY, we must provide an emergent consumer experience that matches what they expect in other places: the ability to have the same views, data, and accounts across devices.</p> <p>Regardless of the underlying architecture of LBRY, we must provide an emergent consumer experience that matches what they expect in other places: the ability to have the same views, data, and accounts across devices.</p>
@ -1543,11 +1544,11 @@ return array (
'site_admin' => false, 'site_admin' => false,
), ),
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 2, 'comments' => 2,
'created_at' => '2018-12-07T16:06:50Z', 'created_at' => '2018-12-07T16:06:50Z',
'updated_at' => '2019-02-05T23:52:23Z', 'updated_at' => '2019-02-05T23:52:23Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>International audiences are a ripe target for adoption of LBRY for several reasons:</p> 'body_html' => '<p>International audiences are a ripe target for adoption of LBRY for several reasons:</p>
<ol> <ol>
@ -1649,15 +1650,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 1, 'comments' => 1,
'created_at' => '2018-12-07T16:05:09Z', 'created_at' => '2018-12-07T16:05:09Z',
'updated_at' => '2019-02-05T23:53:14Z', 'updated_at' => '2019-02-05T23:53:14Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>Lackluster content discovery has throttled user engagement. While search has improved and subscriptions were added, existing experiences still do not do a sufficient job driving people to content that is interesting to them.</p> 'body_html' => '<p>Lackluster content discovery has throttled user engagement. While search has improved and subscriptions were added, existing experiences still do not do a sufficient job driving people to content that is interesting to them.</p>
<p>LBRY must look to improve discovery through any possible mechanism. The most promising avenues are:</p> <p>LBRY must look to improve discovery through any possible mechanism. The most promising avenues are:</p>
@ -1768,15 +1769,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 0, 'comments' => 0,
'created_at' => '2018-12-07T16:04:03Z', 'created_at' => '2018-12-07T16:04:03Z',
'updated_at' => '2019-02-05T23:52:00Z', 'updated_at' => '2019-02-05T23:52:00Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>In a decentralized system with no authority like LBRY, it is imperative that the community itself be able to provide feedback about the content itself. Is it legitimate? Is there a problem with it? Was it good?</p> 'body_html' => '<p>In a decentralized system with no authority like LBRY, it is imperative that the community itself be able to provide feedback about the content itself. Is it legitimate? Is there a problem with it? Was it good?</p>
<p>One solution to this is comments. This is related to Community Metadata, but is a less thorny problem since it doesnt pose the same user experience challenges. Any system that does this ought to meet the same egalitarian standard that LBRY itself aims for. Required attributes:</p> <p>One solution to this is comments. This is related to Community Metadata, but is a less thorny problem since it doesnt pose the same user experience challenges. Any system that does this ought to meet the same egalitarian standard that LBRY itself aims for. Required attributes:</p>
@ -1875,15 +1876,15 @@ return array (
), ),
'state' => 'open', 'state' => 'open',
'locked' => false, 'locked' => false,
'assignee' => NULL, 'assignee' => null,
'assignees' => 'assignees' =>
array( array(
), ),
'milestone' => NULL, 'milestone' => null,
'comments' => 0, 'comments' => 0,
'created_at' => '2018-12-07T16:02:35Z', 'created_at' => '2018-12-07T16:02:35Z',
'updated_at' => '2019-02-05T23:52:08Z', 'updated_at' => '2019-02-05T23:52:08Z',
'closed_at' => NULL, 'closed_at' => null,
'author_association' => 'NONE', 'author_association' => 'NONE',
'body_html' => '<p>Providing a desktop-based application experience was a necessary step towards getting the protocol working and will always be necessary for people who want a complete, full, and uncontrolled LBRY experience.</p> 'body_html' => '<p>Providing a desktop-based application experience was a necessary step towards getting the protocol working and will always be necessary for people who want a complete, full, and uncontrolled LBRY experience.</p>
<p>We always knew most people wouldnt want that. Installing an application is high friction and requires users to be fully responsible for their own security.</p> <p>We always knew most people wouldnt want that. Installing an application is high friction and requires users to be fully responsible for their own security.</p>

View file

@ -69,12 +69,12 @@ class Dispatcher
return false; return false;
} }
return (boolean)$routes[$httpMethod]; return (bool)$routes[$httpMethod];
} }
try { try {
$handler = $this->dispatchVariableRoute($httpMethod, $uri); $handler = $this->dispatchVariableRoute($httpMethod, $uri);
return (boolean)$handler; return (bool)$handler;
} catch (HttpRouteNotFoundException | HttpMethodNotAllowedException $e) { } catch (HttpRouteNotFoundException | HttpMethodNotAllowedException $e) {
return false; return false;
} }

View file

@ -7,7 +7,7 @@ class HandlerResolver implements HandlerResolverInterface
public function resolve($handler) public function resolve($handler)
{ {
if (is_array($handler) && is_string($handler[0])) { if (is_array($handler) && is_string($handler[0])) {
$handler[0] = new $handler[0]; $handler[0] = new $handler[0]();
} }
return $handler; return $handler;

View file

@ -7,19 +7,19 @@ class Route
/** /**
* Constants for before and after filters * Constants for before and after filters
*/ */
const BEFORE = 'before'; public const BEFORE = 'before';
const AFTER = 'after'; public const AFTER = 'after';
const PREFIX = 'prefix'; public const PREFIX = 'prefix';
/** /**
* Constants for common HTTP methods * Constants for common HTTP methods
*/ */
const ANY = 'ANY'; public const ANY = 'ANY';
const GET = 'GET'; public const GET = 'GET';
const HEAD = 'HEAD'; public const HEAD = 'HEAD';
const POST = 'POST'; public const POST = 'POST';
const PUT = 'PUT'; public const PUT = 'PUT';
const PATCH = 'PATCH'; public const PATCH = 'PATCH';
const DELETE = 'DELETE'; public const DELETE = 'DELETE';
const OPTIONS = 'OPTIONS'; public const OPTIONS = 'OPTIONS';
} }

View file

@ -4,9 +4,9 @@ namespace Routing;
class RouteCollector class RouteCollector
{ {
const DEFAULT_CONTROLLER_ROUTE = 'index'; public const DEFAULT_CONTROLLER_ROUTE = 'index';
const APPROX_CHUNK_SIZE = 10; public const APPROX_CHUNK_SIZE = 10;
/** /**
* @var RouteParser * @var RouteParser

View file

@ -9,7 +9,6 @@ namespace Routing;
*/ */
class RouteParser class RouteParser
{ {
/** /**
* Search through the given route looking for dynamic portions. * Search through the given route looking for dynamic portions.
* *
@ -22,7 +21,7 @@ class RouteParser
* *
* Finally we look for an optional '?' which is used to signify an optional route. * Finally we look for an optional '?' which is used to signify an optional route.
*/ */
const VARIABLE_REGEX = public const VARIABLE_REGEX =
"~\{ "~\{
\s* ([a-zA-Z0-9_]*) \s* \s* ([a-zA-Z0-9_]*) \s*
(?: (?:
@ -33,7 +32,7 @@ class RouteParser
/** /**
* The default parameter character restriction (One or more characters that is not a '/'). * The default parameter character restriction (One or more characters that is not a '/').
*/ */
const DEFAULT_DISPATCH_REGEX = '[^/]+'; public const DEFAULT_DISPATCH_REGEX = '[^/]+';
private $parts; private $parts;

View file

@ -2,7 +2,7 @@
class Github class Github
{ {
const REPO_LBRY_DESKTOP = 'lbry-desktop'; public const REPO_LBRY_DESKTOP = 'lbry-desktop';
public static function isAssetForOs(array $asset, string $os) public static function isAssetForOs(array $asset, string $os)
{ {

View file

@ -2,7 +2,7 @@
class LBRY class LBRY
{ {
const DEFAULT_TIMEOUT = 10; public const DEFAULT_TIMEOUT = 10;
public static function getApiUrl($endpoint) public static function getApiUrl($endpoint)
{ {

View file

@ -2,12 +2,12 @@
class Mailgun class Mailgun
{ {
const BASE_URL = 'https://api.mailgun.net/v3'; public const BASE_URL = 'https://api.mailgun.net/v3';
const TOP_DOMAIN = 'lbry.com'; public const TOP_DOMAIN = 'lbry.com';
const MAIL_DOMAIN = 'mail.lbry.com'; public const MAIL_DOMAIN = 'mail.lbry.com';
const LIST_GENERAL = 'lbryians@lbry.com'; public const LIST_GENERAL = 'lbryians@lbry.com';
public static function sendDmcaReport($data) public static function sendDmcaReport($data)
{ {

View file

@ -2,7 +2,7 @@
class Salesforce class Salesforce
{ {
const public const
API_URL = 'https://api.salesforceiq.com/v2/', API_URL = 'https://api.salesforceiq.com/v2/',
DEFAULT_LIST_ID = '58387a94e4b0a1fea2c76f4a'; DEFAULT_LIST_ID = '58387a94e4b0a1fea2c76f4a';

View file

@ -5,7 +5,7 @@ class Transifex
{ {
public static function isConfigured() public static function isConfigured()
{ {
return (boolean)Config::get(Config::TRANSIFEX_API_KEY); return (bool)Config::get(Config::TRANSIFEX_API_KEY);
} }
public static function getTranslationResourceFile($project, $resource, $language, $cache = true) public static function getTranslationResourceFile($project, $resource, $language, $cache = true)

View file

@ -2,26 +2,26 @@
class Config class Config
{ {
const HELP_CONTACT_EMAIL = 'hello@lbry.com'; public const HELP_CONTACT_EMAIL = 'hello@lbry.com';
//Constant to help with managing strings //Constant to help with managing strings
const IS_PROD = "is_prod"; public const IS_PROD = "is_prod";
const CHAINQUERY_DSN = 'chainquery_dsn'; public const CHAINQUERY_DSN = 'chainquery_dsn';
const CHAINQUERY_USERNAME = 'chainquery_username'; public const CHAINQUERY_USERNAME = 'chainquery_username';
const CHAINQUERY_PASSWORD = 'chainquery_password'; public const CHAINQUERY_PASSWORD = 'chainquery_password';
const GITHUB_KEY = "github_key"; public const GITHUB_KEY = "github_key";
const GITHUB_APP_CLIENT_ID = "github_app_client_id"; public const GITHUB_APP_CLIENT_ID = "github_app_client_id";
const GITHUB_APP_CLIENT_SECRET = "github_app_client_secret"; public const GITHUB_APP_CLIENT_SECRET = "github_app_client_secret";
const GITHUB_PERSONAL_AUTH_TOKEN = 'github_personal_auth_token'; public const GITHUB_PERSONAL_AUTH_TOKEN = 'github_personal_auth_token';
const LBRY_API_SERVER = "lbry_api_server"; public const LBRY_API_SERVER = "lbry_api_server";
const MAILCHIMP_KEY = "mailchimp_key"; public const MAILCHIMP_KEY = "mailchimp_key";
const TRANSIFEX_API_KEY = 'transifex_api_key'; public const TRANSIFEX_API_KEY = 'transifex_api_key';
const AWS_LOG_ACCESS_KEY = "aws_log_access_key"; public const AWS_LOG_ACCESS_KEY = "aws_log_access_key";
const AWS_LOG_SECRET_KEY = "aws_log_secret_key"; public const AWS_LOG_SECRET_KEY = "aws_log_secret_key";
const MAILGUN_API_KEY = "mailgun_api_key"; public const MAILGUN_API_KEY = "mailgun_api_key";
const SALESFORCE_KEY = "salesforce_key"; public const SALESFORCE_KEY = "salesforce_key";
const SALESFORCE_SECRET = "salesforce_secret"; public const SALESFORCE_SECRET = "salesforce_secret";
const SLACK_ERROR_NOTIFICATION_URL = "slack_error_notification_url"; public const SLACK_ERROR_NOTIFICATION_URL = "slack_error_notification_url";
protected static $loaded = false; protected static $loaded = false;

View file

@ -2,7 +2,7 @@
class Curl class Curl
{ {
const public const
GET = 'GET', GET = 'GET',
POST = 'POST', POST = 'POST',
PUT = 'PUT', PUT = 'PUT',

View file

@ -2,7 +2,7 @@
class CurlWithCache extends Curl class CurlWithCache extends Curl
{ {
const DEFAULT_CACHE = 600000; public const DEFAULT_CACHE = 600000;
public static function doCurl($method, $url, $params = [], $options = []) public static function doCurl($method, $url, $params = [], $options = [])
{ {

View file

@ -5,7 +5,7 @@ class OS
/* /*
* if changing below constants, you should add permanent redirects for old OS names used in URLs * if changing below constants, you should add permanent redirects for old OS names used in URLs
*/ */
const OS_ANDROID = 'android', public const OS_ANDROID = 'android',
OS_IOS = 'ios', OS_IOS = 'ios',
OS_LINUX = 'linux', OS_LINUX = 'linux',
OS_OSX = 'osx', OS_OSX = 'osx',

View file

@ -13,11 +13,11 @@
*/ */
class Smaz class Smaz
{ {
const CODEBOOK_DEFAULT = 'default'; public const CODEBOOK_DEFAULT = 'default';
const CODEBOOK_EMAIL = 'email'; public const CODEBOOK_EMAIL = 'email';
const VERBATIM_CHAR = 254; public const VERBATIM_CHAR = 254;
const VERBATIM_STR = 255; public const VERBATIM_STR = 255;
protected static $encodeBooks = []; protected static $encodeBooks = [];
protected static $decodeBooks = [ protected static $decodeBooks = [

View file

@ -1,6 +1,8 @@
<?php <?php
class PostException extends Exception {} class PostException extends Exception
{
}
class PostNotFoundException extends PostException class PostNotFoundException extends PostException
{ {
@ -12,7 +14,7 @@ class PostMalformedException extends PostException
class Post class Post
{ {
const SORT_DATE_DESC = 'sort_date_desc', public const SORT_DATE_DESC = 'sort_date_desc',
SORT_ORD_ASC = 'sort_ord_asc'; SORT_ORD_ASC = 'sort_ord_asc';
protected static $slugMap = []; protected static $slugMap = [];

Binary file not shown.

View file

@ -2,18 +2,18 @@
class Response class Response
{ {
const HEADER_STATUS = 'Status'; public const HEADER_STATUS = 'Status';
const HEADER_LOCATION = 'Location'; public const HEADER_LOCATION = 'Location';
const HEADER_CACHE_CONTROL = 'Cache-Control'; public const HEADER_CACHE_CONTROL = 'Cache-Control';
const HEADER_ETAG = 'Etag'; public const HEADER_ETAG = 'Etag';
const HEADER_CONTENT_TYPE = 'Content-Type'; public const HEADER_CONTENT_TYPE = 'Content-Type';
const HEADER_CONTENT_LENGTH = 'Content-Length'; public const HEADER_CONTENT_LENGTH = 'Content-Length';
const HEADER_CONTENT_DISPOSITION = 'Content-Disposition'; public const HEADER_CONTENT_DISPOSITION = 'Content-Disposition';
const HEADER_CONTENT_TYPE_OPTIONS = 'X-Content-Type-Options'; public const HEADER_CONTENT_TYPE_OPTIONS = 'X-Content-Type-Options';
const HEADER_CONTENT_ENCODING = 'Content-Encoding'; public const HEADER_CONTENT_ENCODING = 'Content-Encoding';
const HEADER_CROSS_ORIGIN = 'Access-Control-Allow-Origin'; public const HEADER_CROSS_ORIGIN = 'Access-Control-Allow-Origin';
protected static $metaDescription = ''; protected static $metaDescription = '';
protected static $metaTitle = ''; protected static $metaTitle = '';

View file

@ -12,14 +12,14 @@ function js_end()
class View class View
{ {
const LAYOUT_PARAMS = '_layout_params'; public const LAYOUT_PARAMS = '_layout_params';
const WEB_DIR = ROOT_DIR . '/web'; public const WEB_DIR = ROOT_DIR . '/web';
const COMPONENTS_DIR = self::WEB_DIR . '/components/sass'; public const COMPONENTS_DIR = self::WEB_DIR . '/components/sass';
const COLORS_DIR = self::WEB_DIR . '/scss/color'; public const COLORS_DIR = self::WEB_DIR . '/scss/color';
const SCSS_DIR = self::WEB_DIR . '/scss'; public const SCSS_DIR = self::WEB_DIR . '/scss';
const CSS_DIR = self::WEB_DIR . '/css'; public const CSS_DIR = self::WEB_DIR . '/css';
const JS_DIR = self::WEB_DIR . '/js'; public const JS_DIR = self::WEB_DIR . '/js';
public static function render($template, array $vars = []): string public static function render($template, array $vars = []): string
{ {
@ -193,8 +193,7 @@ class View
} }
return $parser->saveHTML($dom); return $parser->saveHTML($dom);
} } catch (Error $e) {
catch (Error $e) {
Slack::slackGrin(); Slack::slackGrin();
return $html; return $html;
} }

View file

@ -1 +1,3 @@
<?php echo json_encode($json ?? [], JSON_PRETTY_PRINT); <?php
echo json_encode($json ?? [], JSON_PRETTY_PRINT);

View file

@ -1 +1,3 @@
<?php echo file_get_contents($zipPath); <?php
echo file_get_contents($zipPath);

View file

@ -42,7 +42,9 @@
<?php $tagIndex = 0 ?> <?php $tagIndex = 0 ?>
<?php foreach ($tags as $tag => $enabled): ?> <?php foreach ($tags as $tag => $enabled): ?>
<?php if (!isset($tagMetadata[$tag])) continue; ?> <?php if (!isset($tagMetadata[$tag])) {
continue;
} ?>
<?php $tagId = 'tag_' . (++$tagIndex) ?> <?php $tagId = 'tag_' . (++$tagIndex) ?>
<div> <div>
<checkbox-element> <checkbox-element>