_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q252600 | PermalinkManager.update | validation | public function update($previousPermalink, $newPermalink)
{
$blocks = $this->permalinks[$previousPermalink];
$this->remove($previousPermalink);
$this->permalinks[$newPermalink] = $blocks;
return $this;
} | php | {
"resource": ""
} |
q252601 | Column.setSortBy | validation | public function setSortBy($sortKeys){
if($sortKeys==null){
$sortKeys=[];
}
if(!is_array($sortKeys)){
$sortKeys=[$sortKeys];
}
$this->sortKeys=$sortKeys;
} | php | {
"resource": ""
} |
q252602 | Input.isClicked | validation | public function isClicked(string $sType) : bool
{
if ($this->getType() === 'submit' || $this->getType() === 'button') {
if (isset($_POST[$this->getName()])) { return true; }
}
return false;
} | php | {
"resource": ""
} |
q252603 | Helper.mailTagger | validation | public static function mailTagger($mail = '', $name = null)
{
return((!is_int($name) ? "\"".$name."\" <" : '').$mail.(!is_int($name) ? ">" : ''));
} | php | {
"resource": ""
} |
q252604 | Helper.mailListTagger | validation | public static function mailListTagger(array $list)
{
$str = '';
foreach ($list as $name=>$mail) {
if (is_string($mail)) {
$str .= self::mailTagger($mail, $name).Mailer::$ADDERSSES_SEPARATOR;
} elseif (is_array($mail)) {
foreach ($mail as $subna... | php | {
"resource": ""
} |
q252605 | Helper.headerTagger | validation | public static function headerTagger($name = '', $value = '', $adds = array())
{
$str = $name.': '.$value;
if (count($adds)) {
foreach ($adds as $n=>$v) {
$str .= Mailer::$HEADERS_SEPARATOR.($n=='boundary' ? "\n\t" : '').$n."=\"".$v."\"";
}
}
re... | php | {
"resource": ""
} |
q252606 | Helper.listAddresses | validation | public static function listAddresses($list = array(), $type = 'to')
{
if (empty($list)) {
return;
}
$str = ucfirst(strtolower($type)).': '.self::mailListTagger($list);
return(trim($str, Mailer::$ADDERSSES_SEPARATOR).Mailer::$LINE_ENDING);
} | php | {
"resource": ""
} |
q252607 | Helper.formatText | validation | public static function formatText($txt = '', $type = 'plain', $spaces = false)
{
switch ($type) {
case 'ascii' :
$_txt = '';
if ($spaces==true) {
$txt = str_replace(' ', '_', $txt);
}
for ($i=0; $i<strlen($txt);$... | php | {
"resource": ""
} |
q252608 | Helper.getMimeType | validation | public static function getMimeType($filename = '')
{
$ext = strtolower(substr($filename, strrpos($filename, '.')));
switch ($ext) {
case '.jpeg': case '.jpg': $mimetype = 'image/jpeg'; break;
case '.gif': $mimetype = 'image/gif'; break;
case '.png': $mimetype = 'i... | php | {
"resource": ""
} |
q252609 | Helper.deduplicate | validation | public static function deduplicate($array)
{
if (empty($array)) {
return $array;
}
$known = array();
foreach ($array as $_index=>$entry) {
if (is_array($entry)) {
foreach ($entry as $i=>$_email) {
if (!in_array($_email, $kno... | php | {
"resource": ""
} |
q252610 | Helper.checkPeopleArgs | validation | public static function checkPeopleArgs()
{
$args = func_get_args();
if (empty($args)) {
return array();
}
// 1 only email
if (count($args)==1 && is_string($args[0]) && self::isEmail($args[0])) {
return array( array($args[0]) );
}
// 2... | php | {
"resource": ""
} |
q252611 | Helper.charAscii | validation | public static function charAscii($char)
{
if (self::isAscii($char)) {
return $char;
}
$char = htmlentities($char);
return $char;
} | php | {
"resource": ""
} |
q252612 | Menu.destroy | validation | public function destroy($menuId = null)
{
if ($menuId !== null) {
return $this->parseJSON('json', [self::API_CONDITIONAL_DELETE, ['menuid' => $menuId]]);
}
return $this->parseJSON('get', [self::API_DELETE]);
} | php | {
"resource": ""
} |
q252613 | Builder.onClassFound | validation | protected function onClassFound(ScannedPhpClass $subject)
{
$class = $subject->getClass();
$main = $this->reader->getClassAnnotation($class, Di\DiServiceAnnotation::class);
if ($main instanceof Di\DiServiceAnnotation) {
// add the service definition
$definition = $t... | php | {
"resource": ""
} |
q252614 | Builder.createPublicMethodInjection | validation | public function createPublicMethodInjection(\ReflectionMethod $method) : MethodInjection
{
/** @var ParameterInjection[] $injections */
$injections = [];
foreach ($method->getParameters() as $parameter) {
$injections[] = new ParameterInjection(
$parameter->getNa... | php | {
"resource": ""
} |
q252615 | Builder.getInjectHint | validation | private function getInjectHint(\ReflectionMethod $method, \ReflectionParameter $parameter)
{
// find the first injection hint for the given parameter
$hint = Psi::it($this->reader->getMethodAnnotations($method))
->filter(new IsInstanceOf(Di\DiInjectHintAnnotation::class))
->f... | php | {
"resource": ""
} |
q252616 | Upload.upload | validation | public function upload(string $sFile)
{
if ($_FILES[$sFile]['error'] > 0) {
$this->_sError = "Error while the upload";
return false;
}
if ($_FILES[$sFile]['size'] > $this->_iMaxFile) {
$this->_sError = "The file is too big";
return false;
}
$sExtension = strtolower(substr(strrchr($_FILES[$sFi... | php | {
"resource": ""
} |
q252617 | CollectorModule.loadSubmodules | validation | public function loadSubmodules()
{
$this->modules = $this->submodules;
foreach ($this->submodules as $module => $settings) {
$mod = $this->getModule($module);
$mod->init();
}
return true;
} | php | {
"resource": ""
} |
q252618 | TextService.getAction | validation | public function getAction()
{
if (!preg_match('/\/page\/(\w+[\-\w]*)\/text\/(..)(\/(\w+))?$/', $this->name, $matches)) {
throw new InvalidParameterException("Invalid parameters");
}
$pageName = $matches[1];
$language = $matches[2];
$pageTexts = $this->getTextModel... | php | {
"resource": ""
} |
q252619 | TextService.postAction | validation | public function postAction()
{
if (!preg_match('/\/page\/(\w+[\-\w]*)\/text\/(..)$/', $this->name, $matches)) {
throw new InvalidParameterException("Invalid parameters");
}
list($dummy, $pageName, $language) = $matches;
$request = $this->environment->getRequestHelper();
... | php | {
"resource": ""
} |
q252620 | TextService.putAction | validation | public function putAction()
{
if (!preg_match('/\/page\/(\w+[\-\w]*)\/text\/(..)\/(\w+)$/', $this->name, $matches)) {
throw new InvalidParameterException("Invalid parameters");
}
list($dummy, $pageName, $language, $oldName) = $matches;
$request = $this->environment->getR... | php | {
"resource": ""
} |
q252621 | TextService.deleteAction | validation | public function deleteAction()
{
// @todo It's not necessary to specify a language, since the texts in all languages are removed.
if (!preg_match('/\/page\/(\w+[\-\w]*)\/text\/..\/(\w+)$/', $this->name, $matches)) {
throw new InvalidParameterException("Invalid parameters");
}
... | php | {
"resource": ""
} |
q252622 | Form.render | validation | public function render(FormInterface $form)
{
if (method_exists($form, 'prepare')) {
$form->prepare();
}
// Set form role
if (!$form->getAttribute('role')) {
$form->setAttribute('role', 'form');
}
$formContent = '';
foreach ($form as... | php | {
"resource": ""
} |
q252623 | Containerized.pipe | validation | public function pipe($stage)
{
$pipeline = new self($this->container, $this->stages);
$this->handleStage($pipeline->stages, $stage);
return $pipeline;
} | php | {
"resource": ""
} |
q252624 | Containerized.build | validation | protected function build($stage)
{
if ($stage instanceof MiddlewareInterface) {
return $stage;
}
if ($this->container->has($stage)) {
$stage = $this->container->get($stage);
if ($stage instanceof RequestHandlerInterface) {
return new RequestHandler($stage);
}
if ($stage instanceof Middleware... | php | {
"resource": ""
} |
q252625 | Containerized.resolve | validation | protected function resolve()
{
if ($this->resolved) {
return;
}
$this->resolved = [];
foreach ($this->stages as $stage) {
$this->resolved[] = $this->build($stage);
}
} | php | {
"resource": ""
} |
q252626 | Geocoding.signUrlForGoogle | validation | public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string
{
$aUrl = parse_url($sUrlToSign);
$aUrl['query'] .= '&client=' .$sClientId;
$aUrlToSign = $aUrl['path']."?".$aUrl['query'];
$decodedKey = base64_decode(str_replace(array('-'... | php | {
"resource": ""
} |
q252627 | GetCustomersIds.exec | validation | public function exec($calcId = null)
{
if (is_null($calcId)) {
$calcId = $this->queryGetCalcId->exec();
}
if (!isset($this->cachedIds[$calcId])) {
$ids = [];
$where = \Praxigento\BonusHybrid\Repo\Data\Registry\SignUpDebit::A_CALC_REF . '=' . (int)$calcId;
... | php | {
"resource": ""
} |
q252628 | LazyFile.hydrate | validation | private function hydrate()
{
if (true === $this->hydrated) {
return;
}
$this->filesystem->get($this->file);
$this->hydrated = true;
} | php | {
"resource": ""
} |
q252629 | BlockManagerFactory.create | validation | public function create($action)
{
$actionName = ucfirst($action);
$class = sprintf('RedKiteCms\Content\BlockManager\BlockManager%s', $actionName);
if (!class_exists($class)) {
return null;
}
$reflectionClass = new \ReflectionClass($class);
return $refle... | php | {
"resource": ""
} |
q252630 | ActionTrait.getLog | validation | public function getLog()
{
if (!isset($this->_log)) {
$this->_log = new DataInterfaceLog();
if (!empty($this->interface)) {
$this->_log->data_interface_id = $this->interface->interfaceObject->id;
}
$this->_log->status = 'running';
$... | php | {
"resource": ""
} |
q252631 | ActionTrait.getStatus | validation | public function getStatus()
{
if (isset($this->_log)) {
$this->_status = $this->log->statusLog;
} elseif (!isset($this->_status)) {
$this->_status = new Status($this->log);
}
return $this->_status;
} | php | {
"resource": ""
} |
q252632 | MenuBuilder.createMainMenu | validation | public function createMainMenu(Request $request)
{
$menu = $this->factory->createItem('root');
$menu->setCurrentUri($request->getBaseUrl().$request->getPathInfo());
// create menu from admin pool
$admin_pool = $this->container->get('sonata.admin.pool');
foreach ($admin_pool... | php | {
"resource": ""
} |
q252633 | Debug.getInstance | validation | public static function getInstance() : Debug
{
if (!(self::$_oInstance instanceof self)) { self::$_oInstance = new self(); }
return self::$_oInstance;
} | php | {
"resource": ""
} |
q252634 | Debug.activateError | validation | public static function activateError($iLevel)
{
if (self::$_bFirstActivation === true) {
self::_setFileNameInErrorFile();
self::$_bFirstActivation = false;
}
self::_initLogFile();
self::$_bActivateError = true;
error_reporting($iLevel);
set... | php | {
"resource": ""
} |
q252635 | Debug.setKindOfReportLog | validation | public static function setKindOfReportLog(string $sKindOfReportLog)
{
if ($sKindOfReportLog === 'screen' || $sKindOfReportLog === 'all') { self::$_sKindOfReportLog = $sKindOfReportLog; }
else { self::$_sKindOfReportLog = 'error_log'; }
} | php | {
"resource": ""
} |
q252636 | Debug.getTranslateErrorCode | validation | public static function getTranslateErrorCode(int $iCode) : string
{
if ($iCode === 1 && $iCode === 16 && $iCode === 256 && $iCode === 4096) { return LogLevel::ERROR; }
else if ($iCode === 2 && $iCode === 32 && $iCode === 128 && $iCode === 512) { return LogLevel::WARNING; }
else if ($iCode ==... | php | {
"resource": ""
} |
q252637 | Debug._setFileNameInErrorFile | validation | private static function _setFileNameInErrorFile()
{
/**
* We see if it's a cli call or a web call
*/
if (defined('BASH_CALLED')) {
error_log(Bash::setColor('############### '.BASH_CALLED.' ###############', 'cyan'));
}
else {
if (isset($_S... | php | {
"resource": ""
} |
q252638 | XmlRpcParser.parseFault | validation | public static function parseFault(\SimpleXMLElement $fault)
{
$faultData = static::parseStruct($fault->value->struct);
return new \Devedge\XmlRpc\Client\RemoteException($faultData['faultString'], $faultData['faultCode']);
} | php | {
"resource": ""
} |
q252639 | BlockManagerRemove.remove | validation | public function remove($sourceDir, array $options, $username)
{
$dir = $this
->init($sourceDir, $options, $username)
->getDirInUse();
$blockName = $options["blockname"];
$blocksDir = $dir . '/blocks';
$filename = sprintf('%s/%s.json', $blocksDir, $blockName);... | php | {
"resource": ""
} |
q252640 | CustomFieldProvider.getCustomFieldByType | validation | public function getCustomFieldByType($type)
{
if (isset($this->servicesByType[$type])) {
return $this->servicesByType[$type];
} else {
throw new \LogicException('the custom field with type '.$type.' '
. 'is not found');
}
} | php | {
"resource": ""
} |
q252641 | ImportAbstract.fromData | validation | public function fromData($data)
{
$this->fromdata = $data;
$resource = fopen('php://memory', 'r+');
fwrite($resource, $data);
rewind($resource);
// $resource = fopen('data://text/plain,' . $data, 'r+');
$this->setResource($resource);
r... | php | {
"resource": ""
} |
q252642 | ImportAbstract.startAt | validation | public function startAt($startAt=0){
if (!is_numeric($startAt) || $startAt < 0){
throw new Exception("startAt: bad value", 10);
}
$this->startAt = $startAt;
return $this;
} | php | {
"resource": ""
} |
q252643 | QRCode.getAppCode | validation | public function getAppCode($path, $width = 430, $autoColor = false, $lineColor = ['r' => 0, 'g' => 0, 'b' => 0])
{
$params = [
'path' => $path,
'width' => $width,
'auto_color' => $autoColor,
'line_color' => $lineColor,
];
return $this->getStre... | php | {
"resource": ""
} |
q252644 | QRCode.getAppCodeUnlimit | validation | public function getAppCodeUnlimit($scene, $width = 430, $autoColor = false, $lineColor = ['r' => 0, 'g' => 0, 'b' => 0])
{
$params = [
'scene' => $scene,
'width' => $width,
'auto_color' => $autoColor,
'line_color' => $lineColor,
];
return $thi... | php | {
"resource": ""
} |
q252645 | ThemeController.changeAction | validation | public function changeAction()
{
$theme = $this->container->get('request')->request->get('admin_theme');
$this->container->get('vince_t.admin.theme.handler')->setCurrentTheme($theme);
$headers = $this->container->get('request')->server->getHeaders();
$referer = $headers['REFERER'];
... | php | {
"resource": ""
} |
q252646 | CacheManagerFactory.createService | validation | public function createService(ServiceLocatorInterface $serviceLocator)
{
$cacheManager = new CacheManager($serviceLocator->get('HtSettingsModule\Options\ModuleOptions')->getCacheOptions());
$cacheManager->setServiceLocator($serviceLocator);
return $cacheManager;
} | php | {
"resource": ""
} |
q252647 | ItemController.actionCreate | validation | public function actionCreate()
{
$model = new Item();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['index']);
} else {
return $this->render('create', [
'model' => $model,
]);
}
} | php | {
"resource": ""
} |
q252648 | ItemController.actionTriggerEvents | validation | public function actionTriggerEvents()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$result = ($post = Yii::$app->request->post('depdrop_parents'))
? Item::eventList($post[0])
: [];
$output = [];
foreach ($result as $id => $name) {
$output... | php | {
"resource": ""
} |
q252649 | RegistrationListener.onBootstrap | validation | public function onBootstrap(MvcEvent $e)
{
if (!$e->getRequest() instanceof HttpRequest) {
return;
}
$app = $e->getApplication();
$services = $app->getServiceManager();
$eventManager = $app->getEventManager();
$sharedEventManager = $eventManager->g... | php | {
"resource": ""
} |
q252650 | ShowThemeController.showAction | validation | public function showAction(Request $request, Application $app)
{
$options = array(
'twig' => $app["twig"],
'template_assets' => $app["red_kite_cms.template_assets"],
"configuration_handler" => $app["red_kite_cms.configuration_handler"],
"plugin_manager" => $ap... | php | {
"resource": ""
} |
q252651 | Tag.update | validation | public function update($tagId, $name)
{
$params = [
'tag' => [
'id' => $tagId,
'name' => $name,
],
];
return $this->parseJSON('json', [self::API_UPDATE, $params]);
} | php | {
"resource": ""
} |
q252652 | Tag.usersOfTag | validation | public function usersOfTag($tagId, $nextOpenId = '')
{
$params = ['tagid' => $tagId, 'next_openid' => $nextOpenId];
return $this->parseJSON('json', [self::API_USERS_OF_TAG, $params]);
} | php | {
"resource": ""
} |
q252653 | Tag.batchTagUsers | validation | public function batchTagUsers(array $openIds, $tagId)
{
$params = [
'openid_list' => $openIds,
'tagid' => $tagId,
];
return $this->parseJSON('json', [self::API_MEMBER_BATCH_TAG, $params]);
} | php | {
"resource": ""
} |
q252654 | Tag.batchUntagUsers | validation | public function batchUntagUsers(array $openIds, $tagId)
{
$params = [
'openid_list' => $openIds,
'tagid' => $tagId,
];
return $this->parseJSON('json', [self::API_MEMBER_BATCH_UNTAG, $params]);
} | php | {
"resource": ""
} |
q252655 | Encryptor.decryptData | validation | public function decryptData($sessionKey, $iv, $encrypted)
{
try {
$decrypted = openssl_decrypt(
base64_decode($encrypted, true), 'aes-128-cbc', base64_decode($sessionKey, true),
OPENSSL_RAW_DATA | OPENSSL_NO_PADDING, base64_decode($iv, true)
);
... | php | {
"resource": ""
} |
q252656 | Personal.calcBonus | validation | private function calcBonus($dwnlCurrent, $dwnlCompress, $levels)
{
$result = [];
$mapCustomer = $this->hlpDwnlTree->mapById($dwnlCurrent, ECustomer::A_CUSTOMER_REF);
/** @var \Praxigento\BonusHybrid\Repo\Data\Downline $one */
foreach ($dwnlCompress as $one) {
$custId = $o... | php | {
"resource": ""
} |
q252657 | Personal.saveLog | validation | private function saveLog($operId, $calcId)
{
$entity = new ELogOper();
$entity->setOperId($operId);
$entity->setCalcId($calcId);
$this->daoLogOper->create($entity);
} | php | {
"resource": ""
} |
q252658 | Module.addPiwikCode | validation | public function addPiwikCode(ViewEvent $event)
{
$model = $event->getModel();
if (! $model instanceof \Zend\View\Model\ViewModel) {
return;
}
// Return if this is a subrenderer. Therefore we only render once!
$options = $model->getOptions();
if (array_key... | php | {
"resource": ""
} |
q252659 | Benri_Application.createInstance | validation | public static function createInstance($environment, $options = null)
{
if (!self::$_instance) {
self::$_instance = new static($environment, $options, false);
}
return self::$_instance;
} | php | {
"resource": ""
} |
q252660 | BaseDB.getValues | validation | protected function getValues($fields, $preCalculatedResult = false)
{
if ($preCalculatedResult) {
return $preCalculatedResult;
}
$app = App::getInstance();
$sql = $this->constructSelectSQL($fields);
// get cache
$item = $this->getCache($fields[$this->pk... | php | {
"resource": ""
} |
q252661 | BaseDB.getCache | validation | protected function getCache($pk)
{
$app = App::getInstance();
return $app['cache']->getItem($this->dbtable.'/'.$pk->getValue());
} | php | {
"resource": ""
} |
q252662 | BaseDB.constructSelectSQL | validation | public function constructSelectSQL($fields)
{
$sql = array();
$sql[] = "SELECT";
$sql[] = "`" . implode("`, `", array_keys($fields)) . "`";
$sql[] = "FROM `" . $this->dbtable . "`";
$sql[] = "WHERE `" . $this->pk . "` = " . $fields[$this->pk]->getSQL();
return imp... | php | {
"resource": ""
} |
q252663 | User.get | validation | public function get($openId, $lang = 'zh_CN')
{
$params = [
'openid' => $openId,
'lang' => $lang,
];
return $this->parseJSON('get', [self::API_GET, $params]);
} | php | {
"resource": ""
} |
q252664 | User.batchGet | validation | public function batchGet(array $openIds, $lang = 'zh_CN')
{
$params = [];
$params['user_list'] = array_map(function ($openId) use ($lang) {
return [
'openid' => $openId,
'lang' => $lang,
];
}, $openIds);
return... | php | {
"resource": ""
} |
q252665 | User.lists | validation | public function lists($nextOpenId = null)
{
$params = ['next_openid' => $nextOpenId];
return $this->parseJSON('get', [self::API_LIST, $params]);
} | php | {
"resource": ""
} |
q252666 | User.remark | validation | public function remark($openId, $remark)
{
$params = [
'openid' => $openId,
'remark' => $remark,
];
return $this->parseJSON('json', [self::API_REMARK, $params]);
} | php | {
"resource": ""
} |
q252667 | User.blacklist | validation | public function blacklist($beginOpenid = null)
{
$params = ['begin_openid' => $beginOpenid];
return $this->parseJSON('json', [self::API_GET_BLACK_LIST, $params]);
} | php | {
"resource": ""
} |
q252668 | TreeGroup.toObject | validation | public function toObject()
{
$groups = $this->groups;
foreach($groups as &$group){
$group = $group->toObject();
}
$items = $this->items;
foreach($items as &$item){
$item = $item->toObject();
}
return (object)[
'type' => $this->type,
'value' => $this->v... | php | {
"resource": ""
} |
q252669 | TreeGroup.toSelect | validation | public function toSelect(array &$optgroups=[], $level=1, $root=true)
{
$options = [];
foreach($this->items as $item){
$options[] = $item->toSelect();
}
if ( $root === true ){
$text = $this->text;
}
else {
$text = '|'.str_repeat('-', $level).' '.$this->text;
}
... | php | {
"resource": ""
} |
q252670 | FrontController.run | validation | public function run(Request $request)
{
$dispatcher = $this->router->getDispatcher();
$routeInfo = $dispatcher->dispatch($request->server('REQUEST_METHOD'), $request->server('REQUEST_URI_PATH'));
switch ($routeInfo[0]) {
case Dispatcher::NOT_FOUND:
$routeInfo = ... | php | {
"resource": ""
} |
q252671 | FrontController.runRoute | validation | private function runRoute(array $routeInfo): Response
{
/** @noinspection PhpUnusedLocalVariableInspection */
list($_, $callback, $vars) = $routeInfo;
$vars = array_filter($vars, function($var) {
return strpos($var, '_') !== 0;
}, ARRAY_FILTER_USE_KEY);
if (!cla... | php | {
"resource": ""
} |
q252672 | AbstractApi.get | validation | protected function get($path, array $parameters = array(), $requestHeaders = array())
{
if (array_key_exists('ref', $parameters) && is_null($parameters['ref'])) {
unset($parameters['ref']);
}
$response = $this->client->getHttpClient()->get($path, $parameters, $requestHeaders);
... | php | {
"resource": ""
} |
q252673 | AbstractApi.head | validation | protected function head($path, array $parameters = array(), $requestHeaders = array())
{
if (array_key_exists('ref', $parameters) && is_null($parameters['ref'])) {
unset($parameters['ref']);
}
$response = $this->client->getHttpClient()->request($path, null, 'HEAD', $requestHeade... | php | {
"resource": ""
} |
q252674 | Semantic.query | validation | public function query($keyword, $categories, array $other = [])
{
$params = [
'query' => $keyword,
'category' => implode(',', (array) $categories),
'appid' => $this->getAccessToken()->getAppId(),
];
return $this->parseJSON('... | php | {
"resource": ""
} |
q252675 | TranslationLoader.registerResources | validation | public function registerResources(Translator $translator, array $dirs)
{
$finder = new Finder();
$files = $finder->files()->depth(0)->ignoreUnreadableDirs()->in($dirs);
foreach ($files as $file) {
$file = (string)$file;
preg_match_all('/[^.]+/', basename($file), $matc... | php | {
"resource": ""
} |
q252676 | File.delete | validation | public function delete(string $sName)
{
return unlink($this->_sFolder.$this->_getSubDirectory($sName).md5($sName).'.fil.cac');
} | php | {
"resource": ""
} |
q252677 | File._removeDirectory | validation | private function _removeDirectory($sName)
{
if ($rDirectory = opendir($sName)) {
while (($sFile = readdir($rDirectory)) !== false) {
if ($sFile > '0' && filetype($sName.$sFile) == "file") { unlink($sName.$sFile); } elseif ($sFile > '0' && filetype($sName.$sFile) == "dir") { rem... | php | {
"resource": ""
} |
q252678 | Mailer.init | validation | protected function init(array $options = null)
{
$this->boot();
if (!is_null($options)) {
$this->setOptions(
array_merge($this->getOptions(), $options)
);
}
} | php | {
"resource": ""
} |
q252679 | Mailer.getDefault | validation | public function getDefault($name)
{
return isset($this->options['defaults'][$name]) ? $this->options['defaults'][$name] : null;
} | php | {
"resource": ""
} |
q252680 | Mailer.getErrors | validation | public function getErrors($echoable = false)
{
if (true===$echoable) {
return join("\n<br />", $this->errors);
} else {
return $this->errors;
}
} | php | {
"resource": ""
} |
q252681 | Mailer.getInfos | validation | public function getInfos($echoable = false)
{
if (true===$echoable) {
return join("\n<br />", $this->infos);
} else {
return $this->infos;
}
} | php | {
"resource": ""
} |
q252682 | Mailer.setRegistry | validation | public function setRegistry($var = null, $val = null, $section = false)
{
if (is_null($var)) {
return;
}
if ($section) {
if (!isset($this->registry[$section])) {
$this->registry[$section] = array();
}
$this->registry[$section][$... | php | {
"resource": ""
} |
q252683 | Mailer.getRegistry | validation | public function getRegistry($var = null, $section = false, $default = false)
{
if (is_null($var)) {
return;
}
if ($section && isset($this->registry[$section])) {
if (isset($this->registry[$section][$var])) {
return $this->registry[$section][$var];
... | php | {
"resource": ""
} |
q252684 | Mailer.getMessage | validation | public function getMessage($id = null)
{
if (!is_null($id)) {
return array_key_exists($id, $this->messages) ? $this->messages[$id] : null;
} elseif (count($this->messages)>0) {
return current($this->messages);
} else {
$message_class = $this->getDefault('m... | php | {
"resource": ""
} |
q252685 | Mailer.setTransporter | validation | public function setTransporter(TransportInterface $transporter)
{
if ($transporter->validate()) {
$this->transporter = $transporter;
} else {
throw new \Exception(
sprintf('Transporter "%s" is not valid for current environment!', get_class($transporter))
... | php | {
"resource": ""
} |
q252686 | Mailer.getTransporter | validation | public function getTransporter()
{
if (empty($this->transporter)) {
$transport_class = $this->getDefault('transporter');
if (class_exists($transport_class)) {
$this->setTransporter(new $transport_class);
} else {
throw new \Exception(
... | php | {
"resource": ""
} |
q252687 | Mailer.getSpooler | validation | public function getSpooler()
{
if (empty($this->spooler)) {
$spool_class = $this->getDefault('spooler');
if (class_exists($spool_class)) {
$this->setSpooler(new $spool_class);
} else {
throw new \Exception(
sprintf('Defa... | php | {
"resource": ""
} |
q252688 | DefaultController.actionIndex | validation | public function actionIndex($option = null)
{
$fixtures = Yii::createObject(Fixtures::className());
$option = Question::displayWithQuit('Select operation', ['Export', 'Import'], $option);
if($option == 'e') {
$allTables = $fixtures->tableNameList();
if(!empty($allTables)) {
$answer = Select::display('S... | php | {
"resource": ""
} |
q252689 | DefaultController.actionOne | validation | public function actionOne($option = null)
{
$fixtures = Yii::createObject(Fixtures::className());
$option = Question::displayWithQuit('Select operation', ['Export', 'Import'], $option);
if($option == 'e') {
$table = Enter::display('Enter table name for export');
$tables = $fixtures->export([$table]);
Ou... | php | {
"resource": ""
} |
q252690 | Entity.fill | validation | public function fill(array $attributes)
{
if ($this->getFieldManager()) {
$attributes = $this->getFieldManager()->transformToResource($attributes);
}
return parent::fill($attributes);
} | php | {
"resource": ""
} |
q252691 | Entity.getParentUri | validation | public function getParentUri()
{
if ($this->getParentName()) {
$func = $this->getParentName();
if (! is_string($func)) {
return;
}
$relat = $this->$func();
$parentResourceName = $relat->getRelated()->getResourceName();
... | php | {
"resource": ""
} |
q252692 | Entity.getParentKeyName | validation | public function getParentKeyName()
{
if ($this->getParentName()) {
$func = $this->getParentName();
$relat = $this->$func();
/*
* if (! $relat instanceof \Illuminate\Database\Eloquent\Relations\BelongsTo) {
* $field = $re... | php | {
"resource": ""
} |
q252693 | Entity.getActions | validation | public function getActions()
{
$actions = [];
if (is_array($this->actions)) {
foreach ($this->actions as $action) {
$actions[$action] = $action;
}
}
return $actions;
} | php | {
"resource": ""
} |
q252694 | Entity.getPublicIdAttribute | validation | protected function getPublicIdAttribute()
{
if ($id = Api::decodeHashId($this->attributes['id'])) {
return $id;
}
return Api::encodeHashId($this->attributes['id']);
} | php | {
"resource": ""
} |
q252695 | Entity.autoload | validation | public function autoload()
{
if (self::$loaded) {
return;
}
if (is_array($this->load)) {
foreach ($this->load as $k => $load) {
$this->load($load);
}
}
if (is_array($this->loadUri)) {
foreach ($... | php | {
"resource": ""
} |
q252696 | Stats.deviceSummary | validation | public function deviceSummary(array $deviceIdentifier, $beginDate, $endDate)
{
$params = [
'device_identifier' => $deviceIdentifier,
'begin_date' => $beginDate,
'end_date' => $endDate,
];
return $this->parseJSON('json', [self::API_DEVICE, $params]);
} | php | {
"resource": ""
} |
q252697 | Stats.batchDeviceSummary | validation | public function batchDeviceSummary($timestamp, $pageIndex)
{
$params = [
'date' => $timestamp,
'page_index' => $pageIndex,
];
return $this->parseJSON('json', [self::API_DEVICE_LIST, $params]);
} | php | {
"resource": ""
} |
q252698 | Stats.pageSummary | validation | public function pageSummary($pageId, $beginDate, $endDate)
{
$params = [
'page_id' => $pageId,
'begin_date' => $beginDate,
'end_date' => $endDate,
];
return $this->parseJSON('json', [self::API_PAGE, $params]);
} | php | {
"resource": ""
} |
q252699 | Stats.batchPageSummary | validation | public function batchPageSummary($timestamp, $pageIndex)
{
$params = [
'date' => $timestamp,
'page_index' => $pageIndex,
];
return $this->parseJSON('json', [self::API_PAGE_LIST, $params]);
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.