[ Index ]
 

Code source de CakePHP 1.1.13.4450

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/cake/ -> basics.php (sommaire)

Basic Cake functionality. Core functions for including other source files, loading models and so forth.

Copyright: Copyright 2005-2007, Cake Software Foundation, Inc.
License: http://www.opensource.org/licenses/mit-license.php The MIT License
Version: $Revision: 4450 $
Poids: 1090 lignes (26 kb)
Inclus ou requis: 4 fois
Référencé: 0 fois
Nécessite: 2 fichiers
 cake/app_controller.php
 cake/app_model.php

Définit 44 fonctions

  ob_get_clean()
  loadModels()
  loadPluginModels()
  loadView()
  loadModel()
  loadControllers()
  loadController()
  loadPluginController()
  loadHelper()
  loadPluginHelper()
  loadComponent()
  loadPluginComponent()
  listClasses()
  config()
  uses()
  vendor()
  debug()
  getMicrotime()
  sortByKey()
  array_combine()
  h()
  a()
  aa()
  e()
  low()
  up()
  r()
  pr()
  params()
  am()
  setUri()
  env()
  file_get_contents()
  file_put_contents()
  cache()
  clearCache()
  stripslashes_deep()
  __()
  countdim()
  LogError()
  fileExistsInPath()
  convertSlash()
  chmodr()
  strip_plugin()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

ob_get_clean()   X-Ref
Patch for PHP < 4.3


loadModels()   X-Ref
Loads all models.


loadPluginModels($plugin)   X-Ref
Loads all plugin models.

param: string  $plugin Name of plugin
return:

loadView($viewClass)   X-Ref
Loads custom view class.


loadModel($name = null)   X-Ref
Loads a model by CamelCase name.


loadControllers()   X-Ref
Loads all controllers.


loadController($name)   X-Ref
Loads a controller and its helper libraries.

param: string  $name Name of controller
return: boolean Success

loadPluginController($plugin, $controller)   X-Ref
Loads a plugin's controller.

param: string  $plugin Name of plugin
param: string  $controller Name of controller to load
return: boolean Success

loadHelper($name)   X-Ref
Loads a helper

param: string  $name Name of helper
return: boolean Success

loadPluginHelper($plugin, $helper)   X-Ref
Loads a plugin's helper

param: string  $plugin Name of plugin
param: string  $helper Name of helper to load
return: boolean Success

loadComponent($name)   X-Ref
Loads a component

param: string  $name Name of component
return: boolean Success

loadPluginComponent($plugin, $component)   X-Ref
Loads a plugin's component

param: string  $plugin Name of plugin
param: string  $helper Name of component to load
return: boolean Success

listClasses($path)   X-Ref
Returns an array of filenames of PHP files in given directory.

param: string $path Path to scan for files
return: array  List of files in directory

config()   X-Ref
Loads configuration files

return: boolean Success

uses()   X-Ref
Loads component/components from LIBS.

Example:
<code>
uses('flay', 'time');
</code>


vendor($name)   X-Ref
Require given files in the VENDORS directory. Takes optional number of parameters.

param: string $name Filename without the .php part.

debug($var = false, $showHtml = false)   X-Ref
Prints out debug information about given variable.

Only runs if DEBUG level is non-zero.

param: boolean $var        Variable to show debug information for.
param: boolean $show_html    If set to true, the method prints the debug data in a screen-friendly way.

getMicrotime()   X-Ref
Returns microtime for execution time checking

return: integer

sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC)   X-Ref
Sorts given $array by key $sortby.

param: array    $array
param: string  $sortby
param: string  $order  Sort order asc/desc (ascending or descending).
param: integer $type
return: mixed

array_combine($a1, $a2)   X-Ref
Combines given identical arrays by using the first array's values as keys,
and the second one's values as values. (Implemented for back-compatibility with PHP4)

param: array $a1
param: array $a2
return: mixed Outputs either combined array or false.

h($text)   X-Ref
Convenience method for htmlspecialchars.

