本地的数据库中本来有一个mesg表,后来在这个表后面增加了一个字段maid。
在某个操作中使用
$mesg = D('Mesg');
dump($mesg);
模型里有:
protected $_map = array(
'user'=>'muser',
'content'=>'mcontent',
'time'=>'mtime',
'aid'=>'maid',
);
结果中有这个:
["fields:protected"] => array(8) {
[0] => string(3) "mid"
[1] => string(4) "muid"
[2] => string(5) "muser"
[3] => string(8) "mcontent"
[4] => string(5) "mtime"
[5] => string(4) "maid"//这个
["_autoinc"] => bool(true)
["_pk"] => string(3) "mid"
}
在本地里面是有maid字段的。
但是上传到sinaapp上面的时候,还是同样的操作,结果却是:
["fields":protected] => array(7) {
[0] => string(3) "mid"
[1] => string(4) "muid"
[2] => string(5) "muser"
[3] => string(8) "mcontent"
[4] => string(5) "mtime"
["_autoinc"] => bool(true)
["_pk"] => string(3) "mid"
}
而下面这个无论在本地还是sae上都是正常的:
["_map":protected] => array(4) {
["user"] => string(5) "muser"
["content"] => string(8) "mcontent"
["time"] => string(5) "mtime"
["aid"] => string(4) "maid"
}
本来sae上面的table也是没有那个字段的,后来增加了字段无效,我把所有表重新传上去也无效。
runtime删了很多次也是无效,不知道是什么原因造成的?
回复讨论(解决方案)
先确认 sae 端的表结构已经修改成功
待本地以 sae 方式调试成功后,重新提交整个项目
先确认 sae 端的表结构已经修改成功
待本地以 sae 方式调试成功后,重新提交整个项目
sae表结构是已经修改好的。
“待本地以sae方式调试成功”是什么意思?
先确认 sae 端的表结构已经修改成功
待本地以 sae 方式调试成功后,重新提交整个项目
我现在新建的第二个版本,然后把第一个版本的全部copy过去,然后就好了!!
谢谢!
但是我想知道是什么原因造成的?
在你的机器上你不是用 sae 方式调试的吗?
常规的项目入口文件
require './ThinkPHP/ThinkPHP.php';
SAE的项目入口文件
require './ThinkPHP/Extend/Engine/Sae.php';
先确认 sae 端的表结构已经修改成功
待本地以 sae 方式调试成功后,重新提交整个项目
还有我想问如果不弄第二个版本,怎样将第一个版本整个重新提交?
我不知道应该怎么重新提交。
在你的机器上你不是用 sae 方式调试的吗?
常规的项目入口文件
require './ThinkPHP/ThinkPHP.php';
SAE的项目入口文件
require './ThinkPHP/Extend/Engine/Sae.php';
嗯,这个明白了
还有我想问如果不弄第二个版本,怎样将第一个版本整个重新提交?
我不知道应该怎么重新提交。 你不是用 SVN 软件的吗?
在项目目录上右键-提交即可
引用 5 楼 的回复:
还有我想问如果不弄第二个版本,怎样将第一个版本整个重新提交?
我不知道应该怎么重新提交。
你不是用 SVN 软件的吗?
在项目目录上右键-提交即可
那样提交之后就是没有作用,还是一样有那个问题。
但是我重建一个版本问题就解决了。
不知道为什么。
我也遇到这个问题了。网上搜了下,说是KVDB缓存的问题。然后我禁用KVDB,重新开启,但还是出现这个情况。经过一番折腾才知道禁用KVDB并没有清空缓存,虽然禁用的时候也提示了,但是至少我的没有被清空,原因就不去纠结了。
你可以用下面的代码来查看你的KVDB的缓存内容
[code]$kv = new SaeKV();
$ret = $kv->init();
$ret = $kv->pkrget('', 100);
dump($ret);
[/code]
如果你禁用并重新开启KVDB后,运行上面代码仍然输出缓存内容,那说明KVDB的缓存还在。
复制下面的代码,执行后解决一切问题。
[code] $kv = new SaeKV(); //创建SaeKV对象
$ret = $kv->init(); //初始化
$ret = $kv->pkrget('', 100); //获取缓存内容(帮助文档注明了上限为100条)
$this->show('
当前KVDB缓存内容
');dump($ret);
//遍历并删除
foreach ($ret as $key => $value) {
$ret = $kv->delete($key);
}
$this->show('
');
$this->show('
清空KVDB缓存后的内容
');$ret = $kv->pkrget('', 100);
dump($ret);
if (!$ret){
$this->show('
');
$this->show('KVDB清空成功');
};
[/code]

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Chinese version
Chinese version, very easy to use

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
