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

鍍金池/ 問答/ PHP問答
萌小萌 回答

PHP在表示命名空間的時候會用到反斜杠,此處的單個反斜杠就是表示在當前命名空間內調用全局的方法,具體可以看看命名空間相關資料。
file_exists(path)
這是用法,就是在指定路徑查找文件是否存在。

悶騷型 回答

應該是你的解析json數(shù)據(jù)出錯導致的

痞性 回答
  1. POST 之前檢查一下支付 LOG 表,是否已經(jīng)支付訂單
  2. POST DATA 成攻后寫 支付訂單成攻寫入 LOG 標志

按這個流程已經(jīng)解決。

下墜 回答
  1. 對于監(jiān)聽 ul 下所有 li 這種需求,一般是監(jiān)聽 ul 的事件,然后通過 event.target 之類的方式去獲取真正觸發(fā)事件的元素,這個涉及 DOM 的事件機制,你可以了解一下。
  2. 一般來說不寫 window.onload 這種形式,我個人是這樣的:
(function(window, document, undefined) {
    ...
})(window, document, undefined)

很多規(guī)范寫法都是要慢慢積累的,你也可以直接看各網(wǎng)站那些未被混淆的 js 文件來快速了解。

大濕胸 回答

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

$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

  • yiibaseApplication::__construct() 方法注解
public function __construct($config = [])
{
    Yii::$app = $this;
    //將\yii\base\Application中的所有的屬性和方法交給Yii::$app->loadedModules數(shù)組中
    static::setInstance($this);

    $this->state = self::STATE_BEGIN;

    //加載配置文件的框架信息 如:設置別名,設置框架路徑等等最為重要的是給加載默認組件
    $this->preInit($config);

    //加載配置文件中的異常組件
    $this->registerErrorHandler($config);

    // 調用父類的 __construct。
    // 由于Component類并沒有__construct函數(shù)
    // 這里實際調用的是 `yii\base\Object__construct($config)`
    Component::__construct($config);
}

上面方法中 Component::__construct($config) 會調用 yii\base\Object::__construct() 方法

  • yiibaseObject::__construct() 方法注解
public function __construct($config = [])
{
    if (!empty($config)) {
        // 將配置文件里面的所有配置信息賦值給Object。
        // 由于Object是大部分類的基類,
        // 實際上也就是有配置信息賦值給了yii\web\Application的對象
        Yii::configure($this, $config);
    }
    $this->init();
}

一、下面只是為了說明 'components' => [ 'log' => [...]] 從哪來,若不關心可以直接看 第二步。

  • 先看 $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])) {
            // 若自定義組件中沒有設置該核心組件配置信息,直接使用核心組件默認配置
            $config['components'][$id] = $component;
        } elseif (is_array($config['components'][$id]) && !isset($config['components'][$id]['class'])) {
            // 若自定義組件有設置該核心組件配置信息,但是沒有設置 'class'屬性,則添加該class屬性
            $config['components'][$id]['class'] = $component['class'];
        }
    }
}

/**
 * Returns the configuration of core application components.
 * 返回核心應用組件的配置
 * @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' => [...]] 從哪來

二、重點在這里

  • yii\base\Object::__construct($config = []) 中的 Yii::configure($this, $config);
public static function configure($object, $properties)
{
    // 只是遍歷配置信息,賦值給當前對象
    foreach ($properties as $name => $value) {
        $object->$name = $value;
    }
    return $object;
}
  • 這里我們要配合 yii\base\Object::__set($name, $value)
/**
 * 為實例不存在的屬性賦值時調用
 *
 * Do not call this method directly as it is a PHP magic method that
 * will be implicitly called when executing `$object->property = $value;`.
 * 這個是PHP的魔術方法,會在執(zhí)行 `$object->property = $value;` 的時候自動調用。
 */
public function __set($name, $value)
{
    // setter函數(shù)的函數(shù)名
    // 由于php中方法名稱不區(qū)分大小寫,所以setproperty() 等價于 setProperty()
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        // 調用setter函數(shù)
        $this->$setter($value);
    } elseif (method_exists($this, 'get' . $name)) {
        // 如果只有getter沒有setter 則為只讀屬性
        throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
    } else {
        throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $name);
    }
}

當前情景下的 $object 我們可以認為是 yii\base\Application 的對象 $app

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

這里會調用 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'=>...
           ...
咕嚕嚕 回答

原來就是看不到的,我還以為是能看到的!

深記你 回答

那就改權限唄
sudo chmod -R 755 /public/download/

帥到炸 回答

1.感覺你這樣麻煩了
2.InnoDB是行鎖

離觴 回答

找不到相關文件? opencart 是開源免費的商城, 可以看到源代碼的,讀懂購物流程就行

寫榮 回答

php7.1.6而你的redis擴展是php7.0版本。如何能夠工作?

薔薇花 回答

沒發(fā)現(xiàn)有項配置。

疚幼 回答

已解決,不勞煩貴站回復

蟲児飛 回答

剛剛到樓主提供的地址, register 表單提交后問題重現(xiàn), 很可能是 storage 目錄的權限問題

朕略傻 回答

axios回來的時候已經(jīng)是JS對象了,可以直接使用。不要再用parse方法

孤毒 回答
  1. 日期時間類問題,先核對下要求的格式;
  2. 硬調試。PHP不行的話直接HTML寫死,HTML寫死還不行去插件官網(wǎng)給的Demo里復制原來的代碼,還不行就去換個能正常跑的版本;再核對最終能跑的代碼和之前寫的哪里不一樣。
吢涼 回答

這個其實不存在,因為加密過程中還要添加 “鹽”或者密鑰之類的東西啊, 這個只有你自己知道的東西啊,所以光算法知道也沒有用的。


不過感覺你說的是數(shù)據(jù)防篡改的驗證,不是webapi加密???

Token是服務器端授權客戶端訪問的一種憑證,其生成算法可以公開,不過一些關鍵數(shù)據(jù)不會公開,這樣就防止隨意偽造。Token本身可能有時效,且也需要客戶端妥善保管來使用。

心上人 回答
$cache = Cache::init();
// 獲取緩存對象句柄
$redis = $cache->handler();
$redis->hmset();
$redis->lpop();