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


PHP Shineisp_Commons_Utilities::log方法代码示例

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


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

示例1: indexAction

 public function indexAction()
 {
     $ns = new Zend_Session_Namespace();
     $locale = $ns->lang;
     Shineisp_Commons_Utilities::log("ShineISP starts now from " . $_SERVER['SERVER_ADDR']);
     if (empty($ns->customer)) {
         $this->view->dashboard = true;
     } else {
         $this->view->dashboard = false;
     }
     $this->view->mex = $this->getRequest()->getParam('mex');
     $this->view->mexstatus = $this->getRequest()->getParam('status');
     // Call the static Homepage
     $homepage = CmsPages::findbyvar("homepage", $locale);
     if (!empty($homepage['body'])) {
         // Set the custom layout of the page
         if (!empty($homepage['pagelayout'])) {
             $this->getHelper('layout')->setLayout($homepage['pagelayout']);
         }
         // Set the keywords of the page
         if (!empty($homepage['keywords'])) {
             $this->view->headMeta()->setName('keywords', $homepage['keywords']);
         }
         // Set the body of the page
         $this->view->content = $homepage['body'];
     }
     $this->view->headertitle = "S: " . Shineisp_Registry::get('ISP')->slogan;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:28,代码来源:IndexController.php

示例2: preStmtExecute

 public function preStmtExecute(Doctrine_Event $event)
 {
     // Check if the administrator has enabled the query logging feature
     if (Settings::findbyParam('debug_queries')) {
         $breadcrumps = array();
         $query = $event->getQuery();
         $params = $event->getParams();
         $callers = array_reverse(debug_backtrace(), true);
         $callers = array_slice($callers, 4, count($callers) - 10);
         foreach ($callers as $caller) {
             $class = !empty($caller['class']) ? $caller['class'] : null;
             $breadcrumps[] = $class . "->" . $caller['function'];
         }
         $strBreadcrump = "System: " . implode(" / ", $breadcrumps);
         //the below makes some naive assumptions about the queries being logged
         while (sizeof($params) > 0) {
             $param = array_shift($params);
             if (!is_numeric($param)) {
                 $param = sprintf("'%s'", $param);
             }
             $query = substr_replace($query, $param, strpos($query, '?'), 1);
         }
         Shineisp_Commons_Utilities::log($query, "queries.log");
         Shineisp_Commons_Utilities::log($strBreadcrump, "debug.log", Zend_Log::DEBUG);
         // Increase query counter
         $queryCount = Shineisp_Registry::isRegistered('querycount') ? Shineisp_Registry::get('querycount') : 0;
         $queryCount = $queryCount + 1;
         Shineisp_Registry::set('querycount', $queryCount);
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:30,代码来源:QueriesLogger.php

示例3: eu_check

 private function eu_check()
 {
     $isp = Shineisp_Registry::get('ISP');
     $VIES = new SoapClient($this->vies_soap_url);
     if ($VIES) {
         try {
             $r = $VIES->checkVat(array('countryCode' => $this->countryCode, 'vatNumber' => $this->vat));
             foreach ($r as $chiave => $valore) {
                 $this->viesOutput[$chiave] = $valore;
             }
             return $r->valid;
         } catch (SoapFault $e) {
             $ret = $e->faultstring;
             $regex = '/\\{ \'([A-Z_]*)\' \\}/';
             $n = preg_match($regex, $ret, $matches);
             $ret = !empty($matches[1]) ? $matches[1] : $ret;
             $faults = array('INVALID_INPUT' => 'The provided CountryCode is invalid or the VAT number is empty', 'SERVICE_UNAVAILABLE' => 'The SOAP service is unavailable, try again later', 'MS_UNAVAILABLE' => 'The Member State service is unavailable, try again later or with another Member State', 'TIMEOUT' => 'The Member State service could not be reached in time, try again later or with another Member State', 'SERVER_BUSY' => 'The service cannot process your request. Try again later.');
             $ret = $faults[$ret];
             // adding a log message
             Shineisp_Commons_Utilities::log("Response from VIES: " . $ret);
             $subject = 'Invalid VAT code';
             $body = "Response from VIES: " . $ret;
             Shineisp_Commons_Utilities::SendEmail($isp->email, $isp->email, null, $subject, $body);
             return false;
         }
     } else {
         $subject = 'Connect to VIES';
         $body = "Impossible to connect with VIES";
         Shineisp_Commons_Utilities::SendEmail($isp->email, $isp->email, null, $subject, $body);
         // adding a log message
         Shineisp_Commons_Utilities::log("Response from VIES: " . $ret);
         return false;
     }
     return true;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:Vat.php

示例4: errorAction

 public function errorAction()
 {
     $errors = $this->_getParam('error_handler');
     $mex = $this->_getParam('mex');
     // Ajax controll
     if (Shineisp_Commons_Utilities::isAjax()) {
         echo json_encode($errors->exception->getMessage());
         die;
     }
     switch ($errors->type) {
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
             // 404 error -- controller or action not found
             $this->getResponse()->setHttpResponseCode(404);
             $this->view->message = 'Controller has been not found';
             break;
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
             // 404 error -- controller or action not found
             $this->getResponse()->setHttpResponseCode(404);
             $this->view->message = 'Action has been not found';
             break;
         default:
             // application error
             $this->getResponse()->setHttpResponseCode(500);
             $this->view->message = $errors->exception->getMessage();
             break;
     }
     if (!empty($mex)) {
         $this->view->message .= "<br/><b>{$mex}</b>";
     }
     // Save the error message in the log file errors.log
     $errormessage = $errors->type . ": " . $errors->exception->getMessage();
     Shineisp_Commons_Utilities::log($errormessage);
     $this->view->exception = $errors->exception;
     $this->view->request = $errors->request;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:ErrorController.php

示例5: saveConfig

 /**
 * Save the setup data
 * @param array $dbconfig
 * @param array $preferences
 * 
 * <?xml version="1.0" encoding="UTF-8"?>
 		<shineisp>
 			<config>
 				<database>
 					<hostname>localhost</hostname>
 					<db>shineisp</db>
 					<username>shineisp</username>
 					<password>shineisp2013</password>
 				</database>
 			</config>
 		</shineisp>
 */
 public static function saveConfig($dbconfig, $version = null)
 {
     try {
         $xml = new SimpleXMLElement('<shineisp></shineisp>');
         if (!empty($version)) {
             $xml->addAttribute('version', $version);
         }
         $xml->addAttribute('setupdate', date('Ymdhis'));
         $config = $xml->addChild('config');
         // Database Configuration
         $database = $config->addChild('database');
         $database->addChild('hostname', $dbconfig->hostname);
         $database->addChild('username', $dbconfig->username);
         $database->addChild('password', $dbconfig->password);
         $database->addChild('database', $dbconfig->database);
         // Get the xml string
         $xmlstring = $xml->asXML();
         // Prettify and save the xml configuration
         $dom = new DOMDocument();
         $dom->loadXML($xmlstring);
         $dom->formatOutput = true;
         $dom->saveXML();
         // Save the config xml file
         if (@$dom->save(APPLICATION_PATH . "/configs/config.xml")) {
             Shineisp_Commons_Utilities::log("Update ShineISP config xml file");
             return true;
         } else {
             throw new Exception("Error on saving the xml file in " . APPLICATION_PATH . "/configs/config.xml <br/>Please check the folder permissions");
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:51,代码来源:Settings.php

示例6: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $this->_init($request);
     // 		echo Zend_Controller_Front::getInstance()->getRouter()->getCurrentRouteName();
     // 		Zend_Debug::dump(Zend_Controller_Front::getInstance()->getRequest()->getParams());
     // if the current user role is not allowed to do something
     $resource = $this->_module . ":" . $this->_controller;
     $allowed_resources[] = "default:error";
     $allowed_resources[] = "api:index";
     $allowed_resources[] = "api:request";
     $allowed_resources[] = "admin:index";
     $allowed_resources[] = "admin:login";
     $allowed_resources[] = "system:index";
     $allowed_resources[] = "system:cron";
     $allowed_resources[] = "system:tasks";
     $allowed_resources[] = "setup:index";
     $allowed_resources[] = "setup:checker";
     $allowed_resources[] = "setup:database";
     $allowed_resources[] = "setup:localization";
     $allowed_resources[] = "setup:preferences";
     $allowed_resources[] = "setup:summary";
     // Exclude the system index controller and the default error controller for a formal ACL check
     if (in_array($resource, $allowed_resources)) {
         return true;
     }
     // 		Zend_Debug::dump($resource);
     // 		Zend_Debug::dump($this->_currentRole);
     // Check if the user is an Administrator and let him free to access to all the resources
     if ($this->_currentRole == "administrator") {
         return true;
     }
     if ($this->_currentRole == "guest" && $this->_module == "default") {
         return true;
     }
     if (!$this->_acl->isAllowed($this->_currentRole, $resource, "allow")) {
         if ('guest' == $this->_currentRole) {
             Shineisp_Commons_Utilities::log("Login: The role '" . $this->_currentRole . "' has not sufficient permissions to access the resource '{$resource}'. The user has been redirected to the login page.");
             $request->setControllerName('login');
             $request->setActionName('index');
         } else {
             Shineisp_Commons_Utilities::log("Login: The role '" . $this->_currentRole . "' is not allowed to access to the {$resource}. It is redirected to the no authentication page.");
             $request->setControllerName('login');
             $request->setActionName('noauth');
         }
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:46,代码来源:Acl.php

示例7: productsAction

 public function productsAction()
 {
     $ns = new Zend_Session_Namespace();
     $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><shineisp></shineisp>');
     $localeID = $ns->idlang;
     $products = $xml->addChild('products');
     try {
         // Get all the products
         $records = Products::getAll(null, $localeID);
         if (!empty($records)) {
             foreach ($records as $item) {
                 $item['ProductsData'][0]['shortdescription'] = strip_tags($item['ProductsData'][0]['shortdescription']);
                 $item['ProductsData'][0]['description'] = strip_tags($item['ProductsData'][0]['description']);
                 $item['ProductsData'][0]['shortdescription'] = html_entity_decode($item['ProductsData'][0]['shortdescription'], ENT_NOQUOTES, "UTF-8");
                 $item['ProductsData'][0]['description'] = html_entity_decode($item['ProductsData'][0]['description'], ENT_NOQUOTES, "UTF-8");
                 $item['ProductsData'][0]['shortdescription'] = str_replace("&", "", $item['ProductsData'][0]['shortdescription']);
                 $item['ProductsData'][0]['description'] = str_replace("&", "", $item['ProductsData'][0]['description']);
                 $categories = products::get_text_categories($item['categories']);
                 $categories = htmlspecialchars($categories);
                 $product = $products->addChild('product');
                 $product->addAttribute('uuid', $item['uuid']);
                 $product->addAttribute('id', $item['product_id']);
                 $product->addAttribute('inserted_at', !empty($item['inserted_at']) ? strtotime($item['inserted_at']) : null);
                 $product->addAttribute('updated_at', !empty($item['updated_at']) ? strtotime($item['updated_at']) : null);
                 $product->addChild('sku', htmlentities($item['sku']));
                 if (!empty($item['ProductsMedia'][0]['path']) && file_exists(PUBLIC_PATH . $item['ProductsMedia'][0]['path'])) {
                     $product->addChild('image', "http://" . $_SERVER['HTTP_HOST'] . $item['ProductsMedia'][0]['path']);
                 }
                 $product->addChild('name', !empty($item['ProductsData'][0]['name']) ? $item['ProductsData'][0]['name'] : null);
                 $product->addChild('shortdescription', !empty($item['ProductsData'][0]['shortdescription']) ? "<![CDATA[" . $item['ProductsData'][0]['shortdescription'] . "]]>" : null);
                 $product->addChild('description', !empty($item['ProductsData'][0]['description']) ? "<![CDATA[" . $item['ProductsData'][0]['description'] . "]]>" : null);
                 $product->addChild('categories', $categories);
                 $price = $product->addChild('price', Products::getPrice($item['product_id']));
                 $price->addAttribute('taxincluded', 0);
                 $price->addAttribute('isrecurrent', products::isRecurring($item['product_id']));
                 $price->addAttribute('currency', Settings::findbyParam('currency'));
             }
         }
         header('Content-Type: text/xml; charset=utf-8');
         die($xml->asXML());
     } catch (Exception $e) {
         Shineisp_Commons_Utilities::log(__CLASS__ . " " . $e->getMessage());
         die;
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:45,代码来源:SeoController.php

示例8: _isRecompileNeeded

 function _isRecompileNeeded($cache_file)
 {
     // If there is no cache file, we obviously need to recompile.
     if (!file_exists($cache_file)) {
         return true;
     }
     $cache_mtime = filemtime($cache_file);
     // If the source files are newer than the cache file, recompile.
     foreach ($this->_srcs as $src) {
         if (filemtime($src) > $cache_mtime) {
             Shineisp_Commons_Utilities::log("Updating CSS Cache: {$src} must be updated.");
             return true;
         }
     }
     // Cache is up to date.
     Shineisp_Commons_Utilities::log("CSS Cache is up to date.");
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:18,代码来源:cssCompressor.php

示例9: init

 public function init()
 {
     try {
         // Store logged ISP. I'm in the public area, se we use only the URL
         $ISP = Isp::findByUrl($_SERVER['HTTP_HOST']);
         if (!empty($ISP)) {
             Shineisp_Registry::set('ISP', $ISP);
         }
         // Load all the status in the registry
         $statusreg = Shineisp_Registry::get('Status');
         if (empty($statusreg)) {
             $status = Statuses::getAll();
             Shineisp_Registry::set('Status', $status);
         }
     } catch (Exception $e) {
         Shineisp_Commons_Utilities::log(__METHOD__ . " " . $e->getMessage());
     }
     parent::init();
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:19,代码来源:Default.php

示例10: login

 /**
  * Login in the calendar account
  * 
  * @return boolean
  * @throws Exception
  */
 protected static function login()
 {
     try {
         $client = new Google_Client();
         $client->setApplicationName("ShineISP Google Calendar Application");
         $clientid = Settings::findbyParam('calendar_clientid');
         $clientsecret = Settings::findbyParam('calendar_clientsecret');
         $redirecturi = Settings::findbyParam('calendar_redirecturi');
         $developerkey = Settings::findbyParam('calendar_developerkey');
         $client->setClientId($clientid);
         $client->setClientSecret($clientsecret);
         $client->setRedirectUri($redirecturi);
         $client->setDeveloperKey($developerkey);
         $cal = new Google_CalendarService($client);
         if (isset($_GET['logout'])) {
             unset($_SESSION['token']);
         }
         if (isset($_GET['code'])) {
             $client->authenticate($_GET['code']);
             $_SESSION['token'] = $client->getAccessToken();
             header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
         }
         if (isset($_SESSION['token'])) {
             $client->setAccessToken($_SESSION['token']);
         }
         if ($client->getAccessToken()) {
             self::$loggedIn = true;
             self::$calendar = $cal;
             return $cal;
         } else {
             $authUrl = $client->createAuthUrl();
             return $authUrl;
         }
     } catch (Exception $e) {
         Shineisp_Commons_Utilities::log($e->getMessage(), "plugin_calendar.log");
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:43,代码来源:Main.php

示例11: get_hostingplans_from_order

 /**
  * Get all the hosting plans requested from the order list items.
  * @param $orderID
  * @return ArrayObject
  */
 public static function get_hostingplans_from_order($orderID)
 {
     $hplan = array();
     $i = 0;
     $items = OrdersItems::getAllDetails($orderID, null, true);
     if (count($items) > 0) {
         foreach ($items as $item) {
             if (strtolower($item['Products']['type']) == "hosting") {
                 if (!empty($item['parameters'])) {
                     $hplan[$i]['orderitem_id'] = $item['detail_id'];
                     $hplan[$i]['customer_id'] = $item['Orders']['Customers']['customer_id'];
                     $hplan[$i]['parameters'] = $item['parameters'];
                     $i++;
                 } else {
                     Shineisp_Commons_Utilities::log("Hosting plan " . $item['Products']['sku'] . " has been skipped because it has not any parameters configured yet");
                 }
             }
         }
     }
     return $hplan;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:26,代码来源:Orders.php

示例12: routeShutdown

 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     $force = false;
     $registry = Shineisp_Registry::getInstance();
     // Check if the config file has been created
     $isReady = Shineisp_Main::isReady();
     $module = $request->getModuleName();
     if ($module == "default") {
         // set the right session namespace per module
         $module_session = 'Default';
     } elseif ($module == "admin") {
         $module_session = 'Admin';
     } else {
         $module_session = 'Default';
     }
     $ns = new Zend_Session_Namespace($module_session);
     try {
         $locale = new Zend_Locale(Zend_Locale::BROWSER);
         if (!empty($ns->lang)) {
             $locale = new Zend_Locale($ns->lang);
         }
         Shineisp_Commons_Utilities::log("System: Get the browser locale: " . $locale, "debug.log");
     } catch (Exception $e) {
         Shineisp_Commons_Utilities::log("System: " . $e->getMessage(), "debug.log");
         if (!empty($ns->lang)) {
             Shineisp_Commons_Utilities::log("System: Get the session var locale", "debug.log");
             $locale = new Zend_Locale($ns->lang);
         } else {
             $locale = new Zend_Locale("en");
             Shineisp_Commons_Utilities::log("System: There is not any available locale, set the default one: en_GB", "debug.log");
         }
     }
     // check the user request if it is not set, please get the old prefereces
     $lang = $request->getParam('lang');
     if (empty($lang)) {
         // Get the user preference
         if (strlen($locale) == 2) {
             // Check if the Browser locale is formed with 2 chars
             $lang = $locale;
         } elseif (strlen($locale) > 4) {
             // Check if the Browser locale is formed with > 4 chars
             $lang = substr($locale, 0, 2);
             // Get the language code from the browser preference
         }
     } else {
         $force = true;
     }
     // Get the translate language or the default language: en
     if (file_exists(PUBLIC_PATH . "/languages/{$lang}/{$lang}.mo")) {
         $translate = new Zend_Translate(array('adapter' => "Shineisp_Translate_Adapter_Gettext", 'content' => PUBLIC_PATH . "/languages/{$lang}/{$lang}.mo", 'locale' => $lang, 'disableNotices' => true));
     } else {
         $translate = new Zend_Translate(array('adapter' => "Shineisp_Translate_Adapter_Gettext", 'locale' => $lang, 'disableNotices' => true));
     }
     $registry->set('Zend_Translate', $translate);
     $registry->set('Zend_Locale', $locale);
     if ($isReady) {
         if (empty($ns->langid) || $force) {
             $ns->langid = Languages::get_language_id_by_code($lang);
         }
     } else {
         $ns->langid = 1;
     }
     $ns->lang = $lang;
     Shineisp_Commons_Utilities::log("System: Locale set: " . $locale, "debug.log");
     Shineisp_Commons_Utilities::log("System: Language selected: " . $ns->lang, "debug.log");
 }
开发者ID:moay,项目名称:shineisp,代码行数:66,代码来源:Language.php

示例13: execScript

 /**
  *  Execute the custom cron class
  */
 private function execScript($class, $method, $params)
 {
     try {
         // Check if the class exists
         if (class_exists($class)) {
             // Check if the method exists
             if (method_exists($class, $method)) {
                 // Check the class
                 $theclass = new ReflectionClass($class);
                 $themethod = $theclass->getMethod($method);
                 $isStatic = $themethod->isStatic();
                 Shineisp_Commons_Utilities::log("{$class}::{$method}", 'cron.log');
                 // Check if the method is static
                 if ($isStatic) {
                     call_user_func("{$class}::{$method}", $params);
                 } else {
                     $obj = new $class();
                     call_user_func(array($obj, $method), $params);
                 }
             }
         }
     } catch (Exception $e) {
         Shineisp_Commons_Utilities::log(__METHOD__ . " " . $e->getMessage(), 'cron.log');
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:28,代码来源:CronController.php

示例14: _setAction

 /**
  * Set specific action your image. e.g. resize image, crop, etc...
  *
  * @param string $action
  * @return boolean
  */
 protected function _setAction()
 {
     // dir to where you want to save the thumbnail image
     $relativePath = dirname($this->getImagePath()) . '/thumbs/';
     $dir = PUBLIC_PATH . '/' . $relativePath;
     clearstatcache();
     // create the directory if it does not exist
     if (!is_dir($dir)) {
         if (@mkdir($dir) === false) {
             Shineisp_Commons_Utilities::log($dir . " cannot be created.");
         }
     }
     // name of the image based on the size of the thumbnail
     // @todo the sizes can be in config file/database. for not its hard coded
     $newFileName = $this->width . 'x' . $this->height . '_' . $this->getImageName();
     $thumbPath = $dir . $newFileName;
     // if thumbnail exists then set cache image and return false
     if (file_exists($thumbPath)) {
         $this->setNewImage($relativePath . $newFileName);
         return false;
     }
     // if image product not exists set the default image
     if (!file_exists(PUBLIC_PATH . $this->getImagePath())) {
         $this->setNewImage("/media/products/default.png");
     }
     // resize image
     $image = new Shineisp_Commons_Image();
     // open original image to resize it
     // set the thumnail sizes
     // set new image path and quality
     $image->open(PUBLIC_PATH . $this->getImagePath())->resize($this->width, $this->height)->save($thumbPath, 75);
     // pass new image details to image view helper
     $this->setNewImage($relativePath . $newFileName, $image->getWidth(), $image->getHeight());
     return true;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:41,代码来源:Image.php

示例15: checkServices

 /**
  * CREATE THE ORDER FOR ALL THE AUTORENEWABLE DOMAINS/SERVICES
  * Check all the services [domains, products] and create the orders for each customer only if the service has been set as renewable
  * @return void
  */
 public static function checkServices()
 {
     try {
         $i = 0;
         $customers = array();
         /* We have to start to get all the domains that them expiring date is today
         			 then we have to create a custom array sorted by customerID in order to
         			group services and domains of a specific customer.
         			*/
         // Get all the active domains that expire in 1 day
         $domains = Domains::getExpiringDomainsByDays(1, Statuses::id("active", "domains"));
         if ($domains) {
             Shineisp_Commons_Utilities::log("There are (" . count($domains) . ") new domains to renew");
             // Create the customer group list for the email summary
             foreach ($domains as $domain) {
                 if (is_numeric($domain['reseller'])) {
                     $invoice_dest = Customers::getAllInfo($domain['reseller']);
                     $customers[$domain['customer_id']]['id'] = $invoice_dest['customer_id'];
                     $customers[$domain['customer_id']]['fullname'] = $invoice_dest['firstname'] . " " . $invoice_dest['lastname'] . " " . $invoice_dest['company'];
                     $customers[$domain['customer_id']]['email'] = $invoice_dest['email'];
                     $customers[$domain['customer_id']]['language_id'] = $invoice_dest['language_id'];
                 } else {
                     $customers[$domain['customer_id']]['id'] = $domain['customer_id'];
                     $customers[$domain['customer_id']]['fullname'] = $domain['fullname'];
                     $customers[$domain['customer_id']]['email'] = $domain['email'];
                     $customers[$domain['customer_id']]['language_id'] = $domain['language_id'];
                 }
                 $customers[$domain['customer_id']]['products'][$i]['name'] = $domain['domain'];
                 $customers[$domain['customer_id']]['products'][$i]['type'] = "domain";
                 $customers[$domain['customer_id']]['products'][$i]['renew'] = $domain['renew'];
                 $customers[$domain['customer_id']]['products'][$i]['expiring_date'] = $domain['expiringdate'];
                 $customers[$domain['customer_id']]['products'][$i]['days'] = $domain['days'];
                 // Get the last old order item id
                 if (!empty($domain['oldorders'])) {
                     // find the domain
                     foreach ($domain['oldorders'] as $olditemorder) {
                         // Get all the information from the old order
                         $olditem = OrdersItems::getAllInfo($olditemorder['orderitem_id']);
                         // Check if the old order item refers to the domain selected
                         if (!empty($olditem['parameters']) && !empty($olditem['Orders']['OrdersItemsDomains'][0]['Domains']['tld_id'])) {
                             // Get the old configuration parameters
                             $params = json_decode($olditem['parameters'], true);
                             // 								Zend_Debug::dump($olditem);
                             // 								Zend_Debug::dump($params);
                             // 								Zend_Debug::dump($domain['domain']);
                             // Extract the domain name and match it with the domain selected
                             if (!empty($params['domain']) && $params['domain']['name'] == $domain['domain']) {
                                 $customers[$domain['customer_id']]['products'][$i]['oldorderitemid'] = $olditemorder['orderitem_id'];
                             }
                         }
                     }
                 }
                 Shineisp_Commons_Utilities::log("- " . $domain['domain']);
                 $i++;
             }
         }
         /*
          * Now we have to get the services expired and we have to sum the previous $customers array with these
          * new information.
          */
         // Get all the services active that expire the day after
         $services = OrdersItems::getExpiringServicesByDays(1, Statuses::id("complete", "orders"));
         if ($services) {
             Shineisp_Commons_Utilities::log("There are (" . count($services) . ") new services to renew");
             // Create the customer group list for the email summary
             foreach ($services as $service) {
                 if (is_numeric($service['reseller'])) {
                     $invoice_dest = Customers::getAllInfo($service['reseller']);
                     $customers[$service['customer_id']]['id'] = $invoice_dest['customer_id'];
                     $customers[$service['customer_id']]['fullname'] = $invoice_dest['firstname'] . " " . $invoice_dest['lastname'] . " " . $invoice_dest['company'];
                     $customers[$service['customer_id']]['email'] = $invoice_dest['email'];
                     $customers[$service['customer_id']]['password'] = $invoice_dest['password'];
                     $customers[$service['customer_id']]['language_id'] = $invoice_dest['language_id'];
                 } else {
                     $customers[$service['customer_id']]['id'] = $service['id'];
                     $customers[$service['customer_id']]['fullname'] = $service['fullname'];
                     $customers[$service['customer_id']]['email'] = $service['email'];
                     $customers[$service['customer_id']]['password'] = $service['password'];
                     $customers[$service['customer_id']]['language_id'] = $service['language_id'];
                 }
                 $customers[$service['customer_id']]['products'][$i]['name'] = $service['product'];
                 $customers[$service['customer_id']]['products'][$i]['type'] = "service";
                 $customers[$service['customer_id']]['products'][$i]['renew'] = $service['renew'];
                 $customers[$service['customer_id']]['products'][$i]['expiring_date'] = $service['expiringdate'];
                 $customers[$service['customer_id']]['products'][$i]['days'] = $service['days'];
                 $customers[$service['customer_id']]['products'][$i]['oldorderitemid'] = $service['detail_id'];
                 Shineisp_Commons_Utilities::log("- " . $service['product']);
                 $i++;
             }
         }
         // Create the email messages for the customers
         if (count($customers) > 0) {
             foreach ($customers as $customer) {
                 $items = "";
                 // **** CREATE THE ORDER FOR ALL THE AUTORENEWABLE DOMAINS/SERVICES ***
//.........这里部分代码省略.........
开发者ID:moay,项目名称:shineisp,代码行数:101,代码来源:Cronjobs.php


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