mirror of
https://github.com/flextype/flextype.git
synced 2025-08-06 21:26:48 +02:00
feat(settings): update path format
This commit is contained in:
@@ -81,6 +81,8 @@
|
||||
"victorjonsson/markdowndocs": "^1.3.8"
|
||||
},
|
||||
"config": {
|
||||
"apcu-autoloader": true,
|
||||
"optimize-autoloader": true,
|
||||
"platform-check": false,
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
|
@@ -124,7 +124,7 @@ class Entries
|
||||
continue;
|
||||
}
|
||||
|
||||
if (filesystem()->file(ROOT_DIR . $value['path'])->exists()) {
|
||||
if (filesystem()->file(ROOT_DIR . '/' . $value['path'])->exists()) {
|
||||
include_once ROOT_DIR . '/' . $value['path'];
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ class Entries
|
||||
public function initDirectives(array $directives): void
|
||||
{
|
||||
foreach ($directives as $key => $value) {
|
||||
if (filesystem()->file(ROOT_DIR . $value['path'])->exists()) {
|
||||
if (filesystem()->file(ROOT_DIR . '/' . $value['path'])->exists()) {
|
||||
include_once ROOT_DIR . '/' . $value['path'];
|
||||
}
|
||||
}
|
||||
@@ -498,7 +498,7 @@ class Entries
|
||||
|
||||
$currentEntryID = strings($currenEntry->getPath())
|
||||
->replace('\\', '/')
|
||||
->replace(PATH['project'] . $this->options['directory'] . '/', '')
|
||||
->replace(PATH['project'] . '/' . $this->options['directory'] . '/', '')
|
||||
->trim('/')
|
||||
->toString();
|
||||
|
||||
@@ -893,7 +893,7 @@ class Entries
|
||||
return $this->registry()->get('methods.getFileLocation.result');
|
||||
}
|
||||
|
||||
return PATH['project'] . $this->options['directory'] . '/' . $this->registry()->get('methods.getFileLocation.params.id') . '/' . $this->registry()->get('methods.getFileLocation.collection.filename') . '.' . $this->registry()->get('methods.getFileLocation.collection.extension');
|
||||
return PATH['project'] . '/' . $this->options['directory'] . '/' . $this->registry()->get('methods.getFileLocation.params.id') . '/' . $this->registry()->get('methods.getFileLocation.collection.filename') . '.' . $this->registry()->get('methods.getFileLocation.collection.extension');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -924,7 +924,7 @@ class Entries
|
||||
return $this->registry()->get('methods.getDirectoryLocation.result');
|
||||
}
|
||||
|
||||
return PATH['project'] . $this->options['directory'] . '/' . $this->registry()->get('methods.getDirectoryLocation.params.id');
|
||||
return PATH['project'] . '/' . $this->options['directory'] . '/' . $this->registry()->get('methods.getDirectoryLocation.params.id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -20,9 +20,9 @@ emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void
|
||||
if (! entries()->registry()->get('methods.fetch.collection.fields.created_at.enabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.created_at.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.created_at.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesCreate', static function (): void {
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.create.collection.fields.created_by.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.create.collection.fields.created_by.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.id.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.id.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.modified_at.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.modified_at.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.published_at.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.published_at.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesCreate', static function (): void {
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.create.collection.fields.published_by.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.create.collection.fields.published_by.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.routable.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.routable.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.slug.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.slug.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,7 @@ emitter()->addListener('onEntriesCreate', static function (): void {
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.create.collection.fields.uuid.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.create.collection.fields.uuid.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.visibility.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.visibility.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesCreate', static function (): void {
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.create.collection.fields.calls.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.create.collection.fields.calls.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.id.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.fetch.collection.fields.id.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesCreate', static function (): void {
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.create.collection.fields.limit_calls.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.create.collection.fields.limit_calls.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ emitter()->addListener('onEntriesCreate', static function (): void {
|
||||
}
|
||||
|
||||
// Determine is the current field file path is the same.
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->isEqual(entries()->registry()->get('methods.create.collection.fields.state.path'))) {
|
||||
if (! strings(__FILE__)->replace(ROOT_DIR, '')->replaceFirst('/', '')->isEqual(entries()->registry()->get('methods.create.collection.fields.state.path'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -117,7 +117,7 @@ final class Shortcodes
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! file_exists(ROOT_DIR . $shortcode['path'])) {
|
||||
if (! file_exists(ROOT_DIR . '/' . $shortcode['path'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user