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


PHP DBG::log方法代码示例

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


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

示例1: preResolve

 public function preResolve(\Cx\Core\Routing\Url $url)
 {
     if ($this->cx->getMode() != \Cx\Core\Core\Controller\Cx::MODE_FRONTEND) {
         return;
     }
     $em = $this->cx->getDb()->getEntityManager();
     $rewriteRuleRepo = $em->getRepository($this->getNamespace() . '\\Model\\Entity\\RewriteRule');
     $rewriteRules = $rewriteRuleRepo->findAll(array(), array('order' => 'asc'));
     $last = false;
     $originalUrl = clone $url;
     foreach ($rewriteRules as $rewriteRule) {
         try {
             $url = $rewriteRule->resolve($url, $last);
         } catch (\Exception $e) {
             // This is thrown if the regex of the rule is not valid
         }
         if ($last) {
             break;
         }
     }
     if ($originalUrl->toString() != $url->toString()) {
         if ($rewriteRule->getRewriteStatusCode() != \Cx\Core\Routing\Model\Entity\RewriteRule::REDIRECTION_TYPE_INTERN) {
             $headers = array('Location' => $url->toString());
             if ($rewriteRule->getRewriteStatusCode() == 301) {
                 array_push($headers, $_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently');
             }
             $this->getComponent('Cache')->writeCacheFileForRequest(null, $headers, '');
             \Cx\Core\Csrf\Controller\Csrf::header('Location: ' . $url->toString(), true, $rewriteRule->getRewriteStatusCode());
             die;
         }
         try {
             \DBG::log('Fetching content from ' . $url->toString());
             $request = new \HTTP_Request2($url->toString(), \HTTP_Request2::METHOD_GET);
             $request->setConfig(array('follow_redirects' => true));
             $response = $request->send();
             $content = $response->getBody();
             foreach ($response->getHeader() as $key => $value) {
                 if (in_array($key, array('content-encoding', 'transfer-encoding'))) {
                     continue;
                 }
                 \Cx\Core\Csrf\Controller\Csrf::header($key . ':' . $value);
             }
             $continue = false;
             die($content);
         } catch (\HTTP_Request2_Exception $e) {
             \DBG::dump($e);
         }
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:49,代码来源:ComponentController.class.php

示例2: clearCachePageForDomainAndPort

 /**
  * Clears a cache page
  * @param string $urlPattern Drop all pages that match the pattern, for exact format, make educated guesses
  * @param string $domain Domain name to drop cache page of
  * @param int $port Port to drop cache page of
  */
 protected function clearCachePageForDomainAndPort($urlPattern, $domain, $port)
 {
     $errno = 0;
     $errstr = '';
     $varnishSocket = fsockopen($this->hostname, $this->port, $errno, $errstr);
     if (!$varnishSocket) {
         \DBG::log('Varnish error: ' . $errstr . ' (' . $errno . ') on server ' . $this->hostname . ':' . $this->port);
     }
     $domainOffset = ASCMS_PATH_OFFSET;
     $request = 'BAN ' . $domainOffset . $urlPattern . " HTTP/1.0\r\n";
     $request .= 'Host: ' . $domain . ':' . $port . "\r\n";
     $request .= "User-Agent: Cloudrexx Varnish Cache Clear\r\n";
     $request .= "Connection: Close\r\n\r\n";
     fwrite($varnishSocket, $request);
     fclose($varnishSocket);
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:22,代码来源:ReverseProxyVarnish.class.php

示例3: processRequest

 public static function processRequest($token, $arrOrder)
 {
     global $_CONFIG;
     if (empty($token)) {
         return array('status' => 'error', 'message' => 'invalid token');
     }
     $testMode = intval(\Cx\Core\Setting\Controller\Setting::getValue('paymill_use_test_account', 'Shop')) == 0;
     $apiKey = $testMode ? \Cx\Core\Setting\Controller\Setting::getValue('paymill_test_private_key', 'Shop') : \Cx\Core\Setting\Controller\Setting::getValue('paymill_live_private_key', 'Shop');
     if ($token) {
         try {
             $request = new Paymill\Request($apiKey);
             $transaction = new Paymill\Models\Request\Transaction();
             $transaction->setAmount($arrOrder['amount'])->setCurrency($arrOrder['currency'])->setToken($token)->setDescription($arrOrder['note'])->setSource('contrexx_' . $_CONFIG['coreCmsVersion']);
             DBG::log("Transactoin created with token:" . $token);
             $response = $request->create($transaction);
             $paymentId = $response->getId();
             DBG::log("Payment ID" . $paymentId);
             return array('status' => 'success', 'payment_id' => $paymentId);
         } catch (\Paymill\Services\PaymillException $e) {
             //Do something with the error informations below
             return array('status' => 'error', 'response_code' => $e->getResponseCode(), 'status_code' => $e->getStatusCode(), 'message' => $e->getErrorMessage());
         }
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:24,代码来源:PaymillHandler.class.php

示例4: getHeaderForField

 /**
  * Returns a string to display the table header for the given field name.
  *
  * Uses the order currently stored in the object, as set by setOrder().
  * The optional $direction overrides the current state of the
  * order direction.
  * @param   string  $field      The field name
  * @param   string  $direction  The optional direction
  * @return  string              The string for a clickable table
  *                              header field.
  * @author  Reto Kohli <reto.kohli@comvation.com>
  */
 function getHeaderForField($field, $direction = null)
 {
     global $_CORELANG;
     //\DBG::log("Sorting::getHeaderForField(field=$field): field names: ".var_export($this->arrField, true));
     // The field may consist of the database field name
     // enclosed in backticks, plus optional direction
     $index = self::getFieldindex($field);
     //\DBG::log("Sorting::getHeaderForField($field): Fixed");
     if (empty($index)) {
         \DBG::log("Sorting::getHeaderForField({$field}): WARNING: Cannot make index for {$field}");
         return '';
     }
     $direction_orig = null;
     if ($direction) {
         $direction_orig = $this->orderDirection;
         $this->setOrderDirection($direction);
         $direction = $this->getOrderDirection();
         // Fixed case!
     }
     //\DBG::log("Sorting::getHeaderForField($field): direction $direction, direction_orig $direction_orig, orderDirection $this->orderDirection");
     $uri = $this->baseUri;
     Html::replaceUriParameter($uri, $direction ? $this->getOrderUriEncoded($field) : $this->getOrderReverseUriEncoded($field));
     //\DBG::log("Sorting::getHeaderForField($field): URI $uri");
     $strHeader = Html::getLink($uri, ($direction ? sprintf($_CORELANG['TXT_CORE_SORTING_FORMAT_' . $this->orderDirection], $this->arrField[$index]) : $this->arrField[$index]) . ($this->orderField == $index && ($direction === null || $direction === $direction_orig) ? '&nbsp;' . $this->getOrderDirectionImage() : ''));
     //echo("Sorting::getHeaderForField(fieldName=$field): made header: ".htmlentities($strHeader)."<br />");
     if ($direction_orig) {
         $this->orderDirection = $direction_orig;
     }
     return $strHeader;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:42,代码来源:Sorting.class.php

示例5: checkModRewrite

 private function checkModRewrite()
 {
     global $_CONFIG;
     if ($this->_isNewerVersion('3.0.0', $_CONFIG['coreCmsVersion'])) {
         return true;
     }
     if (function_exists('apache_get_modules')) {
         $apacheModules = apache_get_modules();
         $modRewrite = in_array('mod_rewrite', $apacheModules);
     } else {
         try {
             include_once UPDATE_LIB . '/PEAR/HTTP/Request2.php';
             $request = new HTTP_Request2('http://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['SCRIPT_NAME'], 0, -9) . 'rewrite_test/');
             $objResponse = $request->send();
             $arrHeaders = $objResponse->getHeader();
         } catch (\HTTP_Request2_Exception $e) {
             \DBG::log($e->getMessage());
         }
         if (empty($arrHeaders['location'])) {
             $modRewrite = 'warning';
         } else {
             if (strpos($arrHeaders['location'], 'weiterleitungen_funktionieren') !== false) {
                 $modRewrite = true;
             } else {
                 $modRewrite = false;
             }
         }
     }
     return $modRewrite;
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:30,代码来源:ContrexxUpdate.class.php

示例6: convertAllThemesToComponent

 /**
  * Generate a component.yml for each theme available on the system
  * only used in update process for fixing invalid themes
  */
 public function convertAllThemesToComponent()
 {
     foreach ($this->findAll() as $theme) {
         if ($theme->isComponent()) {
             continue;
         }
         try {
             $this->convertThemeToComponent($theme);
         } catch (\Exception $ex) {
             \DBG::log($ex->getMessage());
             \DBG::log($theme->getThemesname() . ' : Unable to convert theme to component');
         }
     }
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:18,代码来源:ThemeRepository.class.php

示例7: set

 /**
  * Updates a setting
  *
  * If the setting name exists and the new value is not equal to
  * the old one, it is updated, and $changed set to true.
  * Otherwise, nothing happens, and false is returned
  * @see init(), updateAll()
  * @param   string    $name       The settings name
  * @param   string    $value      The settings value
  * @return  boolean               True if the value has been changed,
  *                                false otherwise, null on noop
  */
 public function set($name, $value)
 {
     if (!isset($this->arrSettings[$name])) {
         \DBG::log("\\Cx\\Core\\Setting\\Model\\Entity\\Engine::set({$name}, {$value}): Unknown, changed: " . $this->changed);
         return false;
     }
     if ($this->arrSettings[$name]['value'] == $value) {
         \DBG::log("\\Cx\\Core\\Setting\\Model\\Entity\\Engine::set({$name}, {$value}): Identical, changed: " . $this->changed);
         return null;
     }
     $this->changed = true;
     $this->arrSettings[$name]['value'] = $value;
     \DBG::log("\\Cx\\Core\\Setting\\Model\\Entity\\Engine::set({$name}, {$value}): Added/updated, changed: " . $this->changed);
     return true;
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:27,代码来源:Engine.class.php

示例8: getCategoryRelNews

 /**
  * Get the news ID list based on the category 
  * 
  * @param integer $categoryId
  * 
  * @global object $objDatabase
  * 
  * @return mixed boolean|array
  */
 public function getCategoryRelNews($categoryId)
 {
     global $objDatabase;
     if (empty($categoryId)) {
         return false;
     }
     $query = 'SELECT
         `news_id`
         FROM `' . DBPREFIX . 'module_news_rel_categories`
         WHERE `category_id` = "' . $categoryId . '"';
     $objCategoryNewsList = $objDatabase->Execute($query);
     if (!$objCategoryNewsList) {
         \DBG::log('No News entries found on the category ID: ' . $categoryId);
         return false;
     }
     $newsIdList = array();
     while (!$objCategoryNewsList->EOF) {
         $newsIdList[] = $objCategoryNewsList->fields['news_id'];
         $objCategoryNewsList->MoveNext();
     }
     return $newsIdList;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:31,代码来源:NewsLibrary.class.php

示例9: crawlerSpider

 /**
  * Crawler spider -> crawl all the links present in the sitemap file.
  * 
  * @return null
  */
 public function crawlerSpider()
 {
     try {
         //initialize
         $runStartTime = new \DateTime('now');
         $inputArray = array('lang' => contrexx_raw2db($this->langId), 'startTime' => $runStartTime, 'endTime' => $runStartTime, 'totalLinks' => 0, 'totalBrokenLinks' => 0, 'runStatus' => contrexx_raw2db(self::RUN_STATUS_RUNNING));
         $lastInsertedRunId = $this->modifyCrawler($inputArray);
         $request = new \HTTP_Request2();
         $sitemapPath = ASCMS_DOCUMENT_ROOT . '/sitemap_' . $this->langName . '.xml';
         if (file_exists($sitemapPath)) {
             $sitemapXml = simplexml_load_file($sitemapPath);
             foreach ($sitemapXml->children() as $child) {
                 foreach ($child as $value) {
                     if ($value->getName() == 'loc') {
                         $page = $this->isModulePage((string) $value);
                         if ($page && $page->getType() == self::TYPE_CONTENT) {
                             $this->initializeScript((string) $value, $request, $page->getId());
                             $this->checkMemoryLimit($lastInsertedRunId);
                             //$this->checkTimeoutLimit($lastInsertedRunId);
                         }
                     }
                 }
             }
         } else {
             $this->updateCrawlerStatus($lastInsertedRunId, self::RUN_STATUS_INCOMPLETE);
             \DBG::log('No sitemap found for language ' . $this->langName . '. Please save a page so the sitemap can be build.');
             return;
         }
         //move the uncalled links from link table to history table
         $this->updateHistory($this->langId, $lastInsertedRunId);
         //get the total links and total broken links
         $totalLinks = $this->linkRepo->getLinksCountByLang($runStartTime->format(ASCMS_DATE_FORMAT_INTERNATIONAL_DATETIME), $this->langId);
         $totalBrokenLinks = $this->linkRepo->brokenLinkCountByLang($this->langId);
         //save the run details
         $crawlerRuns = $this->crawlerRepo->findOneBy(array('id' => $lastInsertedRunId));
         if ($crawlerRuns) {
             $inputArray = array('lang' => contrexx_raw2db($this->langId), 'startTime' => $runStartTime, 'totalLinks' => contrexx_raw2db($totalLinks), 'totalBrokenLinks' => contrexx_raw2db($totalBrokenLinks), 'runStatus' => contrexx_raw2db(self::RUN_STATUS_COMPLETED));
             $crawlerRuns->updateEndTime();
             $this->modifyCrawler($inputArray, $crawlerRuns);
         }
     } catch (\Exception $error) {
         $this->updateCrawlerStatus('', self::RUN_STATUS_INCOMPLETE);
         die('Error occurred' . $error);
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:50,代码来源:LinkCrawlerController.class.php

示例10: process

 /**
  * Processes the Order
  *
  * Verifies all data, updates and stores it in the database, and
  * initializes payment
  * @return  boolean         True on successs, false otherwise
  */
 static function process()
 {
     global $objDatabase, $_ARRAYLANG;
     // FOR TESTING ONLY (repeatedly process/store the order, also disable self::destroyCart())
     //$_SESSION['shop']['order_id'] = NULL;
     // Verify that the order hasn't yet been saved
     // (and has thus not yet been confirmed)
     if (isset($_SESSION['shop']['order_id'])) {
         return \Message::error($_ARRAYLANG['TXT_ORDER_ALREADY_PLACED']);
     }
     // No more confirmation
     self::$objTemplate->hideBlock('shopConfirm');
     // Store the customer, register the order
     $customer_ip = $_SERVER['REMOTE_ADDR'];
     $customer_host = substr(@gethostbyaddr($_SERVER['REMOTE_ADDR']), 0, 100);
     $customer_browser = substr(getenv('HTTP_USER_AGENT'), 0, 100);
     $new_customer = false;
     //\DBG::log("Shop::process(): E-Mail: ".$_SESSION['shop']['email']);
     if (self::$objCustomer) {
         //\DBG::log("Shop::process(): Existing User username ".$_SESSION['shop']['username'].", email ".$_SESSION['shop']['email']);
     } else {
         // Registered Customers are required to be logged in!
         self::$objCustomer = Customer::getRegisteredByEmail($_SESSION['shop']['email']);
         if (self::$objCustomer) {
             \Message::error($_ARRAYLANG['TXT_SHOP_CUSTOMER_REGISTERED_EMAIL']);
             \Cx\Core\Csrf\Controller\Csrf::redirect(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'login') . '?redirect=' . base64_encode(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'confirm')));
         }
         // Unregistered Customers are stored as well, as their information is needed
         // nevertheless.  Their active status, however, is set to false.
         self::$objCustomer = Customer::getUnregisteredByEmail($_SESSION['shop']['email']);
         if (!self::$objCustomer) {
             self::$objCustomer = new Customer();
             // Currently, the e-mail address is set as the user name
             $_SESSION['shop']['username'] = $_SESSION['shop']['email'];
             //\DBG::log("Shop::process(): New User username ".$_SESSION['shop']['username'].", email ".$_SESSION['shop']['email']);
             self::$objCustomer->username($_SESSION['shop']['username']);
             self::$objCustomer->email($_SESSION['shop']['email']);
             // Note that the password is unset when the Customer chooses
             // to order without registration.  The generated one
             // defaults to length 8, fulfilling the requirements for
             // complex passwords.  And it's kept absolutely secret.
             $password = empty($_SESSION['shop']['password']) ? \User::make_password() : $_SESSION['shop']['password'];
             //\DBG::log("Password: $password (session: {$_SESSION['shop']['password']})");
             if (!self::$objCustomer->password($password)) {
                 \Message::error($_ARRAYLANG['TXT_INVALID_PASSWORD']);
                 \Cx\Core\Csrf\Controller\Csrf::redirect(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'account'));
             }
             self::$objCustomer->active(empty($_SESSION['shop']['dont_register']));
             $new_customer = true;
         }
     }
     // Update the Customer object from the session array
     // (whether new or not -- it may have been edited)
     self::$objCustomer->gender($_SESSION['shop']['gender']);
     self::$objCustomer->firstname($_SESSION['shop']['firstname']);
     self::$objCustomer->lastname($_SESSION['shop']['lastname']);
     self::$objCustomer->company($_SESSION['shop']['company']);
     self::$objCustomer->address($_SESSION['shop']['address']);
     self::$objCustomer->city($_SESSION['shop']['city']);
     self::$objCustomer->zip($_SESSION['shop']['zip']);
     self::$objCustomer->country_id($_SESSION['shop']['countryId']);
     self::$objCustomer->phone($_SESSION['shop']['phone']);
     self::$objCustomer->fax($_SESSION['shop']['fax']);
     $arrGroups = self::$objCustomer->getAssociatedGroupIds();
     $usergroup_id = \Cx\Core\Setting\Controller\Setting::getValue('usergroup_id_reseller', 'Shop');
     if (empty($usergroup_id)) {
         //\DBG::log("Shop::process(): ERROR: Missing reseller group");
         \Message::error($_ARRAYLANG['TXT_SHOP_ERROR_USERGROUP_INVALID']);
         \Cx\Core\Csrf\Controller\Csrf::redirect(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', ''));
     }
     if (!in_array($usergroup_id, $arrGroups)) {
         //\DBG::log("Shop::process(): Customer is not in Reseller group (ID $usergroup_id)");
         // Not a reseller.  See if she's a final customer
         $usergroup_id = \Cx\Core\Setting\Controller\Setting::getValue('usergroup_id_customer', 'Shop');
         if (empty($usergroup_id)) {
             //\DBG::log("Shop::process(): ERROR: Missing final customer group");
             \Message::error($_ARRAYLANG['TXT_SHOP_ERROR_USERGROUP_INVALID']);
             \Cx\Core\Csrf\Controller\Csrf::redirect(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', ''));
         }
         if (!in_array($usergroup_id, $arrGroups)) {
             //\DBG::log("Shop::process(): Customer is not in final customer group (ID $usergroup_id), either");
             // Neither one, add to the final customer group (default)
             $arrGroups[] = $usergroup_id;
             self::$objCustomer->setGroups($arrGroups);
             //\DBG::log("Shop::process(): Added Customer to final customer group (ID $usergroup_id): ".var_export(self::$objCustomer->getAssociatedGroupIds(), true));
         } else {
             //\DBG::log("Shop::process(): Customer is a final customer (ID $usergroup_id) already: ".var_export(self::$objCustomer->getAssociatedGroupIds(), true));
         }
     } else {
         //\DBG::log("Shop::process(): Customer is a Reseller (ID $usergroup_id) already: ".var_export(self::$objCustomer->getAssociatedGroupIds(), true));
     }
     // Insert or update the customer
     //\DBG::log("Shop::process(): Storing Customer: ".var_export(self::$objCustomer, true));
//.........这里部分代码省略.........
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:101,代码来源:Shop.class.php

示例11: paymentYellowpay

 function paymentYellowpay($order_id, $amount)
 {
     global $_ARRAYLANG, $_LANGID;
     // Prepare payment using current settings and customer selection
     $product_id = self::GetOrderValue('order_product', $order_id);
     if (empty($product_id)) {
         return 'alert("' . $_ARRAYLANG['TXT_EGOV_ERROR_PROCESSING_ORDER'] . "\");\n";
     }
     $quantity = self::GetProduktValue('product_per_day', $product_id) == 'yes' ? intval($_REQUEST['contactFormField_Quantity']) : 1;
     $product_amount = !empty($amount) ? $amount : self::GetProduktValue('product_price', $product_id) * $quantity;
     \Cx\Core\Setting\Controller\Setting::init('Egov', 'config');
     $arrOrder = array('ORDERID' => $order_id, 'AMOUNT' => $product_amount, 'CURRENCY' => self::GetProduktValue('product_paypal_currency', $product_id), 'PARAMPLUS' => 'section=Egov&order_id=' . $order_id . '&handler=yellowpay', 'COM' => self::GetProduktValue('product_name', $product_id));
     $_POST = contrexx_input2raw($_POST);
     // Note that none of these fields is present in the post in the current
     // implementation!  The meaning cannot be guessed from the actual field
     // names (i.e. "contactFormField_17").
     $arrOrder['CN'] = '';
     if (!empty($_POST['Vorname'])) {
         $arrOrder['CN'] = $_POST['Vorname'];
     }
     if (!empty($_POST['Nachname'])) {
         $arrOrder['CN'] .= ($arrOrder['CN'] ? ' ' : '') . $_POST['Nachname'];
     }
     if (!empty($_POST['Adresse'])) {
         $arrOrder['OWNERADDRESS'] = $_POST['Adresse'];
     }
     if (!empty($_POST['PLZ'])) {
         $arrOrder['OWNERZIP'] = $_POST['PLZ'];
     }
     if (!empty($_POST['Ort'])) {
         $arrOrder['OWNERTOWN'] = $_POST['Ort'];
     }
     if (!empty($_POST['Land'])) {
         $arrOrder['OWNERCTY'] = $_POST['Land'];
     }
     if (!empty($_POST['Telefon'])) {
         $arrOrder['OWNERTELNO'] = $_POST['Telefon'];
     }
     if (!empty($_POST['EMail'])) {
         $arrOrder['EMAIL'] = $_POST['EMail'];
     }
     $landingPage = \Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page')->findOneByModuleCmdLang('Egov', '', FRONTEND_LANG_ID);
     $yellowpayForm = \Yellowpay::getForm($arrOrder, 'Send', false, null, $landingPage);
     if (count(\Yellowpay::$arrError)) {
         \DBG::log("Yellowpay could not be initialized:\n" . join("\n", \Yellowpay::$arrError));
         die;
     }
     die("<!DOCTYPE html>\n<html>\n  <head>\n    <title>Yellowpay</title>\n  </head>\n  <body>\n{$yellowpayForm}\n  </body>\n</html>\n");
     // Test/debug: die(htmlentities($yellowpayForm));
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:50,代码来源:Egov.class.php

示例12: testDeleteGroupFromFileSystem

 public function testDeleteGroupFromFileSystem()
 {
     \DBG::log('*** testDeleteGroupFromFileSystem ***');
     $this->addValuesFileSystem();
     Setting::init('MultiSiteTest', 'testgroup7', 'FileSystem');
     Setting::delete(null, 'testgroup7');
     Setting::flush();
     $this->assertNull(Setting::getValue('key7.1'));
     $this->assertNull(Setting::getValue('key7.2'));
     $this->deleteValuesFileSystem();
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:11,代码来源:SettingTest.class.php

示例13: clearVarnishCache

 /**
  * Clears Varnish cache
  */
 private function clearVarnishCache()
 {
     global $_CONFIG;
     if (!isset($_CONFIG['cacheVarnishStatus']) || $_CONFIG['cacheVarnishStatus'] != 'on') {
         return;
     }
     $varnishConfiguration = $this->getVarnishConfiguration();
     $varnishSocket = fsockopen($varnishConfiguration['ip'], $varnishConfiguration['port'], $errno, $errstr);
     if (!$varnishSocket) {
         \DBG::log("Varnish error: {$errstr} ({$errno}) on server {$varnishConfiguration['ip']}:{$varnishConfiguration['port']}");
     }
     $requestDomain = $_CONFIG['domainUrl'];
     $domainOffset = ASCMS_PATH_OFFSET;
     $request = "BAN {$domainOffset} HTTP/1.0\r\n";
     $request .= "Host: {$requestDomain}\r\n";
     $request .= "User-Agent: Cloudrexx Varnish Cache Clear\r\n";
     $request .= "Connection: Close\r\n\r\n";
     fwrite($varnishSocket, $request);
     fclose($varnishSocket);
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:23,代码来源:CacheLib.class.php

示例14: checkMemoryLimit

 /**
  * Checking memory limit
  * 
  * @param type $requiredMemoryLimit required memory limit
  * 
  * @return boolean
  */
 function checkMemoryLimit($requiredMemoryLimit)
 {
     if (empty($this->memoryLimit)) {
         $memoryLimit = \FWSystem::getBytesOfLiteralSizeFormat(@ini_get('memory_limit'));
         //if memory limit is empty then set default php memory limit of 8MiBytes
         $this->memoryLimit = !empty($memoryLimit) ? $memoryLimit : self::MiB2 * 4;
     }
     $potentialRequiredMemory = memory_get_usage() + $requiredMemoryLimit;
     if ($potentialRequiredMemory > $this->memoryLimit) {
         // try to set a higher memory_limit
         if (!@ini_set('memory_limit', $potentialRequiredMemory)) {
             \DBG::log('The link spider script is interrupted due to insufficient memory is available.');
             return false;
         }
     }
     return true;
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:24,代码来源:LinkCrawlerController.class.php

示例15: storeUpdateWebsiteDetailsToYml

 /**
  * Store the website details into the YML file
  * 
  * @param string $folderPath
  * @param string $filePath
  * @param array  $ymlContent
  * 
  * @return null
  */
 public function storeUpdateWebsiteDetailsToYml($folderPath, $filePath, $ymlContent)
 {
     if (empty($folderPath) || empty($filePath)) {
         return;
     }
     try {
         if (!file_exists($folderPath)) {
             \Cx\Lib\FileSystem\FileSystem::make_folder($folderPath);
         }
         $file = new \Cx\Lib\FileSystem\File($filePath);
         $file->touch();
         $yaml = new \Symfony\Component\Yaml\Yaml();
         $file->write($yaml->dump(array('PendingCodeBaseChanges' => $ymlContent)));
     } catch (\Exception $e) {
         \DBG::log($e->getMessage());
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:26,代码来源:UpdateController.class.php


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