Skip to content

Commit e61bed8

Browse files
committed
Remove moveConfig from php builders.
1 parent a48a6db commit e61bed8

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

builders/laravel-php.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
'use strict';
22

3-
const _ = require('lodash');
4-
const fs = require('fs');
53
const path = require('path');
64
const landoPhpPath = path.join(__dirname, '../node_modules/@lando/php');
75
const LandoPhp = require(`${landoPhpPath}/builders/php.js`);
86

9-
const loadScripts = options => {
10-
const lando = _.get(options, '_app._lando');
11-
// Move the script to the confDir and make executable.
12-
if (fs.existsSync(path.join(landoPhpPath, 'scripts'))) {
13-
const confDir = path.join(lando.config.userConfRoot, 'scripts');
14-
const dest = lando.utils.moveConfig(path.join(landoPhpPath, 'scripts'), confDir);
15-
lando.utils.makeExecutable(fs.readdirSync(dest), dest);
16-
lando.log.debug('automoved scripts from %s to %s and set to mode 755',
17-
path.join(landoPhpPath, 'scripts'), confDir);
18-
}
19-
};
20-
21-
// Builder
7+
/**
8+
* Laravel PHP builder class that extends Lando PHP builder.
9+
* Uses the bundled version of @lando/php plugin instead of user's version.
10+
*
11+
* @module laravel-php
12+
*/
2213
module.exports = {
2314
name: 'laravel-php',
2415
parent: '_appserver',
16+
/**
17+
* Builder function that returns the LaravelPhp class
18+
* @param {Object} parent - Parent builder class
19+
* @return {Class} LaravelPhp class extending LandoPhp builder
20+
*/
2521
builder: parent => class LaravelPhp extends LandoPhp.builder(parent, LandoPhp.config) {
22+
/**
23+
* Create a new LaravelPhp instance
24+
* @param {string} id - Service id
25+
* @param {Object} options - Service options
26+
* @param {Object} factory - App factory instance
27+
*/
2628
constructor(id, options = {}, factory) {
27-
loadScripts(options);
2829
options.nginxServiceType = 'laravel-nginx';
2930
super(id, options, factory);
3031
}

0 commit comments

Comments
 (0)