/** * Connects to POG SOAP server defined in configuration.php and * generates new versions of all objects detected in /objects/ dir. * All upgraded objects are then zipped and presented to user. * * @param string $path */ function UpdateAllObjects($path) { $dir = opendir($path); $objects = array(); while (($file = readdir($dir)) !== false) { if (strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && $file != "class.database.php" && $file != "configuration.php" && $file != "setup.php" && $file != "class.pog_base.php") { $objects[] = $file; } } closedir($dir); $i = 0; foreach ($objects as $object) { $content = file_get_contents($path . "/" . $object); $contentParts = split("<b>", $content); if (isset($contentParts[1])) { $contentParts2 = split("</b>", $contentParts[1]); } if (isset($contentParts2[0])) { $className = trim($contentParts2[0]); } if (isset($className)) { eval('include_once("../../objects/class.' . strtolower($className) . '.php");'); $instance = new $className(); if (!TestIsMapping($instance)) { $objectNameList[] = $className; $linkParts1 = split("\\*\\/", $contentParts[1]); $linkParts2 = split("\\@link", $linkParts1[0]); $link = $linkParts2[1]; $options = false; if ($GLOBALS['configuration']['proxy_host'] != false && $GLOBALS['configuration']['proxy_port'] != false && $GLOBALS['configuration']['proxy_username'] != false && $GLOBALS['configuration']['proxy_password'] != false) { $options = array('proxy_host' => $GLOBALS['configuration']['proxy_host'], 'proxy_port' => $GLOBALS['configuration']['proxy_port'], 'proxy_login' => $GLOBALS['configuration']['proxy_username'], 'proxy_password' => $GLOBALS['configuration']['proxy_password']); } $client = new SoapClient($GLOBALS['configuration']['soap'], $options); if ($i == 0) { $package = unserialize($client->GeneratePackageFromLink($link)); } else { $objectString = $client->GenerateObjectFromLink($link); $package["objects"]["class." . strtolower($className) . ".php"] = $objectString; } } } $i++; } //upgrade mapping classes if any foreach ($objectNameList as $objectName) { $instance = new $objectName(); foreach ($instance->pog_attribute_type as $key => $attribute_type) { if ($attribute_type['db_attributes'][1] == "JOIN") { $mappingString = $client->GenerateMapping($objectName, $key, isset($GLOBALS['configuration']['pdoDriver']) ? 'php5.1' : 'php5', isset($GLOBALS['configuration']['pdoDriver']) ? 'pdo' : 'pog', isset($GLOBALS['configuration']['pdoDriver']) ? 'mysql' : ''); $package["objects"]['class.' . strtolower(MappingName($objectName, $key)) . '.php'] = $mappingString; } } } $zipfile = new createZip(); $zipfile->addPOGPackage($package); $zipfile->forceDownload("pog." . time() . ".zip"); }
/** * Connects to POG SOAP server defined in configuration.php and * generates new versions of all objects detected in /objects/ dir. * All upgraded objects are then zipped and presented to user. * * @param string $path */ function UpdateAllObjects($path) { $dir = opendir($path); $objects = array(); while (($file = readdir($dir)) !== false) { if (strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && $file != "class.database.php" && $file != "configuration.php" && $file != "setup.php") { $objects[] = $file; } } closedir($dir); $i = 0; foreach ($objects as $object) { $content = file_get_contents($path . "/" . $object); $contentParts = split("<b>", $content); if (isset($contentParts[1])) { $contentParts2 = split("</b>", $contentParts[1]); } if (isset($contentParts2[0])) { $className = trim($contentParts2[0]); } if (isset($className)) { $objectNameList[] = $className; $linkParts1 = split("\\*\\/", $contentParts[1]); $linkParts2 = split("\\@link", $linkParts1[0]); $link = $linkParts2[1]; $client = new SoapClient($GLOBALS['configuration']['soap']); if ($i == 0) { $package = unserialize($client->GeneratePackageFromLink($link)); } else { $objectString = $client->GenerateObjectFromLink($link); $package["objects"]["class." . strtolower($className) . ".php"] = $objectString; } } $i++; } $zipfile = new createZip(); $zipfile->addPOGPackage($package); $zipfile->forceDownload("pog." . time() . ".zip"); }
if ($GLOBALS['configuration']['soapEngine'] == "nusoap") { $client = new soapclient($GLOBALS['configuration']['soap'], true); $attributeList = unserialize($_SESSION['attributeList']); $typeList = unserialize($_SESSION['typeList']); $params = array('objectName' => $_SESSION['objectName'], 'attributeList' => $attributeList, 'typeList' => $typeList, 'language' => $_SESSION['language'], 'wrapper' => $_SESSION['wrapper'], 'pdoDriver' => $_SESSION['pdoDriver'], 'db_encoding' => "0"); $package = unserialize($client->call('GeneratePackage', $params)); } else { if ($GLOBALS['configuration']['soapEngine'] == "phpsoap") { $client = new SoapClient('services/pog.wsdl', array('cache_wsdl' => 0)); $attributeList = unserialize($_SESSION['attributeList']); $typeList = unserialize($_SESSION['typeList']); $objectName = $_SESSION['objectName']; $language = $_SESSION['language']; $wrapper = $_SESSION['wrapper']; $pdoDriver = $_SESSION['pdoDriver']; $classList = unserialize($_SESSION['classList']); $dbEncoding = "0"; try { $package = unserialize($client->GeneratePackage($objectName, $attributeList, $typeList, $language, $wrapper, $pdoDriver, $dbEncoding, $classList)); } catch (SoapFault $e) { echo "Error: {$e->faultstring}"; } } } $zipfile = new createZip(); $zipfile->addPOGPackage($package); $zipfile->forceDownload("pog." . time() . ".zip"); $_POST = null; } else { header("Location:/"); }
file_put_contents( "temp/$base/{$table['delete_page']}", $s->deleterow() ); */ $createZip = new createZip; $createZip -> addFile($s->listtable(), $table['list_page'] ); $createZip -> addFile($s->newrow(), $table['new_page'] ); $createZip -> addFile($s->editrow(), $table['edit_page'] ); $createZip -> addFile($s->deleterow(), $table['delete_page'] ); $fileName = "temp/$base.zip"; $fd = fopen ($fileName, "wb"); $out = fwrite ($fd, $createZip -> getZippedfile() ); fclose ($fd); $createZip -> forceDownload($fileName); //@unlink($fileName); } else { header("Location: index.php"); }
public function home() { $dim = array(900, 600); $dim = array(800, 533); $dim = array(600, 400); if (_button()) { $v = $this->__(array('start' => 0, 'folder' => '', 'width' => 0, 'height' => 0)); $images = $types = w(); $dim = array($v['width'], $v['height']); @set_time_limit(0); $original = PCK . $v['folder'] . '/'; $gallery = $original . 'gallery/'; if (!@file_exists($original)) { exit; } if (!@file_exists($gallery)) { @mkdir($gallery, 0777); @chmod($gallery, 0777); } require_once XFS . XCOR . 'upload.php'; require_once XFS . XCOR . 'zip.php'; if (!is_writable($original) || !is_writable($gallery)) { exit; } $upload = new upload(); $zip = new createZip(); $fp = @opendir(PCK . $v['folder']); while ($row = @readdir($fp)) { if (preg_match('#^(.*?)\\.(jpg|JPG)$#is', $row, $s) && @is_readable($original . $row)) { $images[] = $row; $type = preg_match('#^(\\d+)$#is', $s[1]) ? 'numeric' : 'string'; $types[$type] = true; } } @closedir($fp); if (!count($images)) { exit('No hay archivos para convertir.'); } $multisort = array(&$images, SORT_ASC); if (!isset($types['string'])) { $multisort[] = SORT_NUMERIC; } hook('array_multisort', $multisort); foreach ($images as $image) { $row = $upload->_row($gallery, $image); $xa = $upload->resize($row, $original, $gallery, $start, $dim, false, false, false, $original . $image); $start++; $zip->addFile(file_get_contents($gallery . $xa['filename']), $xa['filename']); } $zipfile = PCK . $folder . '.zip'; $fd = @fopen($zipfile, 'wb'); $out = @fwrite($fd, $zip->getZippedfile()); @fclose($fd); $zip->forceDownload($zipfile); @unlink($zipfile); exit; } $options = w(); $fp = @opendir(PCK); while ($file = @readdir($fp)) { if (substr($file, 0, 1) != '.' && is_dir(PCK . $file)) { $options[] = $file; } } @closedir($fp); foreach ($options as $row) { echo '<option value="' . $row . '">' . $row . '</option>'; } return; }
$multisort = array(&$images, SORT_ASC); if (!isset($types['string'])) { $multisort[] = SORT_NUMERIC; } hook('array_multisort', $multisort); foreach ($images as $image) { $row = $upload->_row($gallery, $image); $xa = $upload->resize($row, $original, $gallery, $start, $dim, false, false, false, $original . $image); $start++; $zip->addFile(file_get_contents($gallery . $xa['filename']), $xa['filename']); } $zipfile = PCK . $folder . '.zip'; if ($fd = @fopen($zipfile, 'wb')) { $out = @fwrite($fd, $zip->getZippedfile()); @fclose($fd); $zip->forceDownload($zipfile); @unlink($zipfile); } exit; } $options = w(); $fp = @opendir(PCK); while ($file = @readdir($fp)) { if (substr($file, 0, 1) != '.' && is_dir(PCK . $file)) { $options[] = $file; } } @closedir($fp); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es">