问题是,我想将任务跑步者和凉亭的所有好处用于我现有的Zend-Project。我不确定,我应该如何重组整个项目文件夹。 我目前的结构如下:
config module vendor public css js libs jquery bootstrap controller1 jsController1. etc index.php
从此(Gulp and Bower - creating proper files structure)我知道,我必须创建一个单独的文件夹来保存从bower安装的所有库,然后我必须将它们与gulp一起复制到公共文件夹中。现在取决于环境(生产或开发),我想使用缩小的css和js脚本。那么我应该创建2个公共文件夹并根据环境改变zend的基本路径?或者最好的方法是什么?
此外,我想将浏览器同步集成到此项目中(导致livereload)。因此我想使用gulp-connect启动php-server。但是后来apache的环境变量没有设置。我怎么设置它?根据{{3}}我必须添加newArgs(因为我的选项是数组)“APPLICATION_ENV = development”。但是如果在逗号之后添加它,我会收到错误:“无法打开输入文件:APPLICATION_ENV = development”
我当前的琐事:
var gulp = require('gulp'),
php = require('gulp-connect-php');
gulp.task('php', function() {
php.server({
configCallback: function _configCallback(type, collection) {
// If you wish to leave one of the argument types alone, simply return the passed in collection.
if (type === php.OPTIONS_SPAWN_OBJ) { // As the constant suggests, collection is an Object.
// Lets add a custom env var. Good for injecting AWS_RDS config variables.
collection.env = Object.assign({
APPLICATION_ENV: "development"
}, process.env);
return collection;
} else if (type === php.OPTIONS_PHP_CLI_ARR) { // As the constant suggests, collection is an Array.
let newArgs = [
'-e', // Generate extended information for debugger/profiler.
'-d', 'memory_limit=2G' // Define INI entry, Up memory limit to 2G.
,"APPLICATION_ENV=development"
];
// Ensure our argument switches appear before the rest.
return newArgs.concat(collection);
}
}
,
base: 'public',
port: 8010,
keepalive: true},
function _connected_callback() {
console.log("PHP Development Server Connected.");
});
} );