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

		//Check dir
		if (!is_dir($savepath)) {
			throw new NotFoundException('savepath not exists');
		}

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

		//Loop through files
		if (!$this->request->getSession()->started()) {
			$this->request->getSession()->start();
		}
		foreach (glob($savepath . '*-' . $this->request->getSession()->id() . '.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)) {
			throw new NotFoundException('savepath not exists');
		}

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

		//Loop through files
		if (!$this->request->getSession()->started()) {
			$this->request->getSession()->start();
		}
		foreach (glob($savepath . '*-' . $this->request->getSession()->id() . '.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 ) ) { throw new NotFoundException ( 'savepath not exists' ) ; } //Creat feedback array in a cake-like way $ feedbacks = [ ] ; //Loop through files if ( ! $ this -> request -> getSession ( ) -> started ( ) ) { $ this -> request -> getSession ( ) -> start ( ) ; } foreach ( glob ( $ savepath . '*-' . $ this -> request -> getSession ( ) -> id ( ) . '.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.
Must only display images of own session

@return \Cake\Http\Response|null
Example index function for current save in tmp dir solution . Must only display images of own session