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

PHP System类代码示例

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

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



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

示例1: handle

 /**
  * {@inheritdoc}
  */
 public function handle(\Input $input)
 {
     $this->handleRunOnce();
     // PATCH
     if ($input->post('FORM_SUBMIT') == 'database-update') {
         $count = 0;
         $sql = deserialize($input->post('sql'));
         if (is_array($sql)) {
             foreach ($sql as $key) {
                 if (isset($_SESSION['sql_commands'][$key])) {
                     $this->Database->query(str_replace('DEFAULT CHARSET=utf8;', 'DEFAULT CHARSET=utf8 COLLATE ' . $GLOBALS['TL_CONFIG']['dbCollation'] . ';', $_SESSION['sql_commands'][$key]));
                     $count++;
                 }
             }
         }
         $_SESSION['sql_commands'] = array();
         Messages::addConfirmation(sprintf($GLOBALS['TL_LANG']['composer_client']['databaseUpdated'], $count));
         $this->reload();
     }
     /** @var \Contao\Database\Installer $installer */
     $installer = \System::importStatic('Database\\Installer');
     $form = $installer->generateSqlForm();
     if (empty($form)) {
         Messages::addInfo($GLOBALS['TL_LANG']['composer_client']['databaseUptodate']);
         $this->redirect('contao/main.php?do=composer');
     }
     $form = preg_replace('#(<label for="sql_\\d+")>(CREATE TABLE)#', '$1 class="create_table">$2', $form);
     $form = preg_replace('#(<label for="sql_\\d+")>(ALTER TABLE `[^`]+` ADD)#', '$1 class="alter_add">$2', $form);
     $form = preg_replace('#(<label for="sql_\\d+")>(ALTER TABLE `[^`]+` DROP)#', '$1 class="alter_drop">$2', $form);
     $form = preg_replace('#(<label for="sql_\\d+")>(DROP TABLE)#', '$1 class="drop_table">$2', $form);
     $template = new \BackendTemplate('be_composer_client_update');
     $template->composer = $this->composer;
     $template->form = $form;
     return $template->parse();
 }
开发者ID:contao-community-alliance,项目名称:composer-client,代码行数:38,代码来源:UpdateDatabaseController.php


示例2: executeImpact

 /**
  * @see AbstractFleetEventHandler::executeImpact()
  */
 public function executeImpact()
 {
     // check colonies
     $sql = "SELECT COUNT(*) AS count\r\n\t\t\t\tFROM ugml_planets\r\n\t\t\t\tWHERE planetKind = 1\r\n\t\t\t\t\tAND id_owner = " . $this->ownerID;
     $count = WCF::getDB()->getFirstRow($sql);
     // get existing planet
     $system = new System($this->galaxy, $this->system);
     $planetObj = $system->getPlanet($this->planet);
     // restricted by planet limit
     if ($count['count'] >= self::MAX_PLANETS) {
         $this->message = 'planetLimit';
         return;
     }
     // planet exists
     if ($planetObj !== null) {
         $this->message = 'exists';
         return;
     }
     // create planet
     --$this->fleet[self::COLONY_SHIP];
     $name = WCF::getLanguage()->get('wot.planet.colony');
     $planet = PlanetEditor::create($this->galaxy, $this->system, $this->planet, $name, $this->ownerID, self::DEFAULT_METAL, self::DEFAULT_CRYSTAL, self::DEFAULT_DEUTERIUM, 1, time(), self::DEFAULT_FIELDS, null);
     $planet->getEditor()->changeResources($this->metal, $this->crystal, $this->deuterium);
     $planet->getEditor()->changeLevel($this->fleet);
     $this->getEditor()->delete();
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:29,代码来源:ColonizeFleet.class.php


示例3: OLE_PPS_Root

 /**
  * Constructor
  *
  * @access public
  * @param integer $time_1st A timestamp
  * @param integer $time_2nd A timestamp
  */
 function OLE_PPS_Root($time_1st, $time_2nd, $raChild)
 {
     $_ole = new OLE();
     $_sys = new System();
     $this->_tmp_dir = $_sys->tmpdir();
     $this->OLE_PPS(null, $_ole->Asc2Ucs('Root Entry'), OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild);
 }
开发者ID:netcon-source,项目名称:dotspotting,代码行数:14,代码来源:Root.php


示例4: actionIndex

 /**
  * List users and their permissions
  */
 public function actionIndex($p)
 {
     $this->bag->tabs = $this->user->inRooms();
     $system = new System();
     $this->bag->users = $system->userPermissions();
     $this->renderAction('listing');
 }
开发者ID:radekstepan,项目名称:Clubhouse,代码行数:10,代码来源:UsersPresenter.php


示例5: updateplanAction

 public function updateplanAction()
 {
     global $mySession;
     $db = new Db();
     $planId = $this->getRequest()->getParam('planId');
     $this->view->planId = $planId;
     $planData = $db->runQuery("select * from " . SUBSCRIPTIONS . " where plan_id='" . $planId . "'");
     $this->view->planImage = $planData[0]['plan_image'];
     $this->view->pageHeading = "Edit Subscription Plan";
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $myform = new Form_Subscription($planId);
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             $myObj = new System();
             $Result = $myObj->UpdatePlan($dataForm, $planId);
             if ($Result == 1) {
                 $mySession->errorMsg = "Subscription plan updated successfully.";
                 $this->_redirect('subscription/index');
             } else {
                 $mySession->errorMsg = "Subscription plan name you entered is already exists.";
                 $this->view->myform = $myform;
                 $this->render('editplan');
             }
         } else {
             $this->view->myform = $myform;
             $this->render('editplan');
         }
     } else {
         $this->_redirect('subscription/editplan/planId/' . $planId);
     }
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:32,代码来源:SubscriptionController.php


