Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed the visibility to methods that not affect others classes.

  • Loading branch information...
commit 61833294f0c14dac3c1b6aa8845efe57bd29be99 1 parent f5a54d0
@jrbasso jrbasso authored
Showing with 111 additions and 111 deletions.
  1. +1 −1  lib/Cake/Cache/Engine/MemcacheEngine.php
  2. +3 −3 lib/Cake/Cache/Engine/XcacheEngine.php
  3. +13 −13 lib/Cake/Console/Command/AclShell.php
  4. +10 −10 lib/Cake/Console/Command/SchemaShell.php
  5. +10 −10 lib/Cake/Console/Command/TestsuiteShell.php
  6. +1 −1  lib/Cake/Console/Shell.php
  7. +4 −4 lib/Cake/Controller/Component/AuthComponent.php
  8. +3 −3 lib/Cake/Controller/Component/EmailComponent.php
  9. +1 −1  lib/Cake/Controller/Component/RequestHandlerComponent.php
  10. +2 −2 lib/Cake/Controller/Controller.php
  11. +10 −10 lib/Cake/Model/CakeSchema.php
  12. +2 −2 lib/Cake/Model/Datasource/DataSource.php
  13. +1 −1  lib/Cake/Model/Datasource/Database/Mysql.php
  14. +1 −1  lib/Cake/Model/Datasource/Database/Oracle.php
  15. +1 −1  lib/Cake/Model/Datasource/Database/Postgres.php
  16. +1 −1  lib/Cake/Model/Datasource/Database/Sqlite.php
  17. +1 −1  lib/Cake/Model/Datasource/Database/Sqlserver.php
  18. +2 −2 lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
  19. +1 −1  lib/Cake/Test/Case/Controller/ControllerMergeVarsTest.php
  20. +1 −1  lib/Cake/Test/Case/Controller/ControllerTest.php
  21. +2 −2 lib/Cake/Utility/Folder.php
  22. +6 −6 lib/Cake/Utility/Set.php
  23. +2 −2 lib/Cake/View/Helper/CacheHelper.php
  24. +24 −24 lib/Cake/View/Helper/FormHelper.php
  25. +2 −2 lib/Cake/View/Helper/HtmlHelper.php
  26. +6 −6 lib/Cake/View/Helper/PaginatorHelper.php
