本文整理匯總了PHP中Docs::run方法的典型用法代碼示例。如果您正苦於以下問題:PHP Docs::run方法的具體用法?PHP Docs::run怎麽用?PHP Docs::run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Docs
的用法示例。
在下文中一共展示了Docs::run方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processBaseDirectory
}
}
public function processBaseDirectory($directory)
{
$recursiveDirectoryIterator = new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS);
/** @var $iterator RecursiveDirectoryIterator[] */
$iterator = new RecursiveIteratorIterator($recursiveDirectoryIterator);
foreach ($iterator as $item) {
if ($item->getExtension() == 'rst') {
$path = $item->getPathname();
if (strpos($path, '_build/') === false && strpos($path, 'api/') === false) {
$this->_prefix = str_replace('.rst', '', basename($path));
$this->processFile($path);
$baseRstPath = 'transifex/base-rst/' . dirname($path);
@mkdir($baseRstPath, 0777, true);
file_put_contents($baseRstPath . '/' . $this->_prefix . '.rst', $this->_output);
}
}
}
$baseStrPath = 'transifex/strings/';
@mkdir($baseStrPath, 0777, true);
file_put_contents($baseStrPath . '/en.json', json_encode($this->_uniqueStrings, JSON_PRETTY_PRINT));
}
public function run()
{
$this->processBaseDirectory('en');
}
}
$d = new Docs();
$d->run();