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


PHP Strings::lower方法代码示例

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


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

示例1: constructUrl

 public function constructUrl(Request $appRequest, Url $refUrl)
 {
     // Module prefix not match.
     if ($this->module && !Strings::startsWith($appRequest->getPresenterName(), $this->module)) {
         return null;
     }
     $params = $appRequest->getParameters();
     $urlStack = [];
     // Module prefix
     $moduleFrags = explode(":", Strings::lower($appRequest->getPresenterName()));
     $resourceName = array_pop($moduleFrags);
     $urlStack += $moduleFrags;
     // Resource
     $urlStack[] = Strings::lower($resourceName);
     // Id
     if (isset($params['id']) && is_scalar($params['id'])) {
         $urlStack[] = $params['id'];
         unset($params['id']);
     }
     // Set custom action
     if (isset($params['action']) && $this->_isApiAction($params['action'])) {
         unset($params['action']);
     }
     $url = $refUrl->getBaseUrl() . implode('/', $urlStack);
     // Add query parameters
     if (!empty($params)) {
         $url .= "?" . http_build_query($params);
     }
     return $url;
 }
开发者ID:bauer01,项目名称:unimapper-nette,代码行数:30,代码来源:Route.php

示例2: copy

 private function copy($dir, $targetDir)
 {
     $files = [];
     /** @var $file \SplFileInfo */
     foreach (Finder::find('*')->from($dir) as $file) {
         if ($file->isFile()) {
             $filename = $this->getRelativePath($file->getPathname(), $dir);
             $files[$filename] = $file;
         }
     }
     foreach ($files as $filename => $file) {
         $target = $targetDir . '/' . $filename;
         $dir = (new \SplFileInfo($target))->getPath();
         if (!file_exists($dir)) {
             umask(00);
             mkdir($dir, 0777, true);
         }
         if (Strings::lower($file->getExtension()) == 'zip' && extension_loaded('zlib')) {
             $archive = new \ZipArchive();
             $res = $archive->open($file->getRealPath());
             if ($res === true) {
                 $archive->extractTo($targetDir);
                 $archive->close();
             }
             continue;
         }
         @copy($file->getPathname(), $target);
     }
 }
开发者ID:peterzadori,项目名称:movi,代码行数:29,代码来源:ResourceInstaller.php

示例3: init

 /**
  * Method run before install
  *
  * @throws \Canterville\NonExistsException
  * @throws \Canterville\Exception\NotSetException
  */
 protected function init()
 {
     $this->url = $this->getUrl($this->version);
     $this->distType = $this->getDistType($this->url);
     $this->targetDir = $this->getVendorDir() . self::AUTHOR_DIR . Strings::lower($this->name) . '/';
     $calledClass = get_called_class();
     if (!method_exists($calledClass, 'copyToBinFolder')) {
         throw new NotExistsException(sprintf('Method "' . $calledClass . '::%s" non exists.', 'copyToBinFolder'));
     }
     $errorMsg = 'Property "' . $calledClass . '::$%s" not set.';
     if (!isset($this->name)) {
         throw new NotSetException($errorMsg, 'name');
     }
     if (!isset($this->version)) {
         throw new NotSetException($errorMsg, 'version');
     }
     if (!isset($this->url)) {
         throw new NotSetException($errorMsg, 'url');
     }
     if (!isset($this->distType)) {
         throw new NotSetException($errorMsg, 'distType');
     }
     if (!isset($this->targetDir)) {
         throw new NotSetException($errorMsg, 'targetDir');
     }
 }
开发者ID:lawondyss,项目名称:canterville,代码行数:32,代码来源:BaseInstaller.php

示例4: generateHash

 /**
  * Generuje hash hesla i se solicim retezcem
  * @return string
  */
 public function generateHash($heslo, $salt = NULL)
 {
     if ($heslo === Strings::upper($heslo)) {
         // v pripade zapleho capslocku
         $heslo = Strings::lower($heslo);
     }
     return crypt($heslo, $salt ?: '$2a$07$' . Strings::random(23));
 }
开发者ID:prcharom,项目名称:w-pps-reality,代码行数:12,代码来源:Authenticator.php

示例5: addDynamicAction

 /**
  * Adds dynamic action
  * @param string $title
  * @param bool $ajax
  * @return DynamicAction
  */
 public function addDynamicAction($title, $ajax = false)
 {
     $title = Strings::lower($title);
     $action = new \Gridder\Actions\DynamicAction($this, $title);
     $action->setTitle($title);
     $action->setAjax($ajax);
     return $action;
 }
开发者ID:bazo,项目名称:Tatami,代码行数:14,代码来源:ActionColumn.php

示例6: isComposerVendorNameProtectionFree

 public function isComposerVendorNameProtectionFree($composerFullName)
 {
     $composerVendor = NULL;
     if (($data = Strings::match($composerFullName, Addon::COMPOSER_NAME_RE)) !== NULL) {
         $composerVendor = Strings::lower($data['vendor']);
     }
     return !in_array($composerVendor, $this->protectedVendors);
 }
开发者ID:newPOPE,项目名称:web-addons.nette.org,代码行数:8,代码来源:Validators.php

