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


PHP G::update_php_ini方法代码示例

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


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

示例1: saveSystemConf

 public function saveSystemConf($httpData)
 {
     G::loadClass('system');
     $envFile = PATH_CONFIG . 'env.ini';
     $updateRedirector = false;
     $restart = false;
     if (!file_exists($envFile)) {
         // if ini file doesn't exists
         if (!is_writable(PATH_CONFIG)) {
             throw new Exception('The enviroment config directory is not writable. <br/>Please give write permission to directory: /workflow/engine/config');
         }
         $content = ";\r\n";
         $content .= "; ProcessMaker System Bootstrap Configuration\r\n";
         $content .= ";\r\n";
         file_put_contents($envFile, $content);
         //@chmod($envFile, 0777);
     } else {
         if (!is_writable($envFile)) {
             throw new Exception('The enviroment ini file file is not writable. <br/>Please give write permission to file: /workflow/engine/config/env.ini');
         }
     }
     $sysConf = System::getSystemConfiguration($envFile);
     $updatedConf = array();
     if ($sysConf['default_lang'] != $httpData->default_lang) {
         $updatedConf['default_lang'] = $sysConf['default_lang'] = $httpData->default_lang;
         $updateRedirector = true;
     }
     if ($sysConf['default_skin'] != $httpData->default_skin) {
         $updatedConf['default_skin'] = $sysConf['default_skin'] = $httpData->default_skin;
         $updateRedirector = true;
     }
     if ($sysConf['time_zone'] != $httpData->time_zone) {
         $updatedConf['time_zone'] = $httpData->time_zone;
     }
     $httpData->memory_limit .= 'M';
     if ($sysConf['memory_limit'] != $httpData->memory_limit) {
         $updatedConf['memory_limit'] = $httpData->memory_limit;
     }
     if ($updateRedirector) {
         if (!file_exists(PATH_HTML . 'index.html')) {
             throw new Exception('The index.html file is not writable on workflow/public_html directory.');
         } else {
             if (!is_writable(PATH_HTML . 'index.html')) {
                 throw new Exception(G::LoadTranslation('ID_INDEX_NOT_WRITEABLE') . ' /workflow/public_html/index.html');
             }
         }
         System::updateIndexFile(array('lang' => $sysConf['default_lang'], 'skin' => $sysConf['default_skin']));
         $restart = true;
     }
     G::update_php_ini($envFile, $updatedConf);
     if (substr($sysConf['default_skin'], 0, 2) == 'ux') {
         $urlPart = '/main/login';
     } else {
         $urlPart = '/login/login';
     }
     $this->success = true;
     $this->restart = $restart;
     $this->url = '/sys' . SYS_SYS . '/' . $sysConf['default_lang'] . '/' . $sysConf['default_skin'] . $urlPart;
     $this->message = 'Saved Successfully';
 }
开发者ID:nshong,项目名称:processmaker,代码行数:60,代码来源:adminProxy.php

示例2: browserCacheFilesSetUid

 public static function browserCacheFilesSetUid()
 {
     $uid = G::generateUniqueID();
     $arrayData = array();
     $arrayData["browser_cache_files_uid"] = $uid;
     G::update_php_ini(PATH_CONFIG . "env.ini", $arrayData);
 }
开发者ID:nhenderson,项目名称:processmaker,代码行数:7,代码来源:class.g.php

示例3: createMySQLWorkspace


