DELETE FROM MyTable WHERE ID IN (1,2);
你chunkFilename那里寫死了呀,你可以手動設(shè)置chunkFilename的hash值
output: {
...
chunkFilename: 'js/[name].chunk.js?id=[chunkhash:20]'
}
$config = [
//others
'modules' => [
'debug' => [
'class' => 'yii\debug\Module',
],
'gii' => [
'class' => 'yii\gii\Module',
];
],
//others
]
class yii\base\Application extends yii\base\Module
class yii\base\Module extends yii\di\ServiceLocator
class yii\di\ServiceLocator extends yii\base\Component
class yii\base\Component extends yii\base\Object
public function __construct($config = [])
{
Yii::$app = $this;
//將\yii\base\Application中的所有的屬性和方法交給Yii::$app->loadedModules數(shù)組中
static::setInstance($this);
$this->state = self::STATE_BEGIN;
//加載配置文件的框架信息 如:設(shè)置別名,設(shè)置框架路徑等等最為重要的是給加載默認(rèn)組件
$this->preInit($config);
//加載配置文件中的異常組件
$this->registerErrorHandler($config);
// 調(diào)用父類的 __construct。
// 由于Component類并沒有__construct函數(shù)
// 這里實(shí)際調(diào)用的是 `yii\base\Object__construct($config)`
Component::__construct($config);
}
Component::__construct($config)
會調(diào)用 yii\base\Object::__construct()
方法public function __construct($config = [])
{
if (!empty($config)) {
// 將配置文件里面的所有配置信息賦值給Object。
// 由于Object是大部分類的基類,
// 實(shí)際上也就是有配置信息賦值給了yii\web\Application的對象
Yii::configure($this, $config);
}
$this->init();
}
'components' => [ 'log' => [...]]
從哪來,若不關(guān)心可以直接看 第二步。$this->preInit($config);
,即 yii\base\Application::preInit(&$config)
public function preInit(&$config)
{
//others...
// merge core components with custom components
// 合并核心組件和自定義組件
foreach ($this->coreComponents() as $id => $component) {
if (!isset($config['components'][$id])) {
// 若自定義組件中沒有設(shè)置該核心組件配置信息,直接使用核心組件默認(rèn)配置
$config['components'][$id] = $component;
} elseif (is_array($config['components'][$id]) && !isset($config['components'][$id]['class'])) {
// 若自定義組件有設(shè)置該核心組件配置信息,但是沒有設(shè)置 'class'屬性,則添加該class屬性
$config['components'][$id]['class'] = $component['class'];
}
}
}
/**
* Returns the configuration of core application components.
* 返回核心應(yīng)用組件的配置
* @see set()
*/
public function coreComponents()
{
return [
// 日志分配器組件
'log' => ['class' => 'yii\log\Dispatcher'],
//others...
];
}
$this->preInit($config);
, 我們得到的 $config
$config = [
'modules' => [
'debug' => [
'class' => 'yii\debug\Module',
],
'gii' => [
'class' => 'yii\gii\Module',
];
],
'components' => [
'log' => [
'class' => 'yii\\log\\Dispatcher',
],
//others...
]
//others...
]
'components' => [ 'log' => [...]]
從哪來yii\base\Object::__construct($config = [])
中的 Yii::configure($this, $config);
public static function configure($object, $properties)
{
// 只是遍歷配置信息,賦值給當(dāng)前對象
foreach ($properties as $name => $value) {
$object->$name = $value;
}
return $object;
}
yii\base\Object::__set($name, $value)
/**
* 為實(shí)例不存在的屬性賦值時調(diào)用
*
* Do not call this method directly as it is a PHP magic method that
* will be implicitly called when executing `$object->property = $value;`.
* 這個是PHP的魔術(shù)方法,會在執(zhí)行 `$object->property = $value;` 的時候自動調(diào)用。
*/
public function __set($name, $value)
{
// setter函數(shù)的函數(shù)名
// 由于php中方法名稱不區(qū)分大小寫,所以setproperty() 等價于 setProperty()
$setter = 'set' . $name;
if (method_exists($this, $setter)) {
// 調(diào)用setter函數(shù)
$this->$setter($value);
} elseif (method_exists($this, 'get' . $name)) {
// 如果只有g(shù)etter沒有setter 則為只讀屬性
throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
} else {
throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $name);
}
}
當(dāng)前情景下的 $object
我們可以認(rèn)為是 yii\base\Application
的對象 $app
$app->modules = [
'debug' => [
'class' => 'yii\debug\Module',
],
'gii' => [
'class' => 'yii\gii\Module',
];
]
這里會調(diào)用 yii\base\Module::setModules($modules)
方法
public function setModules($modules)
{
foreach ($modules as $id => $module) {
$this->_modules[$id] = $module;
}
}
這樣便有了問題中的
private "_modules" (yiibasemodule)=>
array (size=3)
'backend' =>....
'debug' =>...
'gii'=>...
$app->components = [
'log' => [
'class' => 'yii\\log\\Dispatcher',
],
]
yii\di\ServiceLocator::setComponents($components)
方法public function setComponents($components)
{
foreach ($components as $id => $component) {
$this->set($id, $component);
}
}
public function set($id, $definition)
{
// others ...
if (is_object($definition) || is_callable($definition, true)) {
// an object, a class name, or a PHP callable
$this->_definitions[$id] = $definition;
} elseif (is_array($definition)) {
// 定義如果是個數(shù)組,要確保數(shù)組中具有 class 元素
// a configuration array
if (isset($definition['class'])) {
// 定義的過程,只是寫入了 $_definitions 數(shù)組
$this->_definitions[$id] = $definition;
} else {
throw new InvalidConfigException("The configuration for the \"$id\" component must contain a \"class\" element.");
}
} else {
throw new InvalidConfigException("Unexpected configuration type for the \"$id\" component: " . gettype($definition));
}
}
這樣便有了問題中的
private "_definitions"(yiidiservicelocator)=>
array (size=7)
...
'log'=>...
...
1.下載https://greenindex.dynamic-dn...
2.在函數(shù)deAES中將返回的字符串輸出到控制臺中,這些字符串就是真正運(yùn)行的代碼.
3.然后代入他下面寫的運(yùn)行代碼,在中間調(diào)試.一步步調(diào)試 最多半天就能知道他干嘛的了.
xx
int(11) not null unsigned default 0 comment 'xxx',
對于題主的應(yīng)用場景,我想有兩種思路供題主參考。
1.就像題主所說的,在登錄的時候做會員狀態(tài)檢查,并根據(jù)情況修改會員狀態(tài)。
優(yōu)點(diǎn):不需要開啟守護(hù)進(jìn)程或定時任務(wù),實(shí)現(xiàn)簡單。
缺點(diǎn):
每次會員登錄都要做一次狀態(tài)檢查會延長頁面加載時間
會員等級信息修改滯后??赡茉斐蓵T已經(jīng)過了一年期限,但由于會員沒有登錄,所以等級信息一直沒有修改的情況
2.寫一個腳本實(shí)時監(jiān)控
優(yōu)點(diǎn):可以實(shí)時修改會員狀態(tài)信息,不需要登錄后檢查從而加快頁面打開速度
缺點(diǎn):占用服務(wù)器資源(如果用戶量很大的話,運(yùn)行這個腳本會很占用服務(wù)器資源)
skip32
看看php.ini 是不是安裝opcache了
可以保證在橫屏和電腦端訪問不會拉伸的太夸張吧
一樓說的情況針對同一個庫里面可以這樣搞,二樓說的我想應(yīng)該可以滿足你的需求。通過數(shù)據(jù)庫中間件來實(shí)現(xiàn)
配置中把dsn設(shè)為空試一下
暫時沒有看到哪兒有,可以自己去實(shí) @yuanxiaowa
我先引用一下,然后寫一下我個人的看法,這種需求我覺得是有問題的,基本上沒有人會這么去操作,我建議引入sass工具來管理樣式。另外的話,可以考慮學(xué)習(xí)最新的前端基于數(shù)據(jù)來思考的框架,比如react,bootstrap是UI框架。
dns劫持, 打電話給運(yùn)營商舉報ip
先理清表之間的關(guān)系,及各字段的含義,然后再進(jìn)行操作
建議將表結(jié)構(gòu)及個字段含義,目標(biāo)結(jié)果貼下
一般等一會就好了,這是網(wǎng)站在部署新主題。
如果等十幾分鐘還進(jìn)不去,進(jìn)服務(wù)器重置一下主題就好了
那就改權(quán)限唄sudo chmod -R 755 /public/download/
那是連接查詢的的連接條件啊,怎么能去掉呢?除非你不用連接查詢
讀取的時候再設(shè)一次編碼就行了
PHP面向?qū)ο蟀?/p>
/**
* Created by: Singee77
*/
class Standard
{
//答對全部題所得總分
private $totalScore = 0;
//標(biāo)準(zhǔn)答案
private $standard = [];
//提交答案
private $answer = [];
//所得總分
private $getScore = 0;
public function __construct($totalScore)
{
$this->setTotalScore($totalScore);
}
/**
* @return int
*/
public function getTotalScore()
{
return $this->totalScore;
}
/**
* @param int $totalScore
*/
public function setTotalScore($totalScore)
{
$this->totalScore = $totalScore;
}
/**
* @param array $standard
*/
public function setStandard($standard)
{
$this->standard = $standard;
}
/**
* @return array
*/
public function getStandard()
{
return $this->standard;
}
/**
* @param $answer
*/
public function checkStandard()
{
foreach ($this->answer as $each) {
if (!$weight = $this->checkAnswer($each)) {
//選錯一個總分為0
$this->setGetScore(0);
break;
}
//答對一個就追加分?jǐn)?shù)
$this->appendGetScore($this->getTotalScore() * $weight);
}
}
/**
* @param array $answer
*/
public function setAnswer($answer)
{
$this->answer = $answer;
}
/**
* @return array
*/
public function getAnswer()
{
return $this->answer;
}
/**
* @param $each
* return $weight
*/
private function checkAnswer($each)
{
return array_key_exists($each, $this->standard) ? $this->standard[$each] : 0;
}
/**
* @param int $getScore
*/
public function setGetScore($score)
{
$this->getScore = $score;
}
/**
* @return int
*/
public function getGetScore()
{
return $this->getScore;
}
/**
* @param int $totalScore
*/
public function appendGetScore($appendScore)
{
$this->getScore += $appendScore;
}
}
//實(shí)例一個CHECK對象并設(shè)置總分
$std = new Standard(10);
//設(shè)置標(biāo)準(zhǔn)答案以及占比
$std->setStandard(['A' => 0.2, 'B' => 0.4, 'C' => 0.4]);
//設(shè)置答案
$std->setAnswer(['A', 'B']);
//計算分?jǐn)?shù)
$std->checkStandard();
//獲取所得總分
$totalScore = $std->getTotalScore();
echo $totalScore;
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。