Skip to content
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

Updated laravel to use lando/[email protected] #83

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Updated lando/php to v1.7.1.

## v1.9.0 - [December 9, 2024](https://github.com/lando/laravel/releases/tag/v1.9.0)

* Optimized for `midcore`
Expand Down
33 changes: 17 additions & 16 deletions builders/laravel-php.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
'use strict';

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

const loadScripts = options => {
const lando = _.get(options, '_app._lando');
// Move the script to the confDir and make executable.
if (fs.existsSync(path.join(landoPhpPath, 'scripts'))) {
const confDir = path.join(lando.config.userConfRoot, 'scripts');
const dest = lando.utils.moveConfig(path.join(landoPhpPath, 'scripts'), confDir);
lando.utils.makeExecutable(fs.readdirSync(dest), dest);
lando.log.debug('automoved scripts from %s to %s and set to mode 755',
path.join(landoPhpPath, 'scripts'), confDir);
}
};

// Builder
/**
* Laravel PHP builder class that extends Lando PHP builder.
* Uses the bundled version of @lando/php plugin instead of user's version.
*
* @module laravel-php
*/
module.exports = {
name: 'laravel-php',
parent: '_appserver',
/**
* Builder function that returns the LaravelPhp class
* @param {Object} parent - Parent builder class
* @return {Class} LaravelPhp class extending LandoPhp builder
*/
builder: parent => class LaravelPhp extends LandoPhp.builder(parent, LandoPhp.config) {
/**
* Create a new LaravelPhp instance
* @param {string} id - Service id
* @param {Object} options - Service options
* @param {Object} factory - App factory instance
*/
constructor(id, options = {}, factory) {
loadScripts(options);
options.nginxServiceType = 'laravel-nginx';
super(id, options, factory);
}
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@lando/memcached": "^1.3.3",
"@lando/mssql": "^1.4.3",
"@lando/mysql": "^1.4.4",
"@lando/php": "^1.6.3",
"@lando/php": "^1.7.1",
"@lando/postgres": "^1.4.4",
"@lando/redis": "^1.2.3",
"lodash": "^4.17.21"
Expand Down
Loading