本文整理汇总了PHP中G::streamFile方法的典型用法代码示例。如果您正苦于以下问题:PHP G::streamFile方法的具体用法?PHP G::streamFile怎么用?PHP G::streamFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::streamFile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
<?php
switch ($_GET['MAIN_DIRECTORY']) {
case 'mailTemplates':
$sDirectory = PATH_DATA_MAILTEMPLATES . $_GET['PRO_UID'] . PATH_SEP . ($_GET['CURRENT_DIRECTORY'] != '' ? $_GET['CURRENT_DIRECTORY'] . PATH_SEP : '');
break;
case 'public':
$sDirectory = PATH_DATA_PUBLIC . $_GET['PRO_UID'] . PATH_SEP . ($_GET['CURRENT_DIRECTORY'] != '' ? $_GET['CURRENT_DIRECTORY'] . PATH_SEP : '');
break;
default:
die;
break;
}
//fixed: added a file extension when is a javascript file by krlos
$_GET['FILE'] .= $_GET['sFilextension'] != '' && $_GET['sFilextension'] == 'javascript' ? '.js' : '';
if (file_exists($sDirectory . $_GET['FILE'])) {
G::streamFile($sDirectory . $_GET['FILE'], true);
}
示例2: AppDocument
* 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.
*
*/
/*
* Created on 13-02-2008
*
* @author David Callizaya <davidsantos@colosa.com>
*/
if (!isset($_SESSION['PROCESS'])) {
G::header('location: login');
}
require_once "classes/model/AppDocumentPeer.php";
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a']);
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo($oAppDocument->getAppDocFilename());
if (!isset($_GET['ext'])) {
$ext = $info['extension'];
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
} else {
$ext = $info['extension'];
}
}
$realPath = PATH_DOCUMENT . $_SESSION['APPLICATION'] . '/outdocs/' . $info['basename'] . '.' . $ext;
G::streamFile($realPath, true);
示例3: streamSkin
function streamSkin()
{
$skinTar = $_REQUEST['file'];
$bDownload = true;
G::streamFile($skinTar, $bDownload, basename($skinTar));
@unlink($fileTar);
}
示例4: downloadFile
public function downloadFile($sProcessUID, $sMainDirectory, $sCurrentDirectory, $sFile)
{
switch ($sMainDirectory) {
case 'mailTemplates':
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . ($sCurrentDirectory != '' ? $sCurrentDirectory . PATH_SEP : '');
break;
case 'public':
$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . ($sCurrentDirectory != '' ? $sCurrentDirectory . PATH_SEP : '');
break;
default:
die;
break;
}
if (file_exists($sDirectory . $sFile)) {
G::streamFile($sDirectory . $sFile, true);
}
}
示例5: export
//.........这里部分代码省略.........
$poFile->addTranslation(stripcslashes($msgid), stripcslashes($msgstr));
$aMsgids[$msgid] = true;
}
//$timer->setMarker('end making 1th .po from db');
//find all xml files into PATH_XMLFORM
$aXMLForms = glob(PATH_XMLFORM . '*/*.xml');
//from a sublevel to
$aXMLForms2 = glob(PATH_XMLFORM . '*/*/*.xml');
$aXMLForms = array_merge($aXMLForms, $aXMLForms2);
$aEnglishLabel = array();
$aOptions = array();
$nodesNames = array();
G::loadSystem('dynaformhandler');
foreach ($aXMLForms as $xmlFormPath) {
$xmlFormFile = str_replace(chr(92), '/', $xmlFormPath);
$xmlFormFile = str_replace(PATH_XMLFORM, '', $xmlFormPath);
$dynaForm = new dynaFormHandler($xmlFormPath);
$dynaNodes = $dynaForm->getFields();
//get all fields of each xmlform
foreach ($dynaNodes as $oNode) {
$sNodeName = $oNode->nodeName;
//$arrayNode = $dynaForm->getArray($oNode, Array('type', $_BASE_LANG, $_BASE_LANG));
$arrayNode = $dynaForm->getArray($oNode);
//if has not native language translation
if (!isset($arrayNode[$_BASE_LANG]) || !isset($arrayNode['type']) || isset($arrayNode['type']) && in_array($arrayNode['type'], $this->exceptionFields)) {
continue;
//just continue with the next node
}
// Getting the Base Origin Text
if (!is_array($arrayNode[$_BASE_LANG])) {
$originNodeText = trim($arrayNode[$_BASE_LANG]);
} else {
$langNode = $arrayNode[$_BASE_LANG][0];
$originNodeText = $langNode['__nodeText__'];
}
// Getting the Base Target Text
if (isset($arrayNode[$_TARGET_LANG])) {
if (!is_array($arrayNode[$_TARGET_LANG])) {
$targetNodeText = trim($arrayNode[$_TARGET_LANG]);
} else {
$langNode = $arrayNode[$_TARGET_LANG][0];
$targetNodeText = $langNode['__nodeText__'];
}
} else {
$targetNodeText = $originNodeText;
}
$nodeName = $arrayNode['__nodeName__'];
$nodeType = $arrayNode['type'];
$msgid = $originNodeText;
// if the nodeName already exists in the po file, we need to create other msgid
if (isset($aMsgids[$msgid])) {
$msgid = '[' . $xmlFormFile . '?' . $nodeName . '] ' . $originNodeText;
}
$poFile->addTranslatorComment($xmlFormFile . '?' . $nodeName);
$poFile->addTranslatorComment($xmlFormFile);
$poFile->addReference($nodeType . ' - ' . $nodeName);
$poFile->addTranslation(stripslashes($msgid), stripslashes($targetNodeText));
$aMsgids[$msgid] = true;
//if this node has options child nodes
if (isset($arrayNode[$_BASE_LANG]) && isset($arrayNode[$_BASE_LANG][0]) && isset($arrayNode[$_BASE_LANG][0]['option'])) {
$originOptionNode = $arrayNode[$_BASE_LANG][0]['option'];
//get the options
$targetOptionExists = false;
if (isset($arrayNode[$_TARGET_LANG]) && isset($arrayNode[$_TARGET_LANG][0]) && isset($arrayNode[$_TARGET_LANG][0]['option'])) {
$targetOptionNode = $arrayNode[$_TARGET_LANG][0]['option'];
$targetOptionExists = true;
}
if (!is_array($originOptionNode)) {
if (is_string($originOptionNode)) {
$poFile->addTranslatorComment($xmlFormFile . '?' . $nodeName . '-' . $originOptionNode);
$poFile->addTranslatorComment($xmlFormFile);
$poFile->addReference($nodeType . ' - ' . $nodeName . ' - ' . $originOptionNode);
$poFile->addTranslation(stripslashes($msgid), stripslashes($originOptionNode));
}
} else {
foreach ($originOptionNode as $optionNode) {
$optionName = $optionNode['name'];
$originOptionValue = $optionNode['__nodeText__'];
if ($targetOptionExists) {
$targetOptionValue = getMatchDropdownOptionValue($optionName, $targetOptionNode);
if ($targetOptionValue === false) {
$targetOptionValue = $originOptionValue;
}
} else {
$targetOptionValue = $originOptionValue;
}
$msgid = '[' . $xmlFormFile . '?' . $nodeName . '-' . $optionName . ']';
$poFile->addTranslatorComment($xmlFormFile . '?' . $nodeName . '-' . $optionName);
$poFile->addTranslatorComment($xmlFormFile);
$poFile->addReference($nodeType . ' - ' . $nodeName . ' - ' . $optionName);
$poFile->addTranslation($msgid, stripslashes($targetOptionValue));
}
}
}
}
//end foreach
}
G::auditLog("ExportLanguage", "Language: " . $_GET['LOCALE']);
G::streamFile($sPOFile, true);
}
示例6: dispatchResource
public function dispatchResource()
{
$realPath = $this->matchRoute['path'];
switch ($this->matchRoute['type']) {
case 'sysUnnamed':
require_once 'sysUnnamed.php';
die;
break;
case 'sysNamed':
header('location : ' . $_SERVER['REQUEST_URI'] . '/' . SYS_LANG . '/classic/login/login');
die;
break;
case 'jsMethod':
G::parseURI(getenv("REQUEST_URI"));
$filename = PATH_METHODS . SYS_COLLECTION . '/' . SYS_TARGET . '.js';
G::streamFile($filename);
die;
break;
case 'errorFile':
header("location: /errors/error404.php?url=" . urlencode($_SERVER['REQUEST_URI']));
if (DEBUG_TIME_LOG) {
G::logTimeByPage();
}
//log this page
die;
break;
case 'plugin':
//Get the Plugin Folder, always the first element
$pluginFolder = array_shift($realPath);
//The other parts are the realpath into public_html (no matter how many elements)
$filePath = implode(PATH_SEP, $realPath);
$pluginFilename = PATH_PLUGINS . $pluginFolder . PATH_SEP . 'public_html' . PATH_SEP . $filePath;
if (file_exists($pluginFilename)) {
G::streamFile($pluginFilename);
}
die;
break;
case 'skin':
$fileToBeStreamed = str_replace("/skin/", PATH_CUSTOM_SKINS, $_SERVER['REQUEST_URI']);
if (file_exists($fileToBeStreamed)) {
G::streamFile($fileToBeStreamed);
}
die;
break;
default:
$realPath .= strpos(basename($realPath), '.') === false ? '.php' : '';
G::streamFile($realPath);
die;
}
}
示例7: AppDocument
* License, or (at your option) any later version.
*
* 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.
*
*/
/*
* Created on 13-02-2008
*
* @author David Callizaya <davidsantos@colosa.com>
*/
if (!isset($_SESSION['PROCESS'])) {
G::header('location: login');
}
require_once "classes/model/AppDocumentPeer.php";
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a']);
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo($oAppDocument->getAppDocFilename());
$ext = $info['extension'];
$realPath = PATH_DOCUMENT . $_SESSION['APPLICATION'] . '/' . $sAppDocUid . '.' . $ext;
G::streamFile($realPath, true, $oAppDocument->Fields['APP_DOC_FILENAME']);
示例8: OutputDocument
<?php
require_once 'classes/model/OutputDocument.php';
$uid = $_SERVER['QUERY_STRING'];
$oOutputDocument = new OutputDocument();
$aFields = $oOutputDocument->load($uid);
$type = $aFields['OUT_DOC_TYPE'];
if ($type == 'JRXML') {
$extension = 'jrxml';
}
if ($type == 'ACROFORM') {
$extension = 'pdf';
}
$fileJrxml = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension;
$bDownload = true;
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
$downFileName = preg_replace('/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE']) . '.' . $extension;
G::streamFile($fileJrxml, $bDownload, $downFileName);
示例9: elseif
} elseif (file_exists($realPath2)) {
$sw_file_exists = true;
$realPath = $realPath2;
}
if (!$sw_file_exists) {
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT)) {
$error_message = G::LoadTranslation('ID_ERROR_FILE_NOT_EXIST', SYS_LANG, array('filename' => $info['basename'] . $ver . '.' . $ext)) . ' ' . G::LoadTranslation('ID_CONTACT_ADMIN');
} else {
$error_message = "'" . $info['basename'] . $ver . '.' . $ext . "' " . G::LoadTranslation('ID_ERROR_STREAMING_FILE');
}
if (isset($_POST['request']) && $_POST['request'] == true) {
$res['success'] = 'failure';
$res['message'] = $error_message;
print G::json_encode($res);
} else {
G::SendMessageText($error_message, "ERROR");
$backUrlObj = explode("sys" . SYS_SYS, $_SERVER['HTTP_REFERER']);
G::header("location: " . "/sys" . SYS_SYS . $backUrlObj[1]);
die;
}
} else {
if (isset($_POST['request']) && $_POST['request'] == true) {
$res['success'] = 'success';
$res['message'] = $info['basename'] . $ver . '.' . $ext;
print G::json_encode($res);
} else {
G::streamFile($realPath, $download, $info['basename'] . $ver . '.' . $ext);
}
}
//G::streamFile ( $realPath, true);
示例10: streamExported
public function streamExported($httpData)
{
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
$sFileName = $httpData->f;
$realPath = $PUBLIC_ROOT_PATH . $sFileName;
G::streamFile($realPath, true);
unlink($realPath);
}
示例11: base64_decode
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
// if (($RBAC_Response = $RBAC->userCanAccess("PM_CASES"))!=1) return $RBAC_Response;
$idDecode64 = base64_decode($_GET['id']);
$idExploded = explode('/', $idDecode64);
if ($idExploded[0] == '') {
array_shift($idExploded);
}
if ($idExploded[0] == 'plugin') {
//Get the Plugin Folder, always the first element
$pluginFolder = $idExploded[1];
$pluginFilename = PATH_PLUGINS . $pluginFolder . PATH_SEP . 'public_html' . PATH_SEP . $idExploded[2];
if (file_exists($pluginFilename)) {
G::streamFile($pluginFilename);
}
die;
}
$ainfoSite = explode("/", $_SERVER["REQUEST_URI"]);
//it was added to show the logo into management plugin add by krlos
if (isset($_GET['wsName']) && $_GET['wsName'] != '') {
$ainfoSite[1] = $_GET['wsName'];
}
//end add
$dir = PATH_DATA . "sites" . PATH_SEP . str_replace("sys", "", $ainfoSite[1]) . PATH_SEP . "files/logos";
$imagen = $dir . PATH_SEP . $idDecode64;
if (is_file($imagen)) {
showLogo($imagen);
} else {
$newDir = PATH_DATA . "sites" . PATH_SEP . str_replace("sys", "", $ainfoSite[1]) . PATH_SEP . "files/logos";
示例12: elseif
if (file_exists($realPath)) {
$sw_file_exists = true;
} elseif (file_exists($realPath1)) {
$sw_file_exists = true;
$realPath = $realPath1;
} elseif (file_exists($realPath2)) {
$sw_file_exists = true;
$realPath = $realPath2;
}
if (!$sw_file_exists) {
$error_message = "'" . $info['basename'] . $ver . '.' . $ext . "' " . G::LoadTranslation('ID_ERROR_STREAMING_FILE');
if (isset($_POST['request']) && $_POST['request'] == true) {
$res['success'] = 'failure';
$res['message'] = $error_message;
print G::json_encode($res);
} else {
G::SendMessageText($error_message, "ERROR");
$backUrlObj = explode("sys" . SYS_SYS, $_SERVER['HTTP_REFERER']);
G::header("location: " . "/sys" . SYS_SYS . $backUrlObj[1]);
die;
}
} else {
if (isset($_POST['request']) && $_POST['request'] == true) {
$res['success'] = 'success';
$res['message'] = $info['basename'] . $ver . '.' . $ext;
print G::json_encode($res);
} else {
G::streamFile($realPath, true, $info['basename'] . $ver . '.' . $ext);
}
}
//G::streamFile ( $realPath, true);
示例13: screamFileUpgrades
function screamFileUpgrades()
{
G::streamFile(PATH_DATA . 'log/upgrades.log', true);
}
示例14: savePluginFile
G::mk_dir($pathPublic);
G::mk_dir($pathPublic . 'images');
// file_put_contents ( PATH_DATA . 'skins' . PATH_SEP . $id , "hello world" );
$fields['className'] = $id;
$fields['version'] = $oConf->version;
$fields['description'] = $oConf->description;
$fields['PMversion'] = System::getVersion();
savePluginFile('skinPluginMainClass', $pathHome . $id . '.php', $fields);
savePluginFile('skinPluginClass', $pathBase . 'class.' . $id . '.php', $fields);
copyFile(PATH_SKINS . $id . '.php', $pathBase . 'data');
copyFile(PATH_SKINS . $id . '.html', $pathBase . 'data');
copyFile(PATH_SKINS . $id . '.cnf', $pathBase . 'data');
copyFile(PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'iepngfix.htc', $pathPublic);
copyFile(PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'style.css', $pathPublic);
$aFiles = array();
if ($handle = opendir($pathImages)) {
while (false !== ($file = readdir($handle))) {
if (substr($file, 0, 1) != '.') {
if (isset($aFiles[$file])) {
$aFiles[$file] = 0;
}
copyFile($pathImages . $file, $pathPublic . 'images' . PATH_SEP);
}
}
closedir($handle);
}
$fileTar = packPlugin($id, $oConf->version);
$bDownload = true;
G::streamFile($fileTar, $bDownload, basename($fileTar));
@G::rm_dir($pathHome);
@unlink($fileTar);
示例15: substr
$phpFile = PATH_GULLIVER_HOME . 'methods/' . substr(SYS_COLLECTION, 8) . SYS_TARGET . '.php';
} else {
//when the file is part of the public directory of any PROCESS, this a ProcessMaker feature
if (preg_match('/^[0-9][[:alnum:]]+$/', SYS_COLLECTION) == 1) {
//the pattern is /sysSYS/LANG/SKIN/PRO_UID/file
$auxPart = explode('/', $_SERVER['REQUEST_URI']);
$aAux = explode('?', $auxPart[count($auxPart) - 1]);
//$extPart = explode ( '.' , $auxPart[ count($auxPart)-1] );
$extPart = explode('.', $aAux[0]);
$queryPart = isset($aAux[1]) ? $aAux[1] : "";
$extension = $extPart[count($extPart) - 1];
$phpFile = PATH_DATA_SITE . 'public' . PATH_SEP . SYS_COLLECTION . PATH_SEP . urldecode($auxPart[count($auxPart) - 1]);
$aAux = explode('?', $phpFile);
$phpFile = $aAux[0];
if ($extension != 'php') {
G::streamFile($phpFile);
die;
}
$avoidChangedWorkspaceValidation = true;
$bWE = true;
//$phpFile = PATH_DATA_SITE . 'public' . PATH_SEP . SYS_COLLECTION . PATH_SEP . $auxPart[ count($auxPart)-1];
}
//erik: verify if it is a Controller Class or httpProxyController Class
if (is_file(PATH_CONTROLLERS . SYS_COLLECTION . '.php')) {
require_once PATH_CONTROLLERS . SYS_COLLECTION . '.php';
$controllerClass = SYS_COLLECTION;
//if the method name is empty set default to index method
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';
//if the method exists
if (is_callable(array($controllerClass, $controllerAction))) {
$isControllerCall = true;