定制 microstudi/silex-grunt-skeleton 二次开发

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

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

microstudi/silex-grunt-skeleton

Composer 安装命令:

composer create-project microstudi/silex-grunt-skeleton

包简介

A pre-configured skeleton for the Silex microframework with Grunt tasks added

README 文档

README

Just another Silex-Framework Skeleton

This is a port from the https://github.com/silexphp/Silex-Skeleton with this features added:

  • Built-in PHP server (minimum version required 5.4)
  • Livereloading for any css, js, or php file changes
  • Demo class with view, phpunit test and route
  • Grunt for automating tasks
  • Bower to install javascript packages (currently jQuery, Modernizr)

Installation

composer create-project microstudi/silex-grunt-skeleton new_app_path

GRUNT, BOWER & COMPOSER

This tools are required to use this project:

  • Grunt is a Javascript task runner that helps to execute repetitive tasks such as:

    • Javascript minification
    • CSS minification
    • Image optimizations
    • Package installers
    • Code checks and tests
    • ... so on ...
  • Bower is a dependency manager for common Javascript libraries

  • Composer is a dependency manager for common PHP libraries

Installing grunt and bower

Grunt is a scripting task tool installable through npm, the Node.js.

If you want to install nodejs, grunt and bower on Ubuntu 12.04 or 14.04 for the very first time just do:

sudo apt-get install build-essential libssl-dev git
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo npm install -g grunt-cli
sudo npm install -g bower

Additionally, you may remove the configuration npm user directory to avoid unexpected permissions problems when using npm as non root user afterwards:

sudo rm ~/.npm -rf 

To install Composer on Ubuntu or any other *nix execute this commands:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

For other OS, please refer to the official install guides:

Install Grunt: http://gruntjs.com/getting-started Install Bower: http://bower.io/#install-bower Install Composer: https://getcomposer.org/doc/00-intro.md

Using grunt

Once you have your copy of Grunt installed you need to install the tasks runners used. To do so you may just execute in the path where you have your copy of the Silex-Skeleton code:

npm install

Using bower

Once you have your copy of Bower installed you need to download/update the needed Javascript libraries. To do so you may just execute in the path where you have your copy of the Silex-Skeleton code:

bower install

Using composer

Once you have your copy of Composer installed you need to download/update the needed PHP libraries. To do so you may just execute in the path where you have your copy of the Silex-Skeleton code:

composer install

After that you're ready to execute any of the task available in the same directory:

grunt jshint
grunt phplint
...

Grunt commands

  • Default task: grunt This task is the same as execute as doing: grunt lint It performs static code analysis in order to quick detect mistakes or misspellings

  • Code linter: grunt lint Same as default task

  • Wiredep grunt wiredep This task is to add into the specified layouts the bower components Should be executed manually every time a bower library is installed

  • build grunt build Builds the project into the dist folder. Production web server should point to the "dist/web" folder

  • serve grunt serve Starts an instance of the PHP builtin server with livereload pointing to the development folder "web"

  • serve:dist grunt serve:dist Builds the project and starts an instance of the PHP builtin server with livereload pointing to the production folder "web"

  • precommit grunt precommit This task could be usefull if you want to add it to the pre-commit git hook. Executes the lint tasks for a a modified files only so you'll prevent from commiting broken files:

    Content of .git/hooks/pre-commit:

    #!/bin/sh
    grunt precommit
    

    Remember to make it executable:

    $ chmod +x .git/hooks/pre-commit

TODO:

  • adding optional yml config for assets path (cdn, jquery cdn or cdnfy), google analytics, etc
  • add phpunit to grunt
  • add translations
  • doctrine

microstudi/silex-grunt-skeleton 适用场景与选型建议

microstudi/silex-grunt-skeleton 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 62 次下载、GitHub Stars 达 2, 最近一次更新时间为 2014 年 11 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 microstudi/silex-grunt-skeleton 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 192
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-05