On Oct 27, 7:51 pm, santos <[email protected]> wrote: > Resolved! :) > Thanks! > > My solution: > I create /vendors/shells/myextract.php : > > class MyextractShell extends Shell { > var $tasks = array('Extract', 'Myextract'); > > function main() { > $this->Myextract->execute(); > } > > } > > I create vendors/shells/tasks/myextract.php : > > class MyextractTask extends ExtractTask { > > function __extractTokens() { > foreach ($this->__files as $file) { > $this->__file = $file; > $this->out(sprintf(__('Processing %s...', true), > $file)); > > $code = file_get_contents($file); > $allTokens = token_get_all($code); > $this->__tokens = array(); > $lineNumber = 1; > > foreach ($allTokens as $token) { > if ((!is_array($token)) || (($token[0] != > T_WHITESPACE) && ($token[0] != > T_INLINE_HTML))) { > if (is_array($token)) { > $token[] = $lineNumber; > } > $this->__tokens[] = $token; > } > > if (is_array($token)) { > $lineNumber += count(explode("\n", > $token[1])) - 1; > } else { > $lineNumber += count(explode("\n", > $token)) - 1; > } > } > unset($allTokens); > $this->__parse('__', array('singular')); > $this->__parse('__n', array('singular', 'plural')); > $this->__parse('__d', array('domain', 'singular')); > $this->__parse('__c', array('singular')); > $this->__parse('__dc', array('domain', 'singular')); > $this->__parse('__dn', array('domain', 'singular', > 'plural')); > $this->__parse('__dcn', array('domain', 'singular', > 'plural')); > > $this->__parse('__myd', array('domain', 'singular')); > $this->__parse('__mydn', array('domain', 'singular', > 'plural')); > } > } > > } > > and execute in terminal: cake myextract
Well done :) AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