示例7: calculateAddonsPortalPasswordHash

 /**
  * @param string
  * @param string|NULL
  * @return string
  */
 private function calculateAddonsPortalPasswordHash($password, $salt = NULL)
 {
     if ($password === Strings::upper($password)) {
         // perhaps caps lock is on
         $password = Strings::lower($password);
     }
     return crypt($password, $salt ?: '$2a$07$' . Strings::random(22));
 }
开发者ID:newPOPE,项目名称:web-addons.nette.org,代码行数:13,代码来源:NetteOrgAuthenticator.php

示例8: calculateHash

 /**
  * Computes password hash.
  *
  * @param string
  * @param string|NULL
  * @return string
  */
 public static function calculateHash($password, $salt = NULL)
 {
     if ($password === Strings::upper($password)) {
         // perhaps caps lock is on
         $password = Strings::lower($password);
     }
     return crypt($password, $salt ?: '$2a$07$' . Strings::random(22));
 }
开发者ID:newPOPE,项目名称:web-addons.nette.org,代码行数:15,代码来源:Authenticator.php

示例9: setEmail

 public function setEmail($email)
 {
     /**
      * Not according to RFC 5321, but as per SO this is ok
      * @see http://stackoverflow.com/a/9808332/326257
      */
     $this->setValue('email', $email ? Strings::lower($email) : NULL);
 }
开发者ID:VasekPurchart,项目名称:khanovaskola-v3,代码行数:8,代码来源:User.php

示例10: generateHash

 /**
  * Generuje hash hesla i se solicim retezcem
  * @return string
  */
 public function generateHash($password, $salt = NULL)
 {
     if ($password === Strings::upper($password)) {
         // v pripade zapleho capslocku
         $password = Strings::lower($password);
     }
     return crypt($password, $salt ?: $this->user_salt . Strings::random(23));
 }
开发者ID:prcharom,项目名称:dp-auction-system,代码行数:12,代码来源:UserManager.php

示例11: macroIfAllowedLink

 /**
  * @param MacroNode $node
  * @param PhpWriter $writer
  *
  * @return string
  *
  * @throws CompileException
  */
 public static function macroIfAllowedLink(MacroNode $node, PhpWriter $writer)
 {
     // This macro is allowed only as n:macro in <a ></a> element
     if (Utils\Strings::lower($node->htmlNode->name) != 'a') {
         throw new CompileException("Macro n:allowedHref is allowed only in link element, you used it in {$node->htmlNode->name}.");
     }
     return $writer->write('if($presenter->context->getByType("IPub\\Permissions\\Access\\LinkChecker")->isAllowed(%node.word)){');
 }
开发者ID:cubic,项目名称:permissions,代码行数:16,代码来源:Macros.php

示例12: calculateHash

 /**
  * Computes salted password hash.
  * @param  string
  * @return string
  */
 public static function calculateHash($password, $salt = NULL)
 {
     if ($password === Strings::upper($password)) {
         // perhaps caps lock is on
         $password = Strings::lower($password);
     }
     $password = substr($password, 0, self::PASSWORD_MAX_LENGTH);
     return crypt($password, $salt ?: '$2a$07$' . Strings::random(22));
 }
开发者ID:erwin32,项目名称:nette-foundation-sandbox,代码行数:14,代码来源:Authenticator.php

示例13: hashPassword

 /**
  * Computes salted password hash.
  *
  * @param $password
  * @param null $options
  * @return string
  */
 public static function hashPassword($password, $options = NULL)
 {
     if ($password === Nette\Utils\Strings::upper($password)) {
         // perhaps caps lock is on
         $password = Nette\Utils\Strings::lower($password);
     }
     $password = substr($password, 0, 4096);
     $options = $options ?: implode('$', ['algo' => PHP_VERSION_ID < 50307 ? '$2a' : '$2y', 'cost' => '07', 'salt' => Nette\Utils\Strings::random(22)]);
     return crypt($password, $options);
 }
开发者ID:Kotys,项目名称:eventor.io,代码行数:17,代码来源:Authenticator.php

示例14: spinalCase

 /**
  * Converts the given string to `spinal-case`
  * @param string $string
  * @return string
  */
 public static function spinalCase($string)
 {
     /** RegExp source http://stackoverflow.com/a/1993772 */
     preg_match_all('/([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)/', $string, $matches);
     $matches = $matches[0];
     foreach ($matches as &$match) {
         $match = $match == Strings::upper($match) ? Strings::lower($match) : Strings::firstLower($match);
     }
     return implode('-', $matches);
 }
开发者ID:TomasVotruba,项目名称:Nette-RestRoute,代码行数:15,代码来源:Inflector.php

示例15: getIcon

 /**
  * @param string $ext
  * @return string
  */
 public static final function getIcon($ext)
 {
     $ext = \Nette\Utils\Strings::lower($ext);
     foreach (self::$ICONS as $icon => $extensions) {
         if (in_array($ext, $extensions)) {
             return $icon;
         }
     }
     return self::$DEFAULT_ICON;
 }
开发者ID:brosland,项目名称:media,代码行数:14,代码来源:FileIcon.php


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