cd /home/gitlab
sudo -u git -H bundle config mirror.https://rubygems.org https://gems.ruby-china.org/
# For PostgreSQL (note, the option says "without ... mysql")
sudo -u git -H bundle install --deployment --without development test mysql aws kerberos
# Or if you use MySQL (note, the option says "without ... postgres")
sudo -u git -H bundle install --deployment --without development test postgres aws kerberos
对于升级操作也可以按照相应的 update.md 类似处理即可。
<?phpnamespace IlluminateContractsHashing;interface Hasher {/**
* Hash the given value.
*
* @param string $value
* @param array $options
* @return string
*/publicfunction make($value,array$options=array());/**
* Check the given plain value against a hash.
*
* @param string $value
* @param string $hashedValue
* @param array $options
* @return bool
*/publicfunction check($value,$hashedValue,array$options=array());/**
* Check if the given hash has been hashed using the given options.
*
* @param string $hashedValue
* @param array $options
* @return bool
*/publicfunction needsRehash($hashedValue,array$options=array());}
<?php namespace IlluminateContractsHashing;
interface Hasher {
/**
* Hash the given value.
*
* @param string $value
* @param array $options
* @return string
*/
public function make($value, array $options = array());
/**
* Check the given plain value against a hash.
*
* @param string $value
* @param string $hashedValue
* @param array $options
* @return bool
*/
public function check($value, $hashedValue, array $options = array());
/**
* Check if the given hash has been hashed using the given options.
*
* @param string $hashedValue
* @param array $options
* @return bool
*/
public function needsRehash($hashedValue, array $options = array());
}
<?phpnamespace IlluminateHashing;use IlluminateSupportServiceProvider;class HashServiceProvider extends ServiceProvider {/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/protected$defer=true;/**
* Register the service provider.
*
* @return void
*/publicfunction register(){$this->app->singleton('hash',function(){returnnew BcryptHasher;});}/**
* Get the services provided by the provider.
*
* @return array
*/publicfunction provides(){returnarray('hash');}}
<?php namespace IlluminateHashing;
use IlluminateSupportServiceProvider;
class HashServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->singleton('hash', function() { return new BcryptHasher; });
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('hash');
}
}
很明显的 register 了服务,具体做的就是 new 了一个 Container。如果容器有多种实现,这时建议使用 Config 来配置服务了。
<?phpnamespace IlluminateSupportFacades;/**
* @see IlluminateHashingBcryptHasher
*/classHashextends Facade {/**
* Get the registered name of the component.
*
* @return string
*/protected static function getFacadeAccessor(){return'hash';}}
<?php namespace IlluminateSupportFacades;
/**
* @see IlluminateHashingBcryptHasher
*/
class Hash extends Facade {
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'hash';
}
}