0

I'm using CFileHelper::findFiles() method to list all files under a specific directory. it works correctly when the directory is not empty. but if there is no file under it, the method suddenly stops whit no error messages or exceptions. Is there any idea about this problem?

Edit :

public function actionIndex()
    {
        /**
         * @var Supplier $supplier
         */
        $data = $this->getRequestData();
        $supplier = Supplier::model()->findByPk($data['id']);
        if (isset($supplier)) {
            $files = $supplier->getCertificateFilesList();
            $response = new LabResponse();
            $response->addRegion('certificates-wrapper', $this->renderPartial('partial/_thumbnails', array(
                'supplier' => $supplier,
                'files' => $files
            ), true));
            $this->sendHttpResponse(200, $response->getResponse());
        }
        $this->sendHttpResponse(404);
    }

public function getCertificateFilesList()
    {
        $dir = 'uploads/suppliers/certificates/11';
        $files = CFileHelper::findFiles($dir);
        return $files;
    }
4

0 に答える 0