示例6: edittemplateAction

 public function edittemplateAction()
 {
     global $mySession;
     $db = new Db();
     $templateId = $this->getRequest()->getParam('templateId');
     $this->view->templateId = $templateId;
     $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='" . $templateId . "'");
     $myform = new Form_Mailtemplate($templateId);
     $this->view->myform = $myform;
     $this->view->pageHeading = "Edit - " . $templateData[0]['template_title'];
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $myform = new Form_Mailtemplate($templateId);
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             $myObj = new System();
             $Result = $myObj->UpdateTemplate($dataForm, $templateId);
             if (isset($_REQUEST['save_or_send']) && $_REQUEST['save_or_send'] == '2') {
                 $mySession->sucessMsg = "Newsletter successfully saved and sent to all subscribed members.";
             } else {
                 $mySession->sucessMsg = "Email Template updated successfully.";
             }
             $this->_redirect('system/emailtemplates');
         }
     }
     $this->view->myform = $myform;
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:27,代码来源:SystemController.php


示例7: readParametersSpec

 /**
  * @see FleetStartDirectFireAction::readParametersSpec()
  */
 public function readParametersSpec()
 {
     $system = new System($this->galaxy, $this->system);
     $planet = $system->getPlanet($this->planet, 2);
     $resources = $planet->metal + $planet->crystal;
     $recyclers = min(ceil($resources / 20000), Spec::getSpecObj(self::RECYCLER)->level);
     $this->spec[self::RECYCLER] = $recyclers;
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:11,代码来源:GalaxyHarvestAction.class.php


示例8: run

 public function run()
 {
     if (!($this->from_flavor == 'ce' && $this->toFlavor('pro'))) {
         return;
     }
     $system = new System();
     $system->system_key = $this->config['unique_key'];
     $system->user_id = '1';
     $system->last_connect_date = TimeDate::getInstance()->nowDb();
     $system_id = $system->retrieveNextKey(false, true);
     $this->db->query("INSERT INTO config (category, name, value) VALUES ( 'system', 'system_id', '" . $system_id . "')");
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:12,代码来源:4_SetSystemID.php


示例9: getUserByEmail

 /**
  * Get User by usrGmail
  *
  * @param string $usr_gmail Unique id of User
  *
  * return uid
  *
  */
 public function getUserByEmail($usr_gmail)
 {
     //getting the user data
     require_once PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php";
     $oUsers = new \Users();
     $response['user'] = $oUsers->loadByUserEmailInArray($usr_gmail);
     //getting the skin
     require_once PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.system.php";
     $sysConf = new \System();
     $responseSysConfig = $sysConf->getSystemConfiguration(PATH_CONFIG . 'env.ini');
     $response['enviroment'] = $responseSysConfig['default_skin'];
     return $response;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:21,代码来源:Pmgmail.php


示例10: getValue

 /**
  * 
  * Enter description here ...
  * @return multitype:System
  */
 public static function getValue()
 {
     $dbh = $GLOBALS['dbh'];
     $results = array();
     $sql = "\n\t\t\tSELECT \n\t\t\t\t*\n\t\t\tFROM \n\t\t\t\tsystem\n\t\t";
     foreach ($dbh->query($sql) as $r) {
         $row = new System();
         $row->set_var($r['var']);
         $row->set_val($r['val']);
         $results[] = $row;
     }
     return $results;
 }
开发者ID:nguyentien,项目名称:ps3,代码行数:18,代码来源:system.class.php


示例11: getTargetPlanet

 /**
  * Returns the planet object of the target planet.
  * 
  * @return	Planet
  */
 protected function getTargetPlanet()
 {
     if ($this->planetObj === null) {
         $system = new System($this->galaxy, $this->system);
         $this->planetObj = $system->getPlanet($this->planet, $this->planetType);
         $this->fleetQueue->storePlanet($this->planetObj);
         $this->fleetQueue->galaxy = $this->galaxy;
         $this->fleetQueue->system = $this->system;
         $this->fleetQueue->planet = $this->planet;
         $this->fleetQueue->planetType = $this->planetType;
     }
     return $this->planetObj;
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:18,代码来源:FleetStartResourcesForm.class.php


示例12: formAddNovaCategoria

 public function formAddNovaCategoria()
 {
     $sys = new System();
     $params = $sys->getParam();
     //VERIFICA SE VEIO ALGUM CÓDIGO DE ERRO OU DE SUCESSO POR PARÂMETRO NA URL
     $erro = array_key_exists('erro', $params) ? $params['erro'] : 0;
     $sucesso = array_key_exists('sucesso', $params) ? $params['sucesso'] : 0;
     $categorias = new categoriaModel();
     $categorias->buscaCategoriasOrderBy($categorias, 'datacad', 'desc');
     $categorias = $categorias->retornaDados('assoc');
     $dados = array('titulo' => NOMESITE, 'tela' => 'produtos/formAddNovaCategoria', 'erro' => $erro, 'sucesso' => $sucesso, 'categorias' => $categorias);
     $this->view('camadasadmin', $dados);
 }
开发者ID:mozelli,项目名称:brcompras,代码行数:13,代码来源:admin.php


示例13: run

 /**
  * Generate the module
  *
  * @return string
  */
 public function run()
 {
     /** @var BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_maintenance_mode');
     $objTemplate->action = ampersand(\Environment::get('request'));
     $objTemplate->headline = $GLOBALS['TL_LANG']['tl_maintenance']['maintenanceMode'];
     $objTemplate->isActive = $this->isActive();
     try {
         $driver = \System::getContainer()->get('lexik_maintenance.driver.factory')->getDriver();
         $isLocked = $driver->isExists();
     } catch (\Exception $e) {
         return '';
     }
     // Toggle the maintenance mode
     if (\Input::post('FORM_SUBMIT') == 'tl_maintenance_mode') {
         if ($isLocked) {
             $driver->unlock();
         } else {
             $driver->lock();
         }
         $this->reload();
     }
     if ($isLocked) {
         $objTemplate->class = 'tl_confirm';
         $objTemplate->explain = $GLOBALS['TL_LANG']['MSC']['maintenanceEnabled'];
         $objTemplate->submit = $GLOBALS['TL_LANG']['tl_maintenance']['maintenanceDisable'];
     } else {
         $objTemplate->class = 'tl_info';
         $objTemplate->explain = $GLOBALS['TL_LANG']['MSC']['maintenanceDisabled'];
         $objTemplate->submit = $GLOBALS['TL_LANG']['tl_maintenance']['maintenanceEnable'];
     }
     return $objTemplate->parse();
 }
开发者ID:contao,项目名称:core-bundle,代码行数:38,代码来源:Maintenance.php


示例14: invokeHandler

 protected function invokeHandler()
 {
     $specific = array();
     $size = getimagesize($this->file->getAbsPath());
     if ($size !== false) {
         $specific['imagesize'] = $size[0] . ' x ' . $size[1] . ' px';
     } else {
         $specific['imagesize'] = System::getLanguage()->_('Unknown');
     }
     if (extension_loaded('imagick') && class_exists('Imagick')) {
         try {
             $i = new Imagick($this->file->getAbsPath());
             $specific['format'] = $i->getimageformat();
         } catch (Exception $e) {
             Log::handleException($e, false);
             if ($this->file->ext == "svg") {
                 Log::sysLog('ImageHandler', '"librsvg" is not installed. Without it Imagick could not handle .svg files!');
             }
         }
     } else {
         $specific['format'] = System::getLanguage()->_('Unknown');
     }
     $this->smarty->assign('specific', $specific);
     $this->smarty->display('handler/image.tpl');
 }
开发者ID:nicefirework,项目名称:sharecloud,代码行数:25,代码来源:ImageHandler.class.php


示例15: __construct

 /**
  * Initialize the controller
  *
  * 1. Import the user
  * 2. Call the parent constructor
  * 3. Authenticate the user
  * 4. Load the language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->User->authenticate();
     \System::loadLanguageFile('default');
 }
开发者ID:eknoes,项目名称:core,代码行数:16,代码来源:BackendPage.php


示例16: upimage

 public function upimage()
 {
     //System::load_app_class('Uploader','','no');
     //上传图片框中的描述表单名称,
     //$title = htmlspecialchars($_POST['pictitle'], ENT_QUOTES);
     //$path = htmlspecialchars($_POST['dir'], ENT_QUOTES);
     if (!isset($_POST['pictitle']) && !isset($_FILES['upfile'])) {
         exit;
     }
     $title = $_POST['pictitle'];
     $path = G_UPLOAD . 'shopimg/';
     System::load_sys_class('upload', 'sys', 'no');
     upload::upload_config(array('png', 'jpg', 'jpeg', 'gif'), 500000, 'shopimg');
     upload::go_upload($_FILES['upfile']);
     if (!upload::$ok) {
         $url = '';
         $title = $title;
         $originalName = '';
         $state = upload::$error;
     } else {
         $url = G_UPLOAD_PATH . '/shopimg/' . upload::$filedir . "/" . upload::$filename;
         $title = $title;
         $originalName = '';
         $state = 'SUCCESS';
     }
     echo "{'url':'" . $url . "','title':'" . $title . "','original':'" . $originalName . "','state':'" . $state . "'}";
     //{'url':'upload/20130728/13749880933714.jpg','title':'梨花.jpg','original':'梨花.jpg','state':'SUCCESS'}
 }
开发者ID:ping199143,项目名称:1ydb,代码行数:28,代码来源:ueditor.action.php


示例17: handler

 /**
  * Handles an error.
  *
  * @param integer $errno      Number of the error.
  * @param string  $errstr     Error message.
  * @param string  $errfile    Filename where the error occurred.
  * @param integer $errline    Line of the error.
  * @param string  $errcontext Context of the error.
  *
  * @return boolean
  */
 public function handler($errno, $errstr, $errfile = '', $errline = 0, $errcontext = null)
 {
     $this->setupHandler($errno, $errstr, $errfile, $errline, $errcontext);
     // Notify all loggers
     $this->eventManager->notify($this->event->setArgs(array('trace' => $this->trace, 'type' => $this->type, 'errno' => $this->errno, 'errstr' => $this->errstr, 'errfile' => $this->errfile, 'errline' => $this->errline, 'errcontext' => $this->errcontext)));
     if ($this->isPHPError() && System::isDevelopmentMode() && $this->showPHPErrorHandler()) {
         // allow PHP to return error
         $this->resetHandler();
         return false;
     }
     if (!$this->isDisplayErrorTemplate()) {
         // prevent PHP from handling the event after we return
         $this->resetHandler();
         return true;
     }
     // obey reporing level
     if (abs($this->getType()) > $this->serviceManager['log.display_level']) {
         return false;
     }
     // unless in development mode, exit.
     if (!$this->serviceManager['log.display_template']) {
         return false;
     }
     // if we get this far, display template
     echo ModUtil::func('Errors', 'user', 'system', array('type' => $this->errno, 'message' => $this->errstr, 'file' => $this->errfile, 'line' => $this->errline));
     Zikula_View_Theme::getInstance()->themefooter();
     System::shutDown();
 }
开发者ID:projectesIF,项目名称:Sirius,代码行数:39,代码来源:Standard.php


示例18: skinList

function skinList()
{
    G::loadClass('system');
    $skinList = System::getSkingList();
    $wildcard = '';
    if (isset($_REQUEST['activeskin'])) {
        $wildcard = '@';
    }
    $filterList = array();
    if (defined('PARTNER_FLAG')) {
        $filterList = array('00000000000000000000000000000001', '00000000000000000000000000000002');
    }
    foreach ($skinList['skins'] as $key => $value) {
        if (!isset($value['SKIN_ID']) || !in_array($value['SKIN_ID'], $filterList)) {
            if ($value['SKIN_FOLDER_ID'] != 'simplified' && $value['SKIN_FOLDER_ID'] != 'uxs' && $value['SKIN_FOLDER_ID'] != 'uxmodern') {
                if ($skinList['currentSkin'] == $value['SKIN_FOLDER_ID']) {
                    $value['SKIN_STATUS'] = $wildcard . G::LoadTranslation('ID_ACTIVE');
                    $value['SKIN_NAME'] = $wildcard . $value['SKIN_NAME'];
                    $value['SKIN_WORKSPACE'] = $wildcard . $value['SKIN_WORKSPACE'];
                    $value['SKIN_DESCRIPTION'] = $wildcard . $value['SKIN_DESCRIPTION'];
                    $value['SKIN_AUTHOR'] = $wildcard . $value['SKIN_AUTHOR'];
                    $value['SKIN_CREATEDATE'] = $wildcard . $value['SKIN_CREATEDATE'];
                    $value['SKIN_MODIFIEDDATE'] = $wildcard . $value['SKIN_MODIFIEDDATE'];
                } else {
                    $value['SKIN_STATUS'] = G::LoadTranslation('ID_INACTIVE');
                }
                $skinListArray['skins'][] = $value;
            }
        }
    }
    $skinListArray['currentSkin'] = $skinList['currentSkin'];
    echo G::json_encode($skinListArray);
}
开发者ID:bqevin,项目名称:processmaker,代码行数:33,代码来源:skin_Ajax.php


示例19: smarty_function_getImage

/**
 * Smarty function to return first image src from given HTML content.
 *
 * Examples
 *  {getImage htmlcontent=$item.body}
 *  {getImage htmlcontent=$item.body putbaseurl=true}
 *  {getImage htmlcontent=$item.body putbaseurl=true assign='imagesrc'}
 *
 * @return string
 */
function smarty_function_getImage($params, Zikula_View $view)
{
    $result = $params['htmlcontent'];
    if (isset($params['htmlcontent']) && $params['htmlcontent']) {
        if (strpos($params['htmlcontent'], '<img ') === false) {
            // image is not found in content
        } else {
            // get image src
            $posstart = strpos($params['htmlcontent'], ' src="', $posstart) + 6;
            $posend = strpos($params['htmlcontent'], '"', $posstart);
            $result = substr($params['htmlcontent'], $posstart, $posend - $posstart);
            if (isset($params['putbaseurl']) && $params['putbaseurl']) {
                // put base url, if not
                if (substr($result, 0, 7) != 'http://' || substr($result, 0, 8) != 'https://') {
                    $result = System::getBaseUrl() . ltrim($result, DIRECTORY_SEPARATOR);
                }
            }
        }
    }
    if (isset($params['assign'])) {
        $view->assign($params['assign'], $result);
    } else {
        return $result;
    }
}
开发者ID:nmpetkov,项目名称:Ephemerides,代码行数:35,代码来源:function.getImage.php


示例20: read

 public static function read($pin, $automode = false)
 {
     if ($automode) {
         self::mode($pin, 'in');
     }
     return System::commandSilent(self::GPIO_DEFAULT_PATH . ' read ' . $pin);
 }
开发者ID:kofeve,项目名称:yana-server,代码行数:7,代码来源:Gpio.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP SystemControl类代码示例发布时间:2022-05-23
下一篇:
PHP SysLog类代码示例发布时间: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