function generateSrvc()
 {
     try {
         $util = new MySQLConnector($this->cmdArgv);
         $options = $util->getOptions();
         $stage = $util->_validateAndBuidOptions();
         $currentDir = str_replace("\\", "/", dirname(__FILE__));
         $serviceOutDir = $currentDir . "/" . OUT_DIR . "/" . $util->_options['serviceName'];
         $serviceXslDir = $currentDir . "/" . XSL_DIR;
         $configFileName = $currentDir . "/" . CONFIG_FILE;
         $stage = 2;
         $util->generateProviders($serviceOutDir, $serviceXslDir, $configFileName, $stage);
     } catch (\Exception $e) {
         $this->fail('An unexpected Exception has been raised . ' . $e->getMessage());
     }
 }
Esempio n. 2
0
 /**
  * Получает на вход массив
  * 
  * @param Array $location Ключи: "countryId", "regionId", "cityId"
  * @return UserLocation
  */
 public function __construct($location, &$user)
 {
     parent::__construct();
     if (isset($location["countryId"]) && isset($location["regionId"]) && isset($location["cityId"])) {
         $this->_userId = $user->id;
         $this->_user = $user;
         $this->location = $location;
     }
 }
Esempio n. 3
0
 /**
  * Конструктор. Получает данные текущего пользователя, создаёт объект для доступа к бд
  * 
  */
 public function __construct($id = NULL)
 {
     parent::__construct();
     if ($id == NULL) {
         $user = new User();
         $this->_curentId = $user->id;
     } else {
         $this->_curentId = $id;
     }
 }
Esempio n. 4
0
 public static function FetchAll($method, $fields, $limit, $offset, $orderBy, $orderByDir, $groupBy, $criteria, $delineation, $operator, $associations, $start, $end, $ns, $key)
 {
     if (is_string($fields)) {
         $fields = array($fields);
     }
     switch (strtolower($method)) {
         case self::MYSQL:
             return MySQLConnector::FetchAll($key, $fields, $limit, $offset, $orderBy, $orderByDir, $groupBy, $criteria, $delineation, $operator, $associations, $start, $end);
     }
 }
Esempio n. 5
0
 /**
  * Консртуктор. Выполняется подключение базового класса YT.
  */
 function __construct()
 {
     $rootdir = $_SERVER["DOCUMENT_ROOT"];
     substr($rootdir, -1) == "/" ? $rootdir : ($rootdir = $rootdir . "/");
     $clientLibraryPath = 'engine/libs/video';
     $oldPath = set_include_path($rootdir . $clientLibraryPath);
     Zend_Loader::loadClass('Zend_Gdata_YouTube');
     parent::__construct();
     $string = "CREATE TABLE IF NOT EXISTS `Videos` (\n\t\t\t  `id` int(11) NOT NULL,\n\t\t\t  `videoID` varchar(255) DEFAULT NULL,\n\t\t\t  `title` varchar(255) DEFAULT NULL,\n\t\t\t  `comment` varchar(500) DEFAULT NULL,\n\t\t\t  `user` int(11) NOT NULL,\n\t\t\t  `sqrty` int(11) DEFAULT NULL,\n\t\t\t  `sq_list` varchar(1000) NOT NULL,\n\t\t\t  PRIMARY KEY (`id`)\n\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=cp1251 ;";
     $this->_sql->query($string);
 }
Esempio n. 6
0
 public function __construct($id = NULL)
 {
     parent::__construct();
     secureStartSession();
     if ($id == NULL || $id == $_SESSION["user"]["id"]) {
         $this->setData($_SESSION["user"]);
         $this->isOnline = true;
         $this->checkLastTime(self::$updateInterval);
     } else {
         try {
             $this->setData($this->getDataFromDb($id));
         } catch (Exception $ex) {
             throw new UserException($id, UserException::USR_NOT_EXSIST);
         }
     }
 }
Esempio n. 7
0
 /**
  * Получает группу по ID и её заголовок
  * 
  * @param mixed $groupId
  * @param mixed $title
  * @return Group
  */
 public function __construct($groupId, $title)
 {
     parent::__construct();
     $this->id = $groupId;
     $this->title = $title;
 }
Esempio n. 8
0
 /**
  * Конструктор
  * 
  */
 public function __construct()
 {
     secureStartSession();
     parent::__construct();
 }
 */
