在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ PHP問答
北城荒 回答

問題出在你的ThinkPHP版本上,官方的5.0版本的擴(kuò)展庫版本號(hào)都是1.*,2.0版本均為ThinkPHP5.1版本專用。
先更新你的ThinkPHP版本,再重新composer安裝topthink/think-testing。

舊言 回答

1.下載https://greenindex.dynamic-dn...
2.在函數(shù)deAES中將返回的字符串輸出到控制臺(tái)中,這些字符串就是真正運(yùn)行的代碼.
3.然后代入他下面寫的運(yùn)行代碼,在中間調(diào)試.一步步調(diào)試 最多半天就能知道他干嘛的了.

憶往昔 回答

問題已解決。是學(xué)校網(wǎng)絡(luò)管理員調(diào)整防火墻策略導(dǎo)致

小眼睛 回答

對(duì)于題主的應(yīng)用場景,我想有兩種思路供題主參考。
1.就像題主所說的,在登錄的時(shí)候做會(huì)員狀態(tài)檢查,并根據(jù)情況修改會(huì)員狀態(tài)。
優(yōu)點(diǎn):不需要開啟守護(hù)進(jìn)程或定時(shí)任務(wù),實(shí)現(xiàn)簡單。
缺點(diǎn)
每次會(huì)員登錄都要做一次狀態(tài)檢查會(huì)延長頁面加載時(shí)間
會(huì)員等級(jí)信息修改滯后。可能造成會(huì)員已經(jīng)過了一年期限,但由于會(huì)員沒有登錄,所以等級(jí)信息一直沒有修改的情況

2.寫一個(gè)腳本實(shí)時(shí)監(jiān)控
優(yōu)點(diǎn):可以實(shí)時(shí)修改會(huì)員狀態(tài)信息,不需要登錄后檢查從而加快頁面打開速度
缺點(diǎn):占用服務(wù)器資源(如果用戶量很大的話,運(yùn)行這個(gè)腳本會(huì)很占用服務(wù)器資源)

愛是癌 回答

給你一個(gè)輪子:Element-angular。
他們的做法是:

 upload(path: string, file: File): Observable<any> {
    const req: HttpRequest<{}> = new HttpRequest('POST', path, file, {
      headers: this.headers,
      reportProgress: true,
      withCredentials: this.withCredentials,
    })
    return this.http.request(req)
  }

直接傳文件,并未做過多的處理。

未命名 回答

DELETE FROM MyTable WHERE ID IN (1,2);

默念 回答

應(yīng)該是./install-dependencies.sh
或者sh install-dependencies.sh

你不加./的話,shell會(huì)去$PATH中找這個(gè)命令,而當(dāng)前目錄不在$PATH下。加上./則會(huì)是執(zhí)行當(dāng)前目錄下的腳本

失心人 回答

你這是正則寫錯(cuò)了,'/src="(.+.(png|jpg))"+?/'其中只有第一個(gè),也就是外面的捕獲組使用了非貪婪模式,里面的'.+'沒使用非貪婪模式,改成'.+?'應(yīng)該就可以了。(這個(gè)點(diǎn)不睡也是沒誰了。。)

念初 回答

...
你 split 之后 數(shù)組變?yōu)檫@樣
他是 這樣分的 var arr = ['李明:60', '小花:59']
for 循環(huán) 不是說

arr[0].slice(3) => 60
arr[1].slice(3) => 59
孤巷 回答

配置中把dsn設(shè)為空試一下

九年囚 回答
A = [12, 24, 8, 32], B = [13, 25, 32, 11]
A.sort((a, b) => b - a)
let A1 = [...B].sort((a, b) => b - a).reduce((res, val) => {
  res[B.indexOf(val)] = A[0] > val ? A.shift() : A.pop()
  return res
}, new Array(A.length))
console.log(A1)
萢萢糖 回答

連接

node-sass經(jīng)常有出現(xiàn)安裝的問題,鏈接是之前遇到的一種現(xiàn)象,可以參考

我甘愿 回答

你這個(gè)問題問的就有點(diǎn)矛盾,你說怎么使用php提取關(guān)鍵字(公司簡稱)。這句話,php怎么知道你的字符串中哪個(gè)才是關(guān)鍵字(在沒有關(guān)鍵詞庫的情況下)?

