예제 #1
0
 /**
  * @param string $name
  * @param bool $isDefault
  * @param string $default_assignee_login
  * @return string
  * @throws NotConnectedException
  */
 public function createSubsystem($name, $isDefault, $default_assignee_login)
 {
     if (is_null($this->youtrack)) {
         throw new NotConnectedException();
     }
     $subsystem = new Subsystem(null, $this->youtrack);
     $subsystem->__set('name', $name);
     $subsystem->__set('isDefault', $isDefault);
     $subsystem->__set('defaultAssignee', $default_assignee_login);
     return $this->youtrack->createSubsystem($this->getShortName(), $subsystem);
 }
예제 #2
0
 /**
  * This extra constructor sets subsystems, if they are present in the response
  *
  * @param \SimpleXMLElement $xml
  * @param Connection $youtrack
  */
 public function __construct(\SimpleXMLElement $xml = null, Connection $youtrack = null)
 {
     parent::__construct($xml, $youtrack);
     if (isset($xml->subsystems)) {
         $this->attributes['subsystems'] = array();
         foreach ($xml->subsystems->sub as $subsystemNode) {
             $system = new Subsystem(null, $youtrack);
             $system->__set('name', (string) $subsystemNode['value']);
             $this->attributes['subsystems'][] = $system;
         }
     }
     if (isset($xml->assigneesLogin)) {
         $this->attributes['assigneesUsers'] = array();
         foreach ($xml->assigneesLogin->sub as $assigneesLogin) {
             $user = new User(null, $youtrack);
             $user->__set('login', (string) $assigneesLogin['value']);
             $this->attributes['assigneesUsers'][] = $user;
         }
     }
 }
예제 #3
0
            		exit;*/
            // echo $v.PHP_EOL;
            // $system = array();
            $system = shell_exec($conn);
            //exec($conn,$system);
            //file_put_contents('./rrrr.txt',$conn.PHP_EOL,FILE_APPEND);
            // exit;
            echo $system;
            if (preg_match('/android/i', $system)) {
                $this->android += 1;
            }
            if (preg_match('/mac/i', $system)) {
                $this->ios += 1;
            }
            echo $this->android . '----------' . $this->ios . PHP_EOL;
        }
    }
    /**
     * 获取每个系统的注册人数
     */
    protected function getregnum()
    {
        $reg['android'] = $this->android;
        $reg['ios'] = $this->ios;
        return $reg;
    }
}
$file = './3.2/zb_phone.txt';
$m = new Subsystem($file, '2015-03-02', 'jn');
$data = $m->Resolve();
file_put_contents('./03-02-zb.txt', 'android:' . $data['android'] . '   ios:' . $data['ios']);