require_once 'ODataConnectorForMySQL/Common/ClassAutoLoader.php';
use Doctrine\DBAL\Configuration;
use ODataConnectorForMySQL\EDMXGenerator\IEDMXGenerator;
use ODataConnectorForMySQL\EDMXGenerator\EDMXGenerator;
use ODataConnectorForMySQL\EDMXGenerator\ConnectionParams;
use ODataConnectorForMySQL\Common\ServiceConfig;
use ODataConnectorForMySQL\Common\ODataConnectorForMySQLConstants;
use ODataConnectorForMySQL\Common\ODataConnectorForMySQLException;
ODataConnectorForMySQL\Common\ClassAutoLoader::register();
//set_include_path('/var/www/doctrine-orm');
define('OUT_DIR', '/ODataConnectorForMySQL/OutputFiles');
define('XSL_DIR', '/ODataConnectorForMySQL/ProvidersGenerator');
define('CONFIG_FILE', '/ODataConnectorForMySQL/service.config.xml');
try {
    $util = new MySQLConnector($argv);
    $options = $util->getOptions();
    $stage = $util->validateAndBuidOptions();
    $currentDir = str_replace("\\", "/", dirname(__FILE__));
    $serviceOutDir = $currentDir . OUT_DIR . "/" . $util->options['serviceName'];
    $serviceXslDir = $currentDir . XSL_DIR;
    $configFileName = $currentDir . CONFIG_FILE;
    if ($stage === 1 or $stage === 2) {
        $util->options['driver'] = 'pdo_mysql';
        if (!is_dir($serviceOutDir)) {
            mkdir($serviceOutDir, 0777);
        }
        if ($stage === 1) {
            $util->generateEDMX($serviceOutDir);
        }
        $util->generateProviders($serviceOutDir, $serviceXslDir, $configFileName, $stage);
Esempio n. 10
0
 /**
  * Конструктор
  * 
  * @param integer $id Необязательный параметр. Если NULL, то берутся данные
  * пользователя который вошёл в систему (сессии), иначе по ID другого пользователя
  * @return User
  */
 public final function __construct($id = NULL)
 {
     if (self::$instance != true) {
         throw new UserException(UserException::CREATION, 0);
     }
     MySQLConnector::__construct();
     secureStartSession();
     if ($id == NULL || $id == $_SESSION["user"]["id"]) {
         if (!isset($_SESSION["user"])) {
             $userSignOut = new UserSignInOut();
             if ($userSignOut->checkIfSave()) {
                 $uId = (int) $_COOKIE["id"];
                 $this->_sql->query("SELECT `mail`,`password` FROM `SITE_USERS` WHERE `id`={$uId}");
                 $secArr = $this->_sql->GetRows();
                 $mailSec = $secArr[0]["mail"];
                 $pass = $secArr[0]["password"];
                 if (md5($uId) . md5($mailSec) != $_COOKIE["sec"]) {
                     throw new UserException("", UserException::USR_NOT_AUTENT);
                 } else {
                     $userSignOut->authentication($mailSec, $pass, false, true);
                     $this->setData($_SESSION["user"]);
                     $this->isOnline = true;
                 }
             } else {
                 throw new UserException("", UserException::USR_NOT_AUTENT);
             }
         } else {
             $this->setData($_SESSION["user"]);
             $this->isOnline = true;
             $this->checkLastTime(parent::$updateInterval);
         }
     } else {
         try {
             $this->other = true;
             $this->setData($this->getDataFromDb($id));
         } catch (Exception $ex) {
             throw new UserException($id, UserException::USR_NOT_EXSIST);
         }
     }
 }
Esempio n. 11
0
 public function __construct(User &$user)
 {
     parent::__construct();
     $this->_userId = $user->id;
     $this->_perm = new AccessLevelRights($this->getPermissions());
 }
Esempio n. 12
0
 /**
  * Конструктор. Получает текущее время
  * 
  * @param integer $time Текущее время в секундах
  * @return Finder
  */
 public function __construct($time)
 {
     parent::__construct();
     $this->_time = $time;
 }
Esempio n. 13
0
 /**
  * Конструктор
  * 
  */
 public function __construct()
 {
     parent::__construct();
     $user = UserFull::create();
     $this->_curentId = $user->id;
 }
Esempio n. 14
0
 public function __construct()
 {
     parent::__construct();
     $this->_user = new UserFull();
     $this->_id = $this->_user->id;
 }
Esempio n. 15
0
 public function __construct($id = NULL)
 {
     parent::__construct();
     $this->_id = (int) $id;
 }
Esempio n. 16
0
 public function __construct($id)
 {
     parent::__construct();
     $this->_userId = $id;
 }