定制 kernelfolla/homestead 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kernelfolla/homestead

Composer 安装命令:

composer require kernelfolla/homestead

包简介

Fork of laravel/homestead with some customizations.

README 文档

README

The official Laravel local development environment.

Official documentation is located here.

Introduction

(from the official documentation)

Laravel strives to make the entire PHP development experience delightful, including your local development environment. Vagrant provides a simple, elegant way to manage and provision Virtual Machines.

Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!

Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 7.0, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.

Why I did this fork

Using Laravel Homestead for my projects I had necessity to customize almost everything, I ended up touching up almost everything.

What I did in this fork

  • Removed init.sh and init.bat, the script just copy some files into ~/.homestead, i don’t like it
  • Renamed Homestead.yaml into homestead.yml, less error prone for me, removed also the Homestead.json, i think yaml format is enough and better for these things because it supports comments
  • Refactored all the code using two design patterns, a factory method(Homestead.create) that creates the Homestead object starting from settings or the settings filename and Homestead becomes a command, its execute method is still called configure but this time i’ve added two attributes to the object (settings and config), all parts of code that can be moved into a separate method are moved, so instead of a single method with ~250 lines i have ~400 lines of small methods. Also i’ve created custom getter/setter methods for settings in order to reduce the “||=” usage to set default values, the settings setter becomes a way to prevalidate all the settings
  • A new, smaller Vagrantfile, all the logic is moved into Homestead class, 8 lines of code into Vagrantfile, leaving Vagrant.configure inside Vagrantfile still allows more cutomizations directly there
  • At this point single methods can be overridden into a custom class but also I can specify directly what file and class will be called in the factory method, so i can override the standard homestead class adding 3 lines into homestead.yml
override:
    file: ‘./config/customHomestead.rb’
    class: ‘CustomHomestead’
  • Disabled default port forwarding, if i want port forwarding i can still uncomment them in my homestead.yml
  • Moved after.sh into homestead.yml with two new lists called before_scripts and after_scripts
  • Created/edited separate install/remove scripts to install and remove some more things, mainly install apache and remove unnecessary server, with the right settings it’s possible to switch between nginx and apache just changing homestead.yml and running vagrant provision
  • Reduced noise on apt commands and added some more success and error messages
  • Improved site vhost management, adding mode: symlink and value: /home/vagrant/…/vhost_dev.conf vhost is just added via a symlink
  • Laravel site type now is called standard, because it is the standard php way:)
  • Added support of vagrant-hostmanager, vagrant-hostsupdater is still supported
  • Added some enable_* options to be able mainly to disable everything: enable_bindfs enable_clear_webserver enable_forward_agent enable_hostmanager enable_update_composer
  • Added also support for digitalocean, provisioning but still having some problems with the vagrant user, too tired atm:)

Why I've not made a PR

I didn't because unfortunately at the moment many settings are no more backward compatible with the existing Laravel Homestead project.

Install

per project

composer require kernelfolla/homestead --dev php vendor/bin/homestead make vagrant up

globally

git clone https://github.com/kernelfolla/homestead.git cd homestead vagrant up

Changelog

1.0.1

  • minor fix
  • added new install options: yarn, prestissimo, mailhog

1.0.0

  • initial fork

kernelfolla/homestead 适用场景与选型建议

kernelfolla/homestead 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 411 次下载、GitHub Stars 达 2, 最近一次更新时间为 2016 年 09 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 kernelfolla/homestead 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kernelfolla/homestead 我们能提供哪些服务?
定制开发 / 二次开发

基于 kernelfolla/homestead 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 411
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1398
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-02