Ejemplo n.º 1
0
 public function fire()
 {
     list($path, $contents) = $this->getKeyFile();
     $key = Tiny::generate_set();
     $contents = str_replace($this->laravel['config']['zackkitzmiller/tiny::key'], $key, $contents);
     $this->files->put($path, $contents);
     $this->laravel['config']['zackkitzmiller/tiny::key'] = $key;
     $this->info("Tiny key [{$key}] has been set.");
 }
Ejemplo n.º 2
0
 public function testGenerateSetUnique()
 {
     $set = Tiny::generate_set();
     $set_parts = str_split($set);
     $used = array();
     foreach ($set_parts as $char) {
         $this->assertArrayNotHasKey($char, $used);
         $used[$char] = $char;
     }
 }
Ejemplo n.º 3
0
 public function fire()
 {
     $key = Tiny::generate_set();
     $path = base_path('.env');
     if (file_exists($path) and getenv('LEAGUE_TINY_KEY') !== false) {
         $originalContent = file_get_contents($path);
         $content = str_replace('LEAGUE_TINY_KEY=' . getenv('LEAGUE_TINY_KEY'), 'LEAGUE_TINY_KEY=' . $key, $originalContent);
         file_put_contents($path, $content);
     } else {
         $fp = fopen($path, 'a');
         fwrite($fp, "\nLEAGUE_TINY_KEY={$key}\n");
         fclose($fp);
     }
     $this->info("Tiny key [{$key}] has been set.");
 }
Ejemplo n.º 4
0
 /**
  * Do the tiny conversion.
  * @param string $text
  */
 public function tiny($id)
 {
     return $this->tiny->to($id);
 }
Ejemplo n.º 5
0
 /**
  * {@inheritdoc}
  *
  * @param string $str String to elucidate.
  * @return string
  */
 public function elucidate($str)
 {
     return $this->_tiny->from($str);
 }