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


PHP Solar_Registry::get方法代码示例

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


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

示例1: _exec

 /**
  * 
  * Write out a series of dirs and symlinks for a new Vendor source.
  * 
  * @param string $vendor The Vendor name.
  * 
  * @return void
  * 
  */
 protected function _exec($vendor = null)
 {
     // we need a vendor name, at least
     if (!$vendor) {
         throw $this->_exception('ERR_NO_VENDOR');
     }
     $this->_outln("Making links for vendor '{$vendor}' ...");
     // build "foo-bar" and "FooBar" versions of the vendor name.
     $this->_inflect = Solar_Registry::get('inflect');
     $this->_dashes = $this->_inflect->camelToDashes($vendor);
     $this->_studly = $this->_inflect->dashesToStudly($this->_dashes);
     $links = array(array('dir' => "include", 'tgt' => $this->_studly, 'src' => "../source/{$this->_dashes}/{$this->_studly}"), array('dir' => "include/Test", 'tgt' => $this->_studly, 'src' => "../../source/{$this->_dashes}/tests/Test/{$this->_studly}"), array('dir' => "include/Mock", 'tgt' => $this->_studly, 'src' => "../../source/{$this->_dashes}/tests/Mock/{$this->_studly}"), array('dir' => "include/Fixture", 'tgt' => $this->_studly, 'src' => "../../source/{$this->_dashes}/tests/Fixture/{$this->_studly}"), array('dir' => "script", 'tgt' => $this->_dashes, 'src' => "../source/solar/script/solar"));
     $system = Solar::$system;
     foreach ($links as $link) {
         // $dir, $src, $tgt
         extract($link);
         // make it
         $this->_out("    Making link '{$dir}/{$tgt}' ... ");
         try {
             Solar_Symlink::make($src, $tgt, "{$system}/{$dir}");
             $this->_outln("done.");
         } catch (Exception $e) {
             $this->_out($e->getMessage());
             $this->_outln(" ... failed.");
         }
     }
     // done with this part
     $this->_outln("... done.");
     // make public links
     $link_public = Solar::factory('Solar_Cli_LinkPublic');
     $link_public->exec($vendor);
     // done for real
     $this->_outln("Remember to add '{$this->_studly}_App' to the " . "['Solar_Controller_Front']['classes'] element " . "in your config file so that it finds your apps.");
     $this->_outln("Remember to add '{$this->_studly}_Model' to the " . "['Solar_Sql_Model_Catalog']['classes'] element " . "in your config file so that it finds your models.");
 }
开发者ID:abtris,项目名称:solarphp-quickstart,代码行数:44,代码来源:LinkVendor.php

