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');
 }
 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'));
 }
Example #3
0
 /**
  * Xóa ngôn ngữ
  *
  * @param string $lang_dir_name language folder name
  *
  * @access public
  * @author Dao Anh Minh
  */
 public function action_delete($lang_dir_name = null)
 {
     $lang_path = APPPATH . "lang/{$lang_dir_name}";
     if (is_null($lang_dir_name) or !is_dir($lang_path) or $lang_dir_name == 'vi') {
         Session::set_flash('error', 'Ngôn ngữ không tồn tại');
     } else {
         \Fuel\Core\File::delete_dir($lang_path, true);
         Session::set_flash('success', 'Xóa ngôn ngữ thành công');
     }
     Response::redirect('admin/language');
 }
Example #4
0
 public function action_remove($path)
 {
     try {
         \Fuel\Core\File::delete_dir($path);
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }