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


PHP Zibo::getInstance方法代码示例

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


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

示例1: initialize

 public function initialize()
 {
     $zibo = Zibo::getInstance();
     $this->loadListeners($zibo);
     $this->registerEvents($zibo);
     $this->logItem(self::LOG_INTRO);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:7,代码来源:Module.php

示例2: run

 /**
  * Executes the callback in a different thread. All arguments to this method will be passed on to the callback.
  *
  * The callback will be invoked but the script will not wait for it to finish.
  * @return null
  */
 public function run()
 {
     $pid = @pcntl_fork();
     if ($pid == -1) {
         throw new ZiboException('Could not run the thread: unable to fork the callback');
     }
     if ($pid) {
         // parent process code
         $this->pid = $pid;
     } else {
         // child process code
         pcntl_signal(SIGTERM, array($this, 'signalHandler'));
         try {
             $this->callback->invokeWithArrayArguments(func_get_args());
         } catch (Exception $exception) {
             $message = $exception->getMessage();
             if (!$message) {
                 $message = get_class($exception);
             }
             Zibo::getInstance()->runEvent(Zibo::EVENT_LOG, $message, $exception->getTraceAsString(), 1);
             echo $message . "\n";
             echo $exception->getTraceAsString();
         }
         exit;
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:32,代码来源:Thread.php

示例3: tearDown

 public function tearDown()
 {
     try {
         Reflection::setProperty(Zibo::getInstance(), 'instance', null);
     } catch (ZiboException $e) {
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:7,代码来源:DispatcherTest.php

示例4: getBaseUrl

 /**
  * Gets the base URL
  * @return string
  */
 protected function getBaseUrl()
 {
     if ($this->baseUrl) {
         return $this->baseUrl;
     }
     return $this->baseUrl = Zibo::getInstance()->getRequest()->getBaseUrl();
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:11,代码来源:AbstractContentMapper.php

示例5: render

 /**
  * Render this taskbar view
  * @param boolean $return true to return the rendered view, false to send it to the client
  * @return mixed null when provided $return is set to true; the rendered output when the provided $return is set to false
  */
 public function render($return = true)
 {
     $request = Zibo::getInstance()->getRequest();
     if (!$request) {
         return;
     }
     $baseUrl = $request->getBaseUrl() . Request::QUERY_SEPARATOR;
     $renderedPanels = array();
     $notificationPanels = $this->taskbar->getNotificationPanels();
     foreach ($notificationPanels as $panel) {
         $renderedPanels[] = $this->renderView($panel);
     }
     $applicationsMenu = $this->taskbar->getApplicationsMenu();
     $applicationsMenu->setBaseUrl($baseUrl);
     $settingsMenu = $this->taskbar->getSettingsMenu();
     $settingsMenu->setBaseUrl($baseUrl);
     $settingsMenu->orderItems();
     $this->set('applicationsMenu', $applicationsMenu);
     $this->set('settingsMenu', $settingsMenu);
     $this->set('notificationPanels', array_reverse($renderedPanels));
     $this->set('title', $this->taskbar->getTitle());
     $this->addStyle(self::STYLE_TASKBAR);
     $this->addJavascript(self::SCRIPT_CLICKMENU);
     $this->addInlineJavascript("\$('#taskbarApplications').clickMenu({start: 'left'}); \n \t\t\t\t" . "\$('#taskbarSettings').clickMenu({start: 'right'});");
     return parent::render($return);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:31,代码来源:TaskbarView.php

示例6: smarty_function_image

function smarty_function_image($params, &$smarty)
{
    try {
        if (empty($params['src'])) {
            throw new Exception('No src parameter provided for the image');
        }
        $src = $params['src'];
        unset($params['src']);
        $image = new Image($src);
        if (!empty($params['thumbnail'])) {
            if (empty($params['width'])) {
                throw new Exception('No width parameter provided for the thumbnailer');
            }
            if (empty($params['height'])) {
                throw new Exception('No height parameter provided for the thumbnailer');
            }
            $image->setThumbnailer($params['thumbnail'], $params['width'], $params['height']);
            unset($params['thumbnail']);
            unset($params['width']);
            unset($params['height']);
        }
        foreach ($params as $key => $value) {
            $image->setAttribute($key, $value);
        }
        $html = $image->getHtml();
    } catch (Exception $exception) {
        Zibo::getInstance()->runEvent(Zibo::EVENT_LOG, $exception->getMessage(), $exception->getTraceAsString(), 1);
        $html = '<span class="red" style="color: red;">Could not load image: ' . $exception->getMessage() . '</span>';
    }
    return $html;
}
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:31,代码来源:function.image.php

示例7: indexAction

 /**
  * Action to view and change the profile
  * @return null
  */
 public function indexAction()
 {
     $user = SecurityManager::getInstance()->getUser();
     if (!$user) {
         throw new UnauthorizedException();
     }
     $form = new ProfileForm($this->request->getBasePath(), $user);
     $form->addHook(new AccountProfileHook());
     Zibo::getInstance()->runEvent(self::EVENT_PREPARE_FORM, $form);
     if ($form->isSubmitted()) {
         try {
             $form->validate();
             $form->processSubmit($this);
             if (!$this->response->getView() && !$this->response->willRedirect()) {
                 $this->response->setRedirect($this->request->getBasePath());
             }
             return;
         } catch (ValidationException $exception) {
             $form->setValidationException($exception);
         }
     }
     $translator = $this->getTranslator();
     $view = new ProfileView($form);
     $view->setPageTitle($translator->translate(self::TRANSLATION_TITLE));
     $this->response->setView($view);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:30,代码来源:ProfileController.php

示例8: indexAction

 /**
  * Action to ask for extra information and to send the error report
  * @return null
  */
 public function indexAction()
 {
     $zibo = Zibo::getInstance();
     $session = Session::getInstance();
     $recipient = $zibo->getConfigValue(Module::CONFIG_MAIL_RECIPIENT);
     $subject = $zibo->getConfigValue(Module::CONFIG_MAIL_SUBJECT);
     $report = $session->get(Module::SESSION_REPORT);
     if (!$report || !$recipient) {
         $this->response->setRedirect($this->request->getBaseUrl());
         return;
     }
     $form = new ReportForm($this->request->getBasePath());
     if ($form->isSubmitted()) {
         $comment = $form->getComment();
         if ($comment) {
             $report .= "\n\nComment:\n" . $comment;
         }
         if (!$subject) {
             list($subject, $null) = explode("\n", $report, 2);
         }
         $mail = new Message();
         $mail->setTo($recipient);
         $mail->setSubject($subject);
         $mail->setMessage($report);
         $mail->send();
         $session->set(Module::SESSION_REPORT);
         $this->addInformation(self::TRANSLATION_MAIL_SENT);
         $this->response->setRedirect($this->request->getBaseUrl());
         return;
     }
     $view = new ReportView($form, $report);
     $this->response->setView($view);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:37,代码来源:ReportController.php

示例9: tearDown

 protected function tearDown()
 {
     $this->tearDownApplication();
     try {
         Reflection::setProperty(Zibo::getInstance(), 'instance', null);
     } catch (ZiboException $e) {
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:8,代码来源:IniConfigIOTest.php

示例10: tearDown

 public function tearDown()
 {
     Reflection::setProperty(Zibo::getInstance(), 'instance', null);
     if (file_exists('application/config/modules.temp.xml')) {
         unlink('application/config/modules.temp.xml');
     }
     $this->tearDownApplication();
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:8,代码来源:XmlModuleIOTest.php

示例11: __construct

 /**
  * Constructs a new database manager: loads the drivers and the connections from the configuration
  * @return null
  */
 private function __construct()
 {
     $this->connections = array();
     $this->drivers = array();
     $this->defaultConnectionName = null;
     $zibo = Zibo::getInstance();
     $this->loadDriversFromConfig($zibo);
     $this->loadConnectionsFromConfig($zibo);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:13,代码来源:DatabaseManager.php

示例12: initialize

 /**
  * Initialize the orm module for the request, register orm event listeners
  * @return null
  */
 public function initialize()
 {
     $zibo = Zibo::getInstance();
     $zibo->registerEventListener(Zibo::EVENT_CLEAR_CACHE, array($this, 'clearCache'));
     $zibo->registerEventListener(Installer::EVENT_PRE_INSTALL_SCRIPT, array($this, 'defineModelsForInstalledModules'));
     $zibo->registerEventListener(Installer::EVENT_POST_UNINSTALL_MODULE, array($this, 'deleteModelsForUninstalledModules'));
     $zibo->registerEventListener(Dispatcher::EVENT_PRE_DISPATCH, array($this, 'prepareController'));
     $zibo->registerEventListener(BaseView::EVENT_TASKBAR, array($this, 'prepareTaskbar'));
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:13,代码来源:Module.php

示例13: __construct

 /**
  * Constructs a new recaptcha view
  * @param string $publicKey The public key of the recaptcha
  * @param string $error Error of the previous submit
  * @return null
  */
 public function __construct($publicKey, $error = null, $theme = null)
 {
     if (!$theme) {
         $theme = Zibo::getInstance()->getConfigValue(self::CONFIG_THEME);
     }
     $this->publicKey = $publicKey;
     $this->error = $error;
     $this->theme = $theme;
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:15,代码来源:RecaptchaView.php

示例14: getTempDirectory

 /**
  * Gets the temporary directory for the installation process
  * @param string $path The path in the temporary directory
  * @return zibo\library\filesystem\File
  */
 public static function getTempDirectory($path = null)
 {
     $rootDirectory = Zibo::getInstance()->getRootPath();
     $rootDirectory = $rootDirectory->getPath();
     $path = 'zibo-' . substr(md5($rootDirectory), 0, 7) . ($path ? '/' . $path : '');
     $temp = new File(sys_get_temp_dir(), $path);
     $temp->create();
     return $temp;
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:14,代码来源:Module.php

示例15: __construct

 /**
  * Constructs a new recaptcha
  * @return null
  */
 public function __construct()
 {
     $zibo = Zibo::getInstance();
     $publicKey = $zibo->getConfigValue(self::CONFIG_PUBLIC_KEY);
     $privateKey = $zibo->getConfigValue(self::CONFIG_PRIVATE_KEY);
     $this->setPublicKey($publicKey);
     $this->setPrivateKey($privateKey);
     $this->errors = array();
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:13,代码来源:Recaptcha.php


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