Commit dd055423 authored by 夏彬's avatar 夏彬

添加自动化构建相关的

parent 4f0f7fc1
<project name="zuiketang" default="all" basedir="./"> <project name="s_ibanshou" default="all" basedir="./">
<echo message="platform ${platform}"/> <echo message="platform ${platform}"/>
<if>
<isset property="env"/>
<then>
<echo message="env ${env}"/>
</then>
<else>
<fail message="env not set!"/>
</else>
</if>
<if> <if>
<equals arg1="${platform}" arg2="win"/> <equals arg1="${platform}" arg2="win"/>
<then> <then>
...@@ -23,22 +31,30 @@ ...@@ -23,22 +31,30 @@
<!-- 初始化框架 --> <!-- 初始化框架 -->
<target name="init" depends="prepare"> <target name="init" depends="prepare">
<echo message="copy to build start"/> <echo message="copy to build start"/>
<!--copy common --> <!--copy common -->
<copy todir="${dir.output}/"> <copy todir="${dir.output}/">
<fileset dir="./"> <fileset dir="./">
<patternset> <patternset>
<exclude name="e/config/"/> <include name="e/**"/>
<exclude name="e/back_conf/"/> <include name="skin/**" />
<exclude name="index.html"/> <include name="environments/**" />
<include name="**/**"/>
</patternset> </patternset>
</fileset> </fileset>
<filelist dir="." files="init,build.xml,build.properties,build_win.properties"/>
</copy> </copy>
<delete file="${dir.output}/build.xml" />
<delete file="${dir.output}/build.properties" />
<delete file="${dir.output}/build_win.properties" /> <echo message="init start"/>
<exec command="${php.bin} ${dir.output}/init --env=${env} --overwrite=y" passthru="true"/>
<echo message="init end"/>
<delete file="${dir.output}/init"/>
<delete dir="${dir.output}/environments"/>
<delete file="${dir.output}/build.xml"/>
<delete file="${dir.output}/build_win.properties"/>
<delete file="${dir.output}/build.properties"/>
<echo message="copy to build end"/> <echo message="copy to build end"/>
......
...@@ -12,11 +12,6 @@ node=node ...@@ -12,11 +12,6 @@ node=node
webpack=webpack webpack=webpack
npm=cnpm npm=cnpm
cnpm=cnpm cnpm=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 php.bin=php
defaultpear.bin=pear defaultpear.bin=pear
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
*/ */
require_once '../../../vendor/autoload.php'; require_once '../../../vendor/autoload.php';
require_once '../../config/config_ibanshou.php';
$actualLink = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $actualLink = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$url = !empty($_GET['url']) ? $_GET['url'] : $actualLink; $url = !empty($_GET['url']) ? $_GET['url'] : $actualLink;
...@@ -15,54 +15,7 @@ $debug = !empty($_GET['debug']) ? TRUE : FALSE; ...@@ -15,54 +15,7 @@ $debug = !empty($_GET['debug']) ? TRUE : FALSE;
$callback = !empty($_GET['callback']) ? $_GET['callback'] : 'callback'; $callback = !empty($_GET['callback']) ? $_GET['callback'] : 'callback';
$options = [ $options = $config['wechat'];
/**
* Debug 模式,bool 值:true/false
*
* 当值为 false 时,所有的日志都不会记录
*/
'debug' => TRUE,
/**
* 账号基本信息,请从微信公众平台/开放平台获取
*/
'app_id' => 'wx1863a43cb12dea4f', // xiabin dev
'secret' => 'b708adbaecdecb89fdf73051197edcf2', // AppSecret
'token' => 'your-token', // Token
'aes_key' => '', // EncodingAESKey,安全模式下请一定要填写!!!
/**
* 日志配置
*
* level: 日志级别, 可选为:
* debug/info/notice/warning/error/critical/alert/emergency
* permission:日志文件权限(可选),默认为null(若为null值,monolog会取0644)
* file:日志文件位置(绝对路径!!!),要求可写权限
*/
'log' => [
'level' => 'debug',
'permission' => 0777,
'file' => '/tmp/easywechat.log',
],
/**
* OAuth 配置
*
* scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
* callback:OAuth授权完成后的回调页地址
*/
'oauth' => [
'scopes' => ['snsapi_base'],
'callback' => '',
],
/**
* Guzzle 全局设置
*
* 更多请参考: http://docs.guzzlephp.org/en/latest/request-options.html
*/
'guzzle' => [
'timeout' => 8.0, // 超时时间(秒)
'verify' => FALSE, // 关掉 SSL 认证(强烈不建议!!!)
],
];
$app = new \EasyWeChat\Foundation\Application($options); $app = new \EasyWeChat\Foundation\Application($options);
$js = $app->js; $js = $app->js;
$js->setUrl($url); $js->setUrl($url);
...@@ -103,5 +56,5 @@ $jsApi = [ ...@@ -103,5 +56,5 @@ $jsApi = [
'chooseCard', 'chooseCard',
'openCard' 'openCard'
]; ];
$config = $js->config($jsApi); $jsconfig = $js->config($jsApi);
echo $callback . '(' . $config . ')'; echo $callback . '(' . $jsconfig . ')';
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
$config = [ $config = [
//是否使用用户中心 //是否使用用户中心
'isUseUcenter' => true, 'isUseUcenter' => TRUE,
//sso api config //sso api config
'sso.apiurl' => 'http://u.yunya.com/api/', 'sso.apiurl' => 'http://u.yunya.com/api/',
...@@ -15,7 +15,7 @@ $config = [ ...@@ -15,7 +15,7 @@ $config = [
'context' => '/cas', 'context' => '/cas',
'port' => 443, 'port' => 443,
'server_ca_cert_path' => '', 'server_ca_cert_path' => '',
'debug' => true, 'debug' => TRUE,
'server_ip' => ['54.222.158.174'], 'server_ip' => ['54.222.158.174'],
'logs' => 'e/data/phpcas.log', 'logs' => 'e/data/phpcas.log',
'uc_base_url' => 'http://u.yunya.com/', 'uc_base_url' => 'http://u.yunya.com/',
...@@ -55,4 +55,52 @@ $config = [ ...@@ -55,4 +55,52 @@ $config = [
], ],
], ],
], ],
'wechat' => [
/**
* Debug 模式,bool 值:true/false
*
* 当值为 false 时,所有的日志都不会记录
*/
'debug' => TRUE,
/**
* 账号基本信息,请从微信公众平台/开放平台获取
*/
'app_id' => 'wx1863a43cb12dea4f', // xiabin dev
'secret' => 'b708adbaecdecb89fdf73051197edcf2', // AppSecret
'token' => 'your-token', // Token
'aes_key' => '', // EncodingAESKey,安全模式下请一定要填写!!!
/**
* 日志配置
*
* level: 日志级别, 可选为:
* debug/info/notice/warning/error/critical/alert/emergency
* permission:日志文件权限(可选),默认为null(若为null值,monolog会取0644)
* file:日志文件位置(绝对路径!!!),要求可写权限
*/
'log' => [
'level' => 'debug',
'permission' => 0777,
'file' => '/tmp/easywechat.log',
],
/**
* OAuth 配置
*
* scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
* callback:OAuth授权完成后的回调页地址
*/
'oauth' => [
'scopes' => ['snsapi_base'],
'callback' => '',
],
/**
* Guzzle 全局设置
*
* 更多请参考: http://docs.guzzlephp.org/en/latest/request-options.html
*/
'guzzle' => [
'timeout' => 8.0, // 超时时间(秒)
'verify' => FALSE, // 关掉 SSL 认证(强烈不建议!!!)
],
]
]; ];
\ No newline at end of file
This diff is collapsed.
<?php
$config = [
//是否使用用户中心
'isUseUcenter' => TRUE,
//sso api config
'sso.apiurl' => 'http://u.yunya.com/api/',
'sso.appid' => '10001',
'sso.appkey' => 'oY4@1f0#Io1u!Cd4@NJ#9YJFj1s@EGfDI@VA#vvRbqO',
//cas configs
'cas.configs' => [
'host' => 'sso.weixiuhui.cn',
'context' => '/cas',
'port' => 443,
'server_ca_cert_path' => '',
'debug' => TRUE,
'server_ip' => ['54.222.158.174'],
'logs' => 'e/data/phpcas.log',
'uc_base_url' => 'http://u.yunya.com/',
],
//产品
'wxhpro' => [
'ucenter' => 'http://u.yunya.com',
'xue' => 'http://xue.yunya.com',
's' => 'http://s.yunya.com',
'bbs' => 'http://bbs.yunya.com',
],
//wxh_internal_api
'wxh.internal' => [
'server_secret' => 'TveYDczsq7LTllIUlM5t',
'client' => [
'ucenter' => [
'apiUrl' => 'http://u.yunya.com/api/server',
'clientId' => 'common',
'clientSecret' => 'Kuy2dVHKRWKAFRXX2l6k'
],
'xue' => [
'apiUrl' => 'http://xue.yunya.com/api',
'clientId' => 'common',
'clientSecret' => 'Z2oKgZYYc8mznesYMf1o'
],
'code' => [
'apiUrl' => 'http://dev.wxherr.com/site/api-server',
'clientId' => 'common',
'clientSecret' => '1BO1WQwnpjc2GfjzrOuq'
],
'bbs' => [
'apiUrl' => 'http://bbs.yunya.com/api/server.php',
'clientId' => 'common',
'clientSecret' => 'U2FsdGVkX19ZiutUoO6F'
],
],
],
'wechat' => [
/**
* Debug 模式,bool 值:true/false
*
* 当值为 false 时,所有的日志都不会记录
*/
'debug' => TRUE,
/**
* 账号基本信息,请从微信公众平台/开放平台获取
*/
'app_id' => 'wx1863a43cb12dea4f', // xiabin dev
'secret' => 'b708adbaecdecb89fdf73051197edcf2', // AppSecret
'token' => 'your-token', // Token
'aes_key' => '', // EncodingAESKey,安全模式下请一定要填写!!!
/**
* 日志配置
*
* level: 日志级别, 可选为:
* debug/info/notice/warning/error/critical/alert/emergency
* permission:日志文件权限(可选),默认为null(若为null值,monolog会取0644)
* file:日志文件位置(绝对路径!!!),要求可写权限
*/
'log' => [
'level' => 'debug',
'permission' => 0777,
'file' => '/tmp/easywechat.log',
],
/**
* OAuth 配置
*
* scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
* callback:OAuth授权完成后的回调页地址
*/
'oauth' => [
'scopes' => ['snsapi_base'],
'callback' => '',
],
/**
* Guzzle 全局设置
*
* 更多请参考: http://docs.guzzlephp.org/en/latest/request-options.html
*/
'guzzle' => [
'timeout' => 8.0, // 超时时间(秒)
'verify' => FALSE, // 关掉 SSL 认证(强烈不建议!!!)
],
]
];
\ No newline at end of file
<?php
/**
* The manifest of files that are local to specific environment.
* This file returns a list of environments that the application
* may be installed under. The returned data must be in the following
* format:
*
* ```php
* return [
* 'environment name' => [
* 'path' => 'directory storing the local files',
* 'skipFiles' => [
* // list of files that should only copied once and skipped if they already exist
* ],
* 'setWritable' => [
* // list of directories that should be set writable
* ],
* 'setExecutable' => [
* // list of files that should be set executable
* ],
* 'setCookieValidationKey' => [
* // list of config files that need to be inserted with automatically generated cookie validation keys
* ],
* 'createSymlink' => [
* // list of symlinks to be created. Keys are symlinks, and values are the targets.
* ],
* ],
* ];
* ```
*/
return [
'Development' => [
'path' => 'dev',
],
'Prod' => [
'path' => 'prod',
],
'Test' => [
'path' => 'test',
]
];
This diff is collapsed.
<?php
$config = [
//是否使用用户中心
'isUseUcenter' => true,
//sso api config
'sso.apiurl' => 'http://u.ibanshou.cn/api/',
'sso.appid' => '10001',
'sso.appkey' => 'oY4@1f0#Io1u!Cd4@NJ#9YJFj1s@EGfDI@VA#vvRbqO',
//cas configs
'cas.configs' => [
'host' => 'sso.weixiuhui.cn',
'context' => '/cas',
'port' => 443,
'server_ca_cert_path' => '',
'debug' => FALSE,
'server_ip' => ['54.222.158.174', '172.31.12.30'],
'logs' => 'e/data/phpcas.log',
'uc_base_url' => 'http://u.ibanshou.cn/',
],
//产品
'wxhpro' => [
'ucenter' => 'http://u.ibanshou.cn',
'xue' => 'http://xue.ibanshou.cn',
's' => 'http://s.ibanshou.cn',
'bbs' => 'http://bbs.ibanshou.cn',
],
//wxh_internal_api
'wxh.internal' => [
'server_secret' => 'TveYDczsq7LTllIUlM5t',
'client' => [
'ucenter' => [
'apiUrl' => 'http://u.ibanshou.cn/api/server',
'clientId' => 'common',
'clientSecret' => 'HjEfzuGmoVbBPSDVg9ig'
],
'xue' => [
'apiUrl' => 'http://xue.ibanshou.cn/api',
'clientId' => 'common',
'clientSecret' => 'hv2yWxz2P0ALwMr7jXdO'
],
'code' => [
'apiUrl' => 'http://code.ibanshou.cn/site/api-server',
'clientId' => 'common',
'clientSecret' => '2LMbaS2Ac9a2cPPBlZwq'
],
'bbs' => [
'apiUrl' => 'http://bbs.ibanshou.cn/api/server.php',
'clientId' => 'common',
'clientSecret' => '1WQwnpjcURS0JwSkdiq3r'
],
]
],
'wechat' => [
/**
* Debug 模式,bool 值:true/false
*
* 当值为 false 时,所有的日志都不会记录
*/
'debug' => FALSE,
/**
* 账号基本信息,请从微信公众平台/开放平台获取
*/
'app_id' => 'wx36d4b32ad497a7f1', //weixin2@pp.cc
'secret' => '734c41eefc2c55729a51a958e16d2dc2', // AppSecret
'token' => 'your-token', // Token
'aes_key' => '', // EncodingAESKey,安全模式下请一定要填写!!!
/**
* 日志配置
*
* level: 日志级别, 可选为:
* debug/info/notice/warning/error/critical/alert/emergency
* permission:日志文件权限(可选),默认为null(若为null值,monolog会取0644)
* file:日志文件位置(绝对路径!!!),要求可写权限
*/
'log' => [
'level' => 'notice',
'permission' => 0777,
'file' => '/tmp/easywechat.log',
],
/**
* OAuth 配置
*
* scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
* callback:OAuth授权完成后的回调页地址
*/
'oauth' => [
'scopes' => ['snsapi_base'],
'callback' => '',
],
/**
* Guzzle 全局设置
*
* 更多请参考: http://docs.guzzlephp.org/en/latest/request-options.html
*/
'guzzle' => [
'timeout' => 8.0, // 超时时间(秒)
'verify' => FALSE, // 关掉 SSL 认证(强烈不建议!!!)
],
]
];
\ No newline at end of file
This diff is collapsed.
<?php
$config = [
//是否使用用户中心
'isUseUcenter' => true,
//sso api config
'sso.apiurl' => 'http://u.test.yunyamooc.com/api/',
'sso.appid' => '10001',
'sso.appkey' => 'oY4@1f0#Io1u!Cd4@NJ#9YJFj1s@EGfDI@VA#vvRbqO',
//cas configs
'cas.configs' => [
'host' => 'sso.weixiuhui.cn',
'context' => '/cas',
'port' => 443,
'server_ca_cert_path' => '',
'debug' => false,
'server_ip' => ['54.222.158.174'],
'logs' => 'e/data/phpcas.log',
'uc_base_url' => 'http://u.test.yunyamooc.com/',
],
//产品
'wxhpro' => [
'ucenter' => 'http://u.test.yunyamooc.com',
'xue' => 'http://xue.test.yunyamooc.com',
's' => 'http://s.test.yunyamooc.com',
'bbs' => 'http://bbs.test.yunyamooc.com',
],
//wxh_internal_api
'wxh.internal' => [
'server_secret' => 'TveYDczsq7LTllIUlM5t',
'client' => [
'ucenter' => [
'apiUrl' => 'http://u.test.yunyamooc.com/api/server',
'clientId' => 'common',
'clientSecret' => 'z1z7AZCWpbEkfWpak0dx'
],
'xue' => [
'apiUrl' => 'http://xue.test.yunyamooc.com/api',
'clientId' => 'common',
'clientSecret' => 'AwT3YKykIwkREb48C1w3'
],
'code' => [
'apiUrl' => 'http://testserv.pp.cc/wxherr/site/api-server',
'clientId' => 'common',
'clientSecret' => 'VBz7nU9qIeKUCjY89poG'
],
'bbs' => [
'apiUrl' => 'http://bbs.test.yunyamooc.com/api/server.php',
'clientId' => 'common',
'clientSecret' => 'AJmfi4ORZURS0JwSkdiq3r'
],
],
],
'wechat' => [
/**
* Debug 模式,bool 值:true/false
*
* 当值为 false 时,所有的日志都不会记录
*/
'debug' => false,
/**
* 账号基本信息,请从微信公众平台/开放平台获取
*/
'app_id' => 'wx81144f73d043d453', // 未迟 dev
'secret' => '5cf8cc7adcfce108d1ef3c9c1a831457', // AppSecret
'token' => 'your-token', // Token
'aes_key' => '', // EncodingAESKey,安全模式下请一定要填写!!!
/**
* 日志配置
*
* level: 日志级别, 可选为:
* debug/info/notice/warning/error/critical/alert/emergency
* permission:日志文件权限(可选),默认为null(若为null值,monolog会取0644)
* file:日志文件位置(绝对路径!!!),要求可写权限
*/
'log' => [
'level' => 'debug',
'permission' => 0777,
'file' => '/tmp/easywechat.log',
],
/**
* OAuth 配置
*
* scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
* callback:OAuth授权完成后的回调页地址
*/
'oauth' => [
'scopes' => ['snsapi_base'],
'callback' => '',
],
/**
* Guzzle 全局设置
*
* 更多请参考: http://docs.guzzlephp.org/en/latest/request-options.html
*/
'guzzle' => [
'timeout' => 8.0, // 超时时间(秒)
'verify' => FALSE, // 关掉 SSL 认证(强烈不建议!!!)
],
]
];
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
* Yii Application Initialization Tool
*
* In order to run in non-interactive mode:
*
* init --env=Development --overwrite=n
*
* @author Alexander Makarov <sam@rmcreative.ru>
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
if (!extension_loaded('openssl')) {
die('The OpenSSL PHP extension is required by Yii2.');
}
$params = getParams();
$root = str_replace('\\', '/', __DIR__);
$envs = require("$root/environments/index.php");
$envNames = array_keys($envs);
echo "Yii Application Initialization Tool v1.0\n\n";
$envName = null;
if (empty($params['env']) || $params['env'] === '1') {
echo "Which environment do you want the application to be initialized in?\n\n";
foreach ($envNames as $i => $name) {
echo " [$i] $name\n";
}
echo "\n Your choice [0-" . (count($envs) - 1) . ', or "q" to quit] ';
$answer = trim(fgets(STDIN));
if (!ctype_digit($answer) || !in_array($answer, range(0, count($envs) - 1))) {
echo "\n Quit initialization.\n";
exit(0);
}
if (isset($envNames[$answer])) {
$envName = $envNames[$answer];
}
} else {
$envName = $params['env'];
}
if (!in_array($envName, $envNames)) {
$envsList = implode(', ', $envNames);
echo "\n $envName is not a valid environment. Try one of the following: $envsList. \n";
exit(2);
}
$env = $envs[$envName];
if (empty($params['env'])) {
echo "\n Initialize the application under '{$envNames[$answer]}' environment? [yes|no] ";
$answer = trim(fgets(STDIN));
if (strncasecmp($answer, 'y', 1)) {
echo "\n Quit initialization.\n";
exit(0);
}
}
echo "\n Start initialization ...\n\n";
$files = getFileList("$root/environments/{$env['path']}");
if (isset($env['skipFiles'])) {
$skipFiles = $env['skipFiles'];
array_walk($skipFiles, function(&$value) use($env, $root) { $value = "$root/$value"; });
$files = array_diff($files, array_intersect_key($env['skipFiles'], array_filter($skipFiles, 'file_exists')));
}
$all = false;
foreach ($files as $file) {
if (!copyFile($root, "environments/{$env['path']}/$file", $file, $all, $params)) {
break;
}
}
$callbacks = ['setCookieValidationKey', 'setWritable', 'setExecutable', 'createSymlink'];
foreach ($callbacks as $callback) {
if (!empty($env[$callback])) {
$callback($root, $env[$callback]);
}
}
echo "\n ... initialization completed.\n\n";
function getFileList($root, $basePath = '')
{
$files = [];
$handle = opendir($root);
while (($path = readdir($handle)) !== false) {
if ($path === '.git' || $path === '.svn' || $path === '.' || $path === '..') {
continue;
}
$fullPath = "$root/$path";
$relativePath = $basePath === '' ? $path : "$basePath/$path";
if (is_dir($fullPath)) {
$files = array_merge($files, getFileList($fullPath, $relativePath));
} else {
$files[] = $relativePath;
}
}
closedir($handle);
return $files;
}
function copyFile($root, $source, $target, &$all, $params)
{
if (!is_file($root . '/' . $source)) {
echo " skip $target ($source not exist)\n";
return true;
}
if (is_file($root . '/' . $target)) {
if (file_get_contents($root . '/' . $source) === file_get_contents($root . '/' . $target)) {
echo " unchanged $target\n";
return true;
}
if ($all) {
echo " overwrite $target\n";
} else {
echo " exist $target\n";
echo " ...overwrite? [Yes|No|All|Quit] ";
$answer = !empty($params['overwrite']) ? $params['overwrite'] : trim(fgets(STDIN));
if (!strncasecmp($answer, 'q', 1)) {
return false;
} else {
if (!strncasecmp($answer, 'y', 1)) {
echo " overwrite $target\n";
} else {
if (!strncasecmp($answer, 'a', 1)) {
echo " overwrite $target\n";
$all = true;
} else {
echo " skip $target\n";
return true;
}
}
}
}
file_put_contents($root . '/' . $target, file_get_contents($root . '/' . $source));
return true;
}
echo " generate $target\n";
@mkdir(dirname($root . '/' . $target), 0777, true);
file_put_contents($root . '/' . $target, file_get_contents($root . '/' . $source));
return true;
}
function getParams()
{
$rawParams = [];
if (isset($_SERVER['argv'])) {
$rawParams = $_SERVER['argv'];
array_shift($rawParams);
}
$params = [];
foreach ($rawParams as $param) {
if (preg_match('/^--(\w+)(=(.*))?$/', $param, $matches)) {
$name = $matches[1];
$params[$name] = isset($matches[3]) ? $matches[3] : true;
} else {
$params[] = $param;
}
}
return $params;
}
function setWritable($root, $paths)
{
foreach ($paths as $writable) {
if (is_dir("$root/$writable")) {
echo " chmod 0777 $writable\n";
@chmod("$root/$writable", 0777);
} else {
echo "\n Error. Directory $writable does not exist. \n";
}
}
}
function setExecutable($root, $paths)
{
foreach ($paths as $executable) {
echo " chmod 0755 $executable\n";
@chmod("$root/$executable", 0755);
}
}
function setCookieValidationKey($root, $paths)
{
foreach ($paths as $file) {
echo " generate cookie validation key in $file\n";
$file = $root . '/' . $file;
$length = 32;
$bytes = openssl_random_pseudo_bytes($length);
$key = strtr(substr(base64_encode($bytes), 0, $length), '+/=', '_-.');
$content = preg_replace('/(("|\')cookieValidationKey("|\')\s*=>\s*)(""|\'\')/', "\\1'$key'", file_get_contents($file));
file_put_contents($file, $content);
}
}
function createSymlink($root, $links) {
foreach ($links as $link => $target) {
echo " symlink " . $root . "/" . $target . " " . $root . "/" . $link . "\n";
//first removing folders to avoid errors if the folder already exists
@rmdir($root . "/" . $link);
//next removing existing symlink in order to update the target
if (is_link($root . "/" . $link)) {
@unlink($root . "/" . $link);
}
@symlink($root . "/" . $target, $root . "/" . $link);
}
}
@echo off
rem -------------------------------------------------------------
rem Yii command line init script for Windows.
rem
rem @author Qiang Xue <qiang.xue@gmail.com>
rem @link http://www.yiiframework.com/
rem @copyright Copyright (c) 2008 Yii Software LLC
rem @license http://www.yiiframework.com/license/
rem -------------------------------------------------------------
@setlocal
set YII_PATH=%~dp0
if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe
"%PHP_COMMAND%" "%YII_PATH%init" %*
@endlocal
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