public function setUp()
 {
     $files = \Fuel\Core\File::read_dir(APPPATH . 'tests/files', 1);
     foreach ($files as $file => $val) {
         \Fuel\Core\File::delete_dir(APPPATH . 'tests/files' . DS . $file);
     }
     $this->pass = Model_Pass::forge(array('name' => 'test name', 'description' => 'desc', 'logo_text' => 'sample', 'barcode_message' => 'message', 'barcode_format' => 0, 'foreground_color' => 'rgb(0,0,0)', 'background_color' => 'rgb(1,1,1)', 'label_color' => 'rgb(2,2,2)'));
     $this->pass->save();
     \Fuel\Core\Config::set('pass.files_dir', APPPATH . 'tests/files');
     $this->path = \Fuel\Core\Config::get('pass.files_dir');
     \Fuel\Core\Config::set('pass.pkpasses_dir', APPPATH . 'tests/passes');
 }
예제 #2
0
 public function setUp()
 {
     $files = \Fuel\Core\File::read_dir(APPPATH . 'tests/files', 1);
     foreach ($files as $file => $val) {
         \Fuel\Core\File::delete_dir(APPPATH . 'tests/files' . DS . $file);
     }
     $this->pass = Model_Pass::forge(array('name' => 'test name', 'description' => 'desc', 'logo_text' => 'sample', 'barcode_message' => 'message', 'barcode_format' => 0, 'offer_label' => 'samaplelabel', 'offer_value' => 'samplevalue'));
     $this->pass->save();
     \Fuel\Core\Config::set('pass.files_dir', APPPATH . 'tests/files');
     $this->path = \Fuel\Core\Config::get('pass.files_dir');
     $this->manager = new Pass_File_Manager($this->pass);
     \Fuel\Core\File::copy(APPPATH . 'tests/certificate.p12', $this->manager->file_path('certificate.p12'));
 }
예제 #3
0
 public function action_folder($folder = null, $sub = null)
 {
     is_null($folder) and \Fuel\Core\Response::redirect_back();
     $error = '';
     $model = null;
     try {
         $uploads_folder = '/var/www/html/' . $this->_dir . '/' . $folder . '/' . $sub;
         $all = \Fuel\Core\File::read_dir($uploads_folder, 0);
     } catch (Exception $e) {
         $error = $e->getMessage();
         die($error);
     }
     $this->theme->set_partial('content', 'filemanager/folder')->set('all', $all)->set('folder', $folder)->set('sub', $sub)->set('message', $error);
 }