Commit 3e08e08c authored by 汪波's avatar 汪波
parents c6ee5df2 f8d8e993
......@@ -19,7 +19,6 @@ Thumbs.db
/vendor
# composer itself is not needed
composer.phar
# Mac DS_Store Files
.DS_Store
......
......@@ -17,8 +17,6 @@ Thumbs.db
# composer vendor dir
/vendor
# composer itself is not needed
composer.phar
# Mac DS_Store Files
.DS_Store
......
version=1.0.0
commit="none"
name=${phing.project.name}
author.name="xiabin"
author.email="xiabin@pp.cc"
author.username="xiabin"
pear.channel="pear.marcelog.name"
dir.output=${project.basedir}/build
dir.fe_output=${project.basedir}/static/assets
dir.tmp=${dir.output}/tmp
dir.front_end=${project.basedir}/static
node=/home/ops/dev/node/bin/node
webpack = ${node} /home/ops/dev/node/bin/webpack
npm=/home/ops/dev/node/bin/npm
ftp.host=192.168.1.35
ftp.port=40021
ftp.username=pp_pro
ftp.password=8XFX`kAox4j_or1&m=$q0d87bx
ftp.dir=./
php.bin=/usr/local/webserver/php55/bin/php
defaultpear.bin=/home/ops/dev/pear/bin/pear
<project name="zuiketang" default="all" basedir="./src">
<echo message="platform ${platform}"/>
<if>
<equals arg1="${platform}" arg2="win"/>
<then>
<property file="${project.basedir}/build_win.properties"/>
</then>
<else>
<property file="./build.properties"/>
</else>
</if>
<!--创建构建输出目录-->
<target name="prepare" depends="clean">
<mkdir dir="${dir.output}"/>
</target>
<!--清空构建输出目录-->
<target name="clean">
<delete dir="${dir.output}"/>
</target>
<!-- 初始化框架 -->
<target name="init" depends="prepare">
<echo message="copy to build start"/>
<copy todir="${dir.output}">
<filelist dir="." files="yii"/>
<filelist dir="." files="composer.json"/>
<filelist dir="." files="composer.lock"/>
<filelist dir="." files=".bowerrc"/>
<filelist dir="." files="init"/>
</copy>
<!--copy backend -->
<copy todir="${dir.output}/backend">
<fileset dir="./backend">
<include name="**/**"/>
<exclude name="runtime/**"/>
</fileset>
</copy>
<mkdir dir="${dir.output}/backend/runtime"/>
<!--copy common -->
<copy todir="${dir.output}/common">
<fileset dir="./common">
<include name="**/**"/>
</fileset>
</copy>
<!--copy console -->
<copy todir="${dir.output}/console">
<fileset dir="./console">
<include name="**/**"/>
<exclude name="/runtime"/>
</fileset>
</copy>
<!--copy environments -->
<copy todir="${dir.output}/environments">
<fileset dir="./environments">
<include name="**/**"/>
</fileset>
</copy>
<!--copy frontend -->
<copy todir="${dir.output}/frontend">
<fileset dir="./frontend">
<include name="**/**"/>
<exclude name="runtime/**"/>
<exclude name="web/assets/**"/>
<exclude name="web/node_modules/**"/>
</fileset>
</copy>
<mkdir dir="${dir.output}/frontend/runtime"/>
<!--copy bin -->
<copy todir="${dir.output}/bin">
<fileset dir="./bin">
<include name="**/**"/>
</fileset>
</copy>
<echo message="copy to build end"/>
</target>
<!-- install composer npm -->
<target name="install">
<echo message="install composer start"/>
<exec command="${php.bin} ${project.basedir}/bin/composer.phar install --optimize-autoloader --no-dev --prefer-dist"
passthru="true"
dir="${dir.output}"/>
<exec command="${php.bin} ${project.basedir}/bin/composer.phar dump-autoload --optimize" passthru="true"
dir="${dir.output}"/>
<echo message="install composer end"/>
<echo message="build frontend resourse start"/>
<exec command=" ${npm} install" dir="${dir.output}/frontend/web" passthru="true"/>
<exec command=" ${npm} run pro" dir="${dir.output}/frontend/web" passthru="true"/>
<echo message="build frontend resourse end"/>
<echo message="yii2 init start"/>
<exec command="${php.bin} ${dir.output}/init --env=Production --overwrite=y" passthru="true"/>
<echo message="yii2 init end"/>
<echo message="delete other start"/>
<delete dir="${dir.output}/bin" />
<delete dir="${dir.output}/environments" />
<delete dir="${dir.output}/tests" />
<delete dir="${dir.output}/frontend/web/js" />
<delete dir="${dir.output}/frontend/web/css" />
<delete dir="${dir.output}/frontend/web/fonts" />
<delete dir="${dir.output}/frontend/web/img" />
<delete dir="${dir.output}/frontend/web/node_modules" />
<delete file="${dir.output}/frontend/web/package.json" />
<delete file="${dir.output}/frontend/web/webpack.config.js" />
<delete file="${dir.output}/composer.json" />
<delete file="${dir.output}/composer.lock" />
<echo message="delete other end"/>
</target>
<target name="delete">
</target>
<target name="all" depends="init,install"/>
</project>
version=1.0.0
commit="none"
name=${phing.project.name}
author.name="xiabin"
author.email="xiabin@pp.cc"
author.username="xiabin"
pear.channel="pear.marcelog.name"
dir.output=${project.basedir}/build
dir.fe_output=${project.basedir}/static/assets
dir.front_end=${project.basedir}/static
node=node
webpack=webpack
npm=cnpm
ftp.host=114.112.81.8
ftp.port=40021
ftp.username=pp_pro
ftp.password=8XFX`kAox4j_or1&m=$q0d87bx
ftp.dir=
php.bin=php
defaultpear.bin=pear
......@@ -34,9 +34,6 @@
"bower-asset-library": "vendor/bower"
}
},
"scripts": {
"post-install-cmd": "php init --env=Development --overwrite=n"
},
"repositories": {
"packagist": {
"type": "composer",
......
......@@ -4,14 +4,14 @@ return [
'cache' => [
'class' => 'yii\redis\Cache',
'redis' => [
'hostname' => '192.168.1.12',
'hostname' => '192.168.1.21',
'port' => 6380,
'database' => 2,
]
],
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=192.168.1.7;port:3305;dbname=pp_c',
'dsn' => 'mysql:host=192.168.1.7;port=3305;dbname=pp_c',
'username' => 'pp_c',
'password' => 'nF@V5LK#ilb!NEvZ@1Ze#rWm#H',
'charset' => 'utf8',
......@@ -33,20 +33,20 @@ return [
'qiniu' => [
'class' => 'common\components\Qiniu',
'accessKey' => 'n85SCPB9uO2v32az-3TRFsZCXwJu7YddyzLRYXg-',
'secretKey' => 'KDl3b7aLpj7n9YZ07lHGivVY4c_Q-0QSM0TZ_-XS',
'accessKey' => 'Tm34_10r5kYLrUProU3Rx82HXCOnYuF8MhirB_YR',
'secretKey' => 'NwLeT4eF_C2UStiHzNAQmzqnIq_ru-BdHFK43Isn',
'storages' => [
'public' => [
'bucket' => 'pp-classroom',
'bucket' => 'yunya-public',
'fsizeLimit' => pow(1024, 2) * 5, //5MB
'mimeLimit' => 'image/jpeg;image/png;image/gif',
'url' => 'http://dev.qdn.pp.cc/'
'url' => 'http://of805nn40.bkt.clouddn.com/'
],
'video' => [
'bucket' => 'pp-classroom-private',
'bucket' => 'yunya-video',
'fsizeLimit' => pow(1024, 3) * 2, //2GB
'mimeLimit' => 'video/*;flv-application/octet-stream',
'url' => 'http://oe9d6dr84.bkt.clouddn.com/'
'url' => 'http://of80drz7s.bkt.clouddn.com/'
]
]
]
......
......@@ -98,7 +98,9 @@ var config = {
if (process.env.NODE_ENV === 'production') {
config.plugins = config.plugins.concat([
new webpack.DefinePlugin({
__BASE_URL__: JSON.stringify('http://dev.zuiketang.com/'),
__BASE_URL__: JSON.stringify('http://c.pp.cc/'),
__CDN_URL__: JSON.stringify('http://c.pp.cc/'),
__QINIU_URL__: JSON.stringify('http://dev.qdn.pp.cc/'),
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
......@@ -110,11 +112,9 @@ if (process.env.NODE_ENV === 'production') {
} else if (process.env.NODE_ENV === 'testing') {
config.plugins = config.plugins.concat([
new webpack.DefinePlugin({
__LOGIN_LIB_URL__: JSON.stringify("http://testlogin.pp.cc/static/js/lc-login.js"),
__BASE_URL__: JSON.stringify('http://testpro.pp.cc'),
__PP_URL__: JSON.stringify('http://testt.pp.cc'),
__CDN_URL__: JSON.stringify('http://testpro.pp.cc')
__BASE_URL__: JSON.stringify('http://dev.zuiketang.com/'),
__CDN_URL__: JSON.stringify('http://dev.zuiketang.com/'),
__QINIU_URL__: JSON.stringify('http://dev.qdn.pp.cc/'),
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
......@@ -122,7 +122,8 @@ if (process.env.NODE_ENV === 'production') {
}
}),
new webpack.optimize.OccurenceOrderPlugin()
]);
])
;
} else {
config.plugins = config.plugins.concat([
new webpack.DefinePlugin({
......
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 2016/10/13
* Time: 上午10:38
*/
var_dump(function_exists('fnmatch'));
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment