-
-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow config and temp directories to be configured independently. #760
Closed
ArclightHub
wants to merge
1
commit into
knuckleswtf:master
from
ArclightHub:allow-config-and-temp-to-be-configured-independently
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# docker-compose up -d && docker logs -f scribe_app_1 | ||
FROM ubuntu:jammy | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
ENV TZ=Etc/UTC | ||
|
||
# APT | ||
RUN apt-get -qq update && apt-get install -qq \ | ||
make \ | ||
curl \ | ||
php \ | ||
php-curl \ | ||
php-xml \ | ||
php-sqlite3 \ | ||
php-bcmath \ | ||
php-curl \ | ||
php-gd \ | ||
php-imagick \ | ||
php-intl \ | ||
php-mbstring \ | ||
php-pdo \ | ||
php-zip \ | ||
php-soap \ | ||
php-pcov \ | ||
git \ | ||
p7zip-full | ||
|
||
# Composer Install | ||
RUN curl -sS https://getcomposer.org/installer | php && \ | ||
mv composer.phar /usr/local/bin/composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
install: | ||
composer install | ||
|
||
test: install | ||
composer test-ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Allow devs to run the unit tests in a dockerized environment | ||
# clear && docker-compose up -d && docker logs -f scribe_app_1 | ||
version: '3.7' | ||
services: | ||
app: | ||
build: | ||
context: ./ | ||
volumes: | ||
- ./:/testing | ||
working_dir: /testing | ||
command: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Knuckles\Scribe\Configuration; | ||
|
||
/** | ||
* Decouple scribe config file name from the cache directory. | ||
*/ | ||
class CacheConfiguration | ||
{ | ||
/** @var string */ | ||
private string $scribeConfig; | ||
|
||
/** @var string */ | ||
private string $cacheDir; | ||
|
||
/** @var bool */ | ||
private bool $isHidden; | ||
|
||
/** | ||
* @param string $cacheDir | ||
* @param string $scribeConfig | ||
* @param bool $isHidden | ||
*/ | ||
public function __construct(string $cacheDir, string$scribeConfig, bool $isHidden = true) | ||
{ | ||
$this->cacheDir = $cacheDir; | ||
$this->scribeConfig = $scribeConfig; | ||
$this->isHidden = $isHidden; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getScribeConfigFile(): string | ||
{ | ||
return $this->scribeConfig; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function __toString(): string | ||
{ | ||
return ($this->isHidden ? '.' : '') . $this->cacheDir; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,16 @@ | |
namespace Knuckles\Scribe\GroupedEndpoints; | ||
|
||
use Knuckles\Scribe\Commands\GenerateDocumentation; | ||
use Knuckles\Scribe\Configuration\CacheConfiguration; | ||
use Knuckles\Scribe\Matching\RouteMatcherInterface; | ||
|
||
class GroupedEndpointsFactory | ||
{ | ||
public function make(GenerateDocumentation $command, RouteMatcherInterface $routeMatcher, string $docsName = 'scribe'): GroupedEndpointsContract | ||
{ | ||
public function make( | ||
GenerateDocumentation $command, | ||
RouteMatcherInterface $routeMatcher, | ||
CacheConfiguration $docsName | ||
): GroupedEndpointsContract { | ||
if ($command->isForcing()) { | ||
return static::fromApp($command, $routeMatcher, false, $docsName); | ||
} | ||
|
@@ -24,12 +28,12 @@ public static function fromApp( | |
GenerateDocumentation $command, | ||
RouteMatcherInterface $routeMatcher, | ||
bool $preserveUserChanges, | ||
string $docsName = 'scribe' | ||
CacheConfiguration $docsName | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like mismatching parameter names? Name
|
||
): GroupedEndpointsFromApp { | ||
return new GroupedEndpointsFromApp($command, $routeMatcher, $preserveUserChanges, $docsName); | ||
} | ||
|
||
public static function fromCamelDir(string $docsName = 'scribe'): GroupedEndpointsFromCamelDir | ||
public static function fromCamelDir(CacheConfiguration $docsName): GroupedEndpointsFromCamelDir | ||
{ | ||
return new GroupedEndpointsFromCamelDir($docsName); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix this? (The other occurrence(s) too).