Skip to content

Commit

Permalink
qnd: validateRequires minor refinements
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://kelev.kaltura.com/usr/local/kalsource/backend/server/trunk/core@100098 6b8eccd3-e8c5-4e7d-8186-e12b5326b719
  • Loading branch information
erank committed Jun 19, 2013
1 parent 748891c commit 18c31e8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/static_analysis/validateRequires.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ function performStringConcats($str)
if (strpos($reqStatement, '//') === 0)
continue; // comment

if (strpos($reqStatement, 'if (') === 0)
continue; // optional

if (strpos($filePath, $codeRoot . '/alpha/web/api_v3/') === 0 ||
strpos($filePath, $codeRoot . '/alpha/web/ma_console/') === 0)
continue; // don't process folders links
Expand All @@ -63,7 +66,8 @@ function performStringConcats($str)
continue; // don't process client sources (may require files that don't exist)

if (strpos($reqStatement, '$this->appendLine') !== false ||
strpos($reqStatement, '$this->writeTest') !== false)
strpos($reqStatement, '$this->writeTest') !== false ||
strpos($reqStatement, '$this->echoLine') !== false)
continue; // generator code

foreach ($reqStatements as $curStatement)
Expand Down Expand Up @@ -98,9 +102,12 @@ function performStringConcats($str)
$reqFile = str_replace('SF_ROOT_DIR', '"'.$codeRoot.'/alpha/"', $reqFile);
$reqFile = str_replace('ROOT_DIR', '"'.$codeRoot.'/"', $reqFile);
$reqFile = str_replace('KALTURA_ROOT_PATH', '"'.$codeRoot.'"', $reqFile);
$reqFile = str_replace('"$sf_symfony_lib_dir', '"'.$codeRoot.'/symfony/', $reqFile);
$reqFile = str_replace('$sf_symfony_lib_dir', '"'.$codeRoot.'/symfony/"', $reqFile);
$reqFile = str_replace('$sf_app_config_dir_name', '"'.$codeRoot.'/alpha/apps/kaltura/config/"', $reqFile);
$reqFile = str_replace('KALTURA_API_PATH', '"'.$codeRoot.'/api_v3/"', $reqFile);
$reqFile = str_replace('MODULES', '"'.$codeRoot.'/alpha/apps/kaltura/modules/"', $reqFile);
$reqFile = str_replace('$infaFolder', '"'.$codeRoot.'/infra/"', $reqFile);
$reqFile = str_replace('\'', '"', $reqFile);
$reqFile = trim(performStringConcats($reqFile));

Expand Down

0 comments on commit 18c31e8

Please sign in to comment.