Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
role_enum
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
role_enum
Merge requests
!2
Role enums as config source and permission lists
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Role enums as config source and permission lists
enum-source-permission-lists
into
1.x
Overview
0
Commits
7
Pipelines
7
Changes
39
Merged
dpi
requested to merge
enum-source-permission-lists
into
1.x
10 months ago
Overview
0
Commits
7
Pipelines
7
Changes
39
Expand
0
0
Merge request reports
Compare
1.x
version 5
ff307401
10 months ago
version 4
e78437b1
10 months ago
version 3
ead8480a
10 months ago
version 2
28cdc0fc
10 months ago
version 1
abcd2bb1
10 months ago
1.x (base)
and
latest version
latest version
ed8a711c
7 commits,
10 months ago
version 5
ff307401
6 commits,
10 months ago
version 4
e78437b1
5 commits,
10 months ago
version 3
ead8480a
3 commits,
10 months ago
version 2
28cdc0fc
2 commits,
10 months ago
version 1
abcd2bb1
1 commit,
10 months ago
39 files
+
1224
−
76
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
39
Search (e.g. *.vue) (Ctrl+P)
.gitlab/custom_symlink_project.php
0 → 100644
+
71
−
0
Options
#!/usr/bin/env php
<?php
# Pinto custom:
# Originally at,
# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/scripts/symlink_project.php
/**
* @file
* Symlink the files from this project into Drupal's modules/custom directory.
*
* Param 1 = Project name
* Param 2 = Path from webRoot to modules directory. This will vary depending on
* whether running a Drupal 7 or Drupal 10 pipeline. If none supplied
* then default to the Drupal 10 path.
*
* This script is also used for Drupal 7, which can go as low as PHP5.6, so do
* not use new PHP features and make sure that any change here is tested
* against PHP5.6. Therefore specific phpcs rules are disabled for this file.
*/
// phpcs:disable SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator
// phpcs:disable Drupal.Arrays.Array.CommaLastItem
use
Symfony\Component\Filesystem\Filesystem
;
require
__DIR__
.
'/vendor/autoload.php'
;
$project_name
=
isset
(
$argv
[
1
])
?
$argv
[
1
]
:
getenv
(
'CI_PROJECT_NAME'
);
$pathToModules
=
isset
(
$argv
[
2
])
?
$argv
[
2
]
:
'modules/custom'
;
if
(
empty
(
$project_name
))
{
throw
new
RuntimeException
(
'Unable to determine project name.'
);
}
$fs
=
new
Filesystem
();
// Directory where the root project is being created.
$projectRoot
=
getcwd
();
// Directory where the contrib module symlinks are to be created.
$webRoot
=
getenv
(
'_WEB_ROOT'
)
?:
'web'
;
$moduleRoot
=
$projectRoot
.
'/'
.
$webRoot
.
'/'
.
$pathToModules
.
'/'
.
$project_name
;
// Prepare directory for current module.
if
(
$fs
->
exists
(
$moduleRoot
))
{
$fs
->
remove
(
$moduleRoot
);
}
$fs
->
mkdir
(
$moduleRoot
);
echo
"CREATING COPIES OF FILES FROM
$projectRoot
to
$moduleRoot
\n
"
;
foreach
(
scandir
(
$projectRoot
)
as
$item
)
{
if
(
!
in_array
(
$item
,
[
'.'
,
'..'
,
'.git'
,
'.idea'
,
'drush'
,
'vendor'
,
$webRoot
,
'symlink_project.php'
,
'custom_symlink_project.php'
,
'expand_composer_json.php'
,
'composer.json.backup'
,
// PINTO:
'build.env'
,
]))
{
$source
=
sprintf
(
'%s/%s'
,
$projectRoot
,
$item
);
$target
=
sprintf
(
'%s/%s'
,
$moduleRoot
,
$item
);
\is_file
(
$source
)
?
$fs
->
copy
(
$source
,
$target
)
:
$fs
->
mirror
(
$source
,
$target
);
}
}
Loading