• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Constants类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Constants的典型用法代码示例。如果您正苦于以下问题:PHP Constants类的具体用法?PHP Constants怎么用?PHP Constants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Constants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger, $ordVerdDAO, $merknadDAO)
 {
     parent::__construct(Constants::getXMLFilename('NOARKSAK'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger);
     $this->ordVerdDAO = $ordVerdDAO;
     $this->merknadDAO = $merknadDAO;
     $this->selectQuery = "select JOURAARNR, JOURAAR, JOURNR, PAPIR, AAPNET, INNH1, INNH2, MERKNAD, U1, STATUS, FYSARK, FRAARKDEL, SAKTYPE, SAKART, JOURENHET, OTYPE, OKODE1, UNAVN, ADMID, SBHID, UNNTOFF, HJEMMEL from " . $SRC_TABLE_NAME . "";
 }
开发者ID:KDRS-DEVELOP,项目名称:noark4-uttrekk-php,代码行数:7,代码来源:NoarkSakDAO.php


示例2: beforeAction

    /**
     * Before action load knight data of user
     * @param unknown_type $action
     */
    public function beforeAction($action)
    {
        //Load user's knight data
        if (!Yii::app()->user->isGuest) {
            $this->user_data['knights'] = Knights::model()->with('knightsCard', 'knightsStats')->find('id=:id', array(':id' => Yii::app()->user->knights_id));
            $this->user_data['knights_card'] =& $this->user_data['knights']->knightsCard;
            //Load stats of knight
            $this->user_data['knights_stats'] =& $this->user_data['knights']->knightsStats;
            //Load if user has new friendship request
            $sql = 'SELECT friends.id as id, k1.name as name, k1.avatars_id as avatars_id FROM friends
					INNER JOIN users ON users.id = friends.from_user
					INNER JOIN knights as k1 ON k1.users_id = users.id
					WHERE friends.status = :status AND to_user = :users_knights_id1
					ORDER BY start_date DESC';
            $command = Yii::app()->db->createCommand($sql);
            $command->bindValue(':status', Friends::STATUS_ONWAITING, PDO::PARAM_INT);
            $command->bindValue(':users_knights_id1', $this->user_data['knights']->id, PDO::PARAM_INT);
            $this->user_data['knights_new_friends'] = $command->queryAll();
            //Load last messages
            $this->user_data['new_messages'] = Messages::getNewMessages(Yii::app()->user->users_id);
            //Load all attributes name attributes
            $this->app_data['attribute_list'] = Constants::model()->findAll('type=:type', array(':type' => Constants::KNIGHTS_ATTRIBUTES));
        }
        return true;
    }
开发者ID:RubenDjOn,项目名称:medieval-jousting-tournaments,代码行数:29,代码来源:YellowPagesController.php


示例3: action_index

 /**
  * @author Thuanth6589 <[email protected]>
  * action create/edit user
  * @return mixed
  */
 public function action_index()
 {
     $data = array();
     $user_id = Input::get('user_id');
     if (isset($user_id)) {
         $data['user'] = \Model_Muser::find_by_pk($user_id);
         if (!isset($data['user'])) {
             Session::set_flash('error', 'ユーザが存在しません');
             return Response::redirect('/master/users');
         }
     }
     if (Input::method() == 'POST') {
         $url = Session::get('users_url') ? Session::get('users_url') : Uri::base() . 'master/users';
         $user_id = Input::post('user_id', null);
         if ($user_id && !\Model_Muser::find_by_pk($user_id)) {
             Session::set_flash('success', 'ユーザーは存在しません');
             return Response::redirect($url);
         }
         $user = new \Model_Muser();
         $fields = $user->set_data(Input::post());
         $check = $user->validate_unique_login_id($fields['login_id'], isset($fields['user_id']) ? $fields['user_id'] : null);
         if ($check && $user->save_data($fields)) {
             Session::set_flash('success', \Constants::$message_create_success);
             return Response::redirect($url);
         }
         $message = \Constants::$message_create_error;
         if (!$check) {
             $message = '入力したIDは既存に存在してます。';
         }
         Session::set_flash('error', $message);
     }
     $data['department'] = \Constants::get_create_department();
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('user', $data);
 }
开发者ID:huylv-hust,项目名称:uosbo,代码行数:40,代码来源:user.php


示例4: action_index

 /**
  * @author Thuanth6589 <[email protected]>
  * list media
  */
 public function action_index()
 {
     $m_group = new \Model_Mgroups();
     $m_partner = new \Model_Mpartner();
     $tmp = array('' => 'その他');
     $data['groups'] = $tmp + (new \Model_Mgroups())->get_type(2);
     $data['partners'] = $this->_partners;
     $filters = Input::get();
     $query_string = empty($filters) ? '' : '?' . http_build_query($filters);
     Session::set('medias_url', Uri::base() . 'master/medias' . $query_string);
     if (isset($filters['m_group_id']) && $filters['m_group_id']) {
         $data['partners'] += array_column($m_partner->get_partner_group($filters['m_group_id'], $this->_partner_type), 'branch_name', 'partner_code');
     }
     $m_media = new \Model_Mmedia();
     $m_post = new \Model_Mpost();
     $data['count_media'] = $m_media->count_data($filters);
     $pagination = \Uospagination::forge('pagination', array('pagination_url' => Uri::base() . 'master/medias' . $query_string, 'total_items' => $data['count_media'], 'per_page' => \Constants::$default_limit_pagination, 'num_links' => \Constants::$default_num_links, 'uri_segment' => 'page', 'show_last' => true));
     $filters['offset'] = $pagination->offset;
     $filters['limit'] = $pagination->per_page;
     $medias = $m_media->get_data($filters);
     foreach ($medias as $media) {
         $media->count_post = $m_post->count_by_media_id($media->m_media_id);
     }
     $data['pagination'] = $pagination;
     $data['medias'] = $medias;
     $data['type'] = \Constants::$media_type;
     $data['classification'] = \Constants::get_search_media_classification();
     $data['filters'] = $filters;
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('medias', $data);
 }
开发者ID:huylv-hust,项目名称:uosbo,代码行数:35,代码来源:medias.php


示例5: __construct

 public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger, $utvSakDAO, $utvBehDoDAO)
 {
     parent::__construct(Constants::getXMLFilename('UTVBEH'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger);
     $this->selectQuery = "select UTVID, BEHID, JOURAARNR, BEHNR, MOTEID, SAKSNR, SAKSAAR, STATUS, PROTOKOLL from " . $SRC_TABLE_NAME . "";
     $this->utvSakDAO = $utvSakDAO;
     $this->utvBehDoDAO = $utvBehDoDAO;
 }
开发者ID:KDRS-DEVELOP,项目名称:noark4-uttrekk-php,代码行数:7,代码来源:UtvBehDAO.php


示例6: __construct

 public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger)
 {
     parent::__construct(Constants::getXMLFilename('UTVMOTE'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger);
     $this->selectQuery = "select ID, MOTENR, UTVID, LUKKET, MOTEDATO, MOTETID, FRIST, SAKSKART, PROTOKOLL, JOURAARNR FROM " . $SRC_TABLE_NAME . "";
     // Yes $SRC_TABLE_NAME is wrong but I need to finish this!!!
     $this->utvMoteDokDAO = new UtvMoteDokDAO($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger);
 }
开发者ID:KDRS-DEVELOP,项目名称:noark4-uttrekk-php,代码行数:7,代码来源:UtvMoteDAO.php


示例7: init

 public function init()
 {
     Constants::$host = self::$host;
     Constants::$pass = self::$pass;
     Constants::$user = self::$user;
     Constants::$database = self::$database;
 }
开发者ID:awwthentic1234,项目名称:hey,代码行数:7,代码来源:ProjectGlobal.php


示例8: __construct

 public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger)
 {
     parent::__construct(Constants::getXMLFilename('TLKODE'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger);
     $this->selectQuery = "select TILLEGSK, EKODE3, ETEXT3  from " . $SRC_TABLE_NAME . " group by TILLEGSK, EKODE3, ETEXT3 ORDER BY TILLEGSK";
     $this->logger->log($this->XMLfilename, "Created based on following query. select TILLEGSK, EKODE3, ETEXT3  from dgjmjo group by TILLEGSK, EKODE3, ETEXT3 ORDER BY TILLEGSK", Constants::LOG_INFO);
     $this->logger->log($this->XMLfilename, "This will not be correct if tilleggskoder are used that are not part of K-Koder. Manual check in DGJMJO.TILLEGSK advised.", Constants::LOG_TODO);
 }
开发者ID:KDRS-DEVELOP,项目名称:noark4-uttrekk-php,代码行数:7,代码来源:TlKodeDAO.php


示例9: actionGo

 public function actionGo()
 {
     if (isset($_POST)) {
         $val = $_POST['constant'];
         Constants::model()->setCvalue('dayup', $val);
     }
     $this->render('go', array('model' => $val));
 }
开发者ID:emisdb,项目名称:myii,代码行数:8,代码来源:DefaultController.php


示例10: auth_exists

function auth_exists()
{
    $path = Constants::GET_CONFIG_DIRECTORY() . '/cred.php';
    if (file_exists($path)) {
        return true;
    } else {
        return false;
    }
}
开发者ID:alexaylwin,项目名称:alexaylwin.com,代码行数:9,代码来源:util.php


示例11: perform

 function perform()
 {
     if (!is_writable($this->config->get('data_dir'))) {
         $this->ae->add('error', $this->config->get('data_dir') . 'に書き込み権限がありません');
         return 'error';
     }
     $constants = new Constants();
     $constants->set('C_ADMIN_PASS', md5($this->af->get('admin_pass')));
     $constants->set('C_ADMIN_MAIL', $this->af->get('admin_mail'));
     $constants->set('C_AUTO_SELECT', '0');
     $fp = fopen($this->config->get('config_file'), 'w+b');
     if (!$fp || !fwrite($fp, $constants->toString())) {
         $this->ae->add('error', $this->config->get('config_file') . 'に書き込めませんでした');
         return 'error';
     }
     fclose($fp);
     return 'login';
 }
开发者ID:hiroki-namekawa,项目名称:test-upr,代码行数:18,代码来源:HelloDo.php


示例12: __construct

 public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $kommuneName, $logger)
 {
     parent::__construct(Constants::getXMLFilename('DOKLINK'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger);
     $this->selectFromFilerQuery = "select REFAARNR, DOKID, FILNOKKEL, OPPRETTETDATO, OPPRETTETAVID, FILNR, AKTIV from FILER WHERE REFAARNR = '";
     $this->selectFromVedleggQuery = "select REFAARNR, VEDLNR, BESKRIVELSE, DOKID, DOKNAVN, DOKODE, TKDATO, TKAV, PAPIR, LOKPAPIR, DOKSTATUS, DOKKAT, PNID, GRUPPE, GRUPPEID, UNNTOFF, HJEMMEL, AVGRADER, AGDATO from DGJMVEDLEGG WHERE REFAARNR = '";
     $this->kommuneName = $kommuneName;
     $this->dokVersDAO = new DokVersDAO($this->srcBase, $this->uttrekksBase, "", $kommuneName, $logger);
     $this->dokBeskDAO = new DokBeskDAO($this->srcBase, $this->uttrekksBase, "", $kommuneName, $logger);
 }
开发者ID:KDRS-DEVELOP,项目名称:noark4-uttrekk-php,代码行数:9,代码来源:DokLinkDAO.php


示例13: __construct

 function __construct()
 {
     $this->form_fields = array();
     $this->use_bootstrap = false;
     $this->bootstrap_form_orientation = "horizontal";
     $this->form_method = "POST";
     $this->form_action = "";
     $this->constants = Constants::getInstance();
 }
开发者ID:ijos,项目名称:iforms,代码行数:9,代码来源:iForm.php


示例14: init

 public static function init()
 {
     Constants::$host = self::$host;
     Constants::$pass = self::$pass;
     Constants::$user = self::$user;
     Constants::$database = self::$database;
     UploadHandler::$projectFilesPath = ProjectGlobal::$projectFilesPath;
     UploadHandler::$rootFilesPath = "/upload/generated_files/";
 }
开发者ID:awwthentic1234,项目名称:hey,代码行数:9,代码来源:ProjectGlobal.php


示例15: test_Constants

 function test_Constants()
 {
     $this->dir('Constants');
     $original = file_get_contents($this->dir() . 'in.css');
     $expected = file_get_contents($this->dir() . 'out.css');
     $css = Constants::pre_process($original);
     $css = Constants::replace($css);
     $this->assertEqual($css, $expected);
 }
开发者ID:behaba,项目名称:csscaffold,代码行数:9,代码来源:Scaffold_Modules.php


示例16: main

function main()
{
    $g = Constants::gen1();
    var_dump($g->current());
    $g = Constants::gen2();
    var_dump($g->current());
    $g = Constants::gen3("baz");
    var_dump($g->current());
}
开发者ID:badlamer,项目名称:hhvm,代码行数:9,代码来源:static_functions.php


示例17: redefine

 public static function redefine($name, $value)
 {
     if (\XLib\Engine::extLoaded('uopz')) {
         if (Constants::exists($name)) {
             uopz_undefine($name);
             Constants::define($name, $value);
         }
     }
     return false;
 }
开发者ID:xpence,项目名称:portfolio,代码行数:10,代码来源:XLibConstants.php


示例18: saveBlock

 public function saveBlock()
 {
     $io = new FileIO();
     //Build the file name from the bucket path (includes the bucket extension)
     //and the block id.
     $filename = Constants::GET_PAGES_DIRECTORY() . '/' . $this->getBucketId() . '/' . $this->getBlockId() . '.incl';
     $serialized = serialize($this);
     $io = new FileIO();
     $io->writeFile($filename, $serialized);
 }
开发者ID:alexaylwin,项目名称:alexaylwin.com,代码行数:10,代码来源:Block.php


示例19: init

 public function init()
  {
     $this->n_str = Constants::model()->getCvalue('nstr_'.Yii::app()->user->uid);
     $this->n_fin = Constants::model()->getCvalue('nfin_'.Yii::app()->user->uid);
     $this->n_nom = Constants::model()->getCvalue('nnom_'.Yii::app()->user->uid);
     $this->n_art = Constants::model()->getCvalue('nart_'.Yii::app()->user->uid);
     $this->n_quant = Constants::model()->getCvalue('nquant_'.Yii::app()->user->uid);
     $this->n_price = Constants::model()->getCvalue('nprice_'.Yii::app()->user->uid);
     $this->department = Constants::model()->getCvalue('dep_'.Yii::app()->user->uid);
     $this->client = Constants::model()->getCvalue('cli_'.Yii::app()->user->uid);
  }
开发者ID:emisdb,项目名称:gena_0,代码行数:11,代码来源:FileRead.php


示例20: main

function main()
{
    $g = Constants::genA();
    $g = Constants::genB($g);
    $g = Constants::genC($g);
    $g = Constants::genD($g);
    $g = Constants::genE($g);
    $g = Constants::genF($g);
    $g = Constants::genG($g);
    $g = Constants::genH($g);
    var_dump($g->current());
}
开发者ID:badlamer,项目名称:hhvm,代码行数:12,代码来源:multi_static.php



注:本文中的Constants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ConstraintChain类代码示例发布时间:2022-05-23
下一篇:
PHP Console_Getopt类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap