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:  * File Storage stream for Logging
 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://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
15:  * @package       cake
16:  * @subpackage    cake.cake.libs.log
17:  * @since         CakePHP(tm) v 1.3
18:  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
19:  */
20: if (!class_exists('File')) {
21:     require LIBS . 'file.php';
22: }
23: /**
24:  * File Storage stream for Logging.  Writes logs to different files
25:  * based on the type of log it is.
26:  *
27:  * @package cake
28:  * @subpackage cake.cake.libs.log
29:  */
30: class FileLog {
31: 
32: /**
33:  * Path to save log files on.
34:  *
35:  * @var string
36:  */
37:     var $_path = null;
38: 
39: /**
40:  * Constructs a new File Logger.
41:  * 
42:  * Options
43:  *
44:  * - `path` the path to save logs on.
45:  *
46:  * @param array $options Options for the FileLog, see above.
47:  * @return void
48:  */
49:     function FileLog($options = array()) {
50:         $options += array('path' => LOGS);
51:         $this->_path = $options['path'];
52:     }
53: 
54: /**
55:  * Implements writing to log files.
56:  *
57:  * @param string $type The type of log you are making.
58:  * @param string $message The message you want to log.
59:  * @return boolean success of write.
60:  */
61:     function write($type, $message) {
62:         $debugTypes = array('notice', 'info', 'debug');
63: 
64:         if ($type == 'error' || $type == 'warning') {
65:             $filename = $this->_path  . 'error.log';
66:         } elseif (in_array($type, $debugTypes)) {
67:             $filename = $this->_path . 'debug.log';
68:         } else {
69:             $filename = $this->_path . $type . '.log';
70:         }
71:         $output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $message . "\n";
72:         $log = new File($filename, true);
73:         if ($log->writable()) {
74:             return $log->append($output);
75:         }
76:     }
77: }
78: 
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