View
2  lib/Cake/Cache/Engine/MemcacheEngine.php
@@ -94,7 +94,7 @@ public function init($settings = array()) {
* @param string $server The server address string.
* @return array Array containing host, port
*/
- function _parseServerString($server) {
+ protected function _parseServerString($server) {
if (substr($server, 0, 1) == '[') {
$position = strpos($server, ']:');
if ($position !== false) {
View
6 lib/Cake/Cache/Engine/XcacheEngine.php
@@ -127,12 +127,12 @@ public function delete($key) {
* @return boolean True if the cache was successfully cleared, false otherwise
*/
public function clear($check) {
- $this->__auth();
+ $this->_auth();
$max = xcache_count(XC_TYPE_VAR);
for ($i = 0; $i < $max; $i++) {
xcache_clear_cache(XC_TYPE_VAR, $i);
}
- $this->__auth(true);
+ $this->_auth(true);
return true;
}
@@ -146,7 +146,7 @@ public function clear($check) {
* @param boolean $reverse Revert changes
* @return void
*/
- function __auth($reverse = false) {
+ protected function _auth($reverse = false) {
static $backup = array();
$keys = array('PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'password');
foreach ($keys as $key => $setting) {
View
26 lib/Cake/Console/Command/AclShell.php
@@ -109,7 +109,7 @@ public function main() {
* @return void
*/
public function create() {
- extract($this->__dataVars());
+ extract($this->_dataVars());
$class = ucfirst($this->args[0]);
$parent = $this->parseIdentifier($this->args[1]);
@@ -142,7 +142,7 @@ public function create() {
* @return void
*/
public function delete() {
- extract($this->__dataVars());
+ extract($this->_dataVars());
$identifier = $this->parseIdentifier($this->args[1]);
$nodeId = $this->_getNodeId($class, $identifier);
@@ -159,7 +159,7 @@ public function delete() {
* @return void
*/
public function setParent() {
- extract($this->__dataVars());
+ extract($this->_dataVars());
$target = $this->parseIdentifier($this->args[1]);
$parent = $this->parseIdentifier($this->args[2]);
@@ -183,7 +183,7 @@ public function setParent() {
* @return void
*/
public function getPath() {
- extract($this->__dataVars());
+ extract($this->_dataVars());
$identifier = $this->parseIdentifier($this->args[1]);
$id = $this->_getNodeId($class, $identifier);
@@ -226,7 +226,7 @@ protected function _outputNode($class, $node, $indent) {
* @return void
*/
public function check() {
- extract($this->__getParams());
+ extract($this->_getParams());
if ($this->Acl->check($aro, $aco, $action)) {
$this->out(__d('cake_console', '%s is <success>allowed</success>.', $aroName), true);
@@ -241,7 +241,7 @@ public function check() {
* @return void
*/
public function grant() {
- extract($this->__getParams());
+ extract($this->_getParams());
if ($this->Acl->allow($aro, $aco, $action)) {
$this->out(__d('cake_console', 'Permission <success>granted</success>.'), true);
@@ -256,7 +256,7 @@ public function grant() {
* @return void
*/
public function deny() {
- extract($this->__getParams());
+ extract($this->_getParams());
if ($this->Acl->deny($aro, $aco, $action)) {
$this->out(__d('cake_console', 'Permission denied.'), true);
@@ -271,7 +271,7 @@ public function deny() {
* @return void
*/
public function inherit() {
- extract($this->__getParams());
+ extract($this->_getParams());
if ($this->Acl->inherit($aro, $aco, $action)) {
$this->out(__d('cake_console', 'Permission inherited.'), true);
@@ -286,7 +286,7 @@ public function inherit() {
* @return void
*/
public function view() {
- extract($this->__dataVars());
+ extract($this->_dataVars());
if (isset($this->args[1])) {
$identity = $this->parseIdentifier($this->args[1]);
@@ -511,7 +511,7 @@ public function nodeExists() {
if (!isset($this->args[0]) || !isset($this->args[1])) {
return false;
}
- extract($this->__dataVars($this->args[0]));
+ extract($this->_dataVars($this->args[0]));
$key = is_numeric($this->args[1]) ? $secondary_id : 'alias';
$conditions = array($class . '.' . $key => $this->args[1]);
$possibility = $this->Acl->{$class}->find('all', compact('conditions'));
@@ -546,7 +546,7 @@ public function parseIdentifier($identifier) {
* @param mixed $identifier A mixed identifier for finding the node.
* @return integer Integer of NodeId. Will trigger an error if nothing is found.
*/
- function _getNodeId($class, $identifier) {
+ protected function _getNodeId($class, $identifier) {
$node = $this->Acl->{$class}->node($identifier);
if (empty($node)) {
if (is_array($identifier)) {
@@ -562,7 +562,7 @@ function _getNodeId($class, $identifier) {
*
* @return array aro, aco, action
*/
- function __getParams() {
+ protected function _getParams() {
$aro = is_numeric($this->args[0]) ? intval($this->args[0]) : $this->args[0];
$aco = is_numeric($this->args[1]) ? intval($this->args[1]) : $this->args[1];
$aroName = $aro;
@@ -590,7 +590,7 @@ function __getParams() {
* @param string $type Node type (ARO/ACO)
* @return array Variables
*/
- function __dataVars($type = null) {
+ protected function _dataVars($type = null) {
if ($type == null) {
$type = $this->args[0];
}
View
20 lib/Cake/Console/Command/SchemaShell.php
@@ -243,7 +243,7 @@ public function dump() {
*/
public function create() {
list($Schema, $table) = $this->_loadSchema();
- $this->__create($Schema, $table);
+ $this->_create($Schema, $table);
}
/**
@@ -253,7 +253,7 @@ public function create() {
*/
public function update() {
list($Schema, $table) = $this->_loadSchema();
- $this->__update($Schema, $table);
+ $this->_update($Schema, $table);
}
/**
@@ -261,7 +261,7 @@ public function update() {
*
* @return void
*/
- function _loadSchema() {
+ protected function _loadSchema() {
$name = $plugin = null;
if (!empty($this->params['name'])) {
$name = $this->params['name'];
@@ -302,7 +302,7 @@ function _loadSchema() {
* @param string $table
* @return void
*/
- function __create($Schema, $table = null) {
+ protected function _create($Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
$drop = $create = array();
@@ -326,7 +326,7 @@ function __create($Schema, $table = null) {
if ('y' == $this->in(__d('cake_console', 'Are you sure you want to drop the table(s)?'), array('y', 'n'), 'n')) {
$this->out(__d('cake_console', 'Dropping table(s).'));
- $this->__run($drop, 'drop', $Schema);
+ $this->_run($drop, 'drop', $Schema);
}
$this->out("\n" . __d('cake_console', 'The following table(s) will be created.'));
@@ -334,7 +334,7 @@ function __create($Schema, $table = null) {
if ('y' == $this->in(__d('cake_console', 'Are you sure you want to create the table(s)?'), array('y', 'n'), 'y')) {
$this->out(__d('cake_console', 'Creating table(s).'));
- $this->__run($create, 'create', $Schema);
+ $this->_run($create, 'create', $Schema);
}
$this->out(__d('cake_console', 'End create.'));
}
@@ -347,7 +347,7 @@ function __create($Schema, $table = null) {
* @param string $table
* @return void
*/
- function __update(&$Schema, $table = null) {
+ protected function _update(&$Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
$this->out(__d('cake_console', 'Comparing Database to Schema...'));
@@ -378,21 +378,21 @@ function __update(&$Schema, $table = null) {
if ('y' == $this->in(__d('cake_console', 'Are you sure you want to alter the tables?'), array('y', 'n'), 'n')) {
$this->out();
$this->out(__d('cake_console', 'Updating Database...'));
- $this->__run($contents, 'update', $Schema);
+ $this->_run($contents, 'update', $Schema);
}
$this->out(__d('cake_console', 'End update.'));
}
/**
- * Runs sql from __create() or __update()
+ * Runs sql from _create() or _update()
*
* @param array $contents
* @param string $event
* @param CakeSchema $Schema
* @return void
*/
- function __run($contents, $event, &$Schema) {
+ protected function _run($contents, $event, &$Schema) {
if (empty($contents)) {
$this->err(__d('cake_console', 'Sql could not be run'));
return;
View
20 lib/Cake/Console/Command/TestsuiteShell.php
@@ -180,7 +180,7 @@ public function initialize() {
*
* @return array Array of params for CakeTestDispatcher
*/
- protected function parseArgs() {
+ protected function _parseArgs() {
if (empty($this->args)) {
return;
}
@@ -212,7 +212,7 @@ protected function parseArgs() {
*
* @return array Array of params for CakeTestDispatcher
*/
- protected function runnerOptions() {
+ protected function _runnerOptions() {
$options = array();
$params = $this->params;
unset($params['help']);
@@ -244,23 +244,23 @@ public function main() {
$this->out(__d('cake_console', 'CakePHP Test Shell'));
$this->hr();
- $args = $this->parseArgs();
+ $args = $this->_parseArgs();
if (empty($args['case'])) {
return $this->available();
}
- $this->run($args, $this->runnerOptions());
+ $this->_run($args, $this->_runnerOptions());
}
/**
* Runs the test case from $runnerArgs
*
- * @param array $runnerArgs list of arguments as obtained from parseArgs()
- * @param array $options list of options as constructed by runnerOptions()
+ * @param array $runnerArgs list of arguments as obtained from _parseArgs()
+ * @param array $options list of options as constructed by _runnerOptions()
* @return void
*/
- protected function run($runnerArgs, $options = array()) {
+ protected function _run($runnerArgs, $options = array()) {
restore_error_handler();
restore_error_handler();
@@ -274,7 +274,7 @@ protected function run($runnerArgs, $options = array()) {
* @return void
*/
public function available() {
- $params = $this->parseArgs();
+ $params = $this->_parseArgs();
$testCases = CakeTestLoader::generateTestList($params);
$app = $params['app'];
$plugin = $params['plugin'];
@@ -308,14 +308,14 @@ public function available() {
if (is_numeric($choice) && isset($cases[$choice])) {
$this->args[0] = $category;
$this->args[1] = $cases[$choice];
- $this->run($this->parseArgs(), $this->runnerOptions());
+ $this->_run($this->_parseArgs(), $this->_runnerOptions());
break;
}
if (is_string($choice) && in_array($choice, $cases)) {
$this->args[0] = $category;
$this->args[1] = $choice;
- $this->run($this->parseArgs(), $this->runnerOptions());
+ $this->_run($this->_parseArgs(), $this->_runnerOptions());
break;
}
View
2  lib/Cake/Console/Shell.php
@@ -774,7 +774,7 @@ protected function _pluralHumanName($name) {
* @param string $pluginName Name of the plugin you want ie. DebugKit
* @return string $path path to the correct plugin.
*/
- function _pluginPath($pluginName) {
+ protected function _pluginPath($pluginName) {
if (CakePlugin::loaded($pluginName)) {
return CakePlugin::path($pluginName);
}
View
8 lib/Cake/Controller/Component/AuthComponent.php
@@ -277,7 +277,7 @@ public function startup($controller) {
return true;
}
- if (!$this->__setDefaults()) {
+ if (!$this->_setDefaults()) {
return false;
}
$request = $controller->request;
@@ -339,7 +339,7 @@ public function startup($controller) {
*
* @return boolean
*/
- function __setDefaults() {
+ protected function _setDefaults() {
$defaults = array(
'logoutRedirect' => $this->loginAction,
'authError' => __d('cake', 'You are not authorized to access that location.')
@@ -502,7 +502,7 @@ public function mapActions($map = array()) {
* @link http://book.cakephp.org/view/1261/login
*/
public function login($user = null) {
- $this->__setDefaults();
+ $this->_setDefaults();
if (empty($user)) {
$user = $this->identify($this->request, $this->response);
@@ -524,7 +524,7 @@ public function login($user = null) {
* @link http://book.cakephp.org/view/1262/logout
*/
public function logout() {
- $this->__setDefaults();
+ $this->_setDefaults();
if (empty($this->_authenticateObjects)) {
$this->constructAuthenticate();
}
View
6 lib/Cake/Controller/Component/EmailComponent.php
@@ -407,7 +407,7 @@ protected function _formatAttachFiles() {
* @param string $attachment Attachment file name to find
* @return string Path to located file
*/
- function _findFiles($attachment) {
+ protected function _findFiles($attachment) {
if (file_exists($attachment)) {
return $attachment;
}
@@ -426,7 +426,7 @@ function _findFiles($attachment) {
* @param string $subject String to encode
* @return string Encoded string
*/
- function _encode($subject) {
+ protected function _encode($subject) {
$subject = $this->_strip($subject);
$nl = "\r\n";
@@ -472,7 +472,7 @@ protected function _formatAddresses($addresses) {
* @param boolean $message Set to true to indicate main message content
* @return string Stripped value
*/
- function _strip($value, $message = false) {
+ protected function _strip($value, $message = false) {
$search = '%0a|%0d|Content-(?:Type|Transfer-Encoding)\:';
$search .= '|charset\=|mime-version\:|multipart/mixed|(?:[^a-z]to|b?cc)\:.*';
View
2  lib/Cake/Controller/Component/RequestHandlerComponent.php
@@ -175,7 +175,7 @@ public function startup($controller) {
* @param string $xml
* @return array Xml array data
*/
- public function _convertXml($xml) {
+ protected function _convertXml($xml) {
try {
$xml = Xml::build($xml);
if (isset($xml->data)) {
View
4 lib/Cake/Controller/Controller.php
@@ -526,7 +526,7 @@ protected function _getScaffold(CakeRequest $request) {
*
* @return void
*/
- protected function __mergeVars() {
+ protected function _mergeControllerVars() {
$pluginController = $pluginDot = null;
if (!empty($this->plugin)) {
@@ -584,7 +584,7 @@ protected function __mergeVars() {
* @throws MissingModelException
*/
public function constructClasses() {
- $this->__mergeVars();
+ $this->_mergeControllerVars();
$this->Components->init($this);
if ($this->uses) {
$this->uses = (array) $this->uses;
View
20 lib/Cake/Model/CakeSchema.php
@@ -259,7 +259,7 @@ public function read($options = array()) {
if (in_array($fulltable, $currentTables)) {
$key = array_search($fulltable, $currentTables);
if (empty($tables[$table])) {
- $tables[$table] = $this->__columns($Object);
+ $tables[$table] = $this->_columns($Object);
$tables[$table]['indexes'] = $db->index($Object);
$tables[$table]['tableParameters'] = $db->readTableParameters($fulltable);
unset($currentTables[$key]);
@@ -278,7 +278,7 @@ public function read($options = array()) {
$key = array_search($withTable, $currentTables);
$noPrefixWith = $this->_noPrefixTable($prefix, $withTable);
- $tables[$noPrefixWith] = $this->__columns($Object->$class);
+ $tables[$noPrefixWith] = $this->_columns($Object->$class);
$tables[$noPrefixWith]['indexes'] = $db->index($Object->$class);
$tables[$noPrefixWith]['tableParameters'] = $db->readTableParameters($withTable);
unset($currentTables[$key]);
@@ -307,15 +307,15 @@ public function read($options = array()) {
'aros', 'acos', 'aros_acos', Configure::read('Session.table'), 'i18n'
);
if (in_array($table, $systemTables)) {
- $tables[$Object->table] = $this->__columns($Object);
+ $tables[$Object->table] = $this->_columns($Object);
$tables[$Object->table]['indexes'] = $db->index($Object);
$tables[$Object->table]['tableParameters'] = $db->readTableParameters($table);
} elseif ($models === false) {
- $tables[$table] = $this->__columns($Object);
+ $tables[$table] = $this->_columns($Object);
$tables[$table]['indexes'] = $db->index($Object);
$tables[$table]['tableParameters'] = $db->readTableParameters($table);
} else {
- $tables['missing'][$table] = $this->__columns($Object);
+ $tables['missing'][$table] = $this->_columns($Object);
$tables['missing'][$table]['indexes'] = $db->index($Object);
$tables['missing'][$table]['tableParameters'] = $db->readTableParameters($table);
}
@@ -403,12 +403,12 @@ public function generateTable($table, $fields) {
}
$col = "\t\t'{$field}' => array('type' => '" . $value['type'] . "', ";
unset($value['type']);
- $col .= join(', ', $this->__values($value));
+ $col .= join(', ', $this->_values($value));
} elseif ($field == 'indexes') {
$col = "\t\t'indexes' => array(";
$props = array();
foreach ((array)$value as $key => $index) {
- $props[] = "'{$key}' => array(" . join(', ', $this->__values($index)) . ")";
+ $props[] = "'{$key}' => array(" . join(', ', $this->_values($index)) . ")";
}
$col .= join(', ', $props);
} elseif ($field == 'tableParameters') {
@@ -560,7 +560,7 @@ protected function _arrayDiffAssoc($array1, $array2) {
* @param array $values options keys(type, null, default, key, length, extra)
* @return array Formatted values
*/
- public function __values($values) {
+ protected function _values($values) {
$vals = array();
if (is_array($values)) {
foreach ($values as $key => $val) {
@@ -581,7 +581,7 @@ public function __values($values) {
* @param array $Obj model object
* @return array Formatted columns
*/
- public function __columns(&$Obj) {
+ protected function _columns(&$Obj) {
$db = $Obj->getDataSource();
$fields = $Obj->schema(true);
@@ -691,7 +691,7 @@ protected function _compareIndexes($new, $old) {
* @param string $table Full table name
* @return string Prefix-less table name
*/
- function _noPrefixTable($prefix, $table) {
+ protected function _noPrefixTable($prefix, $table) {
return preg_replace('/^' . preg_quote($prefix) . '/', '', $table);
}
}
View
4 lib/Cake/Model/Datasource/DataSource.php
@@ -126,7 +126,7 @@ public function describe(Model $model) {
if (isset($this->_descriptions[$table])) {
return $this->_descriptions[$table];
}
- $cache = $this->__cacheDescription($table);
+ $cache = $this->_cacheDescription($table);
if ($cache !== null) {
$this->_descriptions[$table] =& $cache;
@@ -287,7 +287,7 @@ public function setConfig($config = array()) {
* @param mixed $data The description of the model, usually a string or array
* @return mixed
*/
- function __cacheDescription($object, $data = null) {
+ protected function _cacheDescription($object, $data = null) {
if ($this->cacheSources === false) {
return null;
}
View
2  lib/Cake/Model/Datasource/Database/Mysql.php
@@ -323,7 +323,7 @@ public function describe(Model $model) {
}
}
}
- $this->__cacheDescription($this->fullTableName($model, false), $fields);
+ $this->_cacheDescription($this->fullTableName($model, false), $fields);
$cols->closeCursor();
return $fields;
}
View
2  lib/Cake/Model/Datasource/Database/Oracle.php
@@ -505,7 +505,7 @@ public function describe(Model $model) {
'length'=> $row[0]['DATA_LENGTH']
);
}
- $this->__cacheDescription($this->fullTableName($model, false), $fields);
+ $this->_cacheDescription($this->fullTableName($model, false), $fields);
return $fields;
}
View
2  lib/Cake/Model/Datasource/Database/Postgres.php
@@ -249,7 +249,7 @@ public function describe(Model $model) {
$fields[$c->name]['default'] = constant($fields[$c->name]['default']);
}
}
- $this->__cacheDescription($table, $fields);
+ $this->_cacheDescription($table, $fields);
}
if (isset($model->sequence)) {
$this->_sequenceMap[$table][$model->primaryKey] = $model->sequence;
View
2  lib/Cake/Model/Datasource/Database/Sqlite.php
@@ -185,7 +185,7 @@ public function describe(Model $model) {
}
$result->closeCursor();
- $this->__cacheDescription($model->tablePrefix . $model->table, $fields);
+ $this->_cacheDescription($model->tablePrefix . $model->table, $fields);
return $fields;
}
View
2  lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -247,7 +247,7 @@ public function describe(Model $model) {
$fields[$field]['length'] = $fields[$field]['length'] . ',' . $column->Size;
}
}
- $this->__cacheDescription($table, $fields);
+ $this->_cacheDescription($table, $fields);
$cols->closeCursor();
return $fields;
}
View
4 lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
@@ -422,7 +422,7 @@ public function testCreateWithTableArgs() {
public function testUpdateWithTable() {
$this->Shell = $this->getMock(
'SchemaShell',
- array('in', 'out', 'hr', 'createFile', 'error', 'err', '_stop', '__run'),
+ array('in', 'out', 'hr', 'createFile', 'error', 'err', '_stop', '_run'),
array(&$this->Dispatcher)
);
@@ -433,7 +433,7 @@ public function testUpdateWithTable() {
$this->Shell->args = array('SchemaShellTest', 'articles');
$this->Shell->startup();
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
- $this->Shell->expects($this->once())->method('__run')
+ $this->Shell->expects($this->once())->method('_run')
->with($this->arrayHasKey('articles'), 'update', $this->isInstanceOf('CakeSchema'));
$this->Shell->update();
View
2  lib/Cake/Test/Case/Controller/ControllerMergeVarsTest.php
@@ -236,7 +236,7 @@ public function testMergeVarsWithPlugin() {
}
/**
- * Ensure that __mergeVars is not being greedy and merging with
+ * Ensure that _mergeControllerVars is not being greedy and merging with
* AppController when you make an instance of Controller
*
* @return void
View
2  lib/Cake/Test/Case/Controller/ControllerTest.php
@@ -904,7 +904,7 @@ public function testChildComponentOptionsSupercedeParents() {
}
/**
- * Ensure that __mergeVars is not being greedy and merging with
+ * Ensure that _mergeControllerVars is not being greedy and merging with
* ControllerTestAppController when you make an instance of Controller
*
* @return void
View
4 lib/Cake/Utility/Folder.php
@@ -398,7 +398,7 @@ public function tree($path, $exceptions = true, $type = null) {
}
while (!empty($this->_directories)) {
$dir = array_pop($this->_directories);
- $this->__tree($dir, $exceptions);
+ $this->_tree($dir, $exceptions);
$directories[] = $dir;
}
@@ -420,7 +420,7 @@ public function tree($path, $exceptions = true, $type = null) {
* @param mixed $exceptions Array of files to exclude from the read that will be performed.
* @return void
*/
- public function __tree($path, $exceptions) {
+ protected function _tree($path, $exceptions) {
$this->path = $path;
list($dirs, $files) = $this->read(false, $exceptions, true);
$this->_directories = array_merge($this->_directories, $dirs);
View
12 lib/Cake/Utility/Set.php
@@ -126,7 +126,7 @@ public static function map($class = 'stdClass', $tmp = 'stdClass') {
if (empty($val)) {
return null;
}
- return Set::__map($val, $class);
+ return Set::_map($val, $class);
}
/**
@@ -142,7 +142,7 @@ public static function map($class = 'stdClass', $tmp = 'stdClass') {
* @param boolean $primary whether to assign first array key as the _name_
* @return mixed Mapped object
*/
- public static function __map(&$array, $class, $primary = false) {
+ protected static function _map(&$array, $class, $primary = false) {
if ($class === true) {
$out = new stdClass;
} else {
@@ -158,7 +158,7 @@ public static function __map(&$array, $class, $primary = false) {
if (is_object($out)) {
$out = get_object_vars($out);
}
- $out[$key] = Set::__map($value, $class);
+ $out[$key] = Set::_map($value, $class);
if (is_object($out[$key])) {
if ($primary !== true && is_array($value) && Set::countDim($value, true) === 2) {
if (!isset($out[$key]->_name_)) {
@@ -173,18 +173,18 @@ public static function __map(&$array, $class, $primary = false) {
}
$primary = false;
foreach ($value as $key2 => $value2) {
- $out->{$key2} = Set::__map($value2, true);
+ $out->{$key2} = Set::_map($value2, true);
}
} else {
if (!is_numeric($key)) {
- $out->{$key} = Set::__map($value, true, $key);
+ $out->{$key} = Set::_map($value, true, $key);
if (is_object($out->{$key}) && !is_numeric($key)) {
if (!isset($out->{$key}->_name_)) {
$out->{$key}->_name_ = $key;
}
}
} else {
- $out->{$key} = Set::__map($value, true);
+ $out->{$key} = Set::_map($value, true);
}
}
} else {
View
4 lib/Cake/View/Helper/CacheHelper.php
@@ -187,7 +187,7 @@ protected function _parseFile($file, $cache) {
*
* @return string The content with cake:nocache tags replaced.
*/
- function _replaceSection() {
+ protected function _replaceSection() {
$this->_counter += 1;
return sprintf('<!--nocache:%03d-->', $this->_counter);
}
@@ -200,7 +200,7 @@ function _replaceSection() {
* @param string $content String to remove tags from.
* @return string String with tags removed.
*/
- function _stripTags($content) {
+ protected function _stripTags($content) {
return preg_replace('#<!--/?nocache(\:\d{3})?-->#', '', $content);
}
View
48 lib/Cake/View/Helper/FormHelper.php
@@ -98,7 +98,7 @@ class FormHelper extends AppHelper {
* An array of fieldnames that have been excluded from
* the Token hash used by SecurityComponent's validatePost method
*
- * @see FormHelper::__secure()
+ * @see FormHelper::_secure()
* @see SecurityComponent::validatePost()
* @var array
*/
@@ -591,7 +591,7 @@ public function unlockField($name = null) {
* @param mixed $value Field value, if value should not be tampered with.
* @return void
*/
- protected function __secure($lock, $field = null, $value = null) {
+ protected function _secure($lock, $field = null, $value = null) {
if (!$field) {
$field = $this->entity();
} elseif (is_string($field)) {
@@ -1400,7 +1400,7 @@ public function hidden($fieldName, $options = array()) {
));
if ($secure && $secure !== self::SECURE_SKIP) {
- $this->__secure(true, null, '' . $options['value']);
+ $this->_secure(true, null, '' . $options['value']);
}
return $this->Html->useTag('hidden', $options['name'], array_diff_key($options, array('name' => '')));
@@ -1423,7 +1423,7 @@ public function file($fieldName, $options = array()) {
$field = $this->entity();
foreach (array('name', 'type', 'tmp_name', 'error', 'size') as $suffix) {
- $this->__secure($secure, array_merge($field, array($suffix)));
+ $this->_secure($secure, array_merge($field, array($suffix)));
}
return $this->Html->useTag('file', $options['name'], array_diff_key($options, array('name' => '')));
@@ -1448,7 +1448,7 @@ public function button($title, $options = array()) {
$title = h($title);
}
if (isset($options['name'])) {
- $this->__secure($options['secure'], $options['name']);
+ $this->_secure($options['secure'], $options['name']);
}
return $this->Html->useTag('button', $options['type'], array_diff_key($options, array('type' => '')), $title);
}
@@ -1592,7 +1592,7 @@ public function submit($caption = null, $options = array()) {
}
if (isset($options['name'])) {
- $this->__secure($options['secure'], $options['name']);
+ $this->_secure($options['secure'], $options['name']);
}
unset($options['secure']);
@@ -1698,7 +1698,7 @@ public function select($fieldName, $options = array(), $attributes = array()) {
));
if (is_string($options) && isset($this->_options[$options])) {
- $options = $this->__generateOptions($options);
+ $options = $this->_generateOptions($options);
} elseif (!is_array($options)) {
$options = array();
}
@@ -1729,7 +1729,7 @@ public function select($fieldName, $options = array(), $attributes = array()) {
if (!empty($tag) || isset($template)) {
if (!isset($secure) || $secure == true) {
- $this->__secure(true);
+ $this->_secure(true);
}
$select[] = $this->Html->useTag($tag, $attributes['name'], array_diff_key($attributes, array('name' => '', 'value' => '')));
}
@@ -1751,7 +1751,7 @@ public function select($fieldName, $options = array(), $attributes = array()) {
$attributes['id'] = Inflector::camelize($attributes['id']);
}
- $select = array_merge($select, $this->__selectOptions(
+ $select = array_merge($select, $this->_selectOptions(
array_reverse($options, true),
array(),
$showParents,
@@ -1786,14 +1786,14 @@ public function select($fieldName, $options = array(), $attributes = array()) {
*/
public function day($fieldName = null, $attributes = array()) {
$attributes += array('empty' => true, 'value' => null);
- $attributes = $this->__dateTimeSelected('day', $fieldName, $attributes);
+ $attributes = $this->_dateTimeSelected('day', $fieldName, $attributes);
if (strlen($attributes['value']) > 2) {
$attributes['value'] = date('d', strtotime($attributes['value']));
} elseif ($attributes['value'] === false) {
$attributes['value'] = null;
}
- return $this->select($fieldName . ".day", $this->__generateOptions('day'), $attributes);
+ return $this->select($fieldName . ".day", $this->_generateOptions('day'), $attributes);
}
/**
@@ -1845,7 +1845,7 @@ public function year($fieldName, $minYear = null, $maxYear = null, $attributes =
unset($attributes['orderYear']);
}
return $this->select(
- $fieldName . '.year', $this->__generateOptions('year', $yearOptions),
+ $fieldName . '.year', $this->_generateOptions('year', $yearOptions),
$attributes
);
}
@@ -1868,7 +1868,7 @@ public function year($fieldName, $minYear = null, $maxYear = null, $attributes =
*/
public function month($fieldName, $attributes = array()) {
$attributes += array('empty' => true, 'value' => null);
- $attributes = $this->__dateTimeSelected('month', $fieldName, $attributes);
+ $attributes = $this->_dateTimeSelected('month', $fieldName, $attributes);
if (strlen($attributes['value']) > 2) {
$attributes['value'] = date('m', strtotime($attributes['value']));
@@ -1882,7 +1882,7 @@ public function month($fieldName, $attributes = array()) {
return $this->select(
$fieldName . ".month",
- $this->__generateOptions('month', array('monthNames' => $monthNames)),
+ $this->_generateOptions('month', array('monthNames' => $monthNames)),
$attributes
);
}
@@ -1904,7 +1904,7 @@ public function month($fieldName, $attributes = array()) {
*/
public function hour($fieldName, $format24Hours = false, $attributes = array()) {
$attributes += array('empty' => true, 'value' => null);
- $attributes = $this->__dateTimeSelected('hour', $fieldName, $attributes);
+ $attributes = $this->_dateTimeSelected('hour', $fieldName, $attributes);
if (strlen($attributes['value']) > 2) {
if ($format24Hours) {
@@ -1917,7 +1917,7 @@ public function hour($fieldName, $format24Hours = false, $attributes = array())
}
return $this->select(
$fieldName . ".hour",
- $this->__generateOptions($format24Hours ? 'hour24' : 'hour'),
+ $this->_generateOptions($format24Hours ? 'hour24' : 'hour'),
$attributes
);
}
@@ -1938,7 +1938,7 @@ public function hour($fieldName, $format24Hours = false, $attributes = array())
*/
public function minute($fieldName, $attributes = array()) {
$attributes += array('empty' => true, 'value' => null);
- $attributes = $this->__dateTimeSelected('min', $fieldName, $attributes);
+ $attributes = $this->_dateTimeSelected('min', $fieldName, $attributes);
if (strlen($attributes['value']) > 2) {
$attributes['value'] = date('i', strtotime($attributes['value']));
@@ -1952,7 +1952,7 @@ public function minute($fieldName, $attributes = array()) {
unset($attributes['interval']);
}
return $this->select(
- $fieldName . ".min", $this->__generateOptions('minute', $minuteOptions),
+ $fieldName . ".min", $this->_generateOptions('minute', $minuteOptions),
$attributes
);
}
@@ -1965,7 +1965,7 @@ public function minute($fieldName, $attributes = array()) {
* @param array $attributes Array of attributes, must contain 'empty' key.
* @return array Attributes array with currently selected value.
*/
- function __dateTimeSelected($select, $fieldName, $attributes) {
+ protected function _dateTimeSelected($select, $fieldName, $attributes) {
if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) {
if (is_array($value) && isset($value[$select])) {
$attributes['value'] = $value[$select];
@@ -2017,7 +2017,7 @@ public function meridian($fieldName, $attributes = array()) {
$attributes['value'] = null;
}
return $this->select(
- $fieldName . ".meridian", $this->__generateOptions('meridian'),
+ $fieldName . ".meridian", $this->_generateOptions('meridian'),
$attributes
);
}
@@ -2264,7 +2264,7 @@ protected function _name($options = array(), $field = null, $key = 'name') {
* @param array $attributes
* @return array
*/
- function __selectOptions($elements = array(), $parents = array(), $showParents = null, $attributes = array()) {
+ protected function _selectOptions($elements = array(), $parents = array(), $showParents = null, $attributes = array()) {
$select = array();
$attributes = array_merge(
array('escape' => true, 'style' => null, 'value' => null, 'class' => null),
@@ -2284,7 +2284,7 @@ function __selectOptions($elements = array(), $parents = array(), $showParents =
}
$parents[] = $name;
}
- $select = array_merge($select, $this->__selectOptions(
+ $select = array_merge($select, $this->_selectOptions(
$title, $parents, $showParents, $attributes
));
@@ -2357,7 +2357,7 @@ function __selectOptions($elements = array(), $parents = array(), $showParents =
* @param array $options
* @return array
*/
- function __generateOptions($name, $options = array()) {
+ protected function _generateOptions($name, $options = array()) {
if (!empty($this->options[$name])) {
return $this->options[$name];
}
@@ -2487,7 +2487,7 @@ protected function _initInputField($field, $options = array()) {
}
}
- $this->__secure($secure, $fieldName);
+ $this->_secure($secure, $fieldName);
return $result;
}
}
View
4 lib/Cake/View/Helper/HtmlHelper.php
@@ -902,7 +902,7 @@ public function nestedList($list, $options = array(), $itemOptions = array(), $t
$tag = $options;
$options = array();
}
- $items = $this->__nestedListItem($list, $options, $itemOptions, $tag);
+ $items = $this->_nestedListItem($list, $options, $itemOptions, $tag);
return sprintf($this->_tags[$tag], $this->_parseAttributes($options, null, ' ', ''), $items);
}
@@ -916,7 +916,7 @@ public function nestedList($list, $options = array(), $itemOptions = array(), $t
* @return string The nested list element
* @see HtmlHelper::nestedList()
*/
- function __nestedListItem($items, $options, $itemOptions, $tag) {
+ protected function _nestedListItem($items, $options, $itemOptions, $tag) {
$out = '';
$index = 1;
View
12 lib/Cake/View/Helper/PaginatorHelper.php
@@ -251,7 +251,7 @@ public function prev($title = '<< Previous', $options = array(), $disabledTitle
'rel' => 'prev'
);
$options = array_merge($defaults, (array)$options);
- return $this->__pagingLink('Prev', $title, $options, $disabledTitle, $disabledOptions);
+ return $this->_pagingLink('Prev', $title, $options, $disabledTitle, $disabledOptions);
}
/**
@@ -274,7 +274,7 @@ public function next($title = 'Next >>', $options = array(), $disabledTitle = nu
'rel' => 'next'
);
$options = array_merge($defaults, (array)$options);
- return $this->__pagingLink('Next', $title, $options, $disabledTitle, $disabledOptions);
+ return $this->_pagingLink('Next', $title, $options, $disabledTitle, $disabledOptions);
}
/**
@@ -426,7 +426,7 @@ protected function _convertUrlKeys($url, $type) {
* @param array $disabledOptions
* @return string
*/
- protected function __pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) {
+ protected function _pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) {
$check = 'has' . $which;
$_defaults = array(
'url' => array(), 'step' => 1, 'escape' => true,
@@ -468,7 +468,7 @@ protected function __pagingLink($which, $title = null, $options = array(), $disa
* @return boolean True if the result set is not at the first page.
*/
public function hasPrev($model = null) {
- return $this->__hasPage($model, 'prev');
+ return $this->_hasPage($model, 'prev');
}
/**
@@ -478,7 +478,7 @@ public function hasPrev($model = null) {
* @return boolean True if the result set is not at the last page.
*/
public function hasNext($model = null) {
- return $this->__hasPage($model, 'next');
+ return $this->_hasPage($model, 'next');
}
/**
@@ -504,7 +504,7 @@ public function hasPage($model = null, $page = 1) {
* @param integer $page Page number you are checking.
* @return boolean Whether model has $page
*/
- protected function __hasPage($model, $page) {
+ protected function _hasPage($model, $page) {
$params = $this->params($model);
if (!empty($params)) {
if ($params["{$page}Page"] == true) {
Please sign in to comment.
Something went wrong with that request. Please try again.