CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 1.3 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 1.3
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Classes

  • AclBase
  • AclBehavior
  • AclComponent
  • AclNode
  • AclShell
  • Aco
  • AcoAction
  • AjaxHelper
  • ApcEngine
  • ApiShell
  • App
  • AppController
  • AppHelper
  • AppModel
  • Aro
  • AuthComponent
  • BakeShell
  • BakeTask
  • BehaviorCollection
  • Cache
  • CacheEngine
  • CacheHelper
  • CakeErrorController
  • CakeLog
  • CakeRoute
  • CakeSchema
  • CakeSession
  • CakeSocket
  • ClassRegistry
  • Component
  • Configure
  • ConnectionManager
  • ConsoleShell
  • ContainableBehavior
  • Controller
  • ControllerTask
  • CookieComponent
  • DataSource
  • DbAcl
  • DbConfigTask
  • DboMssql
  • DboMysql
  • DboMysqlBase
  • DboMysqli
  • DboOracle
  • DboPostgres
  • DboSource
  • DboSqlite
  • Debugger
  • EmailComponent
  • ErrorHandler
  • ExtractTask
  • File
  • FileEngine
  • FileLog
  • FixtureTask
  • Folder
  • FormHelper
  • Helper
  • HtmlHelper
  • HttpSocket
  • I18n
  • I18nModel
  • I18nShell
  • Inflector
  • IniAcl
  • JavascriptHelper
  • JqueryEngineHelper
  • JsBaseEngineHelper
  • JsHelper
  • L10n
  • MagicDb
  • MagicFileResource
  • MediaView
  • MemcacheEngine
  • Model
  • ModelBehavior
  • ModelTask
  • MootoolsEngineHelper
  • Multibyte
  • NumberHelper
  • Object
  • Overloadable
  • Overloadable2
  • PagesController
  • PaginatorHelper
  • Permission
  • PluginShortRoute
  • PluginTask
  • ProjectTask
  • PrototypeEngineHelper
  • RequestHandlerComponent
  • Router
  • RssHelper
  • Sanitize
  • Scaffold
  • ScaffoldView
  • SchemaShell
  • Security
  • SecurityComponent
  • SessionComponent
  • SessionHelper
  • Set
  • Shell
  • String
  • TemplateTask
  • TestSuiteShell
  • TestTask
  • TextHelper
  • ThemeView
  • TimeHelper
  • TranslateBehavior
  • TreeBehavior
  • Validation
  • View
  • ViewTask
  • XcacheEngine
  • Xml
  • XmlElement
  • XmlHelper
  • XmlManager
  • XmlNode
  • XmlTextNode

Functions

  • mb_encode_mimeheader
  • mb_stripos
  • mb_stristr
  • mb_strlen
  • mb_strpos
  • mb_strrchr
  • mb_strrichr
  • mb_strripos
  • mb_strrpos
  • mb_strstr
  • mb_strtolower
  • mb_strtoupper
  • mb_substr
  • mb_substr_count
  1: <?php
  2: /**
  3:  * Internationalization Management Shell
  4:  *
  5:  * PHP versions 4 and 5
  6:  *
  7:  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  8:  * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  9:  *
 10:  * Licensed under The MIT License
 11:  * Redistributions of files must retain the above copyright notice.
 12:  *
 13:  * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 14:  * @link          http://cakephp.org CakePHP(tm) Project
 15:  * @package       cake
 16:  * @subpackage    cake.cake.console.libs
 17:  * @since         CakePHP(tm) v 1.2.0.5669
 18:  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 19:  */
 20: 
 21: /**
 22:  * Shell for I18N management.
 23:  *
 24:  * @package       cake
 25:  * @subpackage    cake.cake.console.libs
 26:  */
 27: class I18nShell extends Shell {
 28: 
 29: /**
 30:  * Contains database source to use
 31:  *
 32:  * @var string
 33:  * @access public
 34:  */
 35:     var $dataSource = 'default';
 36: 
 37: /**
 38:  * Contains tasks to load and instantiate
 39:  *
 40:  * @var array
 41:  * @access public
 42:  */
 43:     var $tasks = array('DbConfig', 'Extract');
 44: 
 45: /**
 46:  * Override startup of the Shell
 47:  *
 48:  * @access public
 49:  */
 50:     function startup() {
 51:         $this->_welcome();
 52:         if (isset($this->params['datasource'])) {
 53:             $this->dataSource = $this->params['datasource'];
 54:         }
 55: 
 56:         if ($this->command && !in_array($this->command, array('help'))) {
 57:             if (!config('database')) {
 58:                 $this->out(__('Your database configuration was not found. Take a moment to create one.', true), true);
 59:                 return $this->DbConfig->execute();
 60:             }
 61:         }
 62:     }
 63: 
 64: /**
 65:  * Override main() for help message hook
 66:  *
 67:  * @access public
 68:  */
 69:     function main() {
 70:         $this->out(__('I18n Shell', true));
 71:         $this->hr();
 72:         $this->out(__('[E]xtract POT file from sources', true));
 73:         $this->out(__('[I]nitialize i18n database table', true));
 74:         $this->out(__('[H]elp', true));
 75:         $this->out(__('[Q]uit', true));
 76: 
 77:         $choice = strtolower($this->in(__('What would you like to do?', true), array('E', 'I', 'H', 'Q')));
 78:         switch ($choice) {
 79:             case 'e':
 80:                 $this->Extract->execute();
 81:             break;
 82:             case 'i':
 83:                 $this->initdb();
 84:             break;
 85:             case 'h':
 86:                 $this->help();
 87:             break;
 88:             case 'q':
 89:                 exit(0);
 90:             break;
 91:             default:
 92:                 $this->out(__('You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.', true));
 93:         }
 94:         $this->hr();
 95:         $this->main();
 96:     }
 97: 
 98: /**
 99:  * Initialize I18N database.
100:  *
101:  * @access public
102:  */
103:     function initdb() {
104:         $this->Dispatch->args = array('schema', 'create', 'i18n');
105:         $this->Dispatch->dispatch();
106:     }
107: 
108: /**
109:  * Show help screen.
110:  *
111:  * @access public
112:  */
113:     function help() {
114:         $this->hr();
115:         $this->out(__('I18n Shell:', true));
116:         $this->hr();
117:         $this->out(__('I18n Shell initializes i18n database table for your application', true));
118:         $this->out(__('and generates .pot file(s) with translations.', true));
119:         $this->hr();
120:         $this->out(__('usage:', true));
121:         $this->out('   cake i18n help');
122:         $this->out('   cake i18n initdb [-datasource custom]');
123:         $this->out();
124:         $this->hr();
125: 
126:         $this->Extract->help();
127:     }
128: }
129: 
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs