本文整理汇总了PHP中Object::getError方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::getError方法的具体用法?PHP Object::getError怎么用?PHP Object::getError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object
的用法示例。
在下文中一共展示了Object::getError方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getftpfiles
/**
* 通过ftp列出图片服务器的图片文件
* @return boolean
*/
public function getftpfiles()
{
/* 检测上传根目录 */
if (!$this->uploader->checkRootPath($this->rootPath)) {
$this->error = $this->uploader->getError();
return false;
}
if (substr($this->savePath, strlen($this->savePath) - 1) != '/') {
$this->savePath .= '/';
}
/* 检查上传目录 */
$files1 = $this->uploader->nlist($this->rootPath . $this->savePath);
if (empty($files1)) {
$this->error = $this->uploader->getError();
return false;
}
//$haha=$this->uploader->pwd();
//$this->uploader->chdir($this->rootPath.$this->savePath);
//$haha1=$this->uploader->pwd();
$allowFiles = substr(str_replace(".", "|", join("", $this->exts)), 1);
$files = array();
foreach ($files1 as $file) {
if (preg_match("/\\.(" . $allowFiles . ")\$/i", $file) || $this->uploader->chdir($file)) {
$files[] = array('url' => str_replace($this->rootPath, '', $file), 'filename' => str_replace($this->rootPath . $this->savePath, '', $file), 'isdir' => $this->uploader->chdir($file) ? 'dir' : 'img');
}
}
return $files;
}
示例2: getSubPath
/**
* 获取子目录的名称
* @param array $file 上传的文件信息
*/
private function getSubPath($filename)
{
$subpath = '';
$rule = $this->subName;
if ($this->autoSub && !empty($rule)) {
$subpath = $this->getName($rule, $filename) . '/';
if (!empty($subpath) && !$this->uploader->mkdir($this->savePath . $subpath)) {
$this->error = $this->uploader->getError();
return false;
}
}
return $subpath;
}
示例3: getSubPath
/**
* 获取子目录的名称
* @param array $file 上传的文件信息
*/
private function getSubPath($filename)
{
$subpath = '';
$rule = self::$config['subName'];
if (self::$config['autoSub'] && !empty($rule)) {
$subpath = $this->getName($rule, $filename) . '/';
if (!empty($subpath) && !self::$uploader->mkdir(self::$config['savePath'] . $subpath)) {
$this->error = self::$uploader->getError();
return false;
}
}
return $subpath;
}
示例4: getSubPath
/**
* 获取子目录的名称
* @param array $file 上传的文件信息
*/
private static function getSubPath($filename)
{
$subpath = '';
$rule = self::subName;
if (self::autoSub && !empty($rule)) {
$subpath = self::getName($rule, $filename) . '/';
if (!empty($subpath) && !self::$uploader->mkdir(self::savePath . $subpath)) {
self::$error = self::$uploader->getError();
return false;
}
}
return $subpath;
}
示例5: __construct
public function __construct($filename, $directory)
{
if (!file_exists($directory . '/' . $filename)) {
$this->error = 'File ' . $filename . ' doesn\'t exist.';
return;
}
$handle = fopen($directory . '/' . $filename, 'r');
$object = NULL;
$text = '';
$materials = array();
$material_filename = '';
while (($line = fgets($handle)) !== FALSE) {
$line = trim($line);
if (strpos($line, 'o ') === 0) {
// Start of a new object.
// Store the old object first.
if (!empty($text)) {
$object = new Object($text, $materials[$material_filename], $directory);
if ($error = $object->getError()) {
$this->error = $error;
return;
}
$this->objects[] = $object;
}
$text = $line;
} elseif (strpos($line, 'mtllib ') === 0) {
$material_filename = trim(substr($line, 7));
if (empty($materials[$material_filename])) {
$materialLoader = new MaterialLoader($material_filename, $directory);
if ($error = $materialLoader->getError()) {
$this->error = $error;
return;
}
$materials[$material_filename] = $materialLoader->materials;
}
} elseif (!empty($line) && strpos($line, '#') !== 0) {
$text .= PHP_EOL . $line;
}
}
// It's the end of file. Create a new object.
if (!empty($text)) {
$object = new Object($text, $materials[$material_filename], $directory);
if ($error = $object->getError()) {
$this->error = $error;
return;
}
$this->objects[] = $object;
}
}
示例6: getError
/** Return mysql error (return false, if no error occurred)
*
* @return bool|string
*/
public function getError()
{
return $this->Db_obj->getError();
}
示例7: getConfig
private function getConfig($config_path = null)
{
$name = $config_path ? ltrim('./', $config_path) : 'ueditor.json';
$config_path = MODULE_PATH . 'Conf/' . $name;
if (is_file($config_path)) {
// $this->config = load_config($config_path); 这种方法加载失败,难道注释影响? !--
$config = json_decode(preg_replace("/\\/\\*[\\s\\S]+?\\*\\//", "", file_get_contents($config_path)), true);
$this->config = array_merge($this->config, $config);
} else {
echo json_encode(array('state' => '配置文件加载失败!'));