Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
242
Issues
242
List
Boards
Labels
Service Desk
Milestones
Merge Requests
32
Merge Requests
32
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
20ec8968
Commit
20ec8968
authored
1 hour ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(cs): fixer
parent
4e58a8d4
epic/minds-pro
1 merge request
!308
WIP: (feat): Minds Pro
Pipeline
#81167708
failed with stages
in 11 minutes
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
12 deletions
+11
-12
SEO.php
Core/Blogs/SEO.php
+1
-1
SEO.php
Core/Pro/SEO.php
+6
-5
Settings.php
Core/Pro/Settings.php
+2
-1
Manager.php
Core/Router/Manager.php
+1
-2
ProMiddleware.php
Core/Router/Middleware/ProMiddleware.php
+1
-2
SEOMiddleware.php
Core/Router/Middleware/SEOMiddleware.php
+0
-1
No files found.
Core/Blogs/SEO.php
View file @
20ec8968
...
...
@@ -84,7 +84,7 @@ class SEO
$serverParams
=
$request
->
getServerParams
()
??
[];
$host
=
parse_url
(
$serverParams
[
'HTTP_ORIGIN'
]
??
''
,
PHP_URL_HOST
)
?:
$serverParams
[
'HTTP_HOST'
];
$proSettings
=
$proDomain
->
lookup
(
$host
);
$proSettings
=
$proDomain
->
lookup
(
$host
);
if
(
$proSettings
&&
(
count
(
$slugs
)
<
2
||
$slugs
[
0
]
===
'blog'
))
{
$slugParts
=
explode
(
'-'
,
$slugs
[
1
]);
...
...
This diff is collapsed.
Click to expand it.
Core/Pro/SEO.php
View file @
20ec8968
...
...
@@ -66,14 +66,15 @@ class SEO
'og:image'
=>
$this
->
user
->
getIconURL
(
'large'
),
]);
Manager
::
add
(
'/'
,
function
()
{});
Manager
::
add
(
'/'
,
function
()
{
});
Manager
::
add
(
'/newsfeed'
,
[
$this
,
'activityHandler'
]);
Manager
::
add
(
'/media'
,
[
$this
,
'entityHandler'
]);
// blog route added in Blogs\SEO
}
function
activityHandler
(
$slugs
=
[])
public
function
activityHandler
(
$slugs
=
[])
{
if
(
isset
(
$slugs
[
0
])
&&
is_numeric
(
$slugs
[
0
]))
{
$activity
=
new
Activity
(
$slugs
[
0
]);
...
...
@@ -116,20 +117,20 @@ class SEO
}
}
function
getEntityProperty
(
$entity
,
$prop
)
public
function
getEntityProperty
(
$entity
,
$prop
)
{
$getter
=
"get${$prop}"
;
if
(
isset
(
$entity
->
{
$prop
}))
{
return
$entity
->
{
$prop
};
}
else
if
(
Helpers\MagicAttributes
::
getterExists
(
$entity
,
$getter
))
{
}
elseif
(
Helpers\MagicAttributes
::
getterExists
(
$entity
,
$getter
))
{
return
$entity
->
{
$getter
}();
}
return
null
;
}
function
entityHandler
(
$slugs
=
[])
public
function
entityHandler
(
$slugs
=
[])
{
if
(
isset
(
$slugs
[
0
])
&&
is_numeric
(
$slugs
[
0
]))
{
$entity
=
$this
->
entitiesBuilder
->
single
(
$slugs
[
0
]);
...
...
This diff is collapsed.
Click to expand it.
Core/Pro/Settings.php
View file @
20ec8968
...
...
@@ -103,7 +103,8 @@ class Settings implements JsonSerializable
/** @var array */
protected
$featuredContent
=
[];
public
function
getOneLineHeadline
()
{
public
function
getOneLineHeadline
()
{
return
preg_replace
(
"/
\\
r?
\\
n+/"
,
' '
,
$this
->
headline
);
}
...
...
This diff is collapsed.
Click to expand it.
Core/Router/Manager.php
View file @
20ec8968
...
...
@@ -21,8 +21,7 @@ class Manager
*/
public
function
__construct
(
$middleware
=
null
)
{
)
{
$this
->
middleware
=
$middleware
?:
[
new
Middleware\SEOMiddleware
(),
new
Middleware\ProMiddleware
(),
// this needs to always be the last element in this array
...
...
This diff is collapsed.
Click to expand it.
Core/Router/Middleware/ProMiddleware.php
View file @
20ec8968
...
...
@@ -40,8 +40,7 @@ class ProMiddleware implements RouterMiddleware
$manager
=
null
,
$seo
=
null
,
$entitiesBuilder
=
null
)
{
)
{
$this
->
domain
=
$domain
?:
Di
::
_
()
->
get
(
'Pro\Domain'
);
$this
->
manager
=
$manager
?:
Di
::
_
()
->
get
(
'Pro\Manager'
);
$this
->
seo
=
$seo
?:
Di
::
_
()
->
get
(
'Pro\SEO'
);
...
...
This diff is collapsed.
Click to expand it.
Core/Router/Middleware/SEOMiddleware.php
View file @
20ec8968
...
...
@@ -13,5 +13,4 @@ class SEOMiddleware implements RouterMiddleware
{
new
SEO\Defaults
(
Di
::
_
()
->
get
(
'Config'
));
}
}
This diff is collapsed.
Click to expand it.
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