ディレクトリ内の最新の変更されたファイルを返すことができる Cakephp のメソッドはありますか? $this->System->getLatestModifiedFile()
Cakephp モデルで試してみましたが、Call to a member function getLatestModifiedFile() on a non-object
エラーが発生しました。
アドバイスありがとうございます!
Cakephp ファイルとフォルダー API を参照して、File::lastChange()
メソッドを使用して問題を解決することができました。助けてくれてありがとう。次に例を示します。
App::uses('Folder', 'Utility');
App::uses('File', 'Utility');
$file = new File('/tmp/test.txt');
//the following will return an epoch time, can be formatted by date method
echo $file->lastChange();
http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.htmlFile::lastChange()
にアクセスして、File API セクションを探してください。これは役立つかもしれません。