示例2: _exec

 /**
  * 
  * Write out a series of dirs and symlinks for a new Vendor source.
  * 
  * @param string $vendor The Vendor name.
  * 
  * @return void
  * 
  */
 protected function _exec($vendor = null)
 {
     // we need a vendor name, at least
     if (!$vendor) {
         throw $this->_exception('ERR_NO_VENDOR_NAME');
     }
     $this->_outln("Removing links for vendor '{$vendor}' ...");
     // build "foo-bar" and "FooBar" versions of the vendor name.
     $this->_inflect = Solar_Registry::get('inflect');
     $this->_dashes = $this->_inflect->camelToDashes($vendor);
     $this->_studly = $this->_inflect->dashesToStudly($this->_dashes);
     // the base system dir
     $system = Solar::$system;
     // the links to remove (reverse order from make-vendor)
     $links = array("script/{$this->_dashes}", "include/Mock/{$this->_studly}", "include/Test/{$this->_studly}", "include/{$this->_studly}");
     // remove the links
     foreach ($links as $link) {
         $this->_out("    Removing '{$link}' ... ");
         $path = "{$system}/{$link}";
         if (Solar_File::exists($path)) {
             unlink($path);
             $this->_outln("done.");
         } else {
             $this->_outln("missing.");
         }
     }
     // done!
     $this->_outln("... done.");
     // reminders
     $this->_outln("Remember to remove '{$this->_studly}_App' from the " . "['Solar_Controller_Front']['classes'] element " . "in your config file.");
     $this->_outln("Remember to remove '{$this->_studly}_Model' from the " . "['Solar_Sql_Model_Catalog']['classes'] element " . "in your config file.");
     // need to write a recursive-remove method for Solar_Dir that will
     // delete only the symlinked files (not the real files)
     $this->_outln("You will need to remove the " . "'docroot/public/{$this->_studly}' directory yourself, as it " . "may contain copies of public assets (not links).");
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:44,代码来源:UnlinkVendor.php

示例3: actionOverview

 public function actionOverview($page = 1)
 {
     $model_news = new JForg_Model_News();
     $locale = Solar_Registry::get('locale');
     if ($this->_format != null) {
         //requesting an newsfeed (rss,rss2 or atom)
         //disable all pageing stuff
         $this->title = $this->locale('TEXT_NEWS');
         $items_per_page = 15;
         $page = 1;
     } else {
         //requesting an usual (xhtml) webpage.
         //do this pageing stuff
         $page = (int) $page;
         $items_per_page = 5;
         $pagecount = $model_news->countPages(array('where' => 'language = \'' . $locale->getCode() . '\'', 'paging' => $items_per_page, 'page' => $page));
         if ($page > $pagecount['pages']) {
             $page = $pagecount['pages'];
         }
         if ($page == 0) {
             $page = 1;
         }
         $this->title = $this->locale('TEXT_NEWS') . ' - ' . $this->locale('TEXT_PAGE') . ': ' . $page;
         $this->page = $page;
         $this->max_page = $pagecount['pages'];
     }
     $collection = $model_news->fetchAllByLanguage($locale->getCode(), array('page' => $page, 'paging' => $items_per_page));
     $this->news = $collection;
 }
开发者ID:BackupTheBerlios,项目名称:jabberfriends-svn,代码行数:29,代码来源:News.php

示例4: getTextRaw

 /**
  * 
  * Returns a localized string WITH NO ESCAPING.
  * 
  * @param string $key The locale key to look up from the class.
  * 
  * @param int|float $num A number to help determine if the
  * translation should return singluar or plural.
  * 
  * @param array $replace If an array, will call vsprintf() on the
  * localized string using the replacements in the array.
  * 
  * @return string The translated locale string.
  * 
  */
 public function getTextRaw($key, $num = 1, $replace = null)
 {
     static $locale;
     if (!$locale) {
         $locale = Solar_Registry::get('locale');
     }
     return $locale->fetch($this->_class, $key, $num, $replace);
 }
开发者ID:agentile,项目名称:foresmo,代码行数:23,代码来源:GetTextRaw.php

示例5: postLoginFailure

 /**
  * 
  * The login was a failure, complete the protocol
  * 
  * @return void
  * 
  */
 public function postLoginFailure()
 {
     $response = Solar_Registry::get('response');
     $response->setHeader('WWW-Authenticate', 'Basic realm="' . $this->_config['realm'] . '"');
     $response->setStatusCode(401);
     $response->display();
     exit(0);
 }
开发者ID:kalkin,项目名称:solarphp,代码行数:15,代码来源:HttpBasic.php

示例6: _postConstruct

 protected function _postConstruct()
 {
     parent::_postConstruct();
     // "Test_Solar_View_Helper_" = 23
     $this->_helper_name = substr(get_class($this), 23);
     $this->_helper_class = substr(get_class($this), 5);
     $this->_request = Solar_Registry::get('request');
     $this->_view = Solar::factory('Solar_View');
 }
开发者ID:agentile,项目名称:foresmo,代码行数:9,代码来源:Helper.php

示例7: _postConstruct

 /**
  * 
  * Post-construction tasks to complete object construction.
  * 
  * @return void
  * 
  */
 protected function _postConstruct()
 {
     parent::_postConstruct();
     // only set up the handler if it doesn't exist yet.
     if (!self::$_handler) {
         self::$_handler = Solar::dependency('Solar_Session_Handler', $this->_config['handler']);
     }
     $this->_request = Solar_Registry::get('request');
 }
开发者ID:kalkin,项目名称:solarphp,代码行数:16,代码来源:Native.php

示例8: setup

 /**
  * 
  * Setup; runs before each test method.
  * 
  */
 public function setup()
 {
     parent::setup();
     // remove "Test_" prefix
     $this->_class = substr(get_class($this), 5);
     // get the request environment
     $this->_request = Solar_Registry::get('request');
     // get a new adapter
     $this->_auth = Solar::factory($this->_class, $this->_config);
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:15,代码来源:Adapter.php

示例9: setup

 public function setup()
 {
     parent::setup();
     $this->_view = Solar::factory('Solar_View');
     $this->_name = substr(get_class($this), 18, -4);
     $this->_name[0] = strtolower($this->_name[0]);
     // retain and reset the request environment
     $this->_request = Solar_Registry::get('request');
     $this->_request->reset();
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:10,代码来源:HelperTestCase.php

示例10: _exec

 /**
  * 
  * Write out a series of dirs and symlinks for a new Vendor source.
  * 
  * @param string $vendor The Vendor name.
  * 
  * @return void
  * 
  */
 protected function _exec($vendor = null)
 {
     // we need a vendor name, at least
     if (!$vendor) {
         throw $this->_exception('ERR_NO_VENDOR_NAME');
     }
     // build "foo-bar" and "FooBar" versions of the vendor name.
     $this->_inflect = Solar_Registry::get('inflect');
     $this->_dashes = $this->_inflect->camelToDashes($vendor);
     $this->_studly = $this->_inflect->dashesToStudly($this->_dashes);
     // create dirs, files, and symlinks
     $this->_createDirs();
     $this->_createFiles();
     $this->_createLinks();
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:24,代码来源:MakeVendor.php

示例11: _postConstruct

 /**
  * 
  * Post-construction tasks to complete object construction.
  * 
  * @return void
  * 
  */
 protected function _postConstruct()
 {
     parent::_postConstruct();
     // get the current request environment
     $this->_request = Solar_Registry::get('request');
     // set convenience vars from config
     $this->_routing = $this->_config['routing'];
     $this->_default = $this->_config['default'];
     $this->_disable = (array) $this->_config['disable'];
     // set up a class stack for finding commands
     $this->_stack = Solar::factory('Solar_Class_Stack');
     $this->_stack->add($this->_config['classes']);
     // extended setup
     $this->_setup();
 }
开发者ID:agentile,项目名称:foresmo,代码行数:22,代码来源:Console.php

示例12: _postConstruct

 /**
  * 
  * Post-construction tasks to complete object construction.
  * 
  * @return void
  * 
  */
 protected function _postConstruct()
 {
     if (!self::$_session) {
         self::$_session = Solar::factory('Solar_Session', array('class' => 'Solar_Csrf'));
     }
     if (!self::$_request) {
         self::$_request = Solar_Registry::get('request');
     }
     // ignore construct-time configuration for the key, but honor
     // it from the config file.  we want the key name to be the
     // same everywhere all the time.
     $key = Solar_Config::get('Solar_Csrf', 'key');
     if ($key) {
         self::$_key = $key;
     }
 }
开发者ID:agentile,项目名称:foresmo,代码行数:23,代码来源:Csrf.php

示例13: _exec

 /**
  * 
  * Write out a series of dirs and symlinks for a new Vendor source.
  * 
  * @param string $vendor The Vendor name.
  * 
  * @return void
  * 
  */
 protected function _exec($vendor = null)
 {
     // we need a vendor name, at least
     if (!$vendor) {
         throw $this->_exception('ERR_NO_VENDOR_NAME');
     }
     // build "foo-bar" and "FooBar" versions of the vendor name.
     $this->_inflect = Solar_Registry::get('inflect');
     $this->_dashes = $this->_inflect->camelToDashes($vendor);
     $this->_studly = $this->_inflect->dashesToStudly($this->_dashes);
     // create dirs, files, and symlinks
     $this->_createDirs();
     $this->_createFiles();
     $this->_createLinks();
     // done!
     $this->_outln("Done!");
     $this->_outln("Remember to add '{$this->_studly}_App' to the " . "['Solar_Controller_Front']['classes'] element " . "in your config file so that it finds your apps.");
     $this->_outln("Remember to add '{$this->_studly}_Model' to the " . "['Solar_Sql_Model_Catalog']['classes'] element " . "in your config file so that it finds your models.");
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:28,代码来源:MakeVendor.php

示例14: redirect

 /**
  * 
  * Issues an immediate "Location" redirect.  Use instead of display()
  * to perform a redirect.  You should die() or exit() after calling this.
  * 
  * @param Solar_Uri_Action|string $spec The URI to redirect to.
  * 
  * @param int|string $code The HTTP status code to redirect with; default
  * is '302 Found'.
  * 
  * @return void
  * 
  */
 public function redirect($spec, $code = '302')
 {
     if ($spec instanceof Solar_Uri_Action) {
         $href = $spec->get(true);
     } elseif (strpos($spec, '://') !== false) {
         // external link, protect against header injections
         $href = str_replace(array("\r", "\n"), '', $spec);
     } else {
         $uri = Solar::factory('Solar_Uri_Action');
         $href = $uri->quick($spec, true);
     }
     // kill off all output buffers
     while (@ob_end_clean()) {
     }
     // make sure there's actually an href
     $href = trim($href);
     if (!$href) {
         throw $this->_exception('ERR_REDIRECT_FAILED', array('href' => $href));
     }
     // set the status code
     $this->setStatusCode($code);
     // set the redirect location
     $this->setHeader('Location', $href);
     // clear the response body
     $this->content = null;
     // is this a GET-after-(POST|PUT) redirect?
     $request = Solar_Registry::get('request');
     if ($request->isPost() || $request->isPut()) {
         // tell the next request object that it's a get-after-post
         $session = Solar::factory('Solar_Session', array('class' => get_class($request)));
         $session->setFlash('is_gap', true);
     }
     // save the session
     session_write_close();
     // send the response directly -- done.
     $this->display();
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:50,代码来源:Response.php

示例15: _postConstruct

 /**
  * 
  * Post-construction tasks to complete object construction.
  * 
  * @return void
  * 
  */
 protected function _postConstruct()
 {
     parent::_postConstruct();
     // get the current request environment
     $this->_request = Solar_Registry::get('request');
 }
开发者ID:kalkin,项目名称:solarphp,代码行数:13,代码来源:Login.php


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