2012-09-25 3 views
0

여기 내 문제가 있습니다 : 나는 symfony에서 사용자 정의 검사기를 작성하려고합니다.php symfony 1.4 사용자 정의 유효성 검사기 오류

사용 :

$this->setValidator('path', new sfValidatorFile(array(

    'required' => false, 
    'path'  => sfConfig::get('sf_upload_dir'), 
    'mime_types' => 'web_images', 
    'validated_file_class' => 'sfImageTransform'))); 
} 

검사기 :이 오류 받고 있어요

<?php class sfImageTransform extends sfValidatedFile{ 

    public function save($file = null, $fileMode = 0666, $create = true, $dirMode = 0777) { 


    $saved = parent::save($file, $fileMode, $create, $dirMode); 

     $img = new sfImage(sfConfig::get('sf_upload_dir').'/'.$saved, 'image/jpeg'); 
     $img->resize(500,400); 
     $img->save(); 

     return $saved; 
    } 
} ?> 

: 여기 Fatal error: Class 'sfImageTransform' not found in /http/htdocs/pizza_propel/lib/vendor/symfony/lib/validator/sfValidatorFile.class.php on line 167

는 제가 '처음 Sensio 연구소 직원을 살해 할 것 부분이다 이제까지 만날거야 : 유효성 검사기 파일에서 <?php ?> 대괄호를 제거 할 때마다, 내 동생이 class sfImageTransform extends sfValidatedFile{ public function save($file = null, $fileMode = 0666, $create = true, $dirMode = 0777) { // let the parent class save the file and do what it normally does $saved = parent::save($file, $fileMode, $create, $dirMode); //echo $saved;die; $img = new sfImage(sfConfig::get('sf_upload_dir').'/'.$saved, 'image/jpeg'); $img->resize(500,400); $img->save(); //$saved->resize(1000,null); // //$saved->resize(1000,null)->overlay(new sfImage('logo.png'), 'bottom-right'); return $saved; } } Fatal error: Class 'sfImageTransform' not found in /http/htdocs/pizza_propel/lib/vendor/symfony/lib/validator/sfValidatorFile.class.php on line 167이됩니다. (예상대로) wser 창을 닫습니다.하지만 다시 넣은 후 새로 고치면 정확히 한 번 실행되고 수행해야 할 작업을 수행하며 다음 시도에서는 다시 동일한 작업을 수행합니다. 진심으로 ... 그 껍데기가 뭐야? 나는 1 시간 넘게이 일에 대해 분노하고 있으며, 나는 75 마일 반경에서 치열한 모든 것을 분쇄하려고합니다. 누구도 전에 이것을 처리 했습니까?

+0

등급은 어디입니까? lib 디렉토리에서? 어떻게 파일 이름을 지었습니까? 귀하의 의견을 주셔서 감사합니다 –

+0

하지만 난 그냥 그것을 해결 : - / – Kuro

답변

0

그리고 다시 한 번 내 자신의 질문에 대답합니다. 나는 정말로 묻는 것을 멈춰야한다.

pangalactically 바보 같은 우연의 일치에 의해, 유효성 검사기 클래스 파일의 이름이 다른 파일이나 그와 비슷한 것으로 충돌 한 것 같습니다. 유효성 검사기 클래스 파일의 이름을 바꾸면 문제가 해결되었습니다.

관련 문제