本文整理汇总了PHP中Autoload::addDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoload::addDir方法的具体用法?PHP Autoload::addDir怎么用?PHP Autoload::addDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autoload
的用法示例。
在下文中一共展示了Autoload::addDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cmdRepo
function cmdRepo()
{
$file = new File('/home/billy/1.tar.bz2', true);
$target = new Dir('/home/billy/temp/1.unpack/includes', true);
//Packer::unpack($file, $target);
Packer::pack($target, new File(dirname(__FILE__) . '/2.tbz', true));
return;
$pm = new PM();
$pm->startup();
$rb = PM::getRollback();
$rb->push('delete', dirname(__FILE__) . '/_files/source', dirname(__FILE__) . '/_files/target/includes/Controller.php');
//$rb->push('delete', './_files/source', '_files/target/includes/Controller.php' );
//$r = $rb->pop();
$r = $rb->stepBack();
print_r($r);
return;
$ps = PM::getPackageSequence();
print_r($ps->get());
print_r($ps->getAfter('news', '2.3'));
//print_pre($ps->addPackage('news', '2.8'));
print_pre($ps->removePackage('news', '2.8'));
return;
Autoload::addDir(Dir::get($this->root, true)->getDir('repo'));
$rl = new RepositoryList($this->dataDir->getFile('source.list'));
$r = $rl->search(explode(' ', 'qt package'));
print_pre($r);
$pm->shutdown();
}
示例2:
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}}} -*/
/**
* This file contains class Log.
*
* @author Skai <climbonn@gmail.com>
* @link http://cassea.wdev.tk/
* @version $Id: $
* @package system
* @since
*/
Autoload::addDir(dirname(__FILE__) . '/logger');
//{{{Log
/**
* Log make it possible to log all events in system. It provide to log the message with
* different priorities to the different log file, E-mails, tables in DB, Jabber.
* And also to filter messages by priority or message content.
*
* Before writing message of event, formatter return the formatted message(text line or xml).
* All function are containing into the objects: Writers, Filters, Formatters.
* The Log object must contain at least one Writer, and can contain one or more Filters.
*/
class Log
{
const CRITICAL = 0;
const ERROR = 1;
const WARNING = 2;
示例3: undeploy
/**
* Производит откат исходя из информации сохраненной в директории отката $dir
*
* В случае успешного отката возвоащает true, false - в случае если при откате
* одной из задач было выброшено исключение
*
* @param Dir $dir
* @return bool
*/
static function undeploy($dir)
{
if (!$dir->exists()) {
return io::out('Rollback dir(' . $dir . ') not exists.', IO::MESSAGE_WARN) | 2;
}
$list = Dir::get($dir, true)->ls('*', Dir::LS_DIR);
if (count($list) == 0) {
return io::out('Undeploy list is empty');
}
Autoload::addDir(t(new File(__FILE__, true))->getParent()->getDir('deployTasks'));
$steps = array();
foreach ($list as $d) {
$steps[$d->getName()] = array('class' => file_get_contents($d->getFile('.class')), 'dir' => $d);
}
krsort($steps);
foreach ($steps as $s) {
try {
call_user_func($s['class'] . '::undeploy', $s['dir']);
} catch (Exception $e) {
io::out($e->getMessage(), IO::MESSAGE_FAIL);
$fail = true;
}
}
return isset($fail) ? false : true;
}