Commit 6f599cbf authored by wwccw0591's avatar wwccw0591

pc

parent ad1f6598
<?php <?php
echo 3333333; header("Content-type: text/html; charset=utf-8");
//利用PHP目录和文件函数遍历用户给出目录的所有的文件和文件夹,修改文件名称
function fRename($dirname)
{
if (!is_dir($dirname)) {
echo "{$dirname}不是一个有效的目录!";
exit();
}
$handle = opendir($dirname);
$i = 1;
while (($fn = readdir($handle)) !== false) {
if ($fn != '.' && $fn != '..') {
echo "<br>将名为:" . $fn . "\n\r";
$curDir = $dirname . '/' . $fn;
if (is_dir($curDir)) {
fRename($curDir);
} else {
$path = pathinfo($curDir);
if (empty($path['extension'])) {
//改成你自己想要的新名字
$newname = $path['dirname'] . '/' . $path['basename'] . '.jpg';
echo "替换成:" . $i . '.' . $newname . "\r\n";
rename($curDir, $newname);
$i++;
}
}
}
}
}
//给出一个目录名称可以是相对路径,也可以是绝对路径
fRename('/www/web/testadmin_shenbd_com/public_html/data/upload/mall/avatar_bak');
exit();
...@@ -247,10 +247,10 @@ class MessageServiceModel extends \Business\AbstractModel ...@@ -247,10 +247,10 @@ class MessageServiceModel extends \Business\AbstractModel
{ {
$messageHistory = \DAO\MessageHistoryModel::getInstance(); $messageHistory = \DAO\MessageHistoryModel::getInstance();
$self = $this->getUserByMemberIdAndSelfType($memberId, $selfType); $self = $this->getUserByMemberIdAndSelfType($memberId, $selfType);
$toMember = $this->getUserByMemberIdAndSelfType($toId, $toType);
if (empty($toId)) { if (empty($toId)) {
$toId =$this->getMemberIdByOtherIdAndType($otherId,$toType); $toId =$this->getMemberIdByOtherIdAndType($otherId,$toType);
} }
$toMember = $this->getUserByMemberIdAndSelfType($toId, $toType);
$returnMemeber['toId'] = (int)$toId; $returnMemeber['toId'] = (int)$toId;
$returnMemeber['toUserId'] = (int)$toMember['uid']; $returnMemeber['toUserId'] = (int)$toMember['uid'];
$returnMemeber['toUserName'] = $toMember['name']; $returnMemeber['toUserName'] = $toMember['name'];
......
...@@ -17,3 +17,6 @@ if(APP_ENV=='test' || APP_ENV=='pre' ||APP_ENV=='ccwdevelop' || APP_ENV=='produc ...@@ -17,3 +17,6 @@ if(APP_ENV=='test' || APP_ENV=='pre' ||APP_ENV=='ccwdevelop' || APP_ENV=='produc
} }
$app = new \Yaf\Application(APPLICATION_PATH . "/conf/application.ini", APP_ENV); $app = new \Yaf\Application(APPLICATION_PATH . "/conf/application.ini", APP_ENV);
$app->bootstrap()->run(); $app->bootstrap()->run();
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