本文整理汇总了PHP中Config::output_dir方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::output_dir方法的具体用法?PHP Config::output_dir怎么用?PHP Config::output_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Config
的用法示例。
在下文中一共展示了Config::output_dir方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update($event, $val = null)
{
switch ($event) {
case Render::INIT:
$this->parentdir = Config::output_dir() . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR;
if (!file_exists($this->parentdir) || is_file($this->parentdir)) {
mkdir($this->parentdir, 0777, true) or die("Can't create the output directory");
}
$this->setOutputDir($this->parentdir . 'OPS' . DIRECTORY_SEPARATOR);
if (!file_exists($this->getOutputDir()) || is_file($this->getOutputDir())) {
mkdir($this->outputdir, 0777, true) or die("Can't create the cache directory");
}
$this->info = $this->initInfo();
$this->openOPF($this->info, $this->getOutputDir());
$this->openNCX($this->info, $this->getOutputDir());
$this->createMimeTypeFile($this->parentdir);
$this->createContainerFile($this->parentdir);
$this->createBuildFile($this->parentdir, $this->info['epub_file']);
$this->createCSSFile($this->getOutputDir());
$this->loadVersionAcronymInfo();
$this->postConstruct();
break;
case Render::FINALIZE:
$this->closeOPF();
$this->closeNCX();
break;
default:
parent::update($event, $val);
}
}
示例2: update
public function update($event, $val = null)
{
switch ($event) {
case Render::CHUNK:
$this->flags = $val;
break;
case Render::STANDALONE:
if ($val) {
$this->registerElementMap(static::getDefaultElementMap());
$this->registerTextMap(static::getDefaultTextMap());
}
break;
case Render::INIT:
$this->setOutputDir(Config::output_dir() . strtolower($this->getFormatName()) . '/');
$this->postConstruct();
if (file_exists($this->getOutputDir())) {
if (!is_dir($this->getOutputDir())) {
v("Output directory is a file?", E_USER_ERROR);
}
} else {
if (!mkdir($this->getOutputDir())) {
v("Can't create output directory", E_USER_ERROR);
}
}
if (Config::css()) {
$this->fetchStylesheet();
}
break;
case Render::VERBOSE:
v("Starting %s rendering", $this->getFormatName(), VERBOSE_FORMAT_RENDERING);
break;
}
}
示例3: update
public function update($event, $val = null)
{
switch ($event) {
case Render::STANDALONE:
if ($val) {
$this->registerElementMap($this->getDefaultElementMap());
$this->registerTextMap($this->getDefaultTextMap());
} else {
$this->registerElementMap($this->elementmap);
$this->registerTextMap($this->elementmap);
}
break;
case Render::INIT:
if (!class_exists("HaruDoc")) {
die("PDF output needs libharu & haru/pecl extensions... Please install them and start PhD again.\n");
}
$this->setOutputDir(Config::output_dir() . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR);
if (!file_exists($this->getOutputDir()) || is_file($this->getOutputDir())) {
mkdir($this->getOutputDir(), 0777, true) or die("Can't create the cache directory.\n");
}
break;
case Render::VERBOSE:
v("Starting %s rendering", $this->getFormatName(), VERBOSE_FORMAT_RENDERING);
break;
}
}
示例4: update
public function update($event, $val = null)
{
switch ($event) {
case Render::CHUNK:
case Render::STANDALONE:
case Render::VERBOSE:
parent::update($event, $val);
break;
case Render::INIT:
$this->setOutputDir(Config::output_dir() . strtolower($this->getFormatName()) . '/');
$this->postConstruct();
if (file_exists($this->getOutputDir())) {
if (!is_dir($this->getOutputDir())) {
v("Output directory is a file?", E_USER_ERROR);
}
} else {
if (!mkdir($this->getOutputDir(), 0777, true)) {
v("Can't create output directory", E_USER_ERROR);
}
}
if (Config::css()) {
$this->fetchStylesheet();
}
break;
}
}
示例5: update
public function update($event, $val = null)
{
switch ($event) {
case Render::CHUNK:
parent::update($event, $val);
break;
case Render::STANDALONE:
parent::update($event, $val);
break;
case Render::INIT:
$this->chmdir = Config::output_dir() . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR;
if (!file_exists($this->chmdir) || is_file($this->chmdir)) {
mkdir($this->chmdir) or die("Can't create the CHM project directory");
}
$this->outputdir = Config::output_dir() . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR . "res" . DIRECTORY_SEPARATOR;
$this->postConstruct();
if (!file_exists($this->outputdir) || is_file($this->outputdir)) {
mkdir($this->outputdir) or die("Can't create the cache directory");
}
$lang = Config::language();
$this->hhpStream = fopen($this->chmdir . "pear_manual_{$lang}.hhp", "w");
$this->hhcStream = fopen($this->chmdir . "pear_manual_{$lang}.hhc", "w");
$this->hhkStream = fopen($this->chmdir . "pear_manual_{$lang}.hhk", "w");
foreach (array("reset-fonts", "style", "manual") as $name) {
if (!file_exists($this->outputdir . "{$name}.css")) {
file_put_contents($this->outputdir . "{$name}.css", $this->fetchStylesheet($name));
}
}
self::headerChm();
break;
case Render::VERBOSE:
parent::update($event, $val);
break;
}
}
示例6: update
public function update($event, $val = null)
{
switch ($event) {
case Render::CHUNK:
parent::update($event, $val);
break;
case Render::STANDALONE:
parent::update($event, $val);
break;
case Render::INIT:
$this->loadVersionAcronymInfo();
$this->chmdir = Config::output_dir() . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR;
if (!file_exists($this->chmdir) || is_file($this->chmdir)) {
mkdir($this->chmdir, 0777, true) or die("Can't create the CHM project directory");
}
$this->outputdir = Config::output_dir() . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR . "res" . DIRECTORY_SEPARATOR;
$this->postConstruct();
if (!file_exists($this->outputdir) || is_file($this->outputdir)) {
mkdir($this->outputdir, 0777, true) or die("Can't create the cache directory");
}
$lang = Config::language();
$this->hhpStream = fopen($this->chmdir . "php_manual_{$lang}.hhp", "w");
$this->hhcStream = fopen($this->chmdir . "php_manual_{$lang}.hhc", "w");
$this->hhkStream = fopen($this->chmdir . "php_manual_{$lang}.hhk", "w");
$stylesheet = $this->generateStylesheet();
$this->headerChm();
// Save the stylesheet.
file_put_contents($this->outputdir . "style.css", $stylesheet . '#usernotes {margin-left : inherit;}' . PHP_EOL . '#layout-content { width: 100% !important; }' . PHP_EOL);
break;
case Render::VERBOSE:
parent::update($event, $val);
break;
}
}
示例7: update
public function update($event, $val = null)
{
switch ($event) {
case Render::CHUNK:
$this->flags = $val;
break;
case Render::STANDALONE:
if ($val) {
$this->registerElementMap(parent::getDefaultElementMap());
$this->registerTextMap(parent::getDefaultTextMap());
}
break;
case Render::INIT:
if ($val) {
if (!is_resource($this->getFileStream())) {
$filename = Config::output_dir();
if (Config::output_filename()) {
$filename .= Config::output_filename();
} else {
$filename .= strtolower($this->getFormatName()) . $this->getExt();
}
$this->postConstruct();
if (Config::css()) {
$this->fetchStylesheet();
}
$this->setFileStream(fopen($filename, "w+"));
fwrite($this->getFileStream(), $this->header());
}
}
break;
case Render::VERBOSE:
v("Starting %s rendering", $this->getFormatName(), VERBOSE_FORMAT_RENDERING);
break;
}
}
示例8: __construct
public function __construct()
{
if (file_exists(Config::output_dir() . "index.sqlite")) {
$this->sqlite = new \SQLite3(Config::output_dir() . 'index.sqlite');
$this->sortIDs();
}
}
示例9: update
public function update($event, $value = null)
{
switch ($event) {
case Render::CHUNK:
$this->flags = $value;
break;
case Render::STANDALONE:
if ($value) {
$this->registerElementMap(static::getDefaultElementMap());
$this->registerTextMap(static::getDefaultTextMap());
$this->registerPIHandlers($this->pihandlers);
}
break;
case Render::INIT:
if ($value) {
if (file_exists(Config::output_dir() . "index.sqlite")) {
$db = new \SQLite3(Config::output_dir() . 'index.sqlite');
$db->exec('DELETE FROM ids');
$db->exec('DELETE FROM indexing');
} else {
$db = new \SQLite3(Config::output_dir() . 'index.sqlite');
$create = <<<SQL
CREATE TABLE ids (
docbook_id TEXT,
filename TEXT,
parent_id TEXT,
sdesc TEXT,
ldesc TEXT,
element TEXT,
previous TEXT,
next TEXT,
chunk INTEGER
);
CREATE TABLE indexing (
time INTEGER PRIMARY KEY
);
SQL;
$db->exec('PRAGMA default_synchronous=OFF');
$db->exec('PRAGMA count_changes=OFF');
$db->exec('PRAGMA cache_size=100000');
$db->exec($create);
}
$this->db = $db;
$this->chunks = array();
} else {
print_r($this->chunks);
}
break;
case Render::FINALIZE:
$retval = $this->db->exec("BEGIN TRANSACTION; INSERT INTO indexing (time) VALUES ('" . time() . "'); COMMIT");
$this->commit();
if ($this->db->lastErrorCode()) {
trigger_error($this->db->lastErrorMsg(), E_USER_WARNING);
}
break;
}
}
示例10: update
public function update($event, $val = null)
{
switch ($event) {
case Render::CHUNK:
switch ($val) {
case self::OPEN_CHUNK:
if ($this->getFileStream()) {
/* I have an already open stream, back it up */
$this->pChunk = $this->cchunk;
}
$this->pushFileStream(fopen("php://temp/maxmemory", "r+"));
$this->cchunk = $this->dchunk;
$this->chunkOpen = true;
break;
case self::CLOSE_CHUNK:
$stream = $this->popFileStream();
$this->writeChunk($stream);
fclose($stream);
/* Do I have a parent stream I need to resume? */
if ($this->getFileStream()) {
$this->cchunk = $this->pChunk;
$this->chunkOpen = true;
} else {
$this->cchunk = array();
$this->chunkOpen = false;
}
break;
default:
var_dump("Unknown action");
}
break;
case Render::STANDALONE:
if ($val) {
$this->registerElementMap(self::getDefaultElementMap());
$this->registerTextMap(self::getDefaultTextMap());
} else {
$this->registerElementMap(static::getDefaultElementMap());
$this->registerTextMap(static::getDefaultTextMap());
}
break;
case Render::INIT:
$this->setOutputDir(Config::output_dir() . strtolower($this->toValidName($this->getFormatName())) . '/');
if (file_exists($this->getOutputDir())) {
if (!is_dir($this->getOutputDir())) {
v("Output directory is a file?", E_USER_ERROR);
}
} else {
if (!mkdir($this->getOutputDir(), 0777, true)) {
v("Can't create output directory", E_USER_ERROR);
}
}
break;
case Render::VERBOSE:
v("Starting %s rendering", $this->getFormatName(), VERBOSE_FORMAT_RENDERING);
break;
}
}
示例11: createFileName
public function createFileName()
{
$filename = Config::output_dir();
if (Config::output_filename()) {
$filename .= Config::output_filename();
} else {
$filename .= strtolower($this->getFormatName()) . $this->getExt();
}
return $filename;
}
示例12: postConstruct
/**
* Called after the constructor finished.
* This is needed since themes set their outputdir and outputfile
* in the constructor. That file/dir is used for mediamanager.
* That means we cannot instantiate and complete the manager in our
* constructor centrally.
*
* Each theme needs its own media manager, since the manager contains
* the output path.
*
* @return void
*/
public function postConstruct()
{
$this->mediamanager = new MediaManager(Config::xml_root());
$outputdir = $this->getOutputDir();
if (isset($outputdir) && $outputdir) {
$this->mediamanager->output_dir = $outputdir;
} else {
$this->mediamanager->output_dir = Config::output_dir() . '/' . strtolower($this->getFormatName()) . '-data/';
$this->mediamanager->relative_ref_path = basename($this->mediamanager->output_dir) . '/';
}
}
示例13: createDatabase
public function createDatabase()
{
$db = new \SQLite3(Config::output_dir() . strtolower($this->getFormatName()) . $this->getExt());
$db->exec('DROP TABLE IF EXISTS functions');
$db->exec('DROP TABLE IF EXISTS params');
$db->exec('DROP TABLE IF EXISTS notes');
$db->exec('DROP TABLE IF EXISTS seealso');
$db->exec('DROP TABLE IF EXISTS changelogs');
$db->exec('PRAGMA default_synchronous=OFF');
$db->exec('PRAGMA count_changes=OFF');
$db->exec('PRAGMA cache_size=100000');
$db->exec($this->createSQL());
$this->db = $db;
}
示例14: update
public function update($event, $val = null)
{
switch ($event) {
case Render::CHUNK:
parent::update($event, $val);
break;
case Render::STANDALONE:
parent::update($event, $val);
break;
case Render::INIT:
$this->setOutputDir(Config::output_dir() . strtolower($this->getFormatName()) . '/');
break;
//No verbose
}
}
示例15: update
public function update($event, $value = null)
{
switch ($event) {
case Render::STANDALONE:
$this->registerElementMap($this->elementmap);
$this->registerTextMap($this->textmap);
break;
case Render::FINALIZE:
$filename = Config::output_dir() . strtolower($this->getFormatName()) . $this->getExt();
file_put_contents($filename, $this->buffer);
break;
case Render::VERBOSE:
v("Starting %s rendering", $this->getFormatName(), VERBOSE_FORMAT_RENDERING);
break;
}
}