src/Controller/Admin/FeedbackController.php
public function index() {
		$savepath = Configure::read('Feedback.configuration.Filesystem.location');

		//Check dir
		if (!is_dir($savepath)) {
		    mkdir($savepath, 0770, true);
		    if (!is_dir($savepath)) {
				throw new NotFoundException('Feedback location not found: ' . $savepath);
			}
		}

		//Creat feedback array in a cake-like way
		$feedbacks = [];

		//Loop through files
		foreach (glob($savepath . '*.feedback') as $feedbackfile) {

			$feedbackObject = unserialize(file_get_contents($feedbackfile));
			$feedbacks[$feedbackObject['time']] = $feedbackObject;

		}

		//Sort by time
		krsort($feedbacks);

		$this->set('feedbacks', $feedbacks);
	}
public function index() {
		$savepath = Configure::read('Feedback.configuration.Filesystem.location');

		//Check dir
		if (!is_dir($savepath)) {
		    mkdir($savepath, 0770, true);
		    if (!is_dir($savepath)) {
				throw new NotFoundException('Feedback location not found: ' . $savepath);
			}
		}

		//Creat feedback array in a cake-like way
		$feedbacks = [];

		//Loop through files
		foreach (glob($savepath . '*.feedback') as $feedbackfile) {

			$feedbackObject = unserialize(file_get_contents($feedbackfile));
			$feedbacks[$feedbackObject['time']] = $feedbackObject;

		}

		//Sort by time
		krsort($feedbacks);

		$this->set('feedbacks', $feedbacks);
	}
public function index ( ) { $ savepath = Configure :: read ( 'Feedback.configuration.Filesystem.location' ) ; //Check dir if ( ! is_dir ( $ savepath ) ) { mkdir ( $ savepath , 0770 , true ) ; if ( ! is_dir ( $ savepath ) ) { throw new NotFoundException ( 'Feedback location not found: ' . $ savepath ) ; } } //Creat feedback array in a cake-like way $ feedbacks = [ ] ; //Loop through files foreach ( glob ( $ savepath . '*.feedback' ) as $ feedbackfile ) { $ feedbackObject = unserialize ( file_get_contents ( $ feedbackfile ) ) ; $ feedbacks [ $ feedbackObject [ 'time' ] ] = $ feedbackObject ; } //Sort by time krsort ( $ feedbacks ) ; $ this -> set ( 'feedbacks' , $ feedbacks ) ; }
Example index function for current save in tmp dir solution

@return \Cake\Http\Response|null
Example index function for current save in tmp dir solution