param: string $text
return: string

a()   X-Ref
Returns an array of all the given parameters.

Example:
<code>
a('a', 'b')
</code>

Would return:
<code>
array('a', 'b')
</code>

return: array

aa()   X-Ref
Constructs associative array from pairs of arguments.

Example:
<code>
aa('a','b')
</code>

Would return:
<code>
array('a'=>'b')
</code>

return: array

e($text)   X-Ref
Convenience method for echo().

param: string $text String to echo

low($str)   X-Ref
Convenience method for strtolower().

param: string $str String to lowercase

up($str)   X-Ref
Convenience method for strtoupper().

param: string $str String to uppercase

r($search, $replace, $subject)   X-Ref
Convenience method for str_replace().

param: string $search String to be replaced
param: string $replace String to insert
param: string $subject String to search

pr($var)   X-Ref
Print_r convenience function, which prints out <PRE> tags around
the output of given array. Similar to debug().

param: array    $var

params($p)   X-Ref
Display parameter

param: mixed  $p Parameter as string or array
return: string

am()   X-Ref
Merge a group of arrays

param: array First array
param: array Second array
param: array Third array
param: array Etc...
return: array All array parameters merged into one

setUri()   X-Ref
Returns the REQUEST_URI from the server environment, or, failing that,
constructs a new one, using the PHP_SELF constant and other variables.

return: string URI

env($key)   X-Ref
Gets an environment variable from available sources.
Used as a backup if $_SERVER/$_ENV are disabled.

param: string $key Environment variable name.
return: string Environment variable setting.

file_get_contents($fileName, $useIncludePath = false)   X-Ref
Returns contents of a file as a string.

param: string  $fileName        Name of the file.
param: boolean $useIncludePath Wheter the function should use the include path or not.
return: mixed    Boolean false or contents of required file.

file_put_contents($fileName, $data)   X-Ref
Writes data into file.

If file exists, it will be overwritten. If data is an array, it will be join()ed with an empty string.

param: string $fileName File name.
param: mixed  $data String or array.

cache($path, $data = null, $expires = '+1 day', $target = 'cache')   X-Ref
Reads/writes temporary data to cache files or session.

param: string $path    File path within /tmp to save the file.
param: mixed  $data    The data to save to the temporary file.
param: mixed  $expires A valid strtotime string when the data expires.
param: string $target  The target of the cached data; either 'cache' or 'public'.
return: mixed  The contents of the temporary file.

clearCache($params = null, $type = 'views', $ext = '.php')   X-Ref
Used to delete files in the cache directories, or clear contents of cache directories

param: mixed $params As String name to be searched for deletion, if name is a directory all files in directory will be deleted.
param: string $type Directory in tmp/cache defaults to view directory
param: string $ext The file extension you are deleting
return: true if files found and deleted false otherwise

stripslashes_deep($value)   X-Ref
Recursively strips slashes from all values in an array

param: unknown_type $value
return: unknown

__($msg, $return = null)   X-Ref
Returns a translated string if one is found,
or the submitted message if not found.

param: unknown_type $msg
param: unknown_type $return
return: unknown

countdim($array)   X-Ref
Counts the dimensions of an array

param: array $array
return: int The number of dimensions in $array

LogError($message)   X-Ref
Shortcut to Log::write.


fileExistsInPath($file)   X-Ref
Searches include path for files

param: string $file
return: Full path to file if exists, otherwise false

convertSlash($string)   X-Ref
Convert forward slashes to underscores and removes first and last underscores in a string

param: string
return: string with underscore remove from start and end of string

chmodr($path, $mode = 0755)   X-Ref
chmod recursively on a directory

param: string $path
param: int $mode
return: boolean

strip_plugin($base, $plugin)   X-Ref
removed the plugin name from the base url

param: string $base
param: string $plugin
return: base url with plugin name removed if present



Généré le : Sun Feb 25 19:27:47 2007 par Balluche grâce à PHPXref 0.7