public function model_image($file_model, $options = array()) { $path = "no-image.png"; if (!is_null($file_model) && FileLib::hasThumbnailFile($file_model['File']['path'])) { $path = FileLib::getThumnailURL($file_model['File']['path']); //$options['data-src'] = $path; } return $this->image($path, $options); }
/** * Test BOM * * @return void */ public function testBOM() { $folder = CakePlugin::path('Tools') . 'Test' . DS . 'test_files' . DS . 'txt' . DS; $fileOK = $folder . 'ok.php'; $fileNOK = $folder . 'nok.php'; $result = FileLib::hasByteOrderMark(file_get_contents($fileOK)); $this->assertFalse($result); $result = FileLib::hasByteOrderMark(file_get_contents($fileNOK)); $this->assertTrue($result); $tmpFileNOK = TMP . 'nok.php'; copy($fileNOK, $tmpFileNOK); $result = FileLib::removeByteOrderMark(file_get_contents($tmpFileNOK)); //file_put_contents($tmpFileNOK, $result); //$result = FileLib::hasByteOrderMark(file_get_contents($tmpFileNOK)); $result = FileLib::hasByteOrderMark($result); $this->assertFalse($result); unlink($tmpFileNOK); }