/** * Get PHash */ public function getPHash() { $content = file_get_contents($this->url); $tempFile = Yii::getAlias('@app/runtime/' . time() . mt_rand(0, 1000)); file_put_contents($tempFile, $content); $hash = ImageManager::getPHash($tempFile); unlink($tempFile); return $hash; }
/** * Get PHash */ public function getPHash() { return ImageManager::getPHash($this->imageFile->tempName); }