Last active
August 29, 2015 14:08
-
-
Save ackintosh/7e9dda34ce9eaf7f3de9 to your computer and use it in GitHub Desktop.
Authコンポーネントのパスワードのハッシュ値をコマンドで生成する ref: http://qiita.com/NAKANO_Akihito/items/df54814dded552767cc5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./app/Console/cake gen_password foo | |
Welcome to CakePHP v2.4.10 Console | |
--------------------------------------------------------------- | |
App : app | |
Path: /Users/hoge/cake/app/ | |
--------------------------------------------------------------- | |
c61bf4fc7e757757ce027b9f91801618abaa2f6b | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('SimplePasswordHasher', 'Controller/Component/Auth'); | |
class GenPasswordShell extends AppShell { | |
public function main() { | |
$passwordHasher = new SimplePasswordHasher(); | |
$this->out($passwordHasher->hash($this->args[0])); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment