public function initialize()
 {
     // Initialize GrFingerX Library
     $this->GrFingerX = new COM('GrFingerX.GrFingerXCtrl.1') or die('Could not initialise object.');
     com_load_typelib('{A9995C7C-77BF-4E27-B581-A4B5BBD90E50}');
     $this->CI =& get_instance();
     /*// Open sqlite database
     		if ($this->db = sqlite_open(RPATH.'/GrFingerSample1.sqlite', 0666, $sqliteerror))
     		{
     			$query = sqlite_query($this->db, "SELECT name FROM sqlite_master WHERE type='table' and name='enroll'");
     			$rows = sqlite_num_rows($query);
     			if ($rows<1){
     				sqlite_query($this->db, "CREATE TABLE enroll (id INTEGER PRIMARY KEY, tpt TEXT NOT NULL)");
     			}
     		}
     		else 
     			return false;*/
     if ($this->GrFingerX->Initialize() != $this->GR_OK) {
         return false;
     }
     return true;
 }
Exemplo n.º 2
0
 function connect($ip = '192.168.0.201', $port = 4370)
 {
     //try{
     //$this->_zkemkeeper = new COM("zkemkeeper.zkem.1") or die("Unable to create com object"); // This is the INIT METHOD
     // If no zkemkeeper installed
     try {
         $this->create_object();
     } catch (Exception $e) {
         //echo 'Error: ',  $e->getMessage(), "\n";
         echo 'Error: Cant create Zkemkeeper object. Please install the SDK';
         return;
     }
     com_load_typelib('zkemkeeper.zkem');
     $s = '';
     $this->_zkemkeeper->GetSDKVersion($s);
     echo $s;
     $u = true;
     $u = $this->_zkemkeeper->Connect_Net($ip, $port);
     $error_code = 0;
     if ($u == false) {
         $this->_zkemkeeper->GetLastError($error_code);
         var_dump($error_code);
     }
 }