感覺你的問題應(yīng)該是php怎么提取字符串中出現(xiàn)頻率最多的子串,感覺像是這樣。
我們有了這個(gè)思路之后,再深一步探討一下,我有個(gè)思路:

  1. 把你某個(gè)時(shí)間段內(nèi),用戶提交的所有title集合起來放在一個(gè)字符串中,然后提取出出現(xiàn)頻率最高的子串
  2. 把子串出現(xiàn)的頻率由高到低,都列出來,人工過濾,哪些才是所需要的關(guān)鍵字,形成一個(gè)關(guān)鍵字庫
  3. 下一次再有提交title的時(shí)候,先與關(guān)鍵字庫進(jìn)行匹配,如果沒有匹配上,除了插入到原有的投訴庫中,再把單獨(dú)的title插入到一個(gè)臨時(shí)的表里,一天結(jié)束,定時(shí)進(jìn)行一個(gè)關(guān)鍵詞提取的算法(重復(fù)1),然后第二天,人工再來過濾

以上。

妖妖 回答

你想讓php渲染模板,那么你不能用vue-cli生成項(xiàng)目,你只能用<script>引入vue,這種場景下,var a = {$user};php就可以直接渲染好啊,然后你js調(diào)用你這個(gè)變量就可以了啊

蝶戀花 回答

先理清表之間的關(guān)系,及各字段的含義,然后再進(jìn)行操作
建議將表結(jié)構(gòu)及個(gè)字段含義,目標(biāo)結(jié)果貼下

懷中人 回答

$options = [

// 緩存類型為File
'type'  =>  'File', 
// 緩存有效期為永久有效
'expire'=>  0, 
//緩存前綴
'prefix'=>  'think',
 // 指定緩存目錄
'path'  =>  APP_PATH.'runtime/cache/',

];
看下配置

心癌 回答

你chunkFilename那里寫死了呀,你可以手動(dòng)設(shè)置chunkFilename的hash值

output: {
    ...
    chunkFilename: 'js/[name].chunk.js?id=[chunkhash:20]'
}
深記你 回答

那就改權(quán)限唄
sudo chmod -R 755 /public/download/

大濕胸 回答

首先,你的 $config 數(shù)組中一定包含以下元素:

$config = [
    //others
    'modules' => [
        'debug' => [
            'class' => 'yii\debug\Module',
        ], 
        'gii'   => [
            'class' => 'yii\gii\Module',
        ];
    ],
    //others
]

這里說明一下繼承關(guān)系:

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

  • yiibaseApplication::__construct() 方法注解
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) 會(huì)調(diào)用 yii\base\Object::__construct() 方法

  • yiibaseObject::__construct() 方法注解
public function __construct($config = [])
{
    if (!empty($config)) {
        // 將配置文件里面的所有配置信息賦值給Object。
        // 由于Object是大部分類的基類,
        // 實(shí)際上也就是有配置信息賦值給了yii\web\Application的對(duì)象
        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...
    ];
}
  • 經(jīng)過 $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' => [...]] 從哪來

二、重點(diǎn)在這里

  • yii\base\Object::__construct($config = []) 中的 Yii::configure($this, $config);
public static function configure($object, $properties)
{
    // 只是遍歷配置信息,賦值給當(dāng)前對(duì)象
    foreach ($properties as $name => $value) {
        $object->$name = $value;
    }
    return $object;
}
  • 這里我們要配合 yii\base\Object::__set($name, $value)
/**
 * 為實(shí)例不存在的屬性賦值時(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;`.
 * 這個(gè)是PHP的魔術(shù)方法,會(huì)在執(zhí)行 `$object->property = $value;` 的時(shí)候自動(dòng)調(diào)用。
 */
public function __set($name, $value)
{
    // setter函數(shù)的函數(shù)名
    // 由于php中方法名稱不區(qū)分大小寫,所以setproperty() 等價(jià)于 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 的對(duì)象 $app

  • 當(dāng)遍歷到:
$app->modules =  [
    'debug' => [
        'class' => 'yii\debug\Module',
    ], 
    'gii'   => [
        'class' => 'yii\gii\Module',
    ];
]

這里會(huì)調(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'=>...
  • 同樣的道理,當(dāng)遍歷到:
$app->components =  [
    'log'   => [
        'class' => 'yii\\log\\Dispatcher',
    ],
]
  • 這里會(huì)調(diào)用 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)) {
        // 定義如果是個(gè)數(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'=>...
           ...