forked from BitBagCommerce/SyliusWishlistPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26678fa
commit 538915b
Showing
31 changed files
with
293 additions
and
91 deletions.
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
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,45 @@ | ||
<?php | ||
|
||
const NODE_MODULES_FOLDER_NAME = 'node_modules'; | ||
const PATH_TO_NODE_MODULES = 'tests' . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR . 'node_modules'; | ||
|
||
/* cannot use `file_exists` or `stat` as gives false on symlinks if target path does not exist yet */ | ||
if (@lstat(NODE_MODULES_FOLDER_NAME)) | ||
{ | ||
if (is_link(NODE_MODULES_FOLDER_NAME) || is_dir(NODE_MODULES_FOLDER_NAME)) { | ||
echo '> `' . NODE_MODULES_FOLDER_NAME . '` already exists as a link or folder, keeping existing as may be intentional.' . PHP_EOL; | ||
exit(0); | ||
} else { | ||
echo '> Invalid symlink `' . NODE_MODULES_FOLDER_NAME . '` detected, recreating...' . PHP_EOL; | ||
if (!@unlink(NODE_MODULES_FOLDER_NAME)) { | ||
echo '> Could not delete file `' . NODE_MODULES_FOLDER_NAME . '`.' . PHP_EOL; | ||
exit(1); | ||
} | ||
} | ||
} | ||
|
||
/* try to create the symlink using PHP internals... */ | ||
$success = @symlink(PATH_TO_NODE_MODULES, NODE_MODULES_FOLDER_NAME); | ||
|
||
/* if case it has failed, but OS is Windows... */ | ||
if (!$success && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { | ||
/* ...then try a different approach which does not require elevated permissions and folder to exist */ | ||
echo '> This system is running Windows, creation of links requires elevated privileges,' . PHP_EOL; | ||
echo '> and target path to exist. Fallback to NTFS Junction:' . PHP_EOL; | ||
exec(sprintf('mklink /J %s %s 2> NUL', NODE_MODULES_FOLDER_NAME, PATH_TO_NODE_MODULES), $output, $returnCode); | ||
$success = $returnCode === 0; | ||
if (!$success) { | ||
echo '> Failed o create the required symlink' . PHP_EOL; | ||
exit(2); | ||
} | ||
} | ||
|
||
$path = @readlink(NODE_MODULES_FOLDER_NAME); | ||
/* check if link points to the intended directory */ | ||
if ($path && realpath($path) === realpath(PATH_TO_NODE_MODULES)) { | ||
echo '> Successfully created the symlink.' . PHP_EOL; | ||
exit(0); | ||
} | ||
|
||
echo '> Failed to create the symlink to `' . NODE_MODULES_FOLDER_NAME . '`.' . PHP_EOL; | ||
exit(3); |
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 |
---|---|---|
|
@@ -15,16 +15,22 @@ APP_SECRET=EDITME | |
DATABASE_URL=mysql://[email protected]/sylius_wish_list_plugin_%kernel.environment%?serverVersion=5.7 | ||
###< doctrine/doctrine-bundle ### | ||
|
||
###> lexik/jwt-authentication-bundle ### | ||
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem | ||
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem | ||
JWT_PASSPHRASE=acme_plugin_development | ||
###< lexik/jwt-authentication-bundle ### | ||
|
||
###> symfony/swiftmailer-bundle ### | ||
# For Gmail as a transport, use: "gmail://username:password@localhost" | ||
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" | ||
# Delivery is disabled by default via "null://localhost" | ||
MAILER_URL=smtp://localhost | ||
###< symfony/swiftmailer-bundle ### | ||
|
||
|
||
###> lexik/jwt-authentication-bundle ### | ||
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem | ||
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem | ||
JWT_PASSPHRASE=YOUR_SECRET_PASSPHRASE | ||
###< lexik/jwt-authentication-bundle ### | ||
###> symfony/messenger ### | ||
# Choose one of the transports below | ||
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages | ||
MESSENGER_TRANSPORT_DSN=doctrine://default | ||
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages | ||
###< symfony/messenger ### |
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
File renamed without changes.
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.