//.........这里部分代码省略.........

            // inserting the outh_client

            if (!$userLogged) {

                $query = sprintf( "USE %s;", $wf );

            } else {

                $query = sprintf( "USE %s;", trim( $_REQUEST['wfDatabase']) );

            }

            $this->mysqlQuery( $query );

            $query = ( "INSERT INTO OAUTH_CLIENTS (CLIENT_ID,CLIENT_SECRET,CLIENT_NAME,CLIENT_DESCRIPTION,CLIENT_WEBSITE,REDIRECT_URI,USR_UID ) VALUES

                ('x-pm-local-client','179ad45c6ce2cb97cf1029e212046e81','PM Web Designer','ProcessMaker Web Designer App','www.processmaker.com','" . $endpoint . "','00000000000000000000000000000001' )");

            $this->mysqlQuery( $query );



            $indexFileUpdated = true;

            if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {

                $this->buildParternExtras($adminUsername, $adminPassword, $_REQUEST['workspace'], $langUri, $skinUri);

            } else {

                try {

                    G::update_php_ini( $envFile, $updatedConf );

                } catch (Exception $e) {

                    $info->result = false;

                    $info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array($envFile));

                    $info->message .= G::LoadTranslation('ID_PROCESSMAKER_UI_NOT_INSTALL');

                    $this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('env.ini')));

                    return $info;

                }



                try {

                    // update the main index file

                    $indexFileUpdated = System::updateIndexFile(array('lang' => 'en','skin' => $updatedConf['default_skin']));

                } catch (Exception $e) {

                    $info->result = false;

                    $info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html."));

                    $info->message .= G::LoadTranslation('ID_PROCESSMAKER_UI_NOT_INSTALL');

                    $this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html')));
开发者ID:nhenderson,项目名称:processmaker,代码行数:67,代码来源:installer.php

示例4: browserCacheFilesSetUid

 public static function browserCacheFilesSetUid()
 {
     //Set UID
     $uid = G::generateUniqueID();
     $arrayData = array();
     $arrayData["browser_cache_files_uid"] = $uid;
     G::update_php_ini(PATH_CONFIG . "env.ini", $arrayData);
     //Set file JavaScript
     $arrayLibrary = G::browserCacheFilesGetLibraryJs();
     foreach ($arrayLibrary as $index => $value) {
         $name = $index;
         $path = $value;
         if (!empty($path)) {
             foreach (glob($path . $name . "*") as $file) {
                 if (preg_match("/^\\.\\w{32}\\.js\$/i", str_replace($path . $name, null, $file))) {
                     @unlink($file);
                     //Delete old file
                 }
             }
             if (file_exists($path . $name . ".js")) {
                 @copy($path . $name . ".js", $path . $name . "." . $uid . ".js");
                 //Create new file
             }
         }
     }
 }
开发者ID:ralpheav,项目名称:processmaker,代码行数:26,代码来源:class.g.php

示例5: saveSystemConf

 public function saveSystemConf($httpData)
 {
     G::loadClass('system');
     $envFile = PATH_CONFIG . 'env.ini';
     $updateRedirector = false;
     $restart = false;
     if (!file_exists($envFile)) {
         if (!is_writable(PATH_CONFIG)) {
             throw new Exception('The enviroment config directory is not writable. <br/>Please give write permission to directory: /workflow/engine/config');
         }
         $content = ";\r\n";
         $content .= "; ProcessMaker System Bootstrap Configuration\r\n";
         $content .= ";\r\n";
         file_put_contents($envFile, $content);
         //@chmod($envFile, 0777);
     } else {
         if (!is_writable($envFile)) {
             throw new Exception('The enviroment ini file file is not writable. <br/>Please give write permission to file: /workflow/engine/config/env.ini');
         }
     }
     $sysConf = System::getSystemConfiguration($envFile);
     $updatedConf = array();
     if ($sysConf['default_lang'] != $httpData->default_lang) {
         $updatedConf['default_lang'] = $sysConf['default_lang'] = $httpData->default_lang;
         $updateRedirector = true;
     }
     if ($sysConf['default_skin'] != $httpData->default_skin) {
         $updatedConf['default_skin'] = $sysConf['default_skin'] = $httpData->default_skin;
         $updateRedirector = true;
     }
     if ($sysConf['time_zone'] != $httpData->time_zone) {
         $updatedConf['time_zone'] = $httpData->time_zone;
     }
     $httpData->memory_limit .= 'M';
     if ($sysConf['memory_limit'] != $httpData->memory_limit) {
         $updatedConf['memory_limit'] = $httpData->memory_limit;
     }
     if ($sysConf['proxy_host'] != $httpData->proxy_host) {
         $updatedConf['proxy_host'] = $httpData->proxy_host;
     }
     if ($sysConf['proxy_port'] != $httpData->proxy_port) {
         $updatedConf['proxy_port'] = $httpData->proxy_port;
     }
     if ($sysConf['proxy_user'] != $httpData->proxy_user) {
         $updatedConf['proxy_user'] = $httpData->proxy_user;
     }
     if ($sysConf['proxy_pass'] != $httpData->proxy_pass) {
         $updatedConf['proxy_pass'] = G::encrypt($httpData->proxy_pass, 'proxy_pass');
     }
     $sessionGcMaxlifetime = ini_get('session.gc_maxlifetime');
     if ($httpData->max_life_time != "" && $sessionGcMaxlifetime != $httpData->max_life_time) {
         if (!isset($sysConf['session.gc_maxlifetime']) || $sysConf['session.gc_maxlifetime'] != $httpData->max_life_time) {
             $updatedConf['session.gc_maxlifetime'] = $httpData->max_life_time;
         }
     }
     if ($updateRedirector) {
         if (!file_exists(PATH_HTML . 'index.html')) {
             throw new Exception('The index.html file is not writable on workflow/public_html directory.');
         } else {
             if (!is_writable(PATH_HTML . 'index.html')) {
                 throw new Exception(G::LoadTranslation('ID_INDEX_NOT_WRITEABLE') . ' /workflow/public_html/index.html');
             }
         }
         System::updateIndexFile(array('lang' => $sysConf['default_lang'], 'skin' => $sysConf['default_skin']));
         $restart = true;
     }
     G::update_php_ini($envFile, $updatedConf);
     if (substr($sysConf['default_skin'], 0, 2) == 'ux') {
         $urlPart = '/main/login';
     } else {
         $urlPart = '/login/login';
     }
     $this->success = true;
     $this->restart = $restart;
     $this->url = "/sys" . SYS_SYS . "/" . ($sysConf["default_lang"] != "" ? $sysConf["default_lang"] : (defined("SYS_LANG") && SYS_LANG != "" ? SYS_LANG : "en")) . "/" . $sysConf["default_skin"] . $urlPart;
     $this->message = 'Saved Successfully';
     $msg = "";
     if ($httpData->proxy_host != '' || $httpData->proxy_port != '' || $httpData->proxy_user != '') {
         $msg = ", Host -> " . $httpData->proxy_host . ", Port -> " . $httpData->proxy_port . ", User -> " . $httpData->proxy_user;
     }
     G::auditLog("UploadSystemSettings", "Time Zone -> " . $httpData->time_zone . ", Memory Limit -> " . $httpData->memory_limit . ", Cookie lifetime -> " . $httpData->max_life_time . ", Default Skin -> " . $httpData->default_skin . ", Default Language -> " . $httpData->default_lang . $msg);
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:82,代码来源:adminProxy.php

示例6: createMySQLWorkspace


//.........这里部分代码省略.........
         $query = sprintf("USE %s;", $wf);
         $this->mysqlQuery($query);
         $this->mysqlFileQuery(PATH_HOME . 'engine/data/mysql/schema.sql');
         $this->mysqlFileQuery(PATH_HOME . 'engine/data/mysql/insert.sql');
         // Create the triggers
         if (file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationInsert.sql') && file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationUpdate.sql') && file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationUpdate.sql') && file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationDelete.sql') && file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerContentUpdate.sql')) {
             $this->mysqlQuery(@file_get_contents(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationInsert.sql'));
             $this->mysqlQuery(@file_get_contents(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationUpdate.sql'));
             $this->mysqlQuery(@file_get_contents(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationUpdate.sql'));
             $this->mysqlQuery(@file_get_contents(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationDelete.sql'));
             $this->mysqlQuery(@file_get_contents(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerContentUpdate.sql'));
             $this->mysqlQuery("INSERT INTO `CONFIGURATION` (\n                            `CFG_UID`,\n                            `CFG_VALUE`\n                           )\n                           VALUES (\n                             'APP_CACHE_VIEW_ENGINE',\n                             '" . mysql_real_escape_string(serialize(array('LANG' => 'en', 'STATUS' => 'active'))) . "'\n                           )");
         }
         // Change admin user
         $query = sprintf("USE %s;", $wf);
         $this->mysqlQuery($query);
         $query = sprintf("UPDATE USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5($adminPassword));
         $this->mysqlQuery($query);
         $query = sprintf("USE %s;", $rb);
         $this->mysqlQuery($query);
         $query = sprintf("UPDATE USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5($adminPassword));
         $this->mysqlQuery($query);
         // Write the paths_installed.php file (contains all the information configured so far)
         if (!file_exists(FILE_PATHS_INSTALLED)) {
             $sh = md5(filemtime(PATH_GULLIVER . '/class.g.php'));
             $h = G::encrypt($db_hostname . $sh . $db_username . $sh . $db_password, $sh);
             $dbText = "<?php\n";
             $dbText .= sprintf("  define('PATH_DATA',         '%s');\n", $pathShared);
             $dbText .= sprintf("  define('PATH_C',            '%s');\n", $pathShared . 'compiled/');
             $dbText .= sprintf("  define('HASH_INSTALLATION', '%s');\n", $h);
             $dbText .= sprintf("  define('SYSTEM_HASH',       '%s');\n", $sh);
             $this->installLog("Creating: " . FILE_PATHS_INSTALLED);
             file_put_contents(FILE_PATHS_INSTALLED, $dbText);
         }
         /**
          * AppCacheView Build
          */
         define('HASH_INSTALLATION', $h);
         define('SYSTEM_HASH', $sh);
         define('PATH_DB', $pathShared . 'sites' . PATH_SEP);
         define('SYS_SYS', 'workflow');
         require_once "propel/Propel.php";
         Propel::init(PATH_CORE . "config/databases.php");
         $con = Propel::getConnection('workflow');
         require_once 'classes/model/AppCacheView.php';
         $lang = 'en';
         //setup the appcacheview object, and the path for the sql files
         $appCache = new AppCacheView();
         $appCache->setPathToAppCacheFiles(PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP);
         //APP_DELEGATION INSERT
         $res = $appCache->triggerAppDelegationInsert($lang, true);
         //APP_DELEGATION Update
         $res = $appCache->triggerAppDelegationUpdate($lang, true);
         //APPLICATION UPDATE
         $res = $appCache->triggerApplicationUpdate($lang, true);
         //APPLICATION DELETE
         $res = $appCache->triggerApplicationDelete($lang, true);
         //CONTENT UPDATE
         $res = $appCache->triggerContentUpdate($lang, true);
         //build using the method in AppCacheView Class
         $res = $appCache->fillAppCacheView($lang);
         //end AppCacheView Build
         //erik: for new env conf handling
         G::loadClass('system');
         $envFile = PATH_CONFIG . 'env.ini';
         //writting for new installtions to use the new skin 'uxmind' with new Front End ExtJs Based
         $updatedConf['default_skin'] = 'uxmodern';
         $info->uri = '/sys' . $_REQUEST['workspace'] . '/en/uxmodern/main/login';
         try {
             G::update_php_ini($envFile, $updatedConf);
         } catch (Exception $e) {
             $info->result = false;
             $info->message = "ProcessMaker couldn't write on configuration file: {$envFile}.<br/>";
             $info->message .= "The new ProcessMaker UI couldn't be applied on installation, you can enable it after from Admin->System settings.";
             $this->installLog("Installed but with error, couldn't update env.ini");
             return $info;
         }
         // getting configuration from env.ini
         $sysConf = System::getSystemConfiguration($envFile);
         try {
             // update the main index file
             $indexFileUpdated = System::updateIndexFile(array('lang' => 'en', 'skin' => $updatedConf['default_skin']));
         } catch (Exception $e) {
             $info->result = false;
             $info->message = "ProcessMaker couldn't write on configuration file: " . PATH_HTML . "index.html.<br/>";
             $info->message .= "The new ProcessMaker UI couldn't be applied on installation, you can enable it after from Admin->System settings.";
             $this->installLog("Installed but with error, couldn't update index.html");
             return $info;
         }
         $this->installLog("Index File updated {$indexFileUpdated} with lang: {$sysConf['default_lang']}, skin: {$sysConf['default_skin']} ");
         $this->installLog("Install completed Succesfully");
         $info->result = true;
         $info->message = 'Succesfully OK';
     } catch (Exception $e) {
         $info->canRedirect = false;
         $info->result = false;
         $info->message = $e->getMessage();
     }
     return $info;
 }
开发者ID:nshong,项目名称:processmaker,代码行数:101,代码来源:installer.php


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