当前位置: 首页>>代码示例>>PHP>>正文


PHP FreePBX::Create方法代码示例

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


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

示例1: sql

function sql($sql, $type = "query", $fetchmode = 'default')
{
    global $db;
    if (empty($db) || !is_object($db) || get_class($db) != "DB") {
        $dbh = FreePBX::Create()->Database();
        $db = new DB($dbh);
    }
    switch ($fetchmode) {
        case 'DB_FETCHMODE_ASSOC':
            //You guessed it, looking for string constants!
        //You guessed it, looking for string constants!
        case DB_FETCHMODE_ASSOC:
            //simulate craptacular function from previous versions
            //that didn't even work correctly! sweet :-/
            //(The integer shouldnt go there)
            if ($type == 'getAssoc') {
                $results = $db->{$type}($sql, true);
            } else {
                $results = $db->{$type}($sql, array(), DB_FETCHMODE_ASSOC);
            }
            break;
        case DB_FETCHMODE_ORDERED:
            $results = $db->{$type}($sql, array(), DB_FETCHMODE_ORDERED);
            break;
        case 'default':
            $results = $db->sql($sql, $type);
            break;
        default:
            throw new Exception("Unknown SQL fetchmode of {$fetchmode}");
            break;
    }
    return $results;
}
开发者ID:powerpbx,项目名称:framework,代码行数:33,代码来源:sql.functions.php

示例2: configure

 protected function configure()
 {
     $this->setName('motd')->setDescription(_('Prints MOTD'))->setDefinition(array(new InputArgument('args', InputArgument::IS_ARRAY, null, null)));
     //banners should be base64 encoded, Why? Because php likes to randomly shift multiline variables. Also makes it all look super cryptic :-/
     $this->banner = "IF9fX19fICAgICAgICAgICAgICBfX19fICBfX19fX18gIF9fDQp8ICBfX198IF9fIF9fXyAgX19ffCAgXyBcfCBfXyApIFwvIC8NCnwgfF8gfCAnX18vIF8gXC8gXyBcIHxfKSB8ICBfIFxcICAvIA0KfCAgX3x8IHwgfCAgX18vICBfXy8gIF9fL3wgfF8pIC8gIFwgDQp8X3wgIHxffCAgXF9fX3xcX19ffF98ICAgfF9fX18vXy9cX1wgICAgIA==";
     $this->supporturl = 'http://www.freepbx.org/support-and-professional-services';
     $this->FreePBX = \FreePBX::Create();
 }
开发者ID:powerpbx,项目名称:framework,代码行数:8,代码来源:Motd.class.php

示例3: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $FreePBX = \FreePBX::Create();
     $args = $input->getArgument('args');
     session_id($args[0]);
     session_start();
     $output->writeln(sprintf(_('Unlocking: %s'), $args[0]));
     if (!isset($_SESSION["AMP_user"])) {
         $_SESSION["AMP_user"] = new \ampuser('fwconsole');
         $_SESSION["AMP_user"]->setAdmin();
         $output->writeln(_('Session Should be unlocked now'));
     }
 }
开发者ID:powerpbx,项目名称:framework,代码行数:13,代码来源:Unlock.class.php

示例4: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $FreePBX = \FreePBX::Create();
     $args = $input->getArgument('args');
     //If we don't have a session file, it is probably not a valid session
     if (!file_exists(session_save_path() . '/sess_' . $args[0])) {
         $output->writeln(sprintf(_('Unlocking: %s Failed, Invalid session'), $args[0]));
         return;
     }
     session_id($args[0]);
     session_start();
     $output->writeln(sprintf(_('Unlocking: %s'), $args[0]));
     if (!isset($_SESSION["AMP_user"])) {
         $_SESSION["AMP_user"] = new \ampuser('fwconsole');
         $_SESSION["AMP_user"]->setAdmin();
         $output->writeln(_('Session Should be unlocked now'));
     }
 }
开发者ID:lidl,项目名称:framework,代码行数:18,代码来源:Unlock.class.php

示例5: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $args = $input->getArgument('args');
     $FreePBX = \FreePBX::Create();
     $astMan = $FreePBX->astman;
     if ($astMan->connected()) {
         $astMan->Command('dialplan reload');
         $res = $astMan->Command('dialplan show ' . $args[0]);
         $lines = explode("\n", $res['data']);
         $output->writeln('Context ' . $args[0] . ': ');
         foreach ($lines as $line) {
             if (strpos($line, '=>')) {
                 $i++;
                 $output->writeln($line);
             }
         }
         if ($i < 1) {
             $output->writeln(_('May be invalid Check your spelling'));
         }
     }
 }
开发者ID:powerpbx,项目名称:framework,代码行数:21,代码来源:Context.class.php

示例6: abortShutdown

 private function abortShutdown($output)
 {
     $freepbx = \FreePBX::Create();
     $astman = $freepbx->astman;
     if (is_object($astman) && $astman->Connected()) {
         $astman->send_request('Command', array('Command' => 'core abort shutdown'));
     }
 }
开发者ID:lidl,项目名称:framework,代码行数:8,代码来源:Stop.class.php


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