本文整理汇总了PHP中G::LoadSystem方法的典型用法代码示例。如果您正苦于以下问题:PHP G::LoadSystem方法的具体用法?PHP G::LoadSystem怎么用?PHP G::LoadSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::LoadSystem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run_create_translation
function run_create_translation($args, $opts)
{
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$opts = $filter->xssFilterHard($opts);
$args = $filter->xssFilterHard($args);
$rootDir = realpath(__DIR__."/../../../../");
$app = new Maveriks\WebApplication();
$app->setRootDir($rootDir);
$loadConstants = false;
$workspaces = get_workspaces_from_args($args);
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
$translation = new Translation();
CLI::logging("Updating labels Mafe ...\n");
foreach ($workspaces as $workspace) {
try {
echo "Updating labels for workspace " . pakeColor::colorize($workspace->name, "INFO") . "\n";
$translation->generateTransaltionMafe($lang);
} catch (Exception $e) {
echo "Errors upgrading labels for workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n";
}
}
CLI::logging("Create successful\n");
}
示例2: packPlugin
function packPlugin($pluginName, $version)
{
$pathBase = PATH_DATA . 'skins' . PATH_SEP . $pluginName . PATH_SEP;
$pathHome = PATH_DATA . 'skins' . PATH_SEP . $pluginName;
$fileTar = PATH_DATA . 'skins' . PATH_SEP . $pluginName . '-' . $version . '.tar';
G::LoadSystem('templatePower');
/*
$pluginDirectory = PATH_PLUGINS . $pluginName;
$pluginOutDirectory = PATH_OUTTRUNK . 'plugins' . PATH_SEP . $pluginName;
$pluginHome = PATH_OUTTRUNK . 'plugins' . PATH_SEP . $pluginName;
//verify if plugin exists,
$pluginClassFilename = PATH_PLUGINS . $pluginName . PATH_SEP . 'class.' . $pluginName . '.php';
if ( !is_file ( $pluginClassFilename ) ) {
printf("The plugin %s doesn't exist in this file %s \n", pakeColor::colorize( $pluginName, 'ERROR'), pakeColor::colorize( $pluginClassFilename, 'INFO') );
die ;
}
*/
G::LoadThirdParty('pear/Archive', 'Tar');
$tar = new Archive_Tar($fileTar);
$tar->_compress = false;
//$tar->createModify( $pathHome . PATH_SEP . $pluginName . '.php' ,'', $pathHome);
addTarFolder($tar, $pathBase, $pathHome);
$aFiles = $tar->listContent();
return $fileTar;
}
示例3: rangeDownload
function rangeDownload($location, $mimeType)
{
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$location = $filter->xssFilterHard($location, "path");
if (!file_exists($location)) {
header("HTTP/1.0 404 Not Found");
return;
}
$size = filesize($location);
$time = date('r', filemtime($location));
$fm = @fopen($location, 'rb');
if (!$fm) {
header("HTTP/1.0 505 Internal server error");
return;
}
$begin = 0;
$end = $size - 1;
if (isset($_SERVER['HTTP_RANGE'])) {
if (preg_match('/bytes=\\h*(\\d+)-(\\d*)[\\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) {
$begin = intval($matches[1]);
if (!empty($matches[2])) {
$end = intval($matches[2]);
}
}
}
header('HTTP/1.0 206 Partial Content');
header("Content-Type: {$mimeType}");
header('Cache-Control: public, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Accept-Ranges: bytes');
header('Content-Length:' . ($end - $begin + 1));
if (isset($_SERVER['HTTP_RANGE'])) {
header("Content-Range: bytes {$begin}-{$end}/{$size}");
}
header("Content-Disposition: inline; filename={$location}");
header("Content-Transfer-Encoding: binary");
header("Last-Modified: {$time}");
$cur = $begin;
fseek($fm, $begin, 0);
while (!feof($fm) && $cur <= $end && connection_status() == 0) {
set_time_limit(0);
print fread($fm, min(1024 * 16, $end - $cur + 1));
$cur += 1024 * 16;
flush();
}
}
示例4: DumpHeaders
function DumpHeaders($filename)
{
global $root_path;
if (!$filename) {
return;
}
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
$isIE = 0;
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false && strstr($HTTP_USER_AGENT, 'Opera') === false) {
$isIE = 1;
}
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false && strstr($HTTP_USER_AGENT, 'Opera') === false) {
$isIE6 = 1;
}
$aux = preg_replace('[^-a-zA-Z0-9\\.]', '_', $filename);
$aux = explode('_', $aux);
$downloadName = $aux[count($aux) - 1];
// $downloadName = $filename;
//$downloadName = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
if ($isIE && !isset($isIE6)) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header("Content-Disposition: inline; filename={$downloadName}");
// This works for most types, but doesn't work with Word files
header("Content-Type: application/download; name=\"{$downloadName}\"");
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
} else {
header("Content-Disposition: attachment; filename=\"{$downloadName}\"");
header("Content-Type: application/octet-stream; name=\"{$downloadName}\"");
}
//$filename = PATH_UPLOAD . "$filename";
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$filename = $filter->xssFilterHard($filename, 'path');
readfile($filename);
}
示例5: print_endpoint_names
function print_endpoint_names()
{
global $iop;
if (!class_exists('G')) {
$realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
$docuroot = explode('/', $realdocuroot);
array_pop($docuroot);
$pathhome = implode('/', $docuroot) . '/';
array_pop($docuroot);
$pathTrunk = implode('/', $docuroot) . '/';
require_once $pathTrunk . 'gulliver/system/class.g.php';
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$currTest = $filter->xssFilterHard($iop->currentTest);
if (!$iop->getEndpoints($iop->currentTest)) {
die("Unable to retrieve endpoints for {$currTest}\n");
}
print "Interop Servers for {$currTestt}:\n";
foreach ($iop->endpoints as $server) {
print " {$server->name}\n";
}
}
示例6: DBConnection
require_once $unitFilename;
require_once PATH_THIRDPARTY . '/lime/lime.php';
require_once PATH_THIRDPARTY . 'lime/yaml.class.php';
require_once PATH_CORE . "config/databases.php";
require_once "propel/Propel.php";
Propel::init(PATH_CORE . "config/databases.php");
G::LoadThirdParty('smarty/libs', 'Smarty.class');
G::LoadSystem('error');
G::LoadSystem('xmlform');
G::LoadSystem('xmlDocument');
G::LoadSystem('form');
G::LoadSystem('dbconnection');
G::LoadSystem('dbsession');
G::LoadSystem('dbrecordset');
G::LoadSystem('dbtable');
G::LoadSystem('testTools');
G::LoadClass('appDelegation');
require_once PATH_CORE . '/classes/model/AppDelegation.php';
$dbc = new DBConnection();
$ses = new DBSession($dbc);
$obj = new AppDelegation($dbc);
$t = new lime_test(1, new lime_output_color());
$t->diag('class AppDelegation');
$t->isa_ok($obj, 'AppDelegation', 'class AppDelegation created');
class AppDel extends unitTest
{
function CreateEmptyAppDelegation($data, $fields)
{
$obj = new AppDelegation();
$res = $obj->createAppDelegation($fields);
return $res;
示例7: createFromPMTable
/**
*
*
* Creates a Dynaform based on a PMTable
*
* @name createFromPMTable
* @author gustavo cruz gustavo[at]colosa[dot]com
* @param array $aData Fields with :
* $aData['DYN_UID'] the dynaform id
* $aData['USR_UID'] the userid
* string $pmTableUid uid of the PMTable
*
*/
public function createFromPMTable($aData, $pmTableUid)
{
$this->create($aData);
$aData['DYN_UID'] = $this->getDynUid();
//krumo(BasePeer::getFieldnames('Content'));
$fields = array();
//$oCriteria = new Criteria('workflow');
$pmTable = AdditionalTablesPeer::retrieveByPK($pmTableUid);
$addTabName = $pmTable->getAddTabName();
$keys = '';
if (isset($aData['FIELDS'])) {
foreach ($aData['FIELDS'] as $iRow => $row) {
if ($keys != '') {
$keys = $keys . '|' . $row['PRO_VARIABLE'];
} else {
$keys = $row['PRO_VARIABLE'];
}
}
} else {
$keys = ' ';
}
// $addTabKeys = $pmTable->getAddTabDynavars();
// $addTabKeys = unserialize($addTabKeys);
// $keys = '';
// foreach ( $addTabKeys as $addTabKey ){
// if (trim($addTabKey['CASE_VARIABLE'])!=''&&$keys!=''){
// $keys = $keys.'|'.$addTabKey['CASE_VARIABLE'];
// } else {
// $keys = $addTabKey['CASE_VARIABLE'];
// }
//
// }
// Determines the engine to use
// For a description of a table
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$sql = $oDataBase->getTableDescription($addTabName);
} else {
$sql = 'DESC ' . $addTabName;
}
$dbh = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
$sth = $dbh->createStatement();
$res = $sth->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$file = $aData['PRO_UID'] . '/' . $aData['DYN_UID'];
$dbc = new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml');
$ses = new DBSession($dbc);
$fieldXML = new DynaFormField($dbc);
$pmConnectionName = $addTabName . '_CONNECTION';
if ($aData['DYN_TYPE'] == 'xmlform') {
$labels = array();
$options = array();
$attributes = array('XMLNODE_NAME_OLD' => '', 'XMLNODE_NAME' => $pmConnectionName, 'TYPE' => 'pmconnection', 'PMTABLE' => $pmTableUid, 'KEYS' => $keys);
$fieldXML->Save($attributes, $labels, $options);
}
$keyRequered = '';
$countKeys = 0;
while ($res->next()) {
if ($res->get('Key') != '') {
$countKeys++;
}
if ($res->get('Extra') == 'auto_increment') {
$keyRequered .= $res->get('Field');
}
}
$dbh = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
$sth = $dbh->createStatement();
$res = $sth->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
while ($res->next()) {
// if(strtoupper($res->get('Null'))=='NO') {
if (strtoupper($res->get($oDataBase->getFieldNull())) == 'NO') {
if ($countKeys == 1 && $res->get('Field') == $keyRequered) {
$required = '0';
} else {
$required = '1';
}
} else {
$required = '0';
}
$fieldName = $res->get('Field');
$defaultValue = $res->get('Default');
$labels = array(SYS_LANG => $fieldName);
$options = array();
$type = explode('(', $res->get('Type'));
switch ($type[0]) {
case 'text':
//.........这里部分代码省略.........
示例8: define
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (!defined('PATH_THIRDPARTY')) {
require_once $_SERVER['PWD'] . '/test/bootstrap/unit.php';
}
require_once PATH_THIRDPARTY . 'lime/lime.php';
define('G_ENVIRONMENT', G_TEST_ENV);
G::LoadThirdParty('smarty/libs', 'Smarty.class');
G::LoadSystem('xmlform');
G::LoadSystem('xmlDocument');
G::LoadSystem('form');
G::LoadSystem('pagedTable');
$t = new lime_test(2, new lime_output_color());
$obj = "pagedTable";
$method = array();
$testItems = 0;
$method = get_class_methods('pagedTable');
$t->diag('class pagedTable');
$t->is(count($method), 10, "class pagedTable " . $testItems . " methods.");
$t->todo('review all pendings in this class');
示例9:
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
* @package gulliver.system
*/
G::LoadSystem('objectTemplate');
class Tree extends Xml_Node
{
var $template = 'tree.html';
var $nodeType = 'base';
var $nodeClass = 'treeNode';
var $contentClass = 'treeContent';
var $width = '100%';
var $contentWidth = '360';
var $contracted = false;
var $showSign = true;
var $isChild = false;
var $plus = "<span style='position:absolute; width:16px;height:22px;cursor:pointer;'onclick='tree.expand(this.parentNode);'> </span>";
var $minus = "<span style='position:absolute; width:16px;height:22px;cursor:pointer' onclick='tree.contract(this.parentNode);'> </span>";
var $point = "<span style='position:absolute; width:5px;height:10px;cursor:pointer;' onclick='tree.select(this.parentNode);'> </span>";
/**
示例10: define
G::LoadSystem('dbrecordset');
G::LoadSystem('dbtable');
G::LoadSystem('rbac');
G::LoadSystem('publisher');
G::LoadSystem('templatePower');
G::LoadSystem('xmlDocument');
G::LoadSystem('xmlform');
G::LoadSystem('xmlformExtension');
G::LoadSystem('form');
G::LoadSystem('menu');
G::LoadSystem("xmlMenu");
G::LoadSystem('dvEditor');
//G::LoadSystem('table');
G::LoadSystem('controller');
G::LoadSystem('httpProxyController');
G::LoadSystem('pmException');
//G::LoadSystem('pagedTable');
// Installer, redirect to install if we don't have a valid shared data folder
if (!defined('PATH_DATA') || !file_exists(PATH_DATA)) {
// new installer, extjs based
define('PATH_DATA', PATH_C);
require_once PATH_CONTROLLERS . 'installer.php';
$controller = 'Installer';
// if the method name is empty set default to index method
if (strpos(SYS_TARGET, '/') !== false) {
list($controller, $controllerAction) = explode('/', SYS_TARGET);
} else {
$controllerAction = SYS_TARGET;
}
$controllerAction = $controllerAction != '' && $controllerAction != 'login' ? $controllerAction : 'index';
// create the installer controller and call its method
示例11: __construct
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
*
* @package gulliver.system
*
*/
G::LoadSystem('database_base');
class database extends database_base
{
public $iFetchType = MYSQL_ASSOC;
/**
* class database constructor
*
* @param $sType adapter type
* @param $sServer server
* @param $sUser db user
* @param $sPass db user password
* @param $sDataBase Database name
*/
public function __construct($sType = DB_ADAPTER, $sServer = DB_HOST, $sUser = DB_USER, $sPass = DB_PASS, $sDataBase = DB_NAME)
{
$this->sType = $sType;
示例12: showPopUp
function showPopUp($PopupText)
{
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$PopupText = $filter->xssFilterHard($PopupText);
echo "<script type=\"text/javascript\" language=\"javascript\">alert (\"{$PopupText}\");</script>";
}
示例13: service
/**
* processes request and returns response
*
* @param string $data usually is the value of $HTTP_RAW_POST_DATA
* @access public
*/
function service($data)
{
global $HTTP_SERVER_VARS;
if (isset($_SERVER['QUERY_STRING'])) {
$qs = $_SERVER['QUERY_STRING'];
} elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$qs = $HTTP_SERVER_VARS['QUERY_STRING'];
} else {
$qs = '';
}
$this->debug("In service, query string={$qs}");
if (ereg('wsdl', $qs)) {
$this->debug("In service, this is a request for WSDL");
if ($this->externalWSDLURL) {
if (strpos($this->externalWSDLURL, "://") !== false) {
// assume URL
header('Location: ' . $this->externalWSDLURL);
} else {
// assume file
header("Content-Type: text/xml\r\n");
$fp = fopen($this->externalWSDLURL, 'r');
fpassthru($fp);
}
} elseif ($this->wsdl) {
header("Content-Type: text/xml; charset=ISO-8859-1\r\n");
print $this->wsdl->serialize($this->debug_flag);
if ($this->debug_flag) {
$this->debug('wsdl:');
$this->appendDebug($this->varDump($this->wsdl));
print $this->getDebugAsXMLComment();
}
} else {
header("Content-Type: text/html; charset=ISO-8859-1\r\n");
print "This service does not provide WSDL";
}
} elseif ($data == '' && $this->wsdl) {
$this->debug("In service, there is no data, so return Web description");
if (!class_exists('G')) {
$realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
$docuroot = explode('/', $realdocuroot);
array_pop($docuroot);
$pathhome = implode('/', $docuroot) . '/';
array_pop($docuroot);
$pathTrunk = implode('/', $docuroot) . '/';
require_once $pathTrunk . 'gulliver/system/class.g.php';
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$webDescription = $filter->xssFilterHard($this->wsdl->webDescription());
print $webDescription;
} else {
$this->debug("In service, invoke the request");
$this->parse_request($data);
if (!$this->fault) {
$this->invoke_method();
}
if (!$this->fault) {
$this->serialize_return();
}
$this->send_response();
}
}
示例14: soapRequest
/**
* soapRequest
*
* make a SOAP request to Zimbra server, returns the XML
*
* @since version 1.0
* @access public
* @param string $body body of page
* @param boolean $header
* @param boolean $footer
* @return string $response
*/
protected function soapRequest($body, $header = false, $connecting = false)
{
G::LoadSystem('inputfilter');
$filter = new InputFilter();
if (!$connecting && !$this->_connected) {
throw new Exception('zimbra.class: soapRequest called without a connection to Zimbra server');
}
if ($header == false) {
$header = '<context xmlns="urn:zimbra">
<authToken>' . $this->auth_token . '</authToken>
<sessionId id="' . $this->session_id . '">' . $this->session_id . '</sessionId>
</context>';
}
$soap_message = '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>' . $header . '</soap:Header>
<soap:Body>' . $body . '</soap:Body>
</soap:Envelope>';
$this->message('SOAP message:<textarea>' . $soap_message . '</textarea>');
curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $soap_message);
$this->_curl = $filter->xssFilterHard($this->_curl, "url");
$response = curl_exec($this->_curl);
if (!$response) {
$this->error = 'ERROR: curl_exec - (' . curl_errno($this->_curl) . ') ' . curl_error($this->_curl);
return false;
} elseif (strpos($response, '<soap:Body><soap:Fault>') !== false) {
$error_code = $this->extractErrorCode($response);
$this->error = 'ERROR: ' . $error_code . ':<textarea>' . $response . '</textarea>';
$this->message($this->error);
$aError = array('error' => $error_code);
return $aError;
//return false;
}
$this->message('SOAP response:<textarea>' . $response . '</textarea><br/><br/>');
$this->_num_soap_calls++;
return $response;
}
示例15: verifyTable
public function verifyTable()
{
$oCriteria = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$sql = $oDataBase->createTableObjectPermission();
}
$con = Propel::getConnection("workflow");
$stmt = $con->prepareStatement($sql);
$rs = $stmt->executeQuery();
}