Go to the source code of this file.
Namespaces | |
| namespace | cake |
Functions | |
| __construct ($path, $create=false, $mode=0755) | |
| __destruct () | |
| append ($data, $force=false) | |
| close () | |
| create () | |
| delete () | |
| executable () | |
| exists () | |
| ext () | |
| & | Folder () |
| group () | |
| info () | |
| lastAccess () | |
| lastChange () | |
| md5 ($maxsize=5) | |
| name () | |
| offset ($offset=false, $seek=SEEK_SET) | |
| open ($mode= 'r', $force=false) | |
| owner () | |
| perms () | |
| prepare ($data, $forceWindows=false) | |
| pwd () | |
| read ($bytes=false, $mode= 'rb', $force=false) | |
| readable () | |
| safe ($name=null, $ext=null) | |
| size () | |
| writable () | |
| write ($data, $mode= 'w', $force=false) | |
Variables | |
| $handle = null | |
| $lock = null | |
| $path = null | |
| __construct | ( | $ | path, | |
| $ | create = false, |
|||
| $ | mode = 0755 | |||
| ) |
Constructor
| string | $path Path to file | |
| boolean | $create Create file if it does not exist (if true) | |
| integer | $mode Mode to apply to the folder holding the file private |
Definition at line 94 of file file.php.
References $path, create(), exists(), Folder(), name(), pwd(), and safe().
Referenced by ThemeView::__construct(), MediaView::__construct(), XmlElement::__construct(), Xml::__construct(), XmlHelper::__construct(), JsHelper::__construct(), JavascriptHelper::__construct(), CakeSocket::__construct(), Overloadable2::__construct(), Overloadable::__construct(), DboSource::__construct(), DboMssql::__construct(), DataSource::__construct(), L10n::__construct(), HttpSocket::__construct(), Folder::__construct(), Flay::__construct(), SessionHelper::__construct(), __construct(), Permission::__construct(), AclNode::__construct(), Model::__construct(), Controller::__construct(), CakeSchema::__construct(), DbAcl::__construct(), and CakeErrorController::__construct().
| __destruct | ( | ) |
Closes the current file if it is opened
private
Definition at line 117 of file file.php.
References close().
Referenced by Object::Object().
| append | ( | $ | data, | |
| $ | force = false | |||
| ) |
| close | ( | ) |
Closes the current file if it is opened.
Definition at line 277 of file file.php.
Referenced by DataSource::__destruct(), __destruct(), read(), and HttpSocket::request().
| create | ( | ) |
Creates the File.
Definition at line 126 of file file.php.
References exists().
Referenced by __construct(), SchemaShell::__create(), Scaffold::__scaffold(), Scaffold::__scaffoldSave(), Shell::_loadDbConfig(), AclShell::checkNodeType(), DboMssql::create(), AclShell::help(), ClassRegistry::init(), I18nShell::initdb(), AclShell::initdb(), AuthComponent::initialize(), AuthComponent::mapActions(), open(), SchemaShell::run(), and I18nShell::startup().
| delete | ( | ) |
Deletes the File.
Definition at line 289 of file file.php.
References exists().
Referenced by DboMysqlBase::delete().
| executable | ( | ) |
| exists | ( | ) |
Returns true if the File exists.
Definition at line 396 of file file.php.
Referenced by __construct(), ApiShell::__parseClass(), ExtractTask::__writeFiles(), ShellDispatcher::_initEnvironment(), create(), DboSource::defaultConditions(), delete(), ProjectTask::execute(), group(), AuthComponent::identify(), lastAccess(), lastChange(), open(), owner(), perms(), MagicDb::read(), size(), and SchemaShell::view().
| ext | ( | ) |
Returns the File extension.
Definition at line 317 of file file.php.
References info().
Referenced by Router::__parseExtension(), View::_getLayoutFileName(), ScaffoldView::_getViewFileName(), View::_getViewFileName(), View::element(), HtmlHelper::meta(), Router::parse(), MagicDb::read(), safe(), and AuthComponent::startup().
| & Folder | ( | ) |
Returns the current folder.
Definition at line 504 of file file.php.
Referenced by ShellDispatcher::__buildPaths(), __construct(), App::__find(), Configure::__list(), ViewTask::bake(), ProjectTask::bake(), PluginTask::bake(), ProjectTask::execute(), and SchemaShell::generate().
| group | ( | ) |
Returns the File group.
Definition at line 468 of file file.php.
References exists().
Referenced by TestSuiteShell::__canRun(), TestSuiteShell::__run(), TestSuiteShell::__setGetVars(), and Model::find().
| info | ( | ) |
| lastAccess | ( | ) |
| lastChange | ( | ) |
| md5 | ( | $ | maxsize = 5 |
) |
Get md5 Checksum of file with previous check of Filesize
| mixed | $maxsize in MB or true to force |
Definition at line 366 of file file.php.
References size().
Referenced by __construct(), EmailComponent::__createBoundary(), Security::hash(), String::insert(), View::uuid(), and JavascriptHelper::writeEvents().
| name | ( | ) |
Returns the File name without extension.
Definition at line 332 of file file.php.
References info().
Referenced by TestSuiteShell::__canRun(), __construct(), Model::__construct(), Controller::__construct(), CakeSchema::__construct(), Model::__constructLinkedModel(), CookieComponent::__delete(), __destroy(), ExtractTask::__extract(), __gc(), Model::__generateAssociation(), ViewTask::__interactive(), PluginTask::__interactive(), ModelTask::__interactive(), DbConfigTask::__interactive(), DboMssql::__mapFields(), ApiShell::__parseClass(), __read(), Model::__saveMulti(), FormHelper::__selectOptions(), __write(), CookieComponent::__write(), CakeSchema::_build(), Component::_loadComponents(), View::_missingView(), View::_render(), AclBehavior::afterDelete(), AclBehavior::afterSave(), BakeShell::all(), DbConfigTask::bake(), TranslateBehavior::beforeFind(), DboMssql::buildColumn(), DboMssql::buildIndex(), FormHelper::button(), FormHelper::checkbox(), DboMssql::column(), FormHelper::create(), CookieComponent::destroy(), ModelTask::doAssociations(), View::error(), ErrorHandler::error(), ErrorHandler::error404(), Model::escapeField(), FormHelper::file(), FormHelper::hidden(), info(), Component::init(), ClassRegistry::init(), ConsoleShell::main(), HtmlHelper::meta(), DboPostgres::name(), AclNode::node(), AclBehavior::node(), Controller::paginate(), FormHelper::password(), pwd(), FormHelper::radio(), CookieComponent::read(), CakeSchema::read(), SchemaShell::run(), safe(), FormHelper::select(), CookieComponent::startup(), AuthComponent::startup(), SchemaShell::startup(), FormHelper::text(), FormHelper::textarea(), XmlNode::toArray(), and XmlNode::toString().
| offset | ( | $ | offset = false, |
|
| $ | seek = SEEK_SET | |||
| ) |
Sets or gets the offset for the currently opened file.
| mixed | $offset The $offset in bytes to seek. If set to false then the current offset is returned. | |
| integer | $seek PHP Constant SEEK_SET | SEEK_CUR | SEEK_END determining what the $offset is relative to |
Definition at line 207 of file file.php.
References open().
Referenced by ContainableBehavior::containments(), MagicFileResource::extract(), Model::find(), DboSource::generateAssociationQuery(), MagicFileResource::offset(), MagicFileResource::read(), DboMssql::renderStatement(), and DboFirebird::renderStatement().
| open | ( | $ | mode = 'r', |
|
| $ | force = false | |||
| ) |
Opens the current file with a given $mode
| string | $mode A valid 'fopen' mode string (r|w|a ...) | |
| boolean | $force If true then the file will be re-opened even if its already opened, otherwise it won't |
Definition at line 145 of file file.php.
| owner | ( | ) |
| perms | ( | ) |
| prepare | ( | $ | data, | |
| $ | forceWindows = false | |||
| ) |
| pwd | ( | ) |
Returns the full path of the File.
Definition at line 384 of file file.php.
References name().
Referenced by __construct(), ViewTask::bake(), SchemaShell::dump(), and MagicDb::read().
Return the contents of this File as a string.
| string | $bytes where to start | |
| string | $mode | |
| boolean | $force If true then the file will be re-opened even if its already opened, otherwise it won't |
Definition at line 171 of file file.php.
References close(), and open().
Referenced by __initSession(), _checkValid(), TreeBehavior::beforeDelete(), SessionHelper::flash(), AuthComponent::initialize(), AuthComponent::mapActions(), DboMssql::read(), SessionHelper::read(), valid(), and SchemaShell::view().
| readable | ( | ) |
| safe | ( | $ | name = null, |
|
| $ | ext = null | |||
| ) |
makes filename safe for saving
| string | $name the name of the file to make safe if different from $this->name |
Definition at line 350 of file file.php.
Referenced by JavascriptHelper::__construct(), __construct(), and JavascriptHelper::codeBlock().
| size | ( | ) |
Returns the Filesize
Definition at line 417 of file file.php.
References exists().
Referenced by FormHelper::file(), and md5().
| writable | ( | ) |
Returns true if the File is writable.
Definition at line 429 of file file.php.
Referenced by FileEngine::__active(), Configure::__writeConfig(), Folder::copy(), and CakeLog::write().
| write | ( | $ | data, | |
| $ | mode = 'w', |
|||
| $ | force = false | |||
| ) |
Write given data to this File.
| string | $data Data to write to this File. | |
| string | $mode Mode of writing. See fwrite(). | |
| string | $force force the file to open |
Definition at line 242 of file file.php.
References open().
Referenced by __initSession(), _checkValid(), append(), ProjectTask::cakeAdmin(), ProjectTask::corePath(), SchemaShell::dump(), Shell::getAdmin(), and ProjectTask::securitySalt().
| $handle = null |
Definition at line 69 of file file.php.
Referenced by EmailComponent::__attachFiles(), Folder::copy(), and MediaView::render().
| $path = null |
Definition at line 85 of file file.php.
Referenced by ShellDispatcher::__buildPaths(), __construct(), App::__find(), EmailComponent::__findFiles(), TestSuiteShell::__findFolderByCategory(), Configure::__list(), Configure::__loadBootstrap(), ApiShell::__parseClass(), App::__paths(), TestSuiteShell::__run(), App::__settings(), CacheHelper::__writeFile(), View::_getLayoutFileName(), ScaffoldView::_getViewFileName(), View::_getViewFileName(), ProjectTask::bake(), Configure::buildPaths(), cache(), Dispatcher::cached(), Set::check(), Set::classicExtract(), ProjectTask::corePath(), Configure::corePaths(), FormHelper::create(), Shell::createFile(), ProjectTask::createHome(), HtmlHelper::css(), ShellDispatcher::dispatch(), PagesController::display(), View::element(), ProjectTask::execute(), Set::extract(), fileExistsInPath(), ModelTask::fixture(), Set::flatten(), ShellDispatcher::help(), Set::insert(), Configure::listObjects(), Configure::load(), Shell::loadTasks(), BakeShell::loadTasks(), ApiShell::main(), make_clean_css(), AclNode::node(), TreeBehavior::recover(), Set::remove(), MediaView::render(), ProjectTask::securitySalt(), Set::sort(), SchemaShell::startup(), Debugger::trimPath(), Helper::webroot(), and write_css_cache